Hash

你如何找到包含 6 個交易的塊的默克爾根?

  • July 15, 2018

讓我們使用區塊#100205 <https://www.blockchain.com/en/btc/block/0000000000033d0de6f4ebe93b3b142424cdbecf4bd98b948e856c4a55f09f76>

該區塊包含 6 個交易。在第二級散列之後,您最終得到 3 個節點。解決方法是什麼?你創建兩個 5 和 6 嗎?

您將複製最後兩個 txs 的雜湊值。樹會“看起來”像這樣:

            abcdefef
             /  \            
          /        \          
       /              \       
     abcd             efef     
     /  \            /  \    
  /        \      /        \  
 ab        cd    ef        ef 
/ \        / \   / \  
a   b      c  d  e   f 

TXID 1 438edc1b0d7ad70f289bb9c082681aa50ee1c3d63dbf106b092abe224f0636a7 字節交換:a736064f22be2a096b10bf3dd6c3e10ea51a6882c0b99b280fd77a0d1bdc8

TXID 2 B91aad22dcfe4fca4b03143682642994c607a832d1c4c11c5fd6616310468f8b 字節交換:8b8f46106361d65f1cc1c4d132a807c6942964823614034bca4ffedc22ad1aBca4ffedc22ad1

Hash12 = 601bffd3fa633bc7cc0ede9f486a5bef88dc8781a58ee4e8c0dd15401000cb71

TXID 3 Daadc472b760fb0586ed2841a9160e99175f05813ce51455f3c08c9765a2a60e 字節交換:0ea6a265978cc0f35514e53c81055f17990e16a94128ed8605fb60b72

TXID 4 6543b2025fea04eac45b81304ace9a7672b7a0969a8e9460e4f5cc93062414ce 字節交換:ce14240693ccf5e460948e9a96a0b772769ace4a30815bc4ea04ea5f02b243

Hash34 = 6c06a7a9e71f66ad01ccf6606176005cad6f5a1a897041f7f8b38a46e62a253a

Hash1234 = D4ff4562b9a0fcd529e9dc80b4466a3a78d6cb03909f8303ae5f38774ed7db2d

TXID 5 E4cb63ed4d06c90be633985f2d6902833c4b502d77fdcb883d5217dfaa75dcc5 字節交換:c5dc75aadf17523d88cbfd772d504b3c8302692d5f9833e60bc9064ded63

TXID 6 B64212bc2fc6e1b469d31bc9140d7164794615b257c51f02d067f2a42aad943d 字節交換:3d94ad2aa4f267d0021fc557b215467964710d14c91fd369b4eb16

雜湊 56 = 49622b3e9ab2aaa1fdd94b56d9f88d9a5604eb5b053781a7668f3056a92e272c

雜湊 56 = 49622b3e9ab2aaa1fdd94b56d9f88d9a5604eb5b053781a7668f3056a92e272c

Hash5656 = 2d8a2fb663d0d018f5343321598d3647b342b06a52306b0e8392bf8273d746a7

Hash12345656= af72e3305e599e39381b45dd328abf2cf740280ca8328fa15fc76820e9bdc5ca 字節交換:cac5bde92068c75fa18f32a80c2840f72cbf8a32dd451b38399e595e3

像魅力一樣工作-謝謝@Raghav Sood

引用自:https://bitcoin.stackexchange.com/questions/77222