Learn

Short, plain explanations of the ideas behind tracing AI agents that move money on-chain. Each page answers one question first, then shows where it appears in a trace.

New to crypto and AI agents? Start from zero Short videos and plain pages, one step at a time.

Start here

What is a span?

One timed operation, such as a tool call or a transaction send, with a name, a start, an end and attributes.

What is a trace?

The tree of spans for one request or agent run. Child spans nest under the operation that caused them.

Agentic era

OpenTelemetry for AI agents, one idea per page: spans, attributes, context, sampling and export, each shown on a real agent run.

Traces and spans: the anatomy of one agent runTrace vs span in OpenTelemetry, on one real agent run: a span is one operation, a trace is every span with the same trace ID. Span ID and parent ID explained.3 min read01/12Span attributes: putting the tx hash on the spanOpenTelemetry span attributes explained with an agent's transaction: key and value rules, the allowed types, and why fees in wei go in as strings.2 min read02/12Span status codes: Unset, Error and OkHow to mark an OpenTelemetry span as an error: status code Error plus an error.type attribute. Why success stays Unset, and when to use Ok. With code.3 min read03/12Span events vs logsOpenTelemetry span event vs log: what a span event is, how exceptions are recorded on spans, and why OpenTelemetry is moving events to the Logs API.3 min read04/12Span kind: client, server, internalOpenTelemetry span kind explained on one agent trace: client vs internal, server, producer and consumer, and why a transaction send is a CLIENT span.3 min read05/12Span links: connecting spans that aren't parent and childWhat an OpenTelemetry span link is, how it differs from a parent span, and how to add one in code, even when the linked span is in another trace.3 min read06/12Context propagation in async Node.jsOpenTelemetry context propagation in Node.js: how the active span survives await, what breaks without a context manager, and the traceparent header.2 min read07/12Baggage vs span attributesOpenTelemetry baggage vs attributes, with an agent ID as the example: what travels to other services, what lands on spans, and what to keep private.2 min read08/12Resource attributes: who emitted this span?OpenTelemetry resource attributes and service.name for an AI agent: what belongs on the resource, what on the span, and why env vars get ignored.2 min read09/12Semantic conventions: shared names for spans and attributesWhat OpenTelemetry semantic conventions are, what Stable and Development mean, where the GenAI names stand, and a lookup for every attribute name.3 min read10/12Sampling without losing the spans that moved moneyAn OpenTelemetry sampling strategy for agents that move money: head vs tail sampling, what a 10% sampling rate drops, and a policy that keeps reverts.2 min read11/12Exporters and OTLP: getting spans to Jaeger or LangfuseThe OpenTelemetry OTLP exporter in a TypeScript Node.js example: send agent spans to Jaeger or Langfuse, and why spans vanish without shutdown.2 min read12/12

Blockchain era

What happens to a transaction after an agent sends it: the lifecycle, fees, reverts and replaced transactions.

How do AI agents pay? Agent payments explainedAI agents pay within a business's budget, through a shop's checkout, or per request with a stablecoin. The three ways in plain words, and what can go wrong.4 min read01/09Transaction lifecycle: send, mempool, confirmWhat happens between sending an EVM transaction and knowing whether it worked: the hash, the pending pool, the block and the receipt.2 min read02/09What is the L1 data fee?On OP Stack chains like Base, every transaction also pays to publish its data to Ethereum. What that fee is, why agents should care and where to see it.2 min read03/09Flashblocks: a receipt before the block existsBase's flashblocks return a transaction receipt before its block is sealed. What a preconfirmation is, how to spot one, and why its fee can change.3 min read04/09ERC-4337 user operations: when the transaction isn't yoursAn ERC-4337 smart account sends user operations, not transactions. What a bundler, the EntryPoint and a paymaster do, and which hash and fee are the agent's.3 min read05/09EIP-5792 call batches: one request, several callsEIP-5792 lets an app ask a wallet to send several calls at once and poll their status. What the batch id and status codes mean, and when calls are atomic.2 min read06/09EIP-7702: when a plain account runs contract codeEIP-7702 lets a regular account delegate to contract code with a signed authorization. What a type 4 transaction carries, and what to record about it.2 min read07/09HTTP 402 Payment Required: what it means and how x402 uses itHTTP 402 Payment Required is still only reserved in the HTTP standard. What it means, how to fix it, and a real x402 402 → pay → 200 exchange, header by header.5 min read08/09x402 vs MPP: the same paid request, traced both waysx402 and MPP both turn HTTP 402 into a payment. We paid one API with each and traced it: the headers, who sends the transaction, and what the trace shows.6 min read09/09

Prefer to watch?

Short videos on the same ideas, for first-timers, on the hashspan YouTube channel.

