# Solana shreds: raw UDP, decoding and streaming

Canonical: https://zerocopy.sh/learn/solana-shreds
Language: en
Updated: 2026-11-19

Leaders cut each block into shreds and send them over UDP. This guide covers what a raw shred contains, how a receiver verifies and reassembles them, and how decoded feeds and Yellowstone gRPC differ.

## How entries become shreds

A leader serializes batches of ledger entries and splits those bytes into data shreds. Entries contain transactions; a shred boundary is a packet boundary, not a transaction boundary. Reconstruct the entry batch before treating its bytes as decoded transactions. The Solana Foundation's [shred specification](https://github.com/solana-foundation/specs/blob/main/p2p/shred.md) defines this construction as a streaming process, so broadcasting can begin while the leader is still producing its block.

The leader groups contiguous data shreds into forward error correction (FEC) sets and produces coding shreds with Reed-Solomon erasure coding. Coding shreds carry redundancy from the same transaction batch. Enough distinct shards from a set can recover missing data. FEC does not recover an arbitrarily large gap, and a duplicate packet contributes no new shard.

In the Merkle format, the leader signs the FEC set's Merkle root with Ed25519. Each shred carries that signature and a Merkle proof linking its bytes to the root. Agave's Merkle implementation uses 1,203-byte data shreds and 1,228-byte coding shreds. These whole-shred sizes include headers and authentication material; transaction payload capacity is smaller. Chained Merkle shreds also carry the previous erasure batch's Merkle root.

## Turbine block propagation

Turbine distributes shreds through a tree of validators. The leader sends a shred to a root node, which forwards it to the next layer. Each downstream validator forwards to a subset of the following layer, instead of requiring the leader to send every packet directly to every validator.

Anza documents a stake-weighted shuffle that generates the tree separately for each shred, using the leader identity, slot, shred index and shred type. Packet loss can compound across those hops. Validators use erasure recovery, then repair when recovery is insufficient. A commercial UDP feed does not by itself give your application that validator repair service: incomplete FEC sets still need explicit handling.

## Before replay and commitment

Shreds in flight contain the ledger data another validator will reconstruct and replay. In Anza's message flow, the leader executes transactions before packaging entries. A raw feed exposes those transactions before the receiving validator executes them. The raw shred contains no execution result, program log or balance change.

Replay validates and executes the reconstructed sequence against the receiving validator's state. Geyser transaction notifications can then carry execution metadata, and account notifications expose state updates during processing. `processed` means the node has processed the block, but that view can still be rolled back. `confirmed` means a supermajority of active stake has directly voted on the block. `finalized` is the network's strongest commitment state, associated with maximum vote lockout.

