Ethereum: Introduction

Ethereum: Introduction

What is Ethereum:

Ethereum is a programmable blockchain, in other words it is a blockchain based platform where developers can build and run distributed applications (DApps) using smart contracts. Let us compare it with traditional web/mobile applications. A web/mobile application communicates with the server in order to query and record the data (state). All the code and data are stored in central location or cloud. DApp is also a web/mobile application but the key differentiator is that it uses smart contracts to run the business logic (code) and data interaction. The state is stored in blocks in a decentralized, distributed ledger. In case of Ethereum, terms like platform and blockchain are used interchangeably.

No alt text provided for this image

Blockchain is a tightly linked sequence of digital blocks of transactions secured by cryptographic hashes. The records/transactions are immutable. On a public blockchain like Bitcoin or Ethereum, miners run Proof of Work (solving a mathematical puzzle) to create a new block of transactions and link it to the previous block. Blockchain ensures that the transactions carried over the platform are always characterized by decentralization, trust, security, transparency, privacy, immutability, provenance and traceability. Blockchain is also referred as trust-less protocol, meaning, there is no need to trust the other party as network takes care of trust.

Ethereum builds on blockchain technology harnessing its power, provides a platform for running DApps and executing smart contracts. Ether (ETH) is a native crypto currency of Ethereum platform. Like bitcoin (BTC), Ether is also a medium of exchange and store of value, but is also used for paying the network fee for running smart contract and storing the state. The network fee payment is provided in units of Gas (explained down below).

At the time of this writing, the bitcoin market cap is roughly US$1.25 trillion with ~18.87 million BTC in circulation. The second largest crypto after Bitcoin is the Ether, the native currency of Ethereum. ?Current market cap of Ether is roughly $554 billion with ~118 million ETH in circulation. Here (link) you can find more crypto market caps and current prices.

In the previous article (link), I explained in a little detail about how blockchain works taking bitcoin as an example. Ethereum also works in a similar way (an upcoming article would have a little deep dive into the specifics) with few of the below differences/exceptions:

  1. Bitcoin uses SHA-256 algorithm for hashing while Ethereum uses Ethash.
  2. In Bitcoin, the duration between two blocks is 10 minutes while Ethereum maintains the duration between two blocks at 12-15 seconds.
  3. Average number of transactions on bitcoin is around 5 transactions per second while Ethereum averages around 15 tps.
  4. Bitcoin is deflationary, means the supply is capped at 21 million and is controlled by halving the block reward every 4 years. Ethereum does not have a fixed cap and the supply is controlled by adjusting the block reward with Ethereum Monetary Policy.
  5. Most importantly, unlike Bitcoin, Ethereum enables smart contracts execution.

Gas

In Bitcoin network, the transaction fee is paid in number of Satoshi per byte multiplied by number of bytes (transaction size). One Satoshi is equal to 0.00000001 BTC (hundred millionth of a bitcoin). This fee also determines the priority of the transactions to include in the next block. Transactions with higher Satoshi/byte rate are more likely to be included early in one of the upcoming blocks. In Ethereum, the fee is charged with a different pricing system called gas. Gas is calculated based on computation requirement of a transaction and space required for the state. For example, a simple payment transaction requires 21,000 units of gas. If gas provided in the transaction is lower than what is required to run that transaction, an error of “Out of Gas” occurs and the transaction/smart contract execution does not take place.

Gas price is variable and is measured in terms of gwei (giga-wei). ?Below are some unit conversions.

1 Gas = variable number of gwei

1 gwei = 1 billion wei

1 Ether = 1 billion gwei

A simple transaction fee can be calculated as below assuming gas price at 150 gwei and Ether trading at US$ 4,500.

21,000 (gas) X 150 (gwei per gas) X 0.000000001 (Ether per gwei) X 4,500 (US$ per Ether) = 14.175 US$

The gas pricing system is designed to derive the cost of complex smart contracts execution which is a combination of multiple sequential operations. The amount of gas requirement for such operations is listed in Ethereum yellow paper, on page 27. Thus, the amount of gas required for a particular smart contract execution is predictable or fixed. The final price to be paid in US$ may differ at different point of time based on gas price and Ether price. The price of gas (link) fluctuates depending on the transaction pool size. Miners include the transactions which pay higher gas price. As per the economics of supply and demand, when more transactions wait to be included, the gas price goes up as the number of transactions per block is limited.

Smart contracts

Nick Szabo, a computer scientist and cryptographer first coined the idea of smart contracts in 1994 and he later invented a virtual currency “Bit Gold” in 1998. Many believed Szabo was the real Satoshi Nakamoto, the anonymous inventor of Bitcoin, but he denied.

Smart contract is a self-executing agreement between parties and written as lines of code. Smart contract can be explained as a software program that enables developers to write business logic that can run on any node in the network and the output state is stored in a distributed ledger and shared across the network.

Ethereum is the first and most popular blockchain platform that enables smart contracts execution. In Ethereum, a contract (smart contract) is a collection of functions and the state (data). Contract is stored at a specific address in the network known as account. Ethereum account is an entity which can receive, hold and send Ethers and interact with smart contracts. There are two types of Ethereum accounts, one is owned/controlled by anyone with the private key. They are typically user accounts. The other type is called contract, deployed to the network. Users or other contracts can send a transaction to a contract and trigger a function. This function execution modifies/updates the state. The transaction and the updated state are included in a new block and shared within the network. This enables the state of any smart contract to be secure, transparent, traceable and immutable.

