It doesn’t take long to get lost in technical jargon and buzzwords when you try to find out what Ethereum really is. It’s uncensorable. It’s decentralized. It’s a blockchain. It’s unregulated. It’s secure. If you string it all together, you could say that Ethereum is “a generalized protocol for decentralized, secure transaction-based state-changing virtual machines.”
But if you’re anything like me, you’re now stuck with more questions than before. What on earth is a ‘decentralized virtual machine’? What is a blockchain? What does it look like, and why is it secure?
And most of all, why should I care?
I decided to delve into books and papers on Ethereum to explain – in plain English – how Ethereum really works. Let’s start with the why question. Why does Ethereum matter?
The Big Picture
There is a lot of hype around digital currencies like Bitcoin and Ethereum. This is in no small part because of the insane price rises over the last few years. In 2010, a Bitcoin enthusiast used 10,000 bitcoins to buy two pizzas. Seven years later, those pizzas are worth over forty million dollars.
The Ethereum currency, called Ether (and shortened to ETH or Ξ ) has also risen dramatically, from under a dollar in early 2015 to more than $300 as of writing this. So on the one hand, you have a bunch of speculators cheering this new technology on, hoping that it will continue to rise spectacularly. They don’t need to understand how it works as long as the price continues to go up.
But on the other hand, you have people who believe that Ethereum could just be the biggest innovation in economics since the invention of money.
And yes, this has to do with all the buzzwords I mentioned. What makes Ethereum unlike anything before is that it combines programmable money (the ‘blockchain’ part) with a globally accessible, programmable computer (the Ethereum part).
This global computer consists of thousands of individual computers connected to each other. These computers work together as if they’re one big Ethereum machine. Every computer has a copy of all the information, so if one computer fails it’s not a big deal.
Copy and pasting information has never looked this cool.
So Ethereum is not just a digital way to store value – you can make that digital value do stuff on that global computer, which is called the Ethereum Virtual Machine. The Ether coin has inherent value: making this Ethereum Virtual Machine run costs energy and time, so you use Ether to pay for time on the global computer. With the ‘EVM’ you can create agreements about anything of value, between anyone on the planet, in a transparent and secure way.
You can write an app for every financial service you can think of. Banking, loaning, buying, selling, crowdfunding, trading, bartering, gambling, royalties, you name it. It’s not just limited to people – computers can interact with the Ethereum Virtual Machine as well. The Ethereum Virtual Machine makes microtransactions feasible, so your phone could start paying for services for you. In Germany, your electric car can already pay the cost of charging at a charging station for you because of Ethereum.
These exchanges and agreements cannot be overruled by any adversary, organization or government. Once an agreement is made, it can’t be changed on a whim.
Ethereum can give everyone the power to exchange value, much like the Internet has given everyone the power to communicate.
Note the word ‘can’. Although Ethereum in its current state can do a lot already, development is ongoing. Learning curves are remarkably steep. And honestly, it’s not remotely fast enough or big enough at the moment to replace real banks and financial services. For example, the Ethereum network handles more than 500,000 transactions per day, while Visa alone handles that number of transactions every twenty seconds. Even if most of the technical hurdles are overcome, that doesn’t mean there is always a business case for ‘
[your favourite thing] on Ethereum‘.
Despite all that, I think it’s a potentially revolutionary technology that deserves a closer look. So what’s Ethereum made of that makes this all possible?
Information & Protocols
Because exchanging value is arguably the most important thing Ethereum does, we’re going to start there. What happens when you transfer money to someone? Well, your account is reduced by some amount of money, and another account is increased by the exact same amount of money.
Regular banks keep a record of all transactions and use that to determine how much you have. Your balance is simply all money that went in minus all money that went out.
Such a record of all transactions ordered chronologically is called a ledger. The blockchain is basically a digital ledger. Each block in the chain is nothing more than a few dozen transactions with some information about the block itself. Really, see for yourself.
The information about itself is called the header of the block, and contains information like the block’s number and who created it. It also contains technical stuff like the difficulty, hashes (more on that later) and the gas limit.
Each block must say which block came before it and what’s in the block – this is the chain part of blockchain. There is a chain of blocks from the first block (aptly called the ‘genesis block’) to the current block.
Every computer in the network stores a copy of this blockchain locally. When a new block is successfully added to the chain, every computer updates their version of the blockchain with peer-to-peer filesharing.
The above is true for both Bitcoin and Ethereum (and a bunch of other blockchains), but this is also where similarities end. Ethereum stores not just transactions, but also states. A state is simply something that an object has and that can be changed. The
color state of a traffic light might be
green, but it might also be
color = green and
color = redare two different states of one object.
Ethereum allows you to store all kinds of states describing all kinds of things, from monetary value and data files to your pet’s name and your favourite movie. If you have an Ethereum wallet, its balance is stored as a state (literally as
balance = ...). This information is not stored in the blockchain, but in a separate state database. As you might expect, you use a transaction to reduce your balance and increase someone else’s balance by the same amount.
But how do you create a state for your pet’s name, and how do you change it? Here’s the key: Ethereum transactions don’t just change account balances. In Ethereum, a transaction can change any kind of state. In other words, with Ethereum you can put anything in the ‘Value’ column of the ledger. If you – for some reason – have stored
petname = Mr. Fluffalopolous , you use a transaction to change that state to
petname = Mr. Fluffalopolous the Third.
Schrödinger’s Block is when your cat is and isn’t worthless at the same time.
And because the ledger keeps track of all changes, you can derive any state from the transactions that changed it, just like you can derive someone’s balance by looking at all their monetary transactions. Note that you can’t just change someone else’s states – this isn’t Wikipedia. There are rules about what you can and can’t do with transactions. This is what people mean when they talk about the Ethereum protocol. A protocol is simply a bunch of rules about what is and isn’t allowed.
Some things are never allowed by the protocol. You can’t send more money than you have, for example. You also can’t just create money out of thin air, or make it disappear. The Ethereum ledger balances itself because the protocol doesn’t allow unbalanced transactions.
It’s not always so restrictive. The protocol leaves it up to you to decide who can and cannot change your pet’s name. This is one of the freedoms you have when programming with Ethereum.
So if someone asks you what Ethereum is, you can now give them a good answer. Ethereum is a global mainframe computer for anything valuable, and you buy time on this computer by paying with Ether. This computer runs on three main ingredients:
- States, which can be changed by…
- Transactions, which are governed by…
- The Ethereum Protocol
Having a global computer is nice and all, but how do I know it’s safe? What makes Ethereum so secure?
The Ethereum Blender
Ethereum is often called a cryptocurrency. This is not just because it sounds cool – although it obviously does. The ‘crypto’ part refers to the science of cryptography. Cryptography aims to define secure protocols to allow communication without anyone reading or tampering with the contents.
One of the cryptographic tools that Ethereum uses a lot is called a secure hashing algorithm, or SHA. This algorithm takes any kind of data as an input and changes that data in a specific way. For example, if I hash
veenspace with the SHA-1 algorithm, the output is the hash
e4a192365543903d6015465069f262b7d707e5b6. (‘Hash’ is both a verb and a noun.)
You can picture hashing as a cryptographic blender. Put any kind of data in, blend it for a fixed amount of time and the result is a blended – ‘hashed’ – bunch of letters and numbers. Like every blender, it blends one way only: you can’t retrieve the original words from the mess of letters and numbers.
It’s not just any blender though. The blender always blends the same way: when you give it a specific input, it will always produce the same output. If you put
veenspace through the SHA-1 blender, which you can do here, it will alwaysgive you the hash
Most importantly, even the smallest change to the input will create a completely different output. Take, for example, the entire Adventures of Sherlock. If you hash the entire book, the resulting hash is
For fun I changed just one word in there. Hashing it again gives me
08f0ee20fcffe7028787ee5232b9ae80de016857. Note how pretty much every part of this second hash is a completely different letter or number than the first!
You might think that’s the lamest party trick ever (and you wouldn’t be wrong) but it’s the key to Ethereum’s security. Each block in the blockchain contains a hash of all previous states and all previous transactions. So if some supervillain / Bitcoin maximalist wanted to ‘rewrite history’ in the blockchain, changing just a single digit somewhere would be instantly noticeable because the hashes would be completely different.
I said that there was no way to reverse the blender, which is not entirely true. You can try and guess what the original input was, and see if the hash you end up is the same. If the input can be anything, it will take around 2 511 guesses. That’s around a 1 with 154 zeroes behind it, in case you were wondering.
Despite this difficulty, a computer in the Ethereum network of computers makes a correct guess every 15 seconds.
Maybe this number thing isn’t always helpful…
This guessing game is what’s called mining. The reason why this guessing game doesn’t take forever is that the input isn’t entirely random. If I give you a copy of the Adventures of Sherlock and tell you that a hash is exactly the same with only one word altered, it’s suddenly much easier to guess. All you have to do to guess is change a random word and leave the rest untouched. You have 99% of the input already, so guessing becomes much easier.
This is why each block stores a hash of all previous states and transactions. What the miners are guessing is
[hash of everything until now] + [some number]. Miners can thus only make a correct guess in a reasonable timeframe if they download the most recent block.
The result is that all miners always work on the latest block and can’t make a single change to older blocks. If you don’t mine on the most recent block, it will take hundreds of thousands of years to guess the entire input. But if you do, you know most of the input already so solving can be done in months, not millennia. And when you have 25,000 computers all guessing at the same time, you get a winner every 15 seconds on average.
That 15 second time – also called the ‘block time’ – is intentional. As more computers join the network, the
some numberpart is made longer to keep the winners 15 seconds apart. This gives everyone the time to download and validate the latest block.
Because all computers in the network are guessing at random the winner is also random. The winning computer gets to add a new block to the blockchain. They’re also awarded 5 ETH for their hard work.
Mining in a nutshell. This loop happens millions upon millions of times a second, all over the globe.
Simply winning the guessing game isn’t enough to add your block to the chain though. Every single computer in the network needs to double-check if you’ve done the work. Only when the majority of the network agrees that your guess was correct and that you changed states correctly is your block valid and thus considered ‘true’.
Validating the guess is easy: all you need to do is input the guessed number and last block’s hash into the Ethereum hashing algorithm, and it should spit out the hash that everyone’s been working on. It’s hard to guess
veenspace when all you have is
e4a192365543903d6015465069f262b7d707e5b6 , but the other way around can literally be done in less than 0.1 seconds.
This whole system of making lots of calculations is often called Proof of Work. Ethereum’s security thus comes from a) keeping everyone on the latest block, b) having miners do an arbitrary amount of work, and c) only accepting the result after the majority has validated it. So where normal money (called ‘fiat’ by people who clearly have never driven a small Italian cars) is secure because it’s backed by governments, cryptocurrency is only as secure as its protocols are.
If you, Mr. Supervillain, wanted to simply ignore the protocol and create Ether out of thin air, the only real way of doing that is to have the majority of the network in your own hands. Such an attack – called a ‘51% Attack’ – is technically possible, but in reality unreasonably expensive and very easy to notice. (So not profitable at all.)
That’s enough explanations for now. I hope you liked it! What should I explain next? Metropolis? ZK Snarks? (Below you can find my infographic about transaction pools and MyEtherWallet.) Tweet your suggestions!
If you learned something from my explanation, consider a tip at
For further reading, I recommend Chris Dannen’s “Introducing Ethereum and Solidity” from Apress. If you’re not afraid of math, the Ethereum Yellow Paper is not impossible to understand.
“What Happens When You Send a Transaction via MyEtherWallet (A Very Simple Illustration):