Bitcoin Stack Change is a query and reply website for Bitcoin crypto-currency lovers. It solely takes a minute to enroll.
Anyone can ask a query
Anyone can reply
The most effective solutions are voted up and rise to the highest
Requested
Considered
170 instances
I’m attempting to undergo the code to examine the merkle tree hash computation completed by BlockMerkleRoot
in bitcoin core. The hash computed utilizing on-line instruments by appending transaction hashes is completely different from those computed by SHA256D64
of BlockMerkleRoot
. I’m positive I’m lacking one thing. Might somebody throw mild on this?
Particulars:
block 500000:
appending coinbase hash 2157b554dcfda405233906e461ee593875ae4b1b97615872db6a25130ecc1dd6 with the primary transaction hash fe6c48bbfdc025670f4db0340650ba5a50f9307b091d9aaa19aa44291961c69f and computing sha256 offers 0387276cdb563dc923e945f8e68596e3556756d2f2119b9b67905658b73afcb2 and doing one other sha256 offers 1c0a7630e70d2b39b15585ec19c13c6f0a729a6501f5396dd75f75cb3aa4d110 which is completely different from the one returned by SHA256D64
which is 1024e63a6bdab1efb75aae1dd065c11a97cf94e978e6aed9adb2f04d08887164.
The software you might be linking to is hashing textual content, Bitcoin hashes are of bytes.
2
The strings you posted are technically transaction IDs not transaction hashes and should be reversed to get that “precise hash”. In bitcoin when hashes are printed as strings they’re reversed. The precise hashes you need to use are d61dcc0e13256adb725861971b4bae753859ee61e406392305a4fddc54b55721
|9fc661192944aa19aa9a1d097b30f9505aba500634b04d0f6725c0fdbb486cfe
When that is hashed twice it offers the next consequence: 647188084df0b2add9aee678e994cf971ac165d01dae5ab7efb1da6b3ae62410
since we print hashes in reverse it turns into “1024…7164” which is what you bought from SHA256D64
.
4