Bitcoin Explained - How Does BTC Work? (White Paper For Beginners)
We all like to pretend we've read the Bitcoin white paper, but in reality we gave it a five minute skim read at best - me included.
I was unhappy with my lack of understanding of the fundamentals, so I live streamed my learning process on Twitch.
Here's my attempt at explaining how Bitcoin works and how it came to life:
In October 2008, Satoshi Nakamoto published the paper above describing Bitcoin and how it could be used as a digital currency.
In January 2009, the Bitcoin network went live and Satoshi Nakamoto mined the first bitcoin block (block 0). The first block of a blockchain is called the genesis block.
Nobody knows who Satoshi Nakamoto is - it could be a guy, it could be a girl, it could be a group.
In December 2010, Satoshi Nakamoto became inactive in the development of Bitcoin and stopped posting on the Bitcointalk forums.
Rumors spread - some people claim Satoshi is dead. Others claim Satoshi is lurking in the shadows as a humble crypto Jesus.
Every now and then someone pops up claiming they're the real Satoshi, but the community quickly denounces them.
Until someone comes out and moves a Bitcoin from one of Satoshi's known addresses - the question of "Who is Satoshi Nakamoto?" will remain unanswered.
Bitcoin: A Peer-to-Peer Electronic Cash System
A peer-to-peer electronic cash system is when online payments can be sent directly from one party to another without going through a middle party.
If I were to send $10 to you via the usual banking system - the transaction would go through the bank before it went to you.
If I were to send you 1 Bitcoin, the transaction would go straight to you. There is no financial institution in the middle.
A trusted middle party is important because they prevent double spending. Double spending is when you use the same money in more than one transaction by duplicating or falsifying its digital file.
If I had $500 online and there was no trusted middle party to keep me honest, I could send that same $500 to multiple people.
So how does the Bitcoin network get around this double spending problem if there is no middle party?
The Double Spending Problem
Using a combination of blockchain, cryptography, digital signatures and network timestamps - Bitcoin runs on a hash-based proof-of-work system. Let's look at what those buzz words mean...
A blockchain is a continuously growing list of data split up into blocks. A block can hold thousands of transactions - up to 1MB (megabyte).
A block does not have to be full in order for a new block to be created. When a new block is created, the previous block is locked in place forever.
Imagine you're writing a story and you run out of paper or finish a chapter half way down the page - you go and get a new piece of paper. As soon as you start writing on page two, you can never go back and edit page one. Hope you didn't make a spelling mistake...
Cryptography is a method of securely storing and transmitting data between parties when a third party is involved. If I send you a message without encryption, you can see it, I can see it, and the third party can see it. With encryption - only you and I can see it.
Digital signatures are similar to ordinary signatures. A transaction on the blockchain won't go through until both parties digitally sign for it using their public key and private key.
A hash is a cryptographic function which takes an input (message / data) and returns a fixed-length of numbers and letters. You get a completely different hash if a single letter or number changes.
- Banana6 (input) > Hash > ABCD 1234 EFGH 5678... (random, but fixed-length)
- Banana69 (input) > Hash > ZYXW 9999 QRST 0101... (random, but fixed-length)
- Lord of the Rings Trilogy > Hash > IJKL 9876 MNOP 5432... (random, but fixed-length)
A network timestamp in Bitcoin's case is when you include the time on a hash of a block. A timestamp proves that the data you're looking at must have existed at the time it shows.
The timestamp server uses the "Unix Time Stamp". This is a counter that started from 0 in 01/01/1970 and has been counting since.
The current timestamp for this article is "1531088779" - 07/08/2018 - 10:26pm (UTC).
Each timestamp includes the previous timestamp in it's hash. This forms a chain that reinforces the ones before it.
Proof-of-work is a way to prevent spam and denial of service attacks (DoS / DDoS) on a network. In order to request something from the network, your computer has to use a bunch of processing power to solve a problem.
In order to clog up a proof-of-work system you would need an insane amount of electricity and a bunch of computer parts. Your wallet would take a big hit.
Without proof-of-work you need a malicious mind and some thinking time. Low bar of entry.
By combining all of this into an ongoing chain of data, the double spending problem can be solved.
The longest chain of blocks serves as proof of all of the previous transactions and is the most trusted because it came from the largest combined pool of processing power.
Proof-of-Work & Nodes Explained
The processing power comes from "nodes" and they run the network. Anyone can be a node and you can leave and rejoin the network whenever you want. All you need is a computer. Nodes are commonly referred to as "miners".
First you download the blockchain (currently 174GB - increases every new block).
When a new transaction is made, it is broadcast to all the nodes on the network. Each node collects new transactions and starts to fill its own block.
As new transactions are coming in, each node is simultaneously finding a difficult proof-of-work for its block.
The proof-of-work in this case requires the node to generate a hash with a certain amount of zero's at the beginning using a hash from the previous block and a nonce. A nonce is a number you add on the end to make a hash different.
- "Previous Hash1" = ABCDEFG123456789... - Nope
- "Previous Hash2" = HIJKLMN987654321... - Nope
- "..." - Nope
- "Previous Hash66983" = 000000ZYXWVUTSRQ... - BINGO!
The number on the end of "Previous Hash" is the nonce.
The number of zero's required at the beginning represents the difficulty. As technology gets better, more calculations can be made per second. The harder the difficulty, the more processing power is required.
Using a 10 minute average block solving time, we can increase the difficulty of the proof-of-work if blocks are being solved too quickly. We can also reduce the difficulty of the PoW if blocks are taking too long to be solved by changing the required number of zero's.
Block generation is a low probability trial and error lottery rather than a complex math problem.
When a node finds the the right proof-of-work hash, it broadcasts its block to all the other nodes.
Other nodes accept the block if all the transactions inside it are valid and not already spent.
Nodes then begin working on creating the next block in the chain using the hash of the accepted block as the previous hash.
As long as the majority (51% or more) of processing power is controlled by nodes that are not trying to cooperate and attack the network, they'll outwork the attackers and generate the longest chain.
How do you ensure that nodes don't team up to attack the network?
The first transaction in a block is a unique transaction which awards a new Bitcoin to the creator of the block.
Since all nodes are working on the same block until the proof-of-work is completed, the first node to broadcast the proof-of-work becomes the creator and gets rewarded.
This provides an incentive to run a node and support the network. It also slowly introduces more coins into circulation and distributes them fairly.
It's similar to gold miners using more and more resources to find undiscovered gold. Replace gold with processing power and electricity and you have Bitcoin miners. This is where the term Bitcoin miner came from. A node runner is a Bitcoin miner.
Incentive can also be funded using transaction fees. The cost to process the transactions can be added to the block reward.
When all the coins are in circulation, incentive will transition to only transaction fees. Since no more coins can be added, the problem of inflation no longer exists.
The incentive also encourages nodes to stay honest. If an attacker is able to accumulate 51% or more of the processing power than all of the honest nodes, they would have to choose between generating new coins or stealing back the payments they've made.
An attacker cannot alter transactions between other people, only the transactions that they have made. Digital signatures provide protection for this.
This relates back to the double spending problem. The attacker can double spend their money - they can't change your balance to 0 directly or steal the money you sent to your Mum.
If the 51% attacker were to play by the rules they'd earn more coins than everyone else combined. Breaking the system would destroy their own potential wealth in the process.
There's no monetary incentive in attacking Bitcoin. The only incentive is a sadist looking to make the world burn. Better make sure the Joker obsessions doesn't get out of hand. Stick to cosplays please, sincerely - The World.
Further Study - Advanced
If you can understand and explain in your own words everything mentioned above, you're no longer a beginner. I encourage you to check out the Bitcoin white paper to further your understanding.
Chapters still to cover:
- Reclaiming Disk Space
- Simplified Payment Verification
- Combining & Splitting Value
Sine this guide is for beginners, I didn't feel the need to dive down these chapters much. The most important chapters for understanding how Bitcoin works are the ones I've covered.
The chapters mentioned in the bullet points above are very technical and are only relevant to certain people.
Here's my attempt at a brief summary:
Reclaiming disk space - old transactions can be hashed without breaking the block's hash using a Merkle Tree. This clears up space for your computer.
Simplified payment verification - you can verify a payment without running a full node by keeping a copy of the block headers of the longest proof-of-work chain.
You can query the full network nodes until you're convinced you're working with the longest chain. When you're happy, you can obtain the Merkle branch linking the transaction to the block it's timestamped in.
You can't check the actual transaction itself, but you can see that a network node has accepted it by linking to a place in the chain. Blocks added after it continue to confirm the network has accepted it.
Combining and splitting value - transactions contain multiple inputs and two outputs to allow value to be split and combined.
$5 - rather than a separate transaction for every cent, you can move it all as one transaction. Two outputs: one for payment, the other for returning change back to the sender.
Privacy - with the current banking system, access to your privacy is limited to the parties involved and the bank. It's sort of private.
With Bitcoin you can keep your privacy by keeping your public key anonymous. All transactions are public, but nobody knows who's made them. It behaves similarly to stock exchanges.
The problem is the majority of users access Bitcoin through services that require full disclosure of their identity. Age, name, telephone number, photo verification...
These services can track your Bitcoin usage and even allow third parties to have a look at what you've been up to. In a system like this you have no privacy. But privacy is possible.
A new key pair needs to be used for each transaction if you want to keep your privacy.
Calculations... Next joke. I'm not Big Shaq - go read the white paper.
Last Words - Summary
Bitcoin is a peer-to-peer system for electronic transactions that removes middle parties and relies on trust.
The double spending problem can be solved by using a combination of: blockchain technology, digital signatures, timestamps, cryptography, hashes, and proof-of-work.
A public record of transactions that cannot be censored or edited due to a specialized network of nodes. With a low bar of entry, any computer can join or leave the network at will, accepting the proof-of-work chain as what happened while they were gone.
With no central authority, the Bitcoin network is a decentralized group of computers which can vote with their processing power.
As long as the largest pool of processing power belongs to honest nodes, the network will run fairly and attackers won't make any progress. Nodes are kept honest through incentive rewards.
I created this article to further my understanding of the fundamentals of Bitcoin and cryptocurrency. What a journey the last few days have been. Ethereum here I come...
I stream my learning and writing process on Twitch - come and ask questions live and learn with me. My goal is to create a collaborative group of crypto enthusiasts that learn together.
Check my socials and Youtube - it actually helps keep me motivated. Reach out, I'm always ready to talk crypto.
Here are two beginner articles I think you'll like:
- Types Of Cryptocurrenies - With Examples!
- How To Invest In The Right Coins - Altcoins & ICOs Explained
Thanks for reading, have a wonderful week. Peace <3