Ethereum protocol and a life cycle of its transaction
First of all, what is Ethereum? It’ s decentralized software platform that enables the functionality of Smart Contracts and Distributed Applications. Launched in 2015, it has its own native programming language to help developers build and publish those application. It is designed to run without any downtime and interference from a third party.
There are four key characteristics of the Ethereum protocol that sets apart from all others: its consensus mechanism, speed, programming language, and the number of projects. Here’s what you need to know about each of these key aspects.
- consensus mechanism: Ethereum uses a Proof-of-Work (PoW) consensus algorithm, but plans to transfer to a Proof-of-Stake system. In the former, miners are required to validate transactions by performing computational work, solving mathematical problems. Under a POS system, ‘miners’ are chosen in a deterministic way, depending on the number of coins they choose to stake. A major reason for this change is that POW is way inefficient as far as energy is concerned, requiring huge amounts of electricity in the mining process. According to research, a single Bitcoin transaction required the same amount of electricity as powering 1.57 American households for one day.
- transaction speed: ideally, the blockchain can process 15 transactions per second (average amount). The average block time (time taken for a block to be mined) for Ethereum is 15–20 seconds — this is faster than Bitcoin’s average of 10 minutes each block. Transaction, of course, can take longer due to the network’s congestion. Ethereum is constantly working to enhance the scalability of the network, and one solution is called Sharding.
- programming language: Solidity is a custom programming language for writing smart contracts, created specifically for Ethereum. The main goal was to build a more massive foundational layer coupled with a powerful scripting language for all of these protocols to build upon. Ethereum is a modular, stateful, Turing-complete contract scripting system paired to a blockchain and developed with a philosophy of simplicity, universal accessibility and generalization.
- number of projects, traction: there are currently more than 1400 projects built on top of the Ethereum platform, making it the most popular platform for the creation of dApps and tokens. Ethereum’s dominance as the platform of choice for new projects is attributed to its unifying standards, which simplifies integration into the Ethereum network.
Proecess of the Ethereum transactions
Each time a user wants to send Ether (ETH) across the network, the transaction is propagated across various devices running the Ethereum protocol on a global scale. As soon as the transaction is verified, it goes inside the Memory Pool, which is a temporary resting place for transactions. Miners will pick transactions from the mempool to be included in the next block, according to various factors such as fees and age of the transaction. Until it is picked up, it is considered as an “unconfirmed transaction” or a “pending transaction”. It becomes “confirmed” if other transactions get included in the block, making the new blocks an additional layer of confirmation.
Assuming that you have an Ethereum client (Geth or Parity) running locally on your computer which is connected to one of the networks (Testnet or Mainnet) and you have access to the contract address and ABI to execute the transaction, these are the main points of the execution of the script necessary for the transactions to follow through.
- construct the raw transaction object **
- sign the Transaction **
- transaction is validated locally
- transaction is broadcast to the network
- miner Node accepts the transaction
- miner Node finds a valid block and broadcasts to the network
- local Node receives/syncs the new block
** offline signing: if you are not comfortable using a plugin or if you are worried that your local geth node is compromised, there is a secure solution to the problem. If you want to make sure your transaction isn’t tampered with, you may use a computer which is offline to convert the function call into a raw transaction and use your private key to sign the transaction. Then, copy the signed transaction string and use a computer that is online to broadcast it to the network. Additionally, hardware wallets such as Ledger or Trezor may provide further security by storing your private key and the code to sign the transaction, since it is programmed into the hardware itself.