Wondering how Bitcoin works? Then check out this infographic!
A Bitcoin is just a piece of data stored on an electronic ledger. This ledger records how many Bitcoins are in each Bitcoin address. When a Bitcoin is sent from one address to another, the ledger adds it to the receiving address and subtracts it from the sending address. But who is managing this ledger? Well, no one in particular! Let’s see how this is possible…
The distributed ledger
Normal currency transactions are recorded by a central processor – a bank for example. A central processor is trusted with maintaining a correct ledger.
Bitcoin on the other hand does not have a central processor. Bitcoin balances and transactions are instead recorded by a peer-to-peer network of processors. These processors, which are called nodes, agree on Bitcoin transactions and keep a copy of the ledger. This means that the nodes collectively maintain the Bitcoin ledger.
Bitcoin public & private keys
There is no central body trusted with maintaining the Bitcoin ledger. Therefore, clever ways of securing balances and verifying transactions are needed.
Each Bitcoin address has a public key and a private key. These are long numbers that are unique to the Bitcoin address. While the public key can be seen by all Bitcoin users, the private key is only known by the address holder. During a transaction, the sender’s private key creates a mathematical signature and is verified by the public key to allow the transaction to happen.
The role of the blockchain
It’s important that the order of Bitcoin transactions is agreed upon by the nodes. This prevents double-spending. To explain, let’s say an address has one Bitcoin but simultaneously tries to send this Bitcoin to two other addresses. The network needs to decide which transaction comes first and which is invalid because the Bitcoin has already been spent.
To dictate the order, transactions are grouped into blocks. These blocks are then arranged one after another to form a chain. This blockchain is a permanent record of transactions.
So transaction order is important, but who looks after this? Bitcoin miners.
Bitcoin miners organize transactions into blocks and then compete against each other to solve complex mathematical puzzles. The first miner to solve the puzzle adds their block to the chain and is rewarded with new Bitcoins.
Why make miners solve complex puzzles? It makes it computationally impractical for an entity to change transactions fraudulently. To do so would require 51% of the network’s mining power, which makes it next to impossible if the puzzles are hard.