Technology

Photo by Ari He

First and foremost it is important to point out that Ethereum is being developed as an open software, meaning that it is 100% open source and everybody who wishes to work with the code can do so freely.

We won’t go too much in depth here about the specific technological components (this will be done in the future series on Technological Foundations), but after working your way through the following passages, you’ll walk away with a sound and comprehensive understanding of the concept that makes Ethereum work.

As already explained above, while Ethereum and Bitcoin built upon more or less the same blockchain architecture to validate and secure data in the network, Ethereum has a way broader scope and aim. Vitalik Buterin describe it as a:

“[…] decentralized mining network and software development platform rolled into one”

The essential feature of Ethereum that makes this possible is called the Ethereum Virtual Machine (EVM).

Photo by Tony Webster

A virtual machine can be described and imagined as a seperate computer that runs on another computer (computer inception in other words).

What the EVM does, is creating the internal state of the network. The internal state is literally the state of all the different aspects of the system at a given point in time. With all kinds of different things happening and taking place inside the network, it moves from one state to the other. How exactly that change is happening will be explained later.

The magic and extraordinary characteristic of the EVM is that is is (quasi) Turing complete. What’s Turing complete you might wonder?

Well, Turing completeness is a concept that goes back to the legendary mathematician and computer scientist Alan Turing who in 1936 published a groundbreaking paper in which he describes and defines a theoretical computer. If something is Turing Complete, it basically means that any given problem that is fed to the system can be computed eventually (this characteristic can be mathematically proven). You might wonder why I wrote that Ethereum’s EVM is “quasi” Turing complete.

This is due to something essential that is required for running code on Ethereum — so-called gas. Every transaction that is happening requires some of that gas in order to be executed — this is done in order to prevent infinite cycles of computing which would bring the system to a complete halt and render it unusable. You can think of it as a simple fee. Just like your car needs gasoline to drive, transactions on Ethereum need gas to run.

Photo by Markus Spiske

There has been a lot of talk about running code on Ethereum so far — but what exactly does this refer to?

The unique thing that can be done with Ethereum is to write so-called smart contracts. These smart contracts can be very simple or very complex and are the foundation of a class of applications known as decentralized applications or in short dApps (more on that later). They are used to automate certain transactions and they execute those without any human interference, making them run as programmed without any possibility of censorship, downtime, fraud or third party interference.

“A smart contract is a computerized transaction protocol that executes the terms of a contract. The general objectives are to satisfy common contractual conditions.” — Nick Szabo, 1994

If you want to explore the origins of smart contracts, read this post about Nick Szabo (the father of smart contracts).

What’s awesome about Ethereum is that it offers the possibility to write these contracts in so-called high level programming languages, such as Solidity, Bamboo or Vyper, which are then compiled (translated) to a so-called EVM bytecode, which is the only language that the EVM actually understands.

So far so good, now let’s take a look at the blockchain aspect of Ethereum.

As with Bitcoin, all the transactions and the data comprised in them is validated and secured using certain cryptographic concepts and tools.

Let’s imagine that you’ve just finished writing a fancy new smart contract. You’ve programmed the smart contract to automatically order a delicious cake from the artesanal bakery next door, if it’s your birthday.

Photo by Patricia Prudente

Once the big day arrives, the smart contract is triggered and it automatically orders this yummy cake for you. In order for the smart contract to run, you need some gas though. Fortunately you thought ahead and have some beautiful Ether laying in your (electronic) wallet. The code runs as programmed by you, some gas is reduced from your account balance — a couple of hours later the doorbell rings and you’re thrilled to see a magnificent cake being delivered right to your doorstep. Awesome!

What seems super easy on the surface, actually has some really sophisticated engineering under its hood.

How did the state (a day like any other day, not your birthday) got changed to the new state (it’s your birthday)?

Well, in come so-called oracles. They are the connection between the blockchain and the off-chain world. These oracles are collecting information from different sources and then let the smart contract know if a certain event has happend or not.

And how is all this data secured and verified? Say hello to our good old friends the miners and the Proof of Work (PoW) consensus mechanism.

This foundational part of the tech is inspired by Bitcoin and works in exactly the same way.

Satoshi, the mysterious founder of Bitcoin, found a groundbreaking and mesmerizing solution to an old problem known as Byzantine Probleme (there will be a full length article about this soon). This problem describes the great challenge to coordinate resources among different participants and to find consensus. The problem is often described as a group of Byzantine generals who all besiege a city. Only if they attack at the same time, thy will be able do win the battle — the only problem is that they need to find a way of how to trust each other to attack in a coordinated manner.

Bitcoin managed to achieve Byzantine Fault Tolerance and solved this problem elegantly. It does so by using a marvelous consensus mechanism known as Proof of Work (PoW).

Miners collect all the transactions and changes happening in the system, verify them and then put them into a block. While they do this bookkeeping, they also participate in a cryptographic puzzle and try to find a solution to a difficult task.

This puzzle is based on hashing. It’s used all over the place but for now it’s simply important to understand the basic idea behind it. A hashing algorithm takes an input (this can be literally anything), runs it through some magic mathematical processes and then creates a unique output. In the case of Bitcoin, where it is used in the , it takes the resulting number (which is a hexadecimal number) and converts it again to a “regular” number. This regular number can then be converted to a binary number (0s and 1s).

The participating mines try to find a hash with a value that is underneath a set target. This is super difficult to do for them and they simply have to guess solutions. Once a correct hash has been found by someone, they have won the right to broadcast their block to the whole network. Once confirmed by the others, it’s get accepted and added cryptographically to the chain of blocks before it.

Why all this hassle you might ask yourself?

Well, this guessing is using a lot of computational power. And this computational power needs energy. Energy that you need to pay for. Therefore, by proving that you worked hard to find a solution and were willing to pay for it, you eventually at some point get rewarded big time: the one who finds the correct solution for the puzzle gets a reward (5 Ether) plus the transaction fees, aka gas (that the other people have to pay in order to have their transactions be conducted).

All the blocks that have been linked together are a testament to all the work that went into finding them. If you’d want to change something in a past block, you’d need to redo all the work that has been conducted afterwards!

Photo by Adi Goldstein

The computer who run the Ethereum software (more on this in a future article) always take the chain with the most Proof of Work put into them as the valid one. Thus consensus is reached in a decentralized network. Crazy, right?

Another fundamental building block is public key encryption, which works as follows: We start by taking a random string of numbers (e.g. 3860280357), from now on this will be called our private key) and mathematically derive another string of numbers from it — the resulting new string of numbers is called public key. A very important aspect of this process is, that it’s a so called one way function, which means that it’s very easy to calculate it into one direction (ergo from private key to public key), but not the other way around (aka it’s almost impossible to derive the private key from the public key)! The main take away that you need to remember and understand right now, is that these two keys share an intimate relation and are linked to each other.

One awesome thing that you can do with this is digitally signing something.

The Ether that you own are stored in your wallet, which is your public key. If you want to send someone Ether, you need to sign that transaction using your private key. You’re now your own bank and are solely responsible for not losing your private key (aka your password).