To bring you the best content bitcoin algorithm cracked our sites and applications, Meredith partners with third party advertisers to serve digital ads, including personalized digital ads. Those advertisers use tracking technologies to collect information about your activity on our sites and applications and across the Internet and your other apps and devices. This article explains Bitcoin mining in details, right down to the hex data and network traffic.
If you’ve ever wondered what really happens in Bitcoin mining, you’ve come to the right place. The block header contains a handful of fields that describe the block. The first field in the block is the protocol version. It is followed by the hash of the previous block in the blockchain, which ensures all the blocks form an unbroken sequence in the blockchain.
Inconveniently, the hash is reversed in the header. The next field is the Merkle root, a special hash of all the transactions in the block. A short program to mine a block I wrote a Python program that mines the above block. The program itself is pretty simple – the hardest part of the code is computing the difficulty target from bits. Otherwise it’s just a loop over different nonce values.
Each iteration puts the data into a structure, hashes it, and tests the result. The following table shows the hash obtained for selected nonce values. The key point is that each nonce generates a basically-random hash value. Every so often a “lucky” nonce will generate a hash starting with some zeroes. To get a lot of zeroes, you need to try an exponentially large number of nonces.