Operations on the Ethereum Blockchain

In this article, we look at the various operations happening on the Ethereum blockchain.

Table of Contents.

  1. Introduction.
  2. Making an Etherium Transfer.
  3. Gas.
  4. An Etherium Node.
  5. Deployment and Invocation of a Smart Contract.
  6. Summary.
  7. References.

Introduction

In the previous article, we learned about the structure of Ethereum compared to bitcoin. We saw that Ethereum has accounts and an Ethereum transaction can not only incorporate the exchange of value between parties but also a message that invokes a smart contract. In this article, we analyze a simple Ethereum transaction between parties on the Ethereum blockchain.

We have learned about the bitcoin UTXOs model, now let's compare it with the Ethereum account/balance model. These are a means of book-keeping on blockchain networks. For instance, in the UTXO model, a user's wallet is the interface that is used to interact with the bitcoin blockchain, it tracks a list of unspent transactions that are associated with all addresses that are owned by the owner of the wallet. The balance of the wallet is the sum total of all unspent transactions. Remember that in order to combine all these balances, a transaction must be initiated and validated. On the other hand, the account/balance model tracks the balances of each account as a global state, in this case, all values are combined on the account to show a sum total owner by the user of the account. No transactions are initiated.

Making an Etherium Transfer.

During an ether transfer between parties, the amount, and target address are specified together with the transaction fees. For example, consider the following transfer of funds between Alice and Bob of 100 ether.

bit121-1

In the above transaction, we initiate two transfers, the first to the recipient's account, and the second is to a miner's account. The first transfers a value of 100 ether to the recipient's account while the second is gas fees or transaction fees sent as a reward to the miner for the creation and validation of a block in the blockchain.

Gas.

Gas is used to measure work on the Ethereum blockchain. Each operation on the blockchain is accompanied by fees. Operations that need more computational power cost more gas and those needing fewer resources cost less.

Unlike the bitcoin transaction fee which is based on the kilobytes a transaction takes up(transaction size), Ethereum chooses fees based on the length of a transaction or contract.

Gas is how fees on Ethereum are calculated. The cost of gas is the amount of work that goes into something, in this case, solving a computational puzzle. The fee is to make sure that transactions are intentionally initiated and that the smart contract code is safe.

At the writing of this article, the gas price for processing a transaction on Ethereum is 55.29 Gwei.

EIP-1559
This EIP is responsible for Ethereum's fee market mechanism. It got rid of the first-price auction where bid a set amount of money to pay for the processing of their transactions. In such cases, the highest bidder won.

This EIP added a discrete base fee for transactions to be included in the next block. Now for users' transactions to be prioritized, a tip was added also referred to as a priority fee. If the priority fee was paid, the miner is would be motivated to process the transaction faster.

In summary, Ethereum added a base fee, once this was paid, it guaranteed that a transaction would be processed but it would have to 'wait in line', if a user wanted his/her transaction to get processed faster, he/she includes a priority fee. The miner upon coming across such a transaction, he/she would give it priority over the rest because it has higher fees.

An Etherium Node.

An Ethereum node is a computational system that represents a business entity or a single participant of the blockchain. A full node runs the program specified by the protocol, as stated on the Ethereum site, the client downloads a copy of the Ethereum blockchain and verifies blocks and keeps on updating itself as new blocks and transactions are created. It also assists others to download and update their copies of the blocks. This is what makes it decentralized and immutable.
Running a node is as simple as downloading the client and running it.

Each node on the blockchain has its own ways of data interpretation and synchronization.
Full nodes are nodes that are full of data, they hold data and can also distribute it from the network. It also validates new blocks. They can also deploy smart contracts to the blockchain. Such nodes are taxing on the computer hardware and bandwidth.
We also have light nodes which are lighter versions of the former, these hold less data. They only receive data based on requests. Although they can verify the validity of the data, their participation is limited in block validation.
There are also archive nodes, these store all data a full node has and constructs an archive of historical states of the blockchain.
Full and light nodes use this data to rebuild but not retain it.

This client performs operations such as;

  • Initiating a transaction
  • Validating a transaction
  • Mining
  • Creation of new blocks
  • Execution of smart contracts
  • Running the EVM(The Etherium Virtual Machine)

To run a node, you can visit this link and learn more.

Deployment and Invocation of a Smart Contract.

As mentioned in previous articles, we write smart contracts using a high-level programming language called solidity. The solidity code is compiled and deployed to the EVM which can host and run multiple smart contracts at once.

bit123-1

As stated, a transaction can be an exchange of value or a smart contract, now, when the target address in a transaction is a smart contract, The execution code that corresponds to the smart contract is activated and executed in the EVM.

bit124

The transaction has a payload embedded in it, this payload is used as the input for the execution of the smart contract. So in general, the transaction carries input that is used in the execution of the smart contract.

The current state of the smart contract consists of values of the variables defined in the contract. It is also possible to further update the state of the smart contract when it is executed.

The output of the execution is stored in a receipt just like with fiat transactions, all records are noted and publicly accessible. A blockchain stores a hash of the state and the hash of the receipt.

Transactions are validated by checking timestamps, nounce combinations, and fees for execution.

For decentralization and immutability, all miners have to execute the same smart contract code triggered. Once a transaction is validated, it is broadcasted and gathered for later block creation and validation.

Unlike bitcoin's cpu-based proof of work consensus protocol, Ethereum has a memory-based proof of work which shall be discussed in later articles.

Summary

An Ethereum full node runs software needed for mining, validation, block creation, and smart contract execution.
Miner nodes receive rewards for verifying. gathering and executing transactions.
All changes to the state variable in smart contracts are stored on the blockchain and are consistent on all blockchain nodes.
Smart contract code is executed by all participants.

References

gas
EIP-1559