The new BlockTemplate
interface introduced in #30440 allows for a more efficient way for a miner to submit the block solution. Instead of having the send the full block, it only needs to provide the nonce, timestamp, version fields and coinbase transaction.
This PR introduces submitSolution()
for that. It’s currently unused.
#29432 and https://github.com/Sjors/bitcoin/pull/48 use it to process the Stratum v2 message SubmitSolution. The method should be sufficiently generic to work with alternative mining protocols (none exist that I’m aware off).
This PR also introduces getCoinbaseMerklePath()
, which is needed in Stratum v2 to construct the merkle_path
field of the NewTemplate
message (see spec). The coinbase merkle path is also used in Stratum “v1”, see e.g. https://bitcoin.stackexchange.com/questions/109820/questions-on-merkle-root-hashing-for-stratum-pools
This last function uses BlockMerkleBranch
which was moved to the test code in #13191. The reason back then for moving it was that it was no longer used. This PR moves it back.
This PR does not change behaviour since both methods are unused.