How Smart Contracts work

Though inspired by Bitcoin, which functions as a new form of money, Ethereum was designed with much greater ambition. It provides a foundational layer for any digital application that can be reduced to mathematics, programmable money being just one use case, with Ether serving as Ethereum’s native currency. 

This capability is known as being ‘Turing Complete’ and led to Ethereum’s description as the world’s computer. To provide this foundational layer, Ethereum has its own scripting language called Solidity, which is how Smart Contracts are written. The instructions are processed in a run-time environment known as the Ethereum Virtual Machine – the EVM for short. 

There are two main types of Ethereum accounts:

External users send/receive transactions using an Ethereum supported wallet like Meta Mask, and connect to Smart Contracts via a web browser and the user interface of an Ethereum supported application.

Contract accounts control Smart Contracts and use them to write state changes to the EVM. They connect with other Smart Contracts and External users.

Contract accounts now include a vast range of digital applications (dApps), building new types of permissionless economies on top of the Ethereum foundational layer. You’ll often hear these applications described as Protocols or Primitives. These names refer to the collective function of Smart Contracts and front-end applications like websites and mobile apps. We introduce examples below.

The EVM stores all Smart Contracts, and as Ethereum accounts interact with a Smart Contract the EVM will execute the requested change, and the most recent state is recorded in the Ethereum blockchain. 

The Ethereum blockchain is a chain of blocks of data reflecting the state change of Accounts

that transfer value. As each block can only store a limited number of transactions, Ethereum charges a fee measured in GAS – denominated in Ether. Executing a transaction, therefore, requires GAS, which is paid for by the external user account that sends the transaction request to the Smart Contract. 

GAS fees are earned by Miners who compete to add verified blocks of transactions to the Ethereum blockchain using an energy-intensive Consensus Mechanism called Proof of Work.

In June 2022 an upgrade to Ethereum described as the Merge will see it transfer to an alternative Consensus Mechanism called Proof of Stake, reducing its energy consumption by 99.5%. 

It is also designed to reduce the fees required to execute Smart Contracts that have ballooned due to Ethereum’s popularity within DEFI and NFTs – the most popular use cases for Smart Contracts.


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *