Atlas of Wonders and Monsters

Share this post

Rabbit Hole #6: The Blockchain

etiennefd.substack.com

Rabbit Hole #6: The Blockchain

Pretty crazy that I didn't know how blockchains worked until this afternoon 🧱

Étienne Fortier-Dubois
Sep 30, 2021
2
Share this post

Rabbit Hole #6: The Blockchain

etiennefd.substack.com

I know, I’m really late to this. “Blockchain” was a buzzword in tech a few years ago, until it was superseded by “AI” and “machine learning” and others. Or maybe it was the other way around. I can’t remember. Whatever. The blockchain is the foundation of web3 and crypto, so it’s still pretty important, even if throwing the word around won’t necessarily be sufficient to get investors to throw money at you right now.

The thing is, I don’t really know what a blockchain is. I have a computer science degree and I hold some cryptocurrencies, and I don’t know what a blockchain is. So chances are that you also don’t. Wanna learn with me?

(If you already know the basics of blockchains, I’m freeing you: go read something else after you’ve subscribed so you don’t miss my next post.)

All right. Let’s start where everyone always starts: Wikipedia.

A blockchain is a growing list of records, called blocks, that are linked together using cryptography.

Here’s what that looks like in the abstract.

The main chain is in black, starting from the green “genesis” block. The purple blocks are orphans. Poor purple blocks.

That doesn’t tell us much yet. There are blocks, and they’re linked into a chain. Cool. But what the hell is a block?

A block is basically a bunch of data. What kind of data? Transactions, i.e. any sort of exchange between two parties. Blocks are kind of lines in a big Excel sheet, if you will. A block might tell you e.g. that Alice sent Bob $3, and Bob sent Carlos $5 in return for something, and so on. All of this is encoded in a structure called a Merkle tree. Let’s not care about how Merkle trees work — it’s just a way to organize data.

Each transaction is signed cryptographically by the people involved. To know what exactly it means to sign stuff, go read the basics of cryptography. (This advice applies to me too. Maybe next week!) This ensures that there isn’t some random person tampering with the transactions: it really is Alice and Bob exchanging money. This — and cryptography in general — works thanks to the magic of math. It’s computationally extremely expensive to crack signed stuff, to the point that it’s really, really secure.

So far so good. But what if Alice sends $3 to Bob, and then sends the exact same $3 to Carlos? And I do mean the same $3. Sure, dollars are fungible, and we can use negative numbers to represent debt, so usually what would happen is simply that Alice went from, say, $4 in her account to $1, and then from $1 to negative $2. But suppose dollars are not fungible, and you can’t go below zero. Then Alice can say “hey Bob I’m sending you $3 for the Denise birthday present pool,” then the transaction proceeds with some time delay, and meanwhile Alice says “hey Carlos here’s the $3 I owe you for bubble tea the other day” and then the transaction proceeds without being aware of the first transaction. Now Alice has spent $3, but Bob and Carlos collectively earned $6. This is called double-spending.

Double-spending is bad! Nobody would want to do business in a world where money appears out of thin air. So what happens in practice is that there’s a central authority (e.g. a bank) that looks at the database — the Excel sheet — of transactions, and decides which transactions are valid.

Crypto people, umm, usually aren’t fans of central authorities.

Part of the reason is that banks can sometimes decide to undo a transaction, as a way to resolve disputes. This means they’re not completely trustworthy. And then there’s always some level of fraud. Central authorities, because they’re central, are single points of failure. If they fail (maybe due to a malicious supervillain), then the whole financial system fails. All of this results in larger transaction fees than would be ideal.

And so we come back to blocks.

In addition to the Merkle tree of transactions, a block contains a timestamp so everyone knows when the block was created. It also contains a cryptographic hash (i.e. an encoded address) pointing to the previous block. This creates a chain. A chain of blocks. A blockchain!

I haven’t explained what a “nonce” is. It means “number used once.” It plays a role in the “proof of work” that a computer must do to create a new block. This is the part I don’t 100% understand yet.

