Blockchain
- Pro: an old record cannot be changed
- Pro: works without a bank, around the clock
- Con: a mistaken transfer cannot be reversed
- Con: all transfers are visible to everyone
Copies of a blockchain are held at once by many participants of the network, meaning the computers that keep its records together. New records are gathered into blocks, and the blocks are linked in order, one after another. Hence the name, a chain of blocks.
Picture a shared notebook that many people have a copy of. Each new page refers to the previous one, so nobody can tear out or quietly rewrite an old page. Everyone else still has the original copy, and the swap would be noticed at once.
Why does this matter to you? The blockchain is what lets cryptocurrency work without a bank in the middle. The whole network keeps the records at the same time, so you do not have to trust any single company.
Each block is like a journal page with a header. Among other things, the header holds the fingerprint of the previous page: a long string of digits and letters calculated from that page's contents. The easiest place to see this is at the very start of the Bitcoin network, in its blocks 0 and 1.
The fingerprint of block 0 is copied character for character into the header of block 1. This is how the pages link up: block 1 "knows" which block came before it. You can look at these blocks in a block explorer, a website that shows every block and every transfer.
A program calculates the fingerprint from the contents of a record. Its key property is that the slightest change in the input changes the whole fingerprint. Let us write a simple transfer, "A -> B: 5", and calculate its fingerprint. Then we change a single digit, 5 to 6.
The two fingerprints have nothing in common, even though the record changed by one character. This kind of fingerprint is called a hash. It is the reason nobody can quietly tweak an old record: its hash would give the swap away at once.
Now put the two properties together. Change anything at all in an old block and its fingerprint becomes different, so the header of the next block no longer matches it, and the rest of the chain after it falls apart too. On top of that, many participants hold a copy of the journal and keep comparing their copies with one another. Any swap is visible to all of them at once, and there is no single point whose failure would bring everything down.
This protection has a weak spot. If nearly all the computers in a network (or nearly all the coins that participants lock up as a deposit for the right to check transfers) belong to a few owners, those owners can impose their terms on the network. Even then they cannot forge someone else's signature on a transfer (the owner's wallet makes it with a secret key), create coins out of thin air or rewrite old records. What they can do is rewrite the last few blocks to cancel their own recent transfer and spend the same coins a second time. In a large network, gathering such a share is almost impossible. In a small one it costs less, and it has already happened.
No. Once a transfer is written into an open blockchain, no person or company can delete or correct it. A mistake can only be fixed with a new record. For example, the recipient can send the coins back with a return transfer, but only if they choose to. Do not trust "services" that promise to reverse a transfer for a fee; the article phishing and scams describes this kind of fraud.
The network's rules can be changed to undo the consequences, but only if most of its participants agree. That happened in Ethereum in 2016, after a large theft from one project. The rules were changed, and those who disagreed kept running the old version of the journal; the article hard fork covers this in detail.
A beginner is better off knowing the flip side of a blockchain in advance.
Two familiar ways of keeping records make a handy comparison. At a bank, one company keeps all the records, while an online spreadsheet is kept together by everyone who has the link.
| Blockchain | Bank's database | Online spreadsheet | |
|---|---|---|---|
| Do many people hold a copy? | yes | no | no1 |
| Can one company change an old record? | no | yes | yes |
| Can everyone see the records? | yes2 | no | varies3 |
| Does it work without a middleman? | yes | no | no |
| Can a mistake be corrected? | no | yes | yes |
| Is adding a record fast and almost free? | varies4 | yes | yes |
A public blockchain is open to all. Anyone can read it, send transfers and take part in running the network. A private one is run by a single organization or a group of companies, which also decides who gets access. Bitcoin and Ethereum are public, while companies use private blockchains internally, for example to track deliveries. Almost everything this site covers runs on public blockchains.
Blocks are added by miners or validators, participants whose computers check transfers and add them to the blockchain in exchange for a reward. The article miners and validators covers them. Space in a block is limited, so your transfer first waits its turn among the unconfirmed ones. In Bitcoin and many other networks this queue is called the mempool. Whoever assembles the next block wants to earn more, so they usually pick first the transfers that offer a higher network fee, the payment for the network to record your transfer. A transfer with a higher fee is usually confirmed sooner. For how the fee works and why its size jumps around, see the article what is gas.
Once a transfer lands in a block, it gets its first confirmation, and every following block makes the record more secure. A block explorer shows how many confirmations your transfer already has.
Users pay for running a blockchain through the fees on their transfers. In most networks, those who add blocks also receive newly created coins as a reward, a rule usually written into the network's code. There are exceptions: the XRP Ledger network has no block reward at all, and its validators work without one. New coins increase the total supply, so indirectly every holder pays for them, as the article what is issuance explains. There is no separate company and no subscription fee of the kind a bank charges.
Researchers Stuart Haber and Scott Stornetta described the idea of a chain of time-stamped records as early as 19912, and the first widely used blockchain was the Bitcoin network in 2009. Many blockchains have appeared since, and they differ a lot, as the article what is cryptocurrency explains.
Spending the same coins twice is called a double spend, and an attempt to rewrite recent blocks by gathering most of a network is called a 51% attack. The Ethereum Classic network, for example, went through several 51% attacks in August 20203. For a closer look at this attack, see miners and validators.
Programs inside a blockchain (smart contracts) often need outside data, such as prices. Where they can get reliable data is the subject of the article Chainlink.