The Wayback Machine - https://web.archive.org/web/20130501075043/http://www.thegenesisblock.com:80/mining-for-dummies/

What is Bitcoin Mining?

This is an introduction to the concept of bitcoin mining – the process of verifying transactions on the bitcoin network. I wanted to publish the first series of posts about the current Bitcoin mining environment, but that seems like it would be fairly challenging to do without first doing an overview of what mining is.  I’ll try and keep this as short as possible, but it’s definitely the most complex aspect of the bitcoin system.

This is the second part in a 4 part series discussing the current state of bitcoin mining:

  1. What is bitcoin mining?
  2. The evolution of mining
  3. Current ASIC Hardware
  4. Bitcoin mining – public companies

1. Why do we need mining? (The elevator pitch)

The block chain is a ledger of every bitcoin transaction since the first block was created (“The Genesis Block”).  Once every 10 minutes, a miner will find a block, and for this he is rewarded bitcoins.  In addition to fairly distributing new coins, this adds to network stability by increasing the difficulty for a malicious miner to be able to affect the network.

2. What is this hashing everyone keeps talking about?

hash_edit

Not quite as delicious, but just as important.

Hashing is an algorithm that takes an arbitrary input, and returns a reproducible fixed-length value.  Additionally, the resulting value will be changed completely even with the smallest change to the inputs [Wikipedia].  For example using sha-256:

SHA-256 of “miner” always outputs:

"Zd8GLQuuXESwbgGTAFJmA3OMR8JCE8DFqWY9uMerbI4="

SHA-256 of “minor” is:

"grOHEppyxlv+B94u++x4hjO3c1DplOGSqxD2W3hS8hw="

3. Why do miners care about hashing?

gold-miningMiners perform a hash on all available transactions since the last block was created.  In order to be accepted, the hash must start with a certain number of zeros which is determined by the difficulty level.  In order to keep trying new hashes to meet the difficulty level, miners will add random numbers to the end of the transactions in order to try and find a has that meets the difficulty requirement.  When an acceptable hash is found, it’s information is send through each node in the network, and new miners continue the chain working on the next block.

4. Why do we use the blockchain instead of trusting every transaction immediately?

Bitcoin_block_chain-paymentobserver

The main chain is highlighted in blue. Every block in the main chain can be traces back to Genesis in green

The current block systems prevents double-spend attacks (one person sending the same bitcoins to multiple poeple) in three ways:

  1. The hash will only match a block of transactions if they remain identical to how they were as they were originally found.
  2. The 10 minute time between blocks allows breaks for the last set of transactions to transmit through the network.  This reduces the ability of a malicious spender being able to send the same transaction to multiple people simultaneously.
  3. Every new block has exactly one path in the block chain to the genesis block.  Therefore each transaction occurs in a serial manner.  It is impossible to have two different blocks unaware of each other – spending the same coin – and be in the main block chain.

5. How do we know there will be 10 minutes between each block?

speed-small-lin-10kThe difficulty in finding a block  - how many zeros must be in the beginning of the hash – is adjusted every 2016 blocks.  Depending on how long it took to find the preceding set, the difficulty will rise or fall to adjust to the network’s speed ( the actual equation can be found on the wiki here).  This means that the faster the network is hashing, the more difficult it becomes to find blocks.

Additional resources:

Satoshi’s orinal paper on the Byzantine General’s problem: http://www.mail-archive.com/cryptography@metzdowd.com/msg09997.html

Bitcoin wiki on mining: https://en.bitcoin.it/wiki/Mining

Reddit discussion on mining: http://www.reddit.com/r/explainlikeimfive/comments/1b689q/eli5_this_bitcoin_mining_thing_again/

About the author  ⁄ Phillip Archer

One Comment

Leave a Comment