🔬 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
| Offset | Size | Field | Type | Description |
|---|---|---|---|---|
0x00 | 64 | Signature | bytes | 64 zero bytes. ShredStream.com does not sign shreds; do not verify this field |
0x40 | 1 | Shred Variant | u8 | Always 0xA5 (legacy data shred) |
0x41 | 8 | Slot | u64 LE | Slot number this shred belongs to |
0x49 | 4 | Index | u32 LE | Shred index within the slot (sequential) |
0x4D | 2 | Version | u16 LE | Always 0 — not used by ShredStream.com |
0x4F | 4 | FEC Set Index | u32 LE | Always 0 — not used by ShredStream.com |
0x53 | 2 | Parent Offset | u16 LE | Always 0 — not used by ShredStream.com |
0x55 | 1 | Flags | u8 | Boundary flags: DATA_COMPLETE = 0x40, LAST_IN_SLOT = 0xC0 |
0x56 | 2 | Size | u16 LE | Total useful size (header + payload). Payload = data[0x58..size] |
0x58 | variable | Payload | bytes | Actual entry data |
| after payload | variable | Zero-padding | bytes | Unused bytes (zeros) from end of payload to byte 1203 |
📏 Constants
| Constant | Value | Notes |
|---|---|---|
SHRED_MAX_SIZE | 1203 bytes | Fixed size of every UDP packet |
DATA_HEADER_SIZE | 88 bytes (0x58) | Total header size before the payload |
MAX_PAYLOAD_SIZE | 1035 bytes | Maximum 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:
| Flag | Value | Meaning |
|---|---|---|
DATA_COMPLETE | 0x40 | This is the last data shred in the current entry batch |
LAST_IN_SLOT | 0xC0 | Sentinel 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:
| Field | Value |
|---|---|
| Flags | 0xC0 |
| Size | 0x58 (88 — header only, no payload) |
| Payload length | 0 bytes |
| Index | Next expected index (= last data shred index + 1) |
| Variant, Version, FEC, Parent | Same 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 == 0x58When 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) hassize = 0x58, meaning its payload length is zero. Do not include it when reassembling entry data.