In the previous series about bitcoin, I have described how bitcoin works. But bitcoin is very limited in its functionality. It’s a system to exchange value in a decentralized way. Ethereum wants to take the idea of decentralization to next level. The ability to execute complex code on the blockchain. This Idea opens doors for a huge number of applications that can be performed in a decentralized way.
How Does Ethereum work?
So as I mentioned before, the goal of Ethereum is to be able to execute complex code on a blockchain and build decentralized applications. This is a revolutionary idea because in centralized architectures we execute code in the CPU of the central computer. How do you execute code on a network of computers?
Before we move further, let’s understand what does a blockchain contain in the case of Ethereum. The blockchain contains the history of all transactions and the history of smart contracts. It contains the state of all smart contracts. A Smart contract is basically a set of instructions to execute.
The smart contracts are run on virtual machines, EVMs. The main reason behind using EVMs is to protect the nodes from unknown codes. It’s for security reasons that you want to isolate the code from the machine.
The nodes in the Ethereum network need to reach consensus about the state of the smart contracts. All nodes execute the code and need to agree on the state of the code.
In order to execute code on the Ethereum blockchain, one need to pay for each instruction in the code. We can pay for each instruction using Gas which is related to Ether. Ether is the cryptocurrency of the Ethereum network. The reason for introducing payment per transaction is to enforce order and responsibility while building decentralized applications on top of Ethereum.
As opposed to bitcoin which only keeps track of transactions, The Ethereum keeps track of Ether balance, storage, and smart contracts. This is very important to understand as the goal is to be a platform for executing code for decentralized applications. The mining works the same way as bitcoin. Ethereum network uses proof of work to append blocks into the blockchain. I have already talked about it in details in the bitcoin series. Ethereum is considering replacing the proof of work with proof of stake.
This Idea will have a huge impact and will disrupt many industries. Think about all the current applications where we can remove the middleman. In the sharing economy, we have many applications like Uber and Airbnb. we can build decentralized applications that implement smart contracts which can hold money, in the form of tokens, and transfer value between different parties without a need for a 3rd party.