These stages do not guarantee when one service will deliver data relative to another. Raw or decoded shreds expose pre-replay bytes; execution streams expose outcomes; commitment-aware RPC reads and subscriptions expose the requested confidence level. A final-shred flag proves neither execution nor confirmation. For transaction sending, see [Solana transaction landing](https://zerocopy.sh/learn/solana-transaction-landing).

## The receiver pipeline

A raw-shred consumer must handle verification and reconstruction. Follow the [processing guide](https://zerocopy.sh/docs/shredstream/processing) and keep each stage separate in your implementation:

1. Parse and validate the shred format and version. Resolve the scheduled leader for its slot, reconstruct the Merkle root from its proof, and verify the Ed25519 signature against that leader's identity. A firewall source address is not a substitute for this authentication.
2. Deduplicate valid shreds by `(slot, index, shred type)`, with data and coding as different types. Keep the first valid copy. An invalid packet must not occupy the key and block a later valid copy. Bound the cache to your processing window and deduplicate across receivers too.
3. Group shards by `slot` and `fec_set_index`. The coding header supplies data and coding counts plus the coding shard's position. Use a compatible Merkle shred decoder for recovery, preserving proof and root consistency. Leave unrecoverable sets marked incomplete.
4. Put data shreds in index order, reconstruct completed entry batches, then decode entries and transactions. UDP may lose, duplicate or reorder packets; receiving a higher index does not establish that every lower index arrived. The final-shred flag does not fill those holes.
5. Obtain execution results and check the commitment your application requires before treating a transaction as settled. Handle skipped slots and abandoned forks. Decoding instructions tells you what was submitted in the ledger, while execution determines their effects on state.

## Choose the data stage

Select an interface by the information your application needs. Decoding handles packet reconstruction without adding execution metadata. Ordinary Yellowstone Geyser transaction subscriptions carry executed transaction data. Yellowstone also defines a separate `SubscribeDeshred` RPC for decoded transactions before execution, without `TransactionStatusMeta`. Check which subscription a service provides, even when it uses gRPC.

| Interface | What arrives | Stage | Transport | Work left |
| --- | --- | --- | --- | --- |
| Raw shreds | Data and coding fragments with authentication material | Before receiver replay | UDP for ZeroCopy Shredstream | Verify, deduplicate, recover, decode and obtain execution results and confirmation |
| Decoded shreds | Transactions reconstructed from entries | Before receiver replay | API-specific; Yellowstone SubscribeDeshred uses gRPC | Interpret transactions, obtain execution results and track commitment |
| Yellowstone Geyser subscriptions | Executed transactions with metadata; account updates | Execution, with commitment filtering | gRPC over HTTP/2 | Filter updates, interpret metadata and track forks |
| JSON-RPC reads | Requested state or transaction results | Method-dependent; getTransaction requires confirmed or finalized | HTTP(S) | Request the right commitment and interpret responses |
| WebSocket subscriptions | Method-specific notifications, such as transaction logs | logsSubscribe supports processed, confirmed and finalized | WebSocket | Manage subscriptions and interpret notifications |

At ZeroCopy, decoded shreds, Yellowstone gRPC, JSON-RPC reads and WebSocket are waitlist only. Raw Shredstream is available on request. The broader [trading infrastructure guide](https://zerocopy.sh/learn/solana-trading-infrastructure) separates these inbound data interfaces from transaction sending.

## ZeroCopy delivery and access

[ZeroCopy Shredstream](https://zerocopy.sh/shredstream) sends one raw shred per UDP datagram, at most 1,228 bytes. It forwards only chained Merkle data and coding shreds of the cluster's current shred version. ZeroCopy does not verify signatures before sending. The [delivery format](https://zerocopy.sh/docs/shredstream/format) specifies an 83-byte common header, with data payload starting at byte 88 and coding payload at byte 89; multibyte integers are little-endian.

Each receiver is a public IPv4 address and UDP port in one metro. IPv6 is unsupported. The six live metros are Frankfurt, Amsterdam, London, New York, Los Angeles and Tokyo. Follow the [Shredstream quickstart](https://zerocopy.sh/docs/quickstart/shredstream) to request access in the console. ZeroCopy supplies the source addresses to allowlist for each receiver's metro when setting it up.

Delivery is billed per IP-day from prepaid credit. An IP-day is one receiver IPv4 address in one metro with delivery enabled during a UTC day. The [published rate](https://zerocopy.sh/pricing) is $449 per receiver IP per metro for 30 days. Extra ports on that IP in the same metro cost nothing more; another metro counts again. Billing starts on activation day, and delivery stops when usable credit runs out.

## Prepare the receive path

Allow inbound UDP on the assigned port only from the supplied source addresses. Raise both the operating system's receive buffer limit and the socket buffer, read promptly in batches where supported, and keep logging and reconstruction off the receive path. A bigger buffer cannot recover packets already dropped.

The documentation's example project includes a TypeScript receiver for inspecting headers. Set these environment variables to your assigned UDP port and a positive bounded-cache capacity, then run the documented receiver:

Run the documentation's header-inspection example

```
export SHREDSTREAM_UDP_PORT=20000
export DEDUPE_ENTRIES=65536
bun receiver.ts
```

Replace `20000` with your receiver's port. This example inspects headers and caches unverified keys. It does not verify signatures, validate the Merkle body, recover FEC sets, replay blocks or confirm transactions. Use it to check arrival, never to select a trusted copy in production.

## Read delivery reports

The console reports what ZeroCopy sent, not what your application received. Each receiver shows its UDP destination, metro and state: Active, Paused or Out of credit. Packet and traffic rates cover two minutes; the packet-rate chart covers the last hour. The table refreshes every ten seconds. Delivery errors count packets ZeroCopy could not send, while Last report shows Not reporting without a recent report.

Compare those reports with local traffic and host UDP drop counters. Track incomplete FEC sets separately from completed reconstruction, and monitor skipped slots. Delivery history lists each receiver's periods over the last 30 days; billed days list IP-days, cost and billing status for the last 30 UTC days.

## Sources

- [Solana Foundation: Shred packets](https://github.com/solana-foundation/specs/blob/main/p2p/shred.md)
- [Agave: Merkle shred implementation](https://github.com/anza-xyz/agave/blob/master/ledger/src/shred/merkle.rs)
- [Anza: Turbine block propagation](https://docs.anza.xyz/consensus/turbine-block-propagation)
- [Anza: Fork generation and message flow](https://docs.anza.xyz/consensus/fork-generation)
- [Anza: Blockstore in a Solana validator](https://docs.anza.xyz/validator/blockstore)
- [Anza: Solana validator Geyser plugins](https://docs.anza.xyz/validator/geyser)
- [Solana: RPC overview and commitment](https://solana.com/docs/rpc)
- [ZeroCopy: Shredstream processing](https://zerocopy.sh/docs/shredstream/processing)
- [Yellowstone: Geyser and deshred protocol definitions](https://github.com/rpcpool/yellowstone-grpc/blob/master/yellowstone-grpc-proto/proto/geyser.proto)
- [Yellowstone: gRPC interface and HTTP/2 transport](https://github.com/rpcpool/yellowstone-grpc)
- [Solana: getTransaction](https://solana.com/docs/rpc/http/gettransaction)
- [Solana: logsSubscribe](https://solana.com/docs/rpc/websocket/logssubscribe)
- [ZeroCopy: Product availability](https://zerocopy.sh/)
- [ZeroCopy: Shredstream overview](https://zerocopy.sh/docs/shredstream)
- [ZeroCopy: Shredstream delivery format](https://zerocopy.sh/docs/shredstream/format)
- [ZeroCopy: Shredstream quickstart](https://zerocopy.sh/docs/quickstart/shredstream)
- [ZeroCopy: Shredstream receivers](https://zerocopy.sh/docs/shredstream/receivers)
- [ZeroCopy: Shredstream billing](https://zerocopy.sh/docs/account/billing#shredstream)
- [ZeroCopy: SWQoS and Shredstream pricing](https://zerocopy.sh/pricing)
- [ZeroCopy: Shredstream monitoring](https://zerocopy.sh/docs/shredstream/monitoring)

