ZeroCopyZeroCopy
Shredstream

Delivery format

Read the Solana shred headers, data flags and payload offsets delivered over UDP

Each UDP datagram carries one raw Solana shred, unchanged, up to 1,228 bytes. Shredstream forwards chained Merkle data and coding shreds for the cluster's current shred version. ZeroCopy does not check the leader's signature before forwarding. Verify it before accepting the shred.

Common header

Offsets and sizes are in bytes from the start of the datagram. Integers wider than one byte use little endian encoding. The common header is 83 bytes.

FieldOffsetSizeMeaning
signature064Leader signature
shred_variant641Shred type and Merkle variant
slot658Slot containing the shred
index734Shred index within its type in the slot
version772Shred version
fec_set_index794Identifier of the FEC set within the slot

Data shred header

The data header follows the common header, and the payload starts at byte 88.

FieldOffsetSize
parent_offset832
flags851
size862

The flags byte uses Agave's values:

ValueMeaning
0x40Data complete: the shred ends a batch of entries
0xc0Last in slot: set with data complete on the slot's last data shred; test (flags & 0xc0) == 0xc0

The low six bits hold the reference tick.

Coding shred header

The coding header follows the common header, and the payload starts at byte 89.

FieldOffsetSize
num_data_shreds832
num_coding_shreds852
position872

With slot and fec_set_index, these fields let you group each FEC set and recover missing data shreds. Decode entries and transactions from the result with a Merkle shred decoder.