What A Blockchain Actually Is, Written In Blockchain
Share this article
Every few weeks I have an experience like the following. I’m sitting at at a bar or a barbecue somewhere, quietly sipping on a drink, and someone asks me about crypto. How does a blockchain work? What’s the story with mining? Why are there 1700+ different currencies? How can I trust money that requires a PhD to understand?
That’s usually the end of a fun night, as the rest of the evening devolves into prolonged discussion of cryptographic hashes, proof-of-work, 51% attacks and smart contracts. Eyes glaze over; glasses empty and stay dry, and everyone goes home more confused than before.
This essay is an attempt to explain blockchains in simple terms, so that everyone can get back to drinking and playing video games. Or, if you’re the kind of person who enjoys being at the center of attention, so that you can be the clever one explaining cryptocurrencies to your technologically-challenged friends and relatives.
It begins with a simple observation:
The preceding paragraphs contained 159 words in 10 sentences, with 964 characters, including 283 vowels and 479 consonants. There are 2 numbers, whose average value is 875.5.
The preceding section (excluding the last paragraph) contained 159 words in 10 sentences, with 964 characters, including 283 vowels and 479 consonants. There were 2 numbers, whose average was 875.5.
Not only is this essay an attempt to explain how blockchains work, this essay is itself structured as a blockchain. Each section—or block—is linked to the preceding block. Feel free to grab a pencil and follow along.
This isn’t a particularly robust blockchain. A real blockchain is a community effort, where many nodes share information and develop a distributed consensus. This particular chain has only one block producer, who is also the author.
But it might have a limited longevity, if people save this essay to their hard drives or share copies of it. They could even fork it, by adding their own blocks to the end.
This section contained 136 words in 12 sentences. It had 835 characters, including 236 vowels and 411 consonants. It also had 8 numbers, whose average is 346.6875.
Block 2. The preceding section contained 136 words in 12 sentences. It had 835 characters, including 236 vowels and 411 consonants. The average of its 8 numbers was 346.6875.
You might be wondering why I’m counting the letters in each paragraph.
Counting letters provides a sort of signature or snapshot for each block. It’s like wax seal on an envelope: once the letters are counted up, it’s very hard for someone to rewrite it without changing the number of letters, numbers and so on.
But it’s tedious to write out the full count of letters, so I’ll abbreviate each block signature like this:
Block Signature: (100, 8, 600, 170, 281, 8, 248.3359375)
Previous Block: (100, 8, 600, 170, 281, 8, 248.3359375)
This signature scheme is only meant as an analogy. Real cryptographers would consider it very weak even by pen-and-paper standards: it’s possible (but hard) to write another 100-word paragraph with 170 vowels, 281 consonants, and so on.
That can’t be said for digital blockchains like bitcoin. Each signature is 64 digits long when written in base 16, and a single typo would totally change the fingerprint.
It’s nearly impossible to find two blocks with the same signature, and the only way to do that is by random guessing.
Block Signature: (95, 7, 595, 149, 276, 13,165.44466145833)
Prev. Block: (95, 7, 595, 149, 276, 13,165.44466145833)
Each block contains a thumbnail of the previous block, which has a signature of the one before that, all the way back to the beginning. This is what makes a blockchain immutable: anyone trying to edit a block would also have to falsify the next block, and so on all the way down the line.
That’s why blockchains are considered ironclad. Anyone can easily check that a block follows the rules, but it’s very hard to create a counterfeit block—and by the time you did, you’d be even further behind.
Signature: (97,7, 565, 259, 148, 8, 163.05558268229)
Previous block: (97,7, 565, 259, 148, 8, 163.05558268229)
Now that we have a tamper-proof ledger, we can use it to record trades in value—without having to worry about forgeries or counterfeiting.
In Bitcoin, the most well-known blockchain, there are two kinds of transactions. The simplest ones create new coins to reward the creator of each block. They look a bit like this:
- The author pays himself 50 coins for creating a new block.
Signature: (71,6,450,197,121, 9, 144.67284252025)
Previous Block: (71,6,450,197,121, 9, 144.67284252025)
The second kind are normal transactions. A simple block might look like this:
- Alice sends 5 coins to Bob, and 1 coin as a transaction fee for the creator of the block.
- The author collects 50 coins, in payment for the creation of a new block, and a 1 coin transaction fee.
It’s also important to note that there are no real names, at least in the Bitcoin blockchain. Instead, every user uses a secret number to prove ownership of their accounts.
This leads to the number one rule of Bitcoin and every other cryptocurrency: never share your private keys.
Previous Block: (95, 7, 595, 149, 276, 13, 165.44466145833)
Do you notice anything strange about this block? The signature doesn’t match the previous block—it actually follows one a few blocks back.
This happens all the time in large networks, where new blocks are constantly being created and shared. Sometimes one node is a few steps behind the others, or there could be a malicious hacker trying to game the system.
Solving this problem involves an important organizational principle: the longest chain is always authoritative. Whenever there are two possible versions of the blockchain, everyone follows the one with the most blocks.
That’s why you’ll sometimes hear people tell you to wait an hour before considering your Bitcoin transaction complete. It’s possible to have two competing versions of the same block, at least for a little while. After a few block-times, one candidate emerges as the clear winner.
Since this block is at the end of a short chain, all of its transactions will be ignored.
The author sends you 1,000,000 bitcoins.
Previous Block: (101,8,625,175,277,12,88.472736876688)
Notice the signature above—once again we’re linked back to the longest version of the blockchain, which is considered the “right’ chain.
The speed of block production raises another problem. With thousands of blockchain participants, new blocks are constantly being created and shared. Everyone wants to get that block creation reward.
That’s the reason for one of the most confusing and misunderstood aspects of cryptocurrency: mining. In order to limit blocks to 10-minute intervals, the rules of Bitcoin require solving a puzzle before each new block.
The only way to solve it is to include an arbitrary, random number in your block, and hope that the block signature comes out within a tiny target area. If that doesn’t work, everyone keeps guessing until someone finds an answer that hits.
This is the mathematical equivalent of rhyming couplets or iambic pentameter: it doesn’t serve any necessary or useful purpose, except that it takes around 10 minutes to solve.
So far we’ve mostly described Bitcoin, the first and best known blockchain. But what about the other 1699 cryptocurrencies?
Some of those are variations of Bitcoin with extra functions for privacy or speed. Others are tokens or separate assets—think of them as movie passes or bus tickets.
The most exciting projects take crypto out of the money game altogether. You may have heard of Ethereum—the forerunner to many advanced smart contract platforms. These are more than just accounting books: a smart contract platform can do anything a computer can do.
Smart contracts are complicated agreements, like:
- Alice bets Bob $10 on a random coin toss.
- Charlie agrees to sell Bitcoin to David, and neither side needs to worry about getting ripped off.
Or, with a bit more development:
- Alice bets Bob $100 that John McAfee will be elected.
- Charlie agrees to pay David $500 for freelance work, which will only be paid if/when the work is completed.
- Edgar pays his insurance company $10 a month, but the insurers will pay $5,000 in the event of an accident.
All of these things are already done in the real world, but require many lawyers, agents, and specialists to execute them. On a blockchain, all of those people can be replaced, in theory, by automated code.
Previous Block: (205,16,1334,377,625,14,677.59623383483)
That’s why some people think blockchain is such a groundbreaking technology. The ability to send money anywhere, with no more effort than sending an email, could revolutionize finance more than banknotes, credit cards and computers combined.
This introduction is far from complete, but it’s hopefully coherent enough to take away some of the mysticism around cryptocurrency and blockchains in general. For a more thorough explanation of Bitcoin and Ethereum, there many detailed explanations on YouTube and Medium, not to mention CryptoBriefing.com.
The author has investments in Bitcoin and Ethereum.