What Are Ethereum Transactions?

·

5 min read

Ethereum transactions are cryptographically signed data messages containing instructions that facilitate interactions on the blockchain. These interactions can range from transferring Ether between accounts to executing smart contract functions. This guide delves into Ethereum transactions, their architecture, and how to programmatically retrieve transaction data.


Overview

Transactions on Ethereum are fundamental to its operation, enabling decentralized interactions. They consist of structured data that instructs the network to perform specific actions, such as value transfers or smart contract executions.


Key Topics Covered


Transaction Fundamentals

A standard Ethereum transaction includes the following parameters:

👉 Learn more about gas fees


Ethereum Accounts

Ethereum features two account types:

  1. Externally Owned Accounts (EOA)

    • Controlled by private keys.
    • Used for sending transactions.
    • Cannot store code or complex data.
  2. Smart Contract Accounts

    • Deployed on the blockchain.
    • Contain executable code and storage.
    • Interact via transactions or calls.

Types of Transactions

  1. Message Calls

    • Transfers Ether or interacts with smart contracts.
    • Example: Swapping tokens on Uniswap.
  2. Contract Creation

    • Deploys new smart contracts.
    • Example: Uploading a decentralized app (DApp).

Transaction States

👉 Troubleshoot pending transactions


Transaction Architecture

Modern Ethereum transactions follow EIP-1559, which introduces:

Example Transaction Object:

{
  "from": "0x...",
  "to": "0x...",
  "value": "0x...",
  "data": "0x...",
  "nonce": "0x...",
  "gasLimit": "0x...",
  "maxFeePerGas": "0x...",
  "maxPriorityFeePerGas": "0x..."
}

Retrieving Transaction Data Programmatically

Use an Ethereum RPC endpoint (e.g., QuickNode) to fetch transactions:

curl -X POST https://YOUR-ENDPOINT \
  -H "Content-Type: application/json" \
  --data '{"method":"eth_getTransactionByHash","params":["0x..."],"id":1,"jsonrpc":"2.0"}'

Output Fields:


FAQ

1. What causes a transaction to fail?

2. How do I speed up a pending transaction?

3. What’s the difference between gasLimit and gasUsed?

4. Can I cancel a transaction?


Conclusion

Ethereum transactions power everything from simple transfers to complex DApp interactions. Understanding their structure and lifecycle is essential for developers and users alike.

Further Reading:

Got questions? Join our Discord or tweet us @QuickNode!


Feedback? Let us know how we can improve!