🔬 Packet Format

This is a reference document for advanced users. If you use our SDKs, you don't need to read this — the SDK handles all parsing automatically. See SDK Quick Start.

📖 Overview

Every UDP packet delivered by ShredStream.com is exactly 1203 bytes and contains a single legacy data shred (variant 0xA5). ShredStream.com delivers data shreds only -- no FEC or coding shreds are included in the stream.

Each shred carries a portion of a Solana slot's entry data. Shreds arrive with sequential indexes within each slot, starting from 0. To reconstruct the full block data for a slot, collect all its shreds, order them by index, and concatenate the payloads.

📐 Offset Table

OffsetSizeFieldTypeDescription
0x0064Signaturebytes64 zero bytes. ShredStream.com does not sign shreds; do not verify this field
0x401Shred Variantu8Always 0xA5 (legacy data shred)
0x418Slotu64 LESlot number this shred belongs to
0x494Indexu32 LEShred index within the slot (sequential)
0x4D2Versionu16 LEAlways 0 — not used by ShredStream.com
0x4F4FEC Set Indexu32 LEAlways 0 — not used by ShredStream.com
0x532Parent Offsetu16 LEAlways 0 — not used by ShredStream.com
0x551Flagsu8Boundary flags: DATA_COMPLETE = 0x40, LAST_IN_SLOT = 0xC0
0x562Sizeu16 LETotal useful size (header + payload). Payload = data[0x58..size]
0x58variablePayloadbytesActual entry data
after payloadvariableZero-paddingbytesUnused bytes (zeros) from end of payload to byte 1203

📏 Constants

ConstantValueNotes
SHRED_MAX_SIZE1203 bytesFixed size of every UDP packet
DATA_HEADER_SIZE88 bytes (0x58)Total header size before the payload
MAX_PAYLOAD_SIZE1035 bytesMaximum payload per shred (80 bytes reserved for Solana wire format compatibility)

🚩 Flags Byte

The flags byte at offset 0x55 signals shred boundaries using a bitmask:

FlagValueMeaning
DATA_COMPLETE0x40This is the last data shred in the current entry batch
LAST_IN_SLOT0xC0Sentinel shred marking the end of a slot (see below)

🏁 Sentinel Shred (Slot End Marker)

When all data shreds for a slot have been sent, ShredStream.com emits a sentinel shred with flags 0xC0 (LAST_IN_SLOT). This is the most reliable way to detect the end of a slot.

Sentinel shred characteristics:

FieldValue
Flags0xC0
Size0x58 (88 — header only, no payload)
Payload length0 bytes
IndexNext expected index (= last data shred index + 1)
Variant, Version, FEC, ParentSame as data shreds (0xA5, 0, 0, 0)

To detect the sentinel:

flags = packet[0x55]
size = struct.unpack_from("<H", packet, 0x56)[0]
is_last_in_slot = (flags & 0xC0) == 0xC0 and size == 0x58

When you receive the sentinel, the slot is complete — reassemble and process it immediately.

⚠️ Important Notes

  • Data shreds only. ShredStream.com delivers legacy data shreds (variant 0xA5). You will not receive FEC/coding shreds.
  • Sequential indexes. Within each slot, shred indexes start at 0 and increment sequentially. Missing an index means a shred was lost in transit.
  • Payload size. The Size field indicates the end of useful data. Payload bytes are at data[0x58..size]. Bytes beyond offset size are zero-padding.
  • Sentinel has no payload. The sentinel shred (flags 0xC0) has size = 0x58, meaning its payload length is zero. Do not include it when reassembling entry data.