Under the Loom
Contents

§ 1.2 · Foundations · 4 min

Anatomy of a Transaction: Nonce, Gas, Signature, and State

Every transaction is a small, rigidly structured machine. Here is what each field does, how a signature is checked, and how execution bends state.

The Loom Desk ·

SHEET 25 · FOUNDATIONSUNDER THE LOOM
Fig. 1.2 — schematic. Watch the real thing in wevr.ai’s live tables.

A blockchain transaction looks like a money movement, but structurally it is closer to a punched card: a short, rigidly formatted instruction that says exactly one thing, in a fixed grammar, with no room for prose. Every field on that card exists for a reason, and once you know what each slot does, the rest of the system — wallets, fees, confirmations, even smart contracts — starts to look like reasonable consequences of the card's design.

Let's take a card apart, slot by slot.

The fields, one by one

Nonce. Not to be confused with the mining term, a transaction's nonce is a per-account counter: this is my first transaction, my second, my third. It solves two problems at once. It enforces ordering — an account's transactions must be applied in nonce order, so you cannot accidentally spend money from a transaction that has not happened yet — and it prevents replay, since the same signed instruction with the same nonce can only be applied once, ever. A skipped nonce is a famous failure mode: if transaction number five is missing, six and seven will wait in the mempool indefinitely, because the protocol will not weave a row out of order.

Recipient. The destination: another account, or a contract that will run code. There is also a special form with no recipient at all — a contract-deployment transaction whose payload is the program being installed.

Value and data. Value is the amount being sent outright. Data — sometimes called calldata — is the instruction payload: empty for a plain payment, or a compact encoding of "call this function with these arguments" when the recipient is a contract. Nearly everything interesting on a smart-contract chain happens through this slot.

Gas limit and fee fields. Execution costs money, and gas is how it is metered — every computational step has a price, and the gas limit is the sender's cap on how much work the transaction may do before being cut off. Alongside it sit the fee parameters that place the transaction in the block-space market. We cover that market in detail in the article on gas; for now, treat these slots as the postage and the delivery-priority sticker on the card.

The signature: proof without revelation

Nothing on the card identifies you as a person. What identifies you is the signature — a number produced by your private key over the exact bytes of this specific card.

The property that makes this work is beautiful: a signature can be checked by anyone, against your public address, without revealing the private key that produced it. And it is bound to one message. The signature over "send five coins to Alice" cannot be recycled to mean "send five coins to Bob," because the bytes being signed are different. That binding, plus the nonce, is what makes a signature an authorisation rather than a mere identity claim: it says this key approved this exact instruction, at this point in this account's history, and nothing more.

When a node validates your transaction, this is the first thing it checks — signature first, balance second, everything else after. A bad signature means the card is forgeries, and it never leaves the waiting room.

Execution: how one card bends the state

Once a proposer includes the transaction in a block, every node executes it identically. Execution is best pictured as a strict, metered march through instructions. Reading a storage slot costs gas. Arithmetic costs gas. Writing a storage slot costs more gas. The meter runs continuously, and two hard outcomes exist:

  • If the march completes within the gas limit, the resulting changes — moved balances, updated contract storage, emitted events — are kept, and the state of the chain bends accordingly.
  • If the meter runs out, execution halts, and every change the transaction made so far is rolled back. The card is discarded, but the gas is not refunded: work was genuinely done by the network, and the fee stands.

That second rule deserves emphasis, because it is what makes untrusted code safe to run. Any participant can hand the network an arbitrary program, and the program cannot consume more than the sender prepaid for. Runaway computation is economically impossible — not because someone would stop it, but because the meter cuts the power.

The receipt: what lands on chain

After execution, the transaction leaves a second, shorter document behind: the receipt. It records whether execution succeeded or reverted, how much gas was actually burned, and — most importantly for anything building on the chain — the events the execution emitted. Events are the outward-facing logs of a contract: "a transfer happened," "a position was opened," "a proposal was voted on." Indexers read events to build every readable interface you have ever used, from block explorers to portfolio trackers.

This two-document structure — instruction plus receipt — is why chain data is so auditable. The card says what was requested; the receipt says what the machine actually did with it.

Reading real cards

Anatomy is easiest to learn on live specimens. Open the live transaction tables on Wevr and read a few rows: every field discussed here — sender, recipient, value, fee, gas used, success or revert — is decoded for you, one row per transaction, across six chains. Find a plain transfer and a contract call and compare their data payloads; the difference between a payment and a program invocation becomes visible in seconds.

When a term on the card still feels slippery, the Wevr glossary keeps plain-language definitions a click away. And once the fields feel familiar, the natural next thread to pull is the one that explains who controls the keys signing these cards in the first place.

Index terms: transactions · nonce · signatures · execution

Next · § 1.3 How a Block Gets Made: From Mempool to Sealed Header →