Ethereum: The world computer
Learn about the most talked of cryptocurrency, how it works and where is it going from here.
Where did it come from?
Satoshi Nakamoto’s Bitcoin was a breakthrough as it established the first decentralized ledger and accounting system which allowed the transfer of the store of value (Bitcoin) over the web. It was the first solution that allowed an open consensus to happen in which anyone can participate but not cheat (Sybil Attack). This accounting system was free from the control of a centralized financial institution and could operate in a system of completely trustless participants, solving the Byzantine Generals problem.
Though the underlying technology (Blockchain) is remarkable, as applications of Bitcoin (Namecoin, coloured coin, smart contracts etc.) started coming up. People started understanding that there were some issues in the way Bitcoin functions.
Some of these Issues that bitcoin faced were:
Absence of a Turing complete scripting language: There is only a limited set of all computing functions possible that could be programmed using the Bitcoin scripting language (e.g. it does not support loops). This made the network lack the versatility that was required to extend the uses that it can be put to. The need for this functionality became evident as the network saw more participants trying to make use of Bitcoin for a variety of uses.
Centralization of Bitcoin mining by large businesses: Large mining farms developed that possessed ASICs (Application Specific Integrated Circuits) which is hardware that is optimized to do Bitcoin mining. It gives an undue advantage to mining farms and businesses over individual miners using their general-purpose graphic cards
Scalability: The number of transactions that Bitcoin could process was very few to support participation at scale. This is limited by the time in which you can create a new block (a log with a limited number of transactions per block). Block creation time is 10 Minutes and the throughput is about 7 transactions per second (compared to 1700 transactions settled by VISA)
Other issues like Value Blindedness (No fine-grain control over withdrawable amount causing a complex transaction system), Lack of State (Coins can only exist in 2 states, spent or unspent hence limiting the scope of multi-stage financial contracts) and Blockchain blindness (No access to information like a nonce, timestamp and previous block hash implying limited use in gambling etc). Don’t worry if you don’t understand these :)
Enter Vitalik Buterin, a young World of Warcraft player whose favourite character in the game was downgraded by the game creators that managed the game’s servers. He was heartbroken post the catastrophic realization of harms that an authority managing a community can do. He eventually got interested in bitcoin and wrote blogs about it. The issues in Bitcoin that are mentioned above, and more, led to a young 21-year-old Vitalik Buterin ideate and launching the Ethereum Network in 2015.
Ethereum
Ethereum pushed the limits to what could be achieved with blockchain to the next frontier. It creates what could be understood as a “world computer” that can run computer programs called smart contracts creating a truly general-purpose blockchain that can support a broad variety of applications. This overcomes the need for making separate blockchains that are application-specific along with the infrastructure and development cost and time needed for the same. Anyone can leverage the programming environment of Ethereum and create their own decentralized applications
How does Ethereum work?
Before going into the working of Ethereum there are a few concepts that need to be understood.
Ethereum Virtual Machine (EVM)
It is the global computer that is composed of all the computers connected through the Ethereum network and running the Ethereum program. A centralized analogy of this could be a cloud computing facility but which is spread across thousands of computers over the world. The Ethereum protocol (set of rules governing Ethereum) safeguards this virtual machine and keep it running without getting corrupted by attackers which can exploit it for personal gains.
Accounts
The Ethereum network is made up of accounts. Each of these accounts is identified publicly by their 20-byte address (analogous to your email/UPI ID) that does not reveal the physical details of the owner. The two types of accounts in Ethereum are:
External accounts are controlled by their private keys (analogous to passwords for your UPI/email). These are the accounts that users like us can make and control.
Contract accounts could be understood as autonomous bots living in the Ethereum global computer (EVM). These accounts also have storage and code associated with it. The terms/logic that decides how the contract functions cannot usually be changed once the contract is created
Smart contracts
It is simply a program that is run on the Ethereum network. It is a collection of code and data in its storage that resides in the contract account. Since Ethereum is Turing complete, it is logically possible to perform any possible computational task with a smart contract. The inception of a smart contract requires defining the rules of the contract and they are automatically executed through the code that it holds.
A very popular application of smart contracts is stablecoin. These do away with the instability in prices that exist in the blockchain universe by creating tokens that are pegged to a traditional currency like the $$USD$$ which is relatively very stable.
Messages and Transactions
Transactions
They are data packages that are signed by a user through their external accounts or private wallets. These can be used to:
The transfer value of Ethereum from one account to the other
Trigger an action by a contract account by giving them an incentive to do the same (also known as gas fees, explained next section)
Messages
These are sent by contracts to other contracts and are temporary exchanges that can trigger the execution of the contract account (bot) that receives it.
Gas
Gas is what fuels the Ethereum network and compensates the nodes connected to it for their computing energy that is being used to process and validate transactions. It motivates a user to execute a program that another user wants to execute and to keep the network safe. It is paid as a fee for every step of computation for validating the transactions on the network and for running programs that are parts of the smart contracts. It is usually measured in a sub-denomination of Ethereum called Gwei
Every transaction in Ethereum needs to have a certain amount of gas (Gas limit- the total amount of gas that the user initiating the transaction allots for paying the gas fee for all the steps involved in its execution) with it so as to get it executed on the blockchain. The more the gas fees, the faster it is that a miner would pick this program up and execute it.
Gas is the charge that the user that initiates the action on EVM pays for the resources of the network that would be used to work out the action. It keeps people from executing infinitely running programs on the network and hence save the network from congestion.
Gas Limit
It is usually measured in Gwei or Giga Wei (1 Billionth of 1 Ether). All steps of the transaction require a certain price to be paid to the miner or the person executing that transaction. The gas prices are determined by supply and demand for the computational power of the network.
It is like fuel that you put in your car before a journey. Fuel is used for every mile that you move. Some actions like moving up a hill might take more fuel than others. However, if the fuel ends in the middle of the execution journey the network reverts back to all the changes that might have happened during the execution of the transaction.
How it works
If a transaction follows the rules set by the Ethereum protocol and it is signed by a legitimate account’s private key that has the amount of Ethereum needed for the transaction (Gas Fee + Eth to be transferred) then:
The gas fee is given to the miner processing the transaction
The miner validates that the details of the transaction are legal by the rules of the network
The miner performs all the computation steps that are needed to be performed as per the transaction (Running of smart contract etc)
If the gas provided by the initiator of the transaction does not run out then the miner completes the entire transaction and adds it to the prospective new block that is to be added to the blockchain.
Miner solves the cryptographic puzzle that is needed to validate his block and generates his proof of work (refer to earlier blogs to understand this). Every other node in the network would be able to verify that this puzzle has been legitimately been solved by the node. (Refer the part 1 of this series for clarity on the Proof of Work method of validating consensus in the distributed trustless network)
The miner broadcasts their solution to the rest of the network to validate.
The block gets added to the chain of blocks and the transaction becomes permanent
Journey of Ether since its inception and the future
The major events in the journey of Ethereum have been the following:
In 2016 $60 M worth ether was stolen from users of an Ethereum decentralized app called the DAO. The community went into disagreement and split into two opinion groups one who wanted to revert the changes and return the stolen ethers to their rightful owners and the others who did not want to do it and keep the network transaction history in its original form.
In 2017 Cryptokitties became the first decentralized app to get real traction and got popular mainstream media coverage. It had tokenized cats being sold for as high as $200,000. The high activity on the network however pushed the processing of the network to its brink and users had to wait for days before their ETH transfers got confirmed
In the 2018 ICO (Initial Coin Offering) boom happened where companies like Telegram raised $ 1.7 Bn by creating a new coin to raise money for their venture.
Ethereum is touted as the world computer, hence the development of applications that run on it has been the recent major boom. Apps that enable things like DeFi, DAO, insurance etc have been revolutionizing conventional methods of sectors governance and finance among many others.
The Way forward
Problems with Ethereum
Ethereum has yet not realised the vision it set out to fulfil. Some of the problems with it are the following:
Scalability: Ethereum has faced the problem of scalability time and again when the traffic on the network increases (e.g. when cryptokitties were booming). It can currently do only ~13 transactions/second
ASICs: Bitmain, a China-based mining giant, launched ASICs for Ethereum mining which again took the mining off the hands of non-centralised farms and GPU users.
Environment: Proof of work is a huge consumer of energy and computing power which has severe environmental effects that people are getting more conscious of.
Limited Developers: The development community of Solidity and other Ethereum development languages is still much smaller than what would be needed to support the exponential increase in demand for DApps
Ethereum 2.0
Addressing these problems, Ethereum is set for an upgrade also called the Ethereum 2.0 upgrade. It is under launch (1 of 3 phases launched) brings important updates like;
Abandoning the proof of work model for proof of stake model would do away with the existing issues like the enormous waste of compute and energy that happens because of competition amongst the nodes for solving the cryptographical problem. In the proof of work model compute power and energy used by all nodes that did not achieve the solution fastest goes in vain. This would also make Ethereum more eco friendly. Proof of stake would also punish the malicious nodes
Introducing sharding or splitting the data chunk into multiple smaller parts which can, in turn, be processed in separate places/nodes and combined to provide a combined block/output. This would allow virtually anyone to run an Ethereum node and benefit from it since the output of the mining activity would also be split into all stakeholders. Parallel processing would increase the efficiency of resource usage in the Ethereum network and increase the transaction processing throughput of the network while decreasing transaction processing costs.
New eWASM (Ethereum WebAssembly) to replace the current EVM (Ethereum virtual machine) which would make it possible for people to use their browsers to access Ethereum app code. It would also give the programmers a suite of popular programming languages that they can choose to write the code for DApps(Rust, C, C++). This would massively increase the number of developers that can develop on the network.