Give the different types of Transactions in Ethereum and also explain the fields included in these transactions.

Ethereum Transactions

In Ethereum, a transaction is a digitally signed message sent from one account to another. It changes the state of the Ethereum blockchain and may:

  • Transfer ether (ETH) between users.
  • Trigger execution of a smart contract (message call).
  • Deploy a new smart contract on the blockchain (contract creation).

2. Types of Ethereum Transactions

Transaction TypeDescription
Message Call TransactionSends a message (function call or value transfer) to an existing contract or account.
Contract Creation TransactionUsed to deploy a new smart contract on the blockchain.

3. Fields in a Standard Ethereum Transaction

All Ethereum transactions contain the following common fields:

FieldDescription
NonceA counter to keep track of the number of transactions sent by the sender. Prevents replay attacks.
Gas PriceAmount of Wei the sender is willing to pay per unit of gas. Acts as a transaction fee.
Gas LimitThe maximum gas units allowed for the transaction execution.
To20-byte address of the recipient. Empty for contract creation transactions.
ValueAmount of ETH (in Wei) to be transferred.
Data / InitData: input for a message call; Init: initialization bytecode for contract creation.
V, R, SComponents of the ECDSA digital signature used to verify the sender and authorize the transaction.

4. Specific Fields Based on Transaction Type

A. Message Call Transaction

Used to interact with existing contracts or EOAs (Externally Owned Accounts).

FieldMeaning
ToAddress of the recipient or contract
DataEncoded input data for contract function
ValueETH to send (optional)

Results in state change and is stored on-chain.


B. Contract Creation Transaction

Used to deploy a new smart contract.

FieldMeaning
ToLeft empty (null)
InitInitialization code (runs once, then removed)
ValueETH to fund the contract with

After successful execution, creates a new contract at a deterministic address based on sender and nonce.


5. Signature Fields (V, R, S)

Every transaction must be signed with the sender’s private key.

FieldDescription
VRecovery ID (27 or 28), helps derive the public key
RPart of the ECDSA signature (X-coordinate of a curve point)
SPart of the ECDSA signature (calculated with private key and R)

These ensure that the transaction was authorized by the sender.


6. RLP (Recursive Length Prefix)

Ethereum transactions are serialized using RLP encoding (Recursive Length Prefix). This allows data like transactions, blocks, and accounts to be stored and transmitted consistently.

RLP ensures deterministic encoding — even the smallest mismatch would break the chain’s consensus.


7. Transaction Execution and Validation

Before execution, a transaction must be:

  • Well-formed and RLP-encoded.
  • Properly signed (valid V, R, S).
  • Have a nonce matching the sender’s account.
  • Contain enough ETH to cover Gas Limit × Gas Price.

8. After Execution: Transaction Receipt

After a transaction runs, Ethereum produces a transaction receipt, which includes:

FieldDescription
Post-transaction stateWorld state after execution
Gas usedTotal gas consumed
LogsEvents emitted (can be used by frontends)
Bloom filterCompressed search structure for logs
Status1 (success) or 0 (failure) — added after Byzantium fork

Diagram – Ethereum Transaction


Leave a Reply

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