Importantly, the chain is decentralized. The “Excel sheet” doesn’t exist in any single computer. Instead, anyone can lend their computers to be part of the network and provide resources to it. If you do, then you’re a node in the network and you have a full copy of the blockchain.

The chain grows as nodes create new blocks. Every time a transaction occurs, each node is informed and collects it in a block. Meanwhile the node tries to find the crypto proof necessary to finalize its block.

1
When it does, it informs the other nodes, who then verify that all the transactions are valid — that Alice didn’t double-spend her $3. If they’re valid, then the block is added to the longest chain. Only the longest chain is considered correct.

So, instead of having a central bank checking the transactions in secret all the time, anyone can check the validity of any transaction at any point in the past by verifying their copy of the blockchain. Trust is achieved by recording everything publicly.


Most of the above is taken from the Bitcoin White Paper, which is pretty short and relatively readable for a technical paper. There are worse places to start if you want to learn more.

Bitcoin was the first application of the blockchain. Both Bitcoin and the blockchain concept were invented by the mysterious Satoshi Nakamoto

2
in 2008. Bitcoin remains the most widespread cryptocurrency.

But now there are many more blockchains. Bitcoin’s main application is being “digital gold”; like physical gold,

3
it doesn’t do much, but you can hold it or use it to pay for stuff. Other blockchains are embedded in larger systems, most notably Ethereum. Ethereum has a cryptocurrency (called Ether or ETH) that is analogous to bitcoin, and is the second-most traded crypto coin. But it also includes a whole layer of programming that can be done and recorded on the blockchain. This allows a much wider range of applications beyond money — smart contracts, DAOs, NFTs, etc.

Illustration of a person peering into a bazaar, meant to represent Ethereum.
the Ethereum website has such amazing art

And then there are countless other cryptocurrencies, and networks analogous to Ethereum. Blockchains in general have a bunch of other applications too, from finance to games to healthcare.


I remember, as a kid, asking my parents about the stock market. They gave me some basic explanation that I didn’t understand. So I proceeded to declare that the stock market was a stupid idea. Since I couldn’t understand what it was for, the only explanation available to me was that it was a scam that some people had set up to become rich.

Foolish youth.

I get a feeling that crypto is the same. It’s not easy to understand. It’s counter-intuitive. It goes against what is considered normal in society (fiat currency, centralized finance). And it is associated with all these weird subcultures. So it’s only natural that we adopt a default attitude of skepticism.

But declaring that crypto is stupid is itself stupid, if you don’t understand it.

I’m not saying that skepticism and criticism are unwarranted. Nor am I saying that understanding blockchains is necessary to use crypto. After all, you don’t need a deep understanding of money or the stock market to invest.

But if you want to criticize the technology, you should first understand what you’re talking about. And if someone who, like me, has a degree in computer science and has been holding some cryptocurrencies for a year, didn’t really get what a blockchain was until today, it means that the vast majority of people don’t get it either. Hopefully this newsletter makes a small dent in that majority.

Was this post helpful? Share it!

Share

1

This is computationally expensive and requires a lot of electricity. It’s the main reason why bitcoin has been criticize from an ecological point of view.

From the perspective of an individual, though, it makes sense, because the system rewards you by giving you tokens to spend on the network — e.g. it gives you some bitcoin as compensation for spending CPU power and electricity.

2

who claimed to be Japanese but probably isn’t, as evidenced by sleep patterns and linguistic analysis; in fact they may not be a single person.

3

Well, gold is used for jewelry and some computer parts. I suppose that’s not exactly the case for bitcoin.

Share this post

Rabbit Hole #6: The Blockchain

etiennefd.substack.com
Comments
TopNewCommunity

No posts

Ready for more?

© 2023 Étienne Fortier-Dubois
Privacy ∙ Terms ∙ Collection notice
Start WritingGet the app
Substack is the home for great writing