Raw Solana shreds become usable data only after six stages: grouping and recovering shreds, rebuilding entries, extracting transactions, resolving account keys, decoding each program's instructions, and storing the result with a status you later reconcile. The packet gives you signed intent in fragments. Account state, program layouts and the final outcome all come from somewhere else.
Six stages between a datagram and a row#
A single UDP datagram holds one shred: an 83-byte common header (the leader's 64-byte signature, the shred type, the slot number, the shred's index, the shred version and the erasure set it belongs to), followed by a slice of block data or of recovery data. Nothing in that slice is a transaction yet. The stages below are the path every decoder walks, whatever language it is written in.
- Collect and recover. Shreds arrive out of order, sometimes twice, sometimes not at all. Group them by slot and FEC set. Each set targets an even split, 32 shreds of data plus 32 of parity, which means missing data shreds can be rebuilt with Reed-Solomon once enough of the set is present.
- Reassemble entries. Concatenate the data payloads of a completed run, in index order. Since Alpenglow, the deshredded bytes are block components: a header marker, entry batches that each start with an 8-byte count, and a footer marker.
- Pull out transactions. Each entry carries
num_hashes, a hash and a list of transactions, in the order the leader packed them. That list is what you came for. - Resolve accounts. Legacy transactions list every account key. Version 0 transactions point into address lookup tables by index, so the real keys live in table accounts you must fetch or track. Version 1 transactions carry no lookups at all.
- Decode instructions by program. Each instruction names a program by index and carries raw bytes. Turning those bytes into "swap 3 SOL for token X" needs that program's layout: an Anchor IDL with 8-byte discriminators, or a hand-written enum for programs such as SPL Token.
- Store and reconcile. Write the row with a status that says it is provisional. Later, ask RPC whether the transaction landed in a block that stayed, and whether it succeeded.
| Stage | Input | Output | Needs outside state |
|---|---|---|---|
| Collect and recover | datagrams | complete data shreds per slot | no |
| Reassemble entries | data payloads | block components and entries | no |
| Pull out transactions | entries | transaction bytes, in order | no |
| Resolve accounts | v0 messages | full account key list | yes: lookup table accounts |
| Decode instructions | instruction bytes | named calls with arguments | yes: program layouts |
| Store and reconcile | decoded rows | rows with a final status | yes: RPC status later |
Which stages need state from outside the packet#
The first three stages are self-contained. Given the same shreds, two decoders produce identical bytes, and you can test them against golden output from the official shredder.
The last three are where most real effort goes, because each one depends on data the packet does not carry:
- Lookup tables change over time. A table can gain addresses, and addresses added in the same slot as a transaction cannot be used by it. Your cache has to know which version of a table applies.
- Program layouts change when a program upgrades. Anchor programs can even override the default discriminator, so reading the published IDL beats assuming the hash rule.
- Outcomes do not exist yet when the shred arrives. Success, failure, logs and balance changes are produced by execution, and they reach you through RPC or a Geyser stream afterwards.
Plan for these three dependencies before writing the fast path. A decoder that is quick but resolves the wrong account is worse than a slow one.
Where first decoders usually break#
Four mistakes show up again and again in early decoder code:
- Treating the account list as complete. On a v0 transaction, the static keys are only the start of the list. Instruction indexes that point past them refer to looked-up addresses.
- Assuming one transaction format. Legacy, v0 and v1 are all live on mainnet. A v1 transaction starts with version byte 129 and puts its signatures last, so a parser written for legacy layouts reads garbage.
- Counting what you see as what happened. A transaction in a block can fail and still pay its fees. Shreds carry no hint of that.
- Decoding on the receive thread. Parsing while packets queue in the socket buffer is the easiest way to lose shreds. Read, hand the bytes off, and decode elsewhere.
A minimum path you can build in one afternoon#
You do not need all six stages working perfectly to learn from live data. A reasonable first cut:
- Receive datagrams, parse the common header, and keep only complete runs of data shreds. Skip recovery for now and count the slots you drop.
- Deshred those runs into entries and print each transaction's first signature.
- Look each signature up on an explorer to confirm your bytes are real transactions.
- Add a filter on one program you care about, using only the static account keys.
- Only then add lookup table resolution, recovery and a store.
Steps 1 to 3 prove the pipeline end to end. Everything after that is refinement you can measure against RPC.
Questions from first-time decoder authors#
Can I skip FEC recovery entirely?#
You can start without it, and you will lose any slot where a data shred went missing. Recovery matters once you need complete slots, for example for indexing or research datasets.
Do I need a full validator to decode shreds?#
No. Decoding needs the shredder's format and the transaction formats, both available as open source crates. You need RPC only for the outside state: lookup tables, and the outcome of each transaction.
Which stage should I optimise first?#
Measure before deciding. In most pipelines the work that grows with traffic sits in recovery and instruction decoding, but your program mix decides where the time goes on your server.
What this pipeline still cannot tell you#
Even a perfect decoder only knows what the leader proposed. Whether the transaction succeeded, what it logged, which inner instructions ran and how balances moved all stay unknown to it. It also cannot promise that the slot survives: a block can be skipped, and early data has to be reconciled against confirmed blocks. If your product needs execution results the moment it shows a row, raw shreds alone are not the right source.
Go deeper, one stage at a time#
The decoding pipeline, stage by stage turns this outline into code, and how a transaction is laid out explains the bytes you reach in stage three. When you hit stage four, read resolving lookup tables. For stage five, filtering by program keeps the work small, and reconciling with confirmed blocks closes the loop on stage six. Ready to try it on live packets? Order a Standard feed, send us your IPv4 address and UDP port, and follow the quickstart.
If you are about to order a feed, the developer's buying checklist covers what we need from you and what you build.
Sources#
- Agave v4.4.1 ledger shred module (header sizes, FEC set size, payload sizes) (checked 2026-11-18)
- Agave v4.4.1 entry struct (num_hashes, hash, transactions) (checked 2026-11-18)
- Agave v4.4.1 block components after Alpenglow (checked 2026-11-18)
- Solana improvement document 0385, the v1 transaction layout (checked 2026-11-18)
- solana-address-lookup-table-interface 4.0.0, lookup table state (checked 2026-11-18)
- solana-transaction-status 4.4.1, TransactionStatusMeta (fields produced by execution) (checked 2026-11-18)
Raw shreds on your own server
Ultra Low Latency Shreds is $200 and Standard Shreds is $100. You pay in crypto, tell us which IPv4 address and UDP port should receive the stream, and we wire it up by hand.