Solidity is the most popular and widely used language to write smart contracts on Ethereum, while other options are Vyper and Yul. As the gas cost is calculated based on number and type of operations, writing a precise smart contract which effects minimal number of operations is important from the cost perspective. Smart contracts are executed numerous times on the network based on a certain event and requires gas to be paid for successful execution each time.

An upcoming separate article would explain the inner workings of smart contract on Ethereum.

The Blockchain Trilemma

There are three main aspects of blockchain technology as below.

No alt text provided for this image

Decentralization

A decentralized system can not be controlled by a central entity and does not rely on any central infrastructure to maintain it.

Security

As the blockchain systems/platforms are decentralized and are open to anyone, the security becomes paramount concern in the blockchain systems.

Scalability

The ability to handle growing number of transactions throughput. Without scalability, the platform would not be adopted at large scale.

A widely agreed fact is that, it is difficult for any blockchain system to achieve all the three aspects. Blockchains often have to make a trade off with one and achieve the two. Private blockchains achieve the security and scalability well and make a tradeoff with decentralization (having limited number nodes as validators), while reaping other benefits of blockchain technology such as provenance, traceability, immutability, single source of truth, trust etc. Public blockchains like Bitcoin and Ethereum 1.0 address the decentralization and security very well, but fail to address scalability.

Ethereum 2.0

Ethereum 2.0 or Eth2 is an upgrade effort towards achieving all the three aspects by some structural changes to the platform. Along with these three aspects, it would address the bigger problem of extensive energy usage. The upgrades are being done in a phased manner and expected to be completed by 2022. The two major structural changes in the Ethereum network are Proof-of-Stake (PoS) and sharding as stated below.

Proof-of-Stake

Miner nodes play role of validators and add the block to the ledger. Eth1 and Bitcoin use Proof-of-Work (PoW) consensus mechanism, where the miner uses computational power to solve the cryptographic puzzle to get an opportunity to mine a block. Ethereum is replacing PoW with PoS in Eth2. In PoS, validators have to stake significant amount of ETH to the protocol to gain the right to mine a block.

Sharding

This is splitting of the blockchain into shards (multiple chains). This improves the efficiency, throughput and security.

Eth2.0 Benefits

Below are the expected benefits of Ethereum upgrade to Eth2

Improved scalability

According to VISA fact sheet, 206 billion VISA payment transactions occurred worldwide during 12 months ended June 2021, that averages to about 6532 transactions per second. The current throughput of Eth1 is around 15 tps, while Eth2.0 would scale to estimated 100,000 tps. The dramatic increase in throughput would mean less transaction fees. That would give boost to the DeFi transactions and adoption of the platform at larger scale.

Stronger security

Eth2 would improve security against coordinated attacks like 51% attack where a malicious user controls 51% of the network to reverse the transactions or even execute double spending. This attack is avoided with introduction of PoS which requires the validators to stake significant amount of Ether into the protocol. If they try to attack the network, the protocol can automatically destroy their Ether. Sharding would also implement shuffling of validators between shards to avoid manipulation, further strengthening the security.

Reduced carbon footprint

As per recent estimates the power consumption by crypto mining is over 100 terawatt-hours annually, which is more than a whole country like Finland would use. Eth2 is moving to PoS that does not require to solve crypto puzzles and computation work. Hence Eth2 would be dramatically less power intensive. As per the Ethereum foundation estimate, Eth2 would use 99.95% less energy than Eth1.

要查看或添加评论,请登录

Ramakant Kasar的更多文章

  • Ethereum – Layer2 Scaling Solutions Overview

    Ethereum – Layer2 Scaling Solutions Overview

    As explained in the previous articles, blockchains have to trade off within decentralization, security and scalability…

  • Ethereum part 4 – The Eth2 upgrade

    Ethereum part 4 – The Eth2 upgrade

    The Blockchain Trilemma There are three main aspects of blockchain technology. Decentralization: Decentralization is at…

  • Ethereum part 3 – The dApp ecosystem

    Ethereum part 3 – The dApp ecosystem

    Ethereum has made running smart contracts on decentralized network a reality. This is resulting in proliferation of…

  • Ethereum - part 2 : Details

    Ethereum - part 2 : Details

    This is a sequel to Ethereum – Introduction where I covered Ethereum overview, transaction fees, smart contracts…

  • Blockchain – How it works?

    Blockchain – How it works?

    Blockchain can be explained as a chain of digital blocks linked sequentially by a cryptographic hash. Each block…

    2 条评论
  • DeFi: The future of Finance

    DeFi: The future of Finance

    DeFi is an acronym for Decentralized Finance, which means it is not controlled by a central agency/intermediary such as…

    2 条评论
  • Crypto Assets – Coins Vs Tokens

    Crypto Assets – Coins Vs Tokens

    Crypto asset is a form of digital asset that is uniquely identified by use of cryptography. Cryptography ensures the…

社区洞察

其他会员也浏览了