A Complete Beginners Guide to Blockchain Technology Part 4 of 6. Slides from the #StartingBlock2015 tour by @blockstrap
Part 1: http://www.slideshare.net/Blockstrap/cbgtbt-part-1-workshop-introduction-primer
Part 2: http://www.slideshare.net/Blockstrap/02-blockchains-101
Part 3: http://www.slideshare.net/Blockstrap/03-transactions-101
Part 4: http://www.slideshare.net/Blockstrap/cbgtbt-part-4-mining
Part 5: http://www.slideshare.net/Blockstrap/05-blockchains-102
Part 6: http://www.slideshare.net/Blockstrap/06-transactions-102
2. Introduction & Primer
First, some context
These slides are from the #StartingBlock2015 tour by @blockstrap.
6 European countries in 8 days – (Istanbul, Amsterdam, Barcelona, Prague, Berlin
& London). We met lots of great people, answered lots of great questions and had
a great time. We look forward to meeting many of them again in the near future.
These slides might only make perfect sense if you were at the talks and can
remember all the additional points we made whilst discussing the tech.
This deck is 4th
of 6.
Questions? Comments? @MrAdamGiles adam@neuroware.io
3. Mining
Refresher
➔ Transactions are broadcast to the network
➔ Blocks store records of transactions
➔ Blocks are created by Miners and then broadcast
➔ New blocks are added to the chain
➔ Miners then compete to build the next block
4. Mining
So...
➔ Mining is the process of collecting transactions and ‘solving’ a block
➔ Blocks are immutable, we need to make sure they’re right
➔ We make solving a block hard and slow - maths to the rescue
➔ … but we want to make verifying a block easy
➔ Because we make mining hard, we reward miners… with bitcoin!
➔ Mining is the process of securing the blockchain
5. Mining
Proof of Work
➔ All the transactions in the block are used to create the Merkle Root hash
➔ It’s added to the other metadata in the header, with a nonce
➔ We hash the whole thing, look at the resulting hash
➔ If it starts with a ‘0’ then we’ve solved the block, and broadcast it
➔ If not, we increment the nonce and try again
➔ Repeat until we find the leading zero
8. Mining
Easy Peasy Lemon Squeezy
➔ 11 attempts isn’t very many, we need to make it harder
➔ We introduce the concept of ‘difficulty’
➔ Difficulty defines how many leading zeros when solving the block
➔ The more zeros we have find, the more attempts at hashing we need
➔ More hashing power becomes the driving force amongst miners
9. Mining
Increasing the Difficulty
➔ As a way of controlling how hard it is to solve a block
➔ Can be adjusted to make it easier or harder
➔ Target time of 10mins per block
➔ As miners add hashing power to the network, we need to make it harder
so increase the difficulty to compensate
➔ Difficulty is recalculated every 2016 blocks (approx 2 weeks)
12. Mining
It’s A Race
➔ Miners try to solve the block at the next height from the top of the chain
➔ The first to achieve it gets their block added to the chain
➔ All the other work done by the other miners is ‘wasted’
➔ To create more blocks than other people, you’d have to have more
hashing power than everyone else
➔ Current hashing power in the bitcoin network is more than the top 500
supercomputers combined
13. Mining
Maintaining Blockchain Integrity
Could someone with lots of hashing power control the blockchain?
In theory, yes - simply compute blocks with double spend transactions &
broadcast to the network
But you need to control 50%+1 of the network for it to work reliably
Network is currently at ~340 thousand terahashes per second
That's 340,000,000,000,000,000 hashes per second!
14. Mining
Too Much Math For One Man
➔ Club together in Mining Pools
➔ Each pool has many miners who split the
problem up
➔ All members try to solve the same block
in parallel
➔ Rewards are shared between the
members
41. Why Bother?
Mining
You get paid!
When you collect the transactions into a block, the miner inserts a special
transaction at the beginning called a ‘coinbase’ transaction
This ‘pays’ the miner for the work they did, and collects the transaction fees
from all the transactions
The coinbase value declines over time (halved every 4 years)
This is the only way bitcoin is created - Only 21m btc will be created
42. Could You Fake A Block?
Mining
The hashing work you did ‘proof of work’ is easy to verify, a node will
repeat the final hash you did to see if they get the same result as you.
If not, the node won’t add the block to the blockchain
The coinbase payment amount is based on an algorithm, if you fake
it, the block is rejected
If the block is rejected by the nodes, you don’t get any of the money
you faked
So… no, you can’t fake them!
Assume familiar with software, just not blockchains
Bitcoin can be polizing, quickly decends into conversations/arguments about politics,
But as software is eating the workd, that's what we'll be focusing on
Simplified first , then circle back round and dive deeper
Simplifications can be missleading
Tell meif too fast/slow