Lesson

How Ethereum Works

Ethereum is a blockchain that is in many ways like Bitcoin meaning anyone can download it and run the blockchain processing software and even download a full node which contains all the the blocks of the blockchain. But what really sets Ethereum apart is the inclusion of the Ethereum virtual machine to process smart contracts. The heart of Ethereum’s power is this EVM. The EVM is co-located with the full Ethereum blockchain so anyone who downloads and runs a node will also by default be running the EVM.

One way to think of the EVM is that it’s like having a full LAMP or MEAN Stack at your disposal. The difference is the Ethereum blockchain is what’s going to store the data instead of the database, whereas the EVM is the app server that’s going to handle processing smart contracts and the programming functionality. There are other services that can be available through these nodes including Swarm for hosting files and Whisper for messaging and DApps. Every Ethereum node runs the EVM.

This then syncs data to maintain consensus of the blockchain. That’s how it maintains security and maintains the blockchain. Because of this, there is high fault tolerance. There is zero downtime because those are so many nodes online at any given moment all over the place. This ensures immutability and will block censorship. One thing to remember is that EVM is the runtime engine that processes smart contracts.There is no inherent network access, file system access, or other processes like you might have in other application environments.

You have really only limited access to other contracts such as sending money to them. The contracts in EVM are stored in bytecode so they have been compiled prior to deployment on the blockchain so the EVM doesn’t compile them. In most instances, these contracts are written in Solidity, but there are other options available such as Lisk, Bamboo and Viper. One thing to remember is that EVM does have some non-persistent memory so you can run variables and you can have variables that are used during the execution of a function; however, when that function is completed executing they will no longer exist in memory.

However, if you do want to maintain data you can create variables which will store that data in key value pairs onto the blockchain. There are number of different EVMs available. Here is a list of a lot of different information that you can get about the Ethereum virtual machines. Here specifically you can see which ones are live on the main network. We have go-ethereum, is by far the most popular usually referred to as Geth.

Parity was written by the former CTO of Ethereum and uses a programming language called Rust. There are other clients as well that run on C++ , Pyethereum, if you’ve ever heard of that before, and Py-EVM which are different versions of Python, Ethereum J and some other things you can use. The key is when you choose your EVM, choose one that comes from an active community. Remember that you don’t necessarily need to know the language that the server itself is written on, you only need to know if you want to contribute to features that are available within that EVM.

Course Discussion