Bitcoin Forum
April 25, 2024, 03:31:01 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Mining software (miners) / Re: OFFICIAL CGMINER mining software thread for linux/win/osx/mips/arm/r-pi 4.10.0 on: February 24, 2018, 11:53:51 PM
Thanks ck!

My question was geared more towards how the version is placed into header_bin, pool->header, and eventually work->data prior to being hashed.

The older block you listed gets hashed as:  https://blockchain.info/block/00000000000000001ed61d4b7dd337c8eb1de0f21a0bd310a8733fb35f21991cformat=hex
02000000ea7ee4542a0d7496954302e67b99a4d1a3d1c2724f8ddb1a00000000000000007d28ed3cb6e06dc df8267afaa908999d48f2d4deba94b4e344c3e126a3c8b00b174e1f54e9db2418e5bc702

The newer as (and current blocks):  https://blockchain.info/block/00000000000000000077140243064000ba35b22d3e2440e936a722b90cd09365?format=hex
00000020633a9073c5b1a5f32afefa4c1116c5bb9c593dfa419812000000000000000000515b81eeca6c575 93c90264ee1a1cb581fc3b7052e8adc23ec16db9917cf828bd33d575ac19100184dbccd28

Current blocks manually double sha256 hashed give correct results with the second format.

I guess I am not seeing in the code where the version is flipped after it is placed in as "20000000" prior to being hashed.

Thanks again for your help!

-Ken


2  Bitcoin / Mining software (miners) / Re: OFFICIAL CGMINER mining software thread for linux/win/osx/mips/arm/r-pi 4.10.0 on: February 22, 2018, 11:52:17 PM
I hope this isn't a dumb question...

Going through some of my debug logs, I noticed that the generated stratum header has the version like this:

[2018-02-15 23:08:23.772] Generated stratum header 20000000ed37665c908b8f6b9120d09918afa1ef1c3bd3fa0024d3f700000000000000005fb360c99001606 f4f9aeb9293c5776d6e3e666adf0e6dacdbb9526ae3561fa95a86592f1761e9f800000000000000 8000000000000000000000000000000000000000000000000000000000

Shouldn't it be like this?:

[2018-02-15 23:08:23.772] Generated stratum header 00000020ed37665c908b8f6b9120d09918afa1ef1c3bd3fa0024d3f700000000000000005fb360c99001606 f4f9aeb9293c5776d6e3e666adf0e6dacdbb9526ae3561fa95a86592f1761e9f800000000000000 8000000000000000000000000000000000000000000000000000000000

I didn't see anywhere in the code where the bbversion was reversed.  Unless I missed it.  I did see some previous posts from way back where the block version is shown in the logs like my second example.  

The version gets put in the header_bin as in the first example, not reversed.    Raw block headers have the version reversed and when test hashed, produce the correct hashes.

Thanks,

-Ken
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!