ShortAmazon blocked an AI from shopping for you. Here's why it mattersWhen software spends money, how does anyone know who sent it, and whether you said yes?ShortQuantum computers will break Bitcoin? Not the part you thinkThe hashes that hold a chain together are fine. The weak spot is the signature.ShortMoney with no undo buttonA bank can give stolen card money back. Crypto has no bank in the middle to undo it.ShortWhat if you lose these 12 words?Lose your phone and the 12 words bring everything back. Lose the words too, and nobody can.ShortYour crypto address is a mailbox. Here's why that's safe #5Anyone can drop a letter in, but only your private key opens it.ShortYour crypto isn't in your wallet. So where is it? #4Your coins live on the blockchain. Your wallet holds the keys.3 minCrypto Wallets Explained in 3 MinutesA wallet holds no coins, only a key. What that means, and the words you must never lose.ShortBitcoin vs Ethereum: who writes the next block? #3Proof of work and proof of stake: how each chain picks who writes the next page.ShortWhy can't anyone secretly change a blockchain? #2Edit one page and every page after it breaks, so the change shows.ShortWhat if changing one letter changed everything?Change “Alex paid 10” to “11” and the whole hash changes with it.3 minBlockchain Explained in 3 MinutesBlocks, hashes and why a chain is hard to change, for first-timers.ShortWhat happens when you send crypto?From the send button to a block, in under a minute.All videos on YouTube →Blockchain and AI agents, explained simply. New videos as they come out.

Glossary

First steps

Blockchain
A shared record kept by many computers at once, written in blocks that are chained together by hashes.
Block
A batch of transactions added to the chain together: one page of the shared notebook.
Hash
A short code calculated from data. Change the data even slightly and the code is completely different.
Node
A computer that keeps its own copy of the blockchain and checks new blocks.
Wallet
An app that holds your keys and shows what is yours on the blockchain. The coins stay on the blockchain.
Address
A public code that receives coins, made from your public key. Safe to share.
Private key
The secret number that signs your transactions, and so moves your coins. Never share it.
Seed phrase
Also called a recovery phrase: usually 12 or 24 words that can rebuild your keys on another device. Never share it.
Transaction
A message signed with your private key that moves coins. It counts once a block includes it.
Confirmation
A block that holds your transaction or comes after it. One confirmation means it is in a block. Each one makes it harder to reverse.

OpenTelemetry

Span
One timed operation, such as a tool call or a transaction send, with a name, a start, an end and attributes.
Trace
Every span that shares one trace ID, such as all the work in one agent run.
Span attribute
A key-value pair on a span, such as blockchain.tx.hash, that you search and group by.
Span status
Unset, Error or Ok: whether the operation the span describes failed.
Span event
A named, timestamped record inside one span, such as an exception.
Span kind
The role a span plays in a call: CLIENT, SERVER, INTERNAL, PRODUCER or CONSUMER.
Context propagation
Carrying the active trace and span across await and, in headers such as traceparent, across processes.
Baggage
Key-value pairs carried in the context and sent to downstream services. They reach a span only if code copies them.
Resource
Attributes that describe who emitted the telemetry, such as service.name, shared by every span from one SDK.
Semantic conventions
Agreed names for spans and attributes, such as error.type, each with a stability level.
GenAI semantic conventions
OpenTelemetry's names for LLM and agent work, such as invoke_agent, execute_tool and gen_ai.agent.id. Still in Development.
Agent identity
Which agent did the work, recorded on spans as gen_ai.agent.id and gen_ai.agent.name.
Sampling
Deciding which traces to keep: when a trace starts (head) or after its spans arrive (tail).
OTLP
OpenTelemetry's protocol for sending telemetry to a backend, over HTTP or gRPC.

On-chain

Transaction hash
The identifier a node returns as soon as it accepts a transaction, before anything has run.
Mempool
The pool of pending transactions waiting to be included in a block.
Receipt
The record of an included transaction's outcome: status, gas used, effective gas price and logs.
Nonce
A sender's transaction counter. Two transactions with the same sender and nonce can't both be mined.
Replaced transaction
A transaction whose nonce was taken by another one from the same sender, such as a speed-up or a cancel.
Revert reason
Why a reverted transaction failed: an Error(string) message, a panic code or a custom error.
Gas
The unit of computation a transaction pays for. Gas used × effective gas price is its execution fee.
Effective gas price
The price per unit of gas a transaction actually paid: the base fee plus the priority fee.
L1 data fee
The part of an OP Stack transaction's cost that pays for publishing its data to Ethereum.
OP Stack
The software behind rollups such as Base and OP Mainnet, which publish their transaction data to Ethereum.
x402
An open protocol for paying for HTTP requests through the 402 Payment Required status code, so agents can pay per request.
MPP
The Machine Payments Protocol: an API answers 402 Payment Required with a challenge, and the agent pays it on Tempo with a token transfer.
Agentic payments
Payments that software agents make on their own, such as per-request API payments over x402 or MPP.
ERC-4337
An Ethereum standard for smart contract accounts that works without protocol changes, through user operations and bundlers.
User operation
The transaction-like object an ERC-4337 smart account signs. A bundler puts it on chain.
Call batch
Several calls sent to a wallet in one EIP-5792 request, tracked by a batch id instead of a transaction hash.
EIP-7702 delegation
A regular account's pointer to contract code, set by a signed authorization in a type 4 transaction.
Flashblocks preconfirmation
A receipt Base returns before the block is sealed. Its block hash is all zeros.
DocsInstall hashspan and trace your first transaction.BlogDeep dives on traces, fees, reverts and agent payments.OpenTelemetry attributesLook up gen_ai.*, rpc.*, http.* and error.type: type, stability, the spans that set them.

Type to search the docs, Learn topics and the blog.