Before we delve into what Ethereum is and how it provides for a whole new way of developing apps we must first be clear with how a general blockchain works. For this you can read the article on how blockchain works here.
Done? Alright now we are set to jump into what is ethereum.
To develop an idea of what the architecture of ethereum entails we first consider the idea of a basic blockchain.
A blockchain is a glorified linked list of sorts,in its simplest form a single block of a blockchain contains a blockhead,the hash of the previous block,timestamp and the transaction details.
If the entire details of the transactions were stored directly into a block it would result in huge scalability issues as downloading the blockchain into every node or the computer of every miner would be a huge task. To solve this issue a Merkle tree is used wherein the Merkle root alone is retained in the block and the transaction can be traced out by using the Merkle root.
Bitcoin was an implementation of this technology.The blockchain was used to hold the necessary details of a transactions and it used the Proof of work consensus algorithm to form a trustless system.
Here bitcoin had to technically store only the transaction data.
What Ethereum Does Differently
Ethereum now builds upon this idea of a blockchain by adding to the the ability for a block to hold not only transaction details but also code snippets called smart contracts.
These code snippets that are pushed into the blockchain give the ability for the first time,for apps to be completely decentralized.This in turn allows for,in some ways a world computer to be formed.
In the case of blockchain the miners were incentivised by providing bitcoins,in the case of ethereum Ether is used. This is a cryptocurrency that is similar to bitcoin and it can be earned through the ethereum blockchain.
Ethereum uses two major things to ensure the stability of the network is maintained.
Gas is the transaction fee that is charged towards the user that pushes the smart contract into the blockchain for processing.
The amount of gas is decided with respect to the number of operations demanded by the program. If a program has a gas cost that is too little it will result in a failed transaction as it will not be picked up by the miners in the first place.
To put it into simple terms GAS is the price attached with every operation within the smart contract.
This price is the reason that the ethereum network is kept safe,meaning that the network is not loaded with smart contracts that require excess computational power,which could potentially harm the network.
Ether is the cryptocurrency that is given as an incentive to miners for performing the operations on the blockchain.
Ethers are required to buy gas and gas is required for the program to be accepted into the blockchain.
Now many people think that if they have a large gas value their smart contract will be taken up by the miners,although this will ensure it is picked up ,it also leads to a situation where a person pays more ether than required for a certain task to be performed.
Why Gas and Ether?
It is necessary to keep gas and ether decoupled. This is essentially because gas represents the fees for every operation on the smart contract, a value that cannot be fluctuating. Ether being a crytpocurrency has the tendency to vary in value due to the ever changing market cap. Since gas is bought with ether it is easy to change the conversion value of ether and gas even as the value of ether fluctuates.
What Advantages Does This Technology Provide
- No Down Time: The services that are deployed onto this blockchain do not need to worry about having down time as there will always be nodes that perform the operations of the smart contract.
- immutable: The services are completely tamper proof and no third party can change the terms of the contract once it is committed into the blockchain.
- Secure: Apps are completely free from hackers as there can never be any intervention from third party attackers.
With the advantages that this technology provides we can clearly see that many of the processes that exist today can better be executed if setup in a decentralized manner thereby rightfully giving power to the people and eliminating the central authority. Ensuring safety,security and accountability.