Skip to main content
Scenario: You inspect a signed Ethereum transaction on the wire and notice something bizarre: there is no from field anywhere in the bytes. How does every node on Ethereum agree on who sent it?

The Wire Format (EIP-2718 + EIP-1559)

An EIP-1559 transaction is a single type byte (0x02) concatenated with an RLP-encoded list of fields: Nodes never trust a claimed from address. They strip (yParity, r, s), recompute the signing hash over the remaining 9 fields, and run ecrecover to derive from cryptographically.

How RLP Encodes Structure in Minimal Bytes

Recursive Length Prefix (RLP) encodes only two things: byte strings and lists. No types, no field names — order defines meaning:
Integers in RLP have no leading zero bytes, and the integer 0 encodes as the empty byte string 0x80 — NOT 0x00. Getting 0 wrong breaks every transaction hash.

Step-by-Step: Build, Sign, Serialize, and Recover Offline

1

Construct an EIP-1559 transaction

2

Hash the unsigned payload and sign it

Transaction.getSigningHash encodes 0x02 || rlp([chainId, ..., accessList]) and returns the 32-byte Keccak-256 digest:
3

Serialize to raw wire bytes and compute the tx hash

4

Deserialize and recover the sender offline

Feed rawBytes back into Transaction.deserialize — exactly what an Ethereum execution client does when it receives eth_sendRawTransaction:
You keep the exact same nonce and increase maxPriorityFeePerGas and maxFeePerGas (typically by at least 10% for mempool replacement). Because the fee fields changed, getSigningHash produces a new digest, you must re-sign, and Transaction.hash produces a new transaction hash. Voltaire’s Transaction.replaceWith(tx, { ... }) helps build replacement transactions cleanly.

What You Built

  • Built an EIP-1559 transaction using branded Address, Wei, and Gwei values.
  • Signed its EIP-2718 signing hash with Secp256k1.
  • Serialized it to wire bytes (0x02 || RLP(...)), deserialized it, and cryptographically recovered from.
Next tutorial: Tutorial 5: Own Your Abstraction: Build a Skill