Learn Ethereum: Transactions
Week 2: Assignment 2

One day I decided to solve a problem that was plaguing us at work. I wanted to make something to streamline our resources and make it easier for use to do our job. I figured that there had to be something online for us to use. I fell down a rabbit hole and I loved it. So much so that I ended up building the solution myself.
Task 1: Register
If you haven’t already, register for this cohort by joining our Discord.
Task 2: Vocabulary
Prepare by familiarizing yourself with these key terms. I’ve broken them down into simple analogies to help you out! Be sure to take the quiz at the end when you are ready.
Key Terms
Transactions: State-changing instructions initiated by an EOA. These instructions are cryptographically signed.
Analogy: Like sending a letter with instructions, transactions are state-changing commands signed by the sender.Signature: Identifies and verifies the sender of a transaction by their private key and signs a transaction.
Analogy: A signature is like a personal stamp that proves you sent the transaction and verifies your identity.Value: The amount of ETH in WEI the sender wants to transfer to a recipient.
Analogy: It's like sending money in a digital envelope, specifying how much ETH is being sent.Input Data: Arbitrary data can optionally be entered here.
Analogy: It’s like writing extra notes on a letter that the recipient can use if needed.gasLimit: The maximum amount of gas units that a transaction can consume.
Analogy: Imagine setting a fuel limit on a car; it’s the max energy you allow the transaction to use.maxPriorityFeePerGas: Maximum price of consumed gas as a tip for a validator.
Analogy: This is like a tip you offer to get faster service when there’s a line.maxFeePerGas: Maximum fee per unit of gas for a transaction.
Analogy: Like setting a maximum budget for gas, it ensures you won’t overpay for the transaction.JSON: JavaScript Object Notation is a lightweight data format that uses key-value pairs. This format is widely used for data exchange in web applications, APIs, and various other contexts due to its simplicity and versatility.
Analogy: JSON is like a simple recipe format that lists ingredients (key-value pairs) easily understood by both humans and machines.Application Binary Interface (ABI): JSON file that defines the functions and variables of a smart contract and allows bytecode to be mapped into human-readable format.
Analogy: It’s like a translation guide that explains how to interact with a smart contract, turning code into understandable commands.calldata: Data area used to pass arguments to a function in a smart contract. While it isn’t stored in Ethereum’s state, it persists on-chain in history logs and is a cost-efficient way to store data temporarily.
Analogy: Imagine sending a package with temporary instructions; it’s not kept but stays on record for future reference.eth_call: Immediately executes a message call without creating a transaction, thus no gas is charged. It is used mostly in read-only contracts.
Analogy: Like peeking into a vault without opening it, it lets you check data without spending gas or making permanent changes.TransactionType: A number between 0 and 0x7f, which represents one of 128 possible types of transactions.
Analogy: It’s like assigning a number to different types of envelopes (transactions) to identify what kind of message is inside.TransactionPayload: A byte array that contains data specific to the transaction, determined by its type.
Analogy: Think of it as the contents of the envelope, holding all the important information specific to the type of transaction.
Task 3.1: Overview of reading
What is an Ethereum Transaction?
In Ethereum, a transaction is like sending a digital letter. It contains all the information needed to tell the Ethereum network what you want to do, such as sending ETH to someone or interacting with a smart contract.
Let’s break down the key parts of an Ethereum transaction object using a simple analogy:
The Transaction Object: A Digital Letter
Imagine you want to send a letter to a friend, and here's what it might look like:
from: This is your return address, showing where the letter is coming from. In Ethereum, it's the sender's address (e.g.,
"0xEA674f...ec8").to: This is your friend’s address—where you're sending the letter (the recipient's Ethereum address, e.g.,
"0xac03b...e5a").gasLimit: Think of this as the postage you attach to your letter. It tells the Ethereum network the maximum amount of resources you're willing to use to send this transaction. In this case, it's
"21000", a standard amount for basic ETH transfers.maxFeePerGas and maxPriorityFeePerGas: These are like extra postage fees you’re willing to pay to get your letter delivered faster. The maxFeePerGas is the total you're willing to spend, and the maxPriorityFeePerGas is the tip to prioritize your transaction.
nonce: This is the number of letters (transactions) you've sent so far. It starts at
"0"for your first transaction and increases by one for each additional one.value: This is how much ETH you’re sending along with the letter. In this example,
"10000000000"represents the amount in wei (the smallest unit of ETH). So, this is a small transfer.
Signing the Transaction: Sealing the Letter
Before you can send your digital letter (transaction), you must prove it came from you. This is done using your private key, which is like a signature that only you can create. Once signed, it shows that the letter is genuine and couldn’t have been sent by anyone else.
A program like Geth (a popular Ethereum client) helps you sign this transaction. It takes care of creating this digital signature and attaching it to the transaction.
JSON-RPC Call: Sending the Digital Letter
Ethereum uses a communication method called JSON-RPC to send the transaction. It’s like giving instructions to a post office to send your letter. Here’s an example from the documentation:
{
"id": 2,
"jsonrpc": "2.0",
"method": "account_signTransaction",
"params": [
{
"from": "0x1923f...db",
"gas": "0x55555",
"maxFeePerGas": "0x1234",
"maxPriorityFeePerGas": "0x1234",
"input": "0xabcd",
"nonce": "0x0",
"to": "0x07a565...e0",
"value": "0x1234"
}
]
}
method:
"account_signTransaction"means you're asking the Ethereum network to sign and send the transaction.params: This includes all the details of your transaction, like who it’s from, where it’s going, how much gas you're willing to pay, and the amount of ETH you're sending.
Example Response: Proof the Letter Was Sent
Once the network processes your transaction, it sends back a confirmation. This is like receiving a receipt or a tracking number for your letter:
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"raw": "0xf883...",
"tx": {
"nonce": "0x0",
"maxFeePerGas": "0x1234",
"gas": "0x55555",
"to": "0x07a565...e0",
"value": "0x1234",
"hash": "0xeba2d...a30e"
}
}
}
hash: This is like the tracking number of your transaction. It’s a unique identifier that proves the transaction has been sent and can be looked up on the Ethereum blockchain.
In summary, an Ethereum transaction works much like sending a letter, with the from, to, and value fields acting as the addresses and content. Gas fees are like the postage, and signing the transaction with your private key ensures only you can send it. Once sent, you can track it using the transaction hash.
What is an EIP?
An Ethereum Improvement Proposal (EIP) is a standardized way for developers to propose changes or upgrades to the Ethereum network. Each EIP addresses a specific problem or improvement, outlining the technical specifications for the change. EIPs are critical for Ethereum's evolution because they enable community-driven updates, making sure the network stays secure, scalable, and adaptable.
Why EIPs Are Important?
For anyone learning Ethereum, understanding EIPs is essential because they shape how the network functions. Key features like transaction fees, gas limits, and new transaction types are often the result of EIPs. They also reflect the decentralized decision-making process that powers Ethereum, with community consensus guiding the direction of the network.
Here a couple of EIPs important for Ethereum transactions:
EIP-1559: Redefining Transaction Fees
EIP-1559 introduced a major change to how transaction fees are handled on Ethereum. Before this proposal, users set a gas fee, which sometimes led to overpaying during high network demand. EIP-1559 brought in:
A base fee that automatically adjusts based on network activity.
A tip (
maxPriorityFeePerGas) that users can add to incentivize miners to prioritize their transactions.
This change made transaction fees more predictable and helped reduce the volatility of gas prices.
EIP-2718: TransactionType
EIP-2718 introduced the concept of TransactionType, enabling support for different types of transactions on Ethereum. Before this, all transactions followed the same format. EIP-2718 allows multiple transaction types to coexist under a unified framework. For example:
- It enabled the creation of new types of transactions, like the one introduced by EIP-1559, while keeping older transaction formats compatible.
This modular approach made it easier for Ethereum to evolve and add new functionality without breaking existing features.
Task 3.2: Read the docs
Read the official "Ethereum Transactions" section here.
After reading, you can take this comprehension quiz to test your understanding.
Task 4: Answer Discussion Questions
Now, it’s time to talk about what we’ve learned. You can answer the discussion questions here.





