Bitcoin Forum
May 11, 2024, 07:51:13 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Mining algorithm  (Read 648 times)
hkproj (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
July 25, 2011, 02:19:56 PM
 #1

Hi, I read the entire wiki, also read some code in C and python. Here is what I understood about the mining algorithm:
 - GetWork using RPC call
 - Read the 'data' section in the result in JSON returned from the server. Decode it into binary and change the byte ordering so that reflects the little-endian format (should I rotate chunks of 4 byte or byte per byte?)
 - Read the 'nonce' value, which is stored in byte from '76' to '80'.
 - Try incrementing the nonce value in the data, and then hash the 'data' with the modified nonce, and re-hash the result.
 - Check if the generated hash's value (converted to a number) is less than that of the target (which is a number stored as HEX).
 - If that is true, send the modified header to the daemon.

Is that right? Thank you.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!