The Correct Way to Understand the Ethereum Transaction Life Cycle

Every transaction on the Ethereum blockchain is created to change the state of the Ethereum virtual machine.

Before we go to the life cycle of a transaction in the Ethereum network, we need to understand what is Ethereum, Account, and Transaction in a broader sense of the blockchain system

  • Ethereum

Ethereum is a blockchain with a computer embedded in it, it has a single machine called Ethereum virtual machine, whose state must be agreed upon by everyone on the network,

Changing the state of the EVM can only be done via a transaction initiated by an account.

  • Account

Ethereum has two types of accounts, contract accounts, and externally owned account(EOA), the whole essence of an account is to allow us to initialize transaction that requests a change in the state of EVM

Externally owned accounts are controlled by anyone with a private and public key

Contract accounts are accounts controlled by code deployed on the Ethereum blockchain.

An Account has the ability to hold, send and receive ether (the native token of Ethereum) and can interact with deployed smart contracts (a program that runs on the Ethereum blockchain)

  • Transaction

The transaction is an action initiated by an external own account, which tries to change the state of the EVM, When these transactions are initiated, they are broadcasted to the whole network.

The validator will execute the transaction and propagate the resulting state change to the rest of the network (Proof of stake algorithm).

There are three types of transaction

  • Regular transaction I.e sending ether from one account to another

  • Contract deployment transaction: a transaction without a 'to' address, where the data field is used for the contract code.

  • Execution of a contract: a transaction that interacts with a deployed smart contract. In this case, the 'to' address is the smart contract address.

- Transaction life cycle

Once a request transaction is submitted, it undergoes the following phase before it is executed on the Ethereum blockchain.

  • A cryptographic hash is generated to uniquely identify the transaction.

  • The transaction request is then broadcast to the network and added to the transaction pool, consisting of other network transactions awaiting validation.

  • A validator (from the proof of stake concept) picks a request transaction and includes it in a block to verify the transaction and consider it successful.

  • As time passes the block containing your transaction will be upgraded from “justified" to "finalized". These upgrades make it much more certain that your transaction was successful and will never be altered. Once a block is "finalized”.

Conclusion

From the understanding of Ethereum to opening an account and using this account to create a transaction request, the request passes through the life cycle, before a state change on the transaction is made on the EVM,