Post
Topic
Board Development & Technical Discussion
Re: Raw original work request of solved block
by
nQuant
on 13/01/2018, 05:18:50 UTC
Ok so if I'm getting what you are saying is, once the block is solved below markel_root becomes a transaction id to send newly generated coins which is already included in blocexplorer's transactions

merkle_root = sha256(sha256(unhexlify(coinbase)).digest()).digest()
No, not at all.

The coinbase transaction's txid is included as part of the merkle root. The construction of the merkle root is described here: https://github.com/bitcoin/bitcoin/blob/master/src/consensus/merkle.cpp#L9. Basically you concatenate the txids of pairs of transactions and hash them, then concatenate pairs of hashes, and so on until there is only one hash remaining.

The fields Coinbase1, ExtraNonce, ExtraNonce2, and Coinbase2 are used to construct the coinbase transaction which pays the miner. The transaction id of that coinbase transaction is then used to construct the merkle root.

Correct you are referring to process of calculating markel, actually I need all those parameters to test my application is actually calculating same markel and all the required inputs further to find same nonce as blockexplorer. That's just for end to end testing of my own mining application.