Title: manual block check does not work Post by: Nordok on April 08, 2018, 03:36:07 PM Hello everybody.
I try to check the blocks manually, but I can not do it. I will give an example with the last block: Build block header Version: 0x20000000 = 02000000 Previous block: 00000000000000000015276a6b8f5478950f226c4ec97dbb5928ff574985d508 || 08d5854957ff2859bb7dc94e6c220f9578548f6b6a2715000000000000000000 merkle root: c06e8990f81cf45774cb34451b746c91980846978734f8389ee919f9dd651566 || 661565ddf919e99e38f8348797460898916c741b4534cb7457f41cf890896ec0 Time 2018-04-07 12:18:45 = 1523092725 = 5AC88CF5 = F58CC85A Bits 17502ab7 = b72a5017 Nonce f8493c99 = 993c49f8 Well. Block is: 0200000008d5854957ff2859bb7dc94e6c220f9578548f6b6a2715000000000000000000661565d df919e99e38f8348797460898916c741b4534cb7457f41cf890896ec0F58CC85Ab72a5017993c49 f8 (160 char) first round sha = 3afa7573e72e3f4e4edd602b7f209292766cc58d130c3b22faaae2176d455e9c second round sha = e843868f1f0f70ac38971dbae5ddf951584ef3d9f783845968e0430b85cf456d but it must be 0000000000000000001bfaabb992b104e81c971d0ea394a0b357e637dea8c034 what am I doing wrong? Why do I get another hash? Title: Re: manual block check does not work Post by: Xynerise on April 08, 2018, 04:55:49 PM Be careful with the byte order.
The byte order of the version is incorrect. It should be Code: 00000020 Code: 0200000 Code: 0000002008d5854957ff2859bb7dc94e6c220f9578548f6b6a2715000000000000000000661565ddf919e99e38f8348797460898916c741b4534cb7457f41cf890896ec0f58cc85ab72a5017993c49f8 Code: 386fd5f539bac4575fe3451fc969b24c1bd828f7269b0e6d186cba17321b57f9 Code: 34c0a8de37e657b3a094a30e1d971ce804b192b9abfa1b000000000000000000 Code: 0000000000000000001bfaabb992b104e81c971d0ea394a0b357e637dea8c034 Title: Re: manual block check does not work Post by: achow101 on April 08, 2018, 05:01:39 PM Your version is completely incorrect. How did you get 02000000 from 0x20000000? The 0x does not mean that there is supposed to be a 0 in front of the 2; it means that this the whole thing is a hexadecimal number. And the version also needs to be byte swapped, so it should be 00000020.
Title: Re: manual block check does not work Post by: Nordok on April 08, 2018, 08:27:35 PM Oh it's great! Big thanks!!!
I still do not understand the nature of my mistake, because in the instruction it is written exactly such use of the order of bits in the version. Picture: http://pp.userapi.com/c845322/v845322932/22ff3/CxHzojhuYj0.jpg URL: https://bitcoin.org/en/developer-reference#block-headers And the strangest thing is, it works for many blocks. For example: https://btc.com/000000000000000009a11b3972c8e532fe964de937c9e0096b43814e67af3728 Title: Re: manual block check does not work Post by: achow101 on April 08, 2018, 09:05:04 PM Oh it's great! Big thanks!!! You are confusing different things. One is block version 2 which is 0x00000002 (byte swapped as 0x02000000). The other is block version 0x20000000 (byte swapped as 0x00000020). These are completely different because 0x20000000 is a hexadecimal number. In decimal, it is 536870912, not 2.I still do not understand the nature of my mistake, because in the instruction it is written exactly such use of the order of bits in the version. Picture: http://pp.userapi.com/c845322/v845322932/22ff3/CxHzojhuYj0.jpg URL: https://bitcoin.org/en/developer-reference#block-headers And the strangest thing is, it works for many blocks. For example: https://btc.com/000000000000000009a11b3972c8e532fe964de937c9e0096b43814e67af3728 Title: Re: manual block check does not work Post by: Nordok on April 09, 2018, 09:38:18 AM Oh, I see...
Big thanks! It works. |