Packet Format

Overview

Every UDP packet delivered by ShredStream.com is exactly 1203 bytes and contains a single Merkle 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.

Memory Layout

┌──────────────────────────────────────────────┐
│  0x00  Signature (64 bytes)                  │
├──────────────────────────────────────────────┤
│  0x40  Shred Variant (1 byte) = 0xA5        │
├──────────────────────────────────────────────┤
│  0x41  Slot (8 bytes, LE u64)               │
├──────────────────────────────────────────────┤
│  0x49  Index (4 bytes, LE u32)              │
├──────────────────────────────────────────────┤
│  0x4D  Version (2 bytes, LE u16)            │
├──────────────────────────────────────────────┤
│  0x4F  FEC Set Index (4 bytes, LE u32)      │
├──────────────────────────────────────────────┤
│  0x53  Parent Offset (2 bytes, LE u16)      │
│  0x55  Flags (1 byte)                        │
│  0x56  Size (2 bytes, LE u16)               │
├──────────────────────────────────────────────┤
│  0x58  Payload (up to 1115 bytes)           │
├──────────────────────────────────────────────┤
│  Merkle proof + chained root (variable)      │
└──────────────────────────────────────────────┘
Total: 1203 bytes

Complete Offset Table

Offset
Size
Field
Type
Description

0x00

64

Signature

bytes

Ed25519 signature over the shred contents

0x40

1

Shred Variant

u8

Always 0xA5 (Merkle 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

Shred version

0x4F

4

FEC Set Index

u32 LE

FEC set this shred belongs to

0x53

2

Parent Offset

u16 LE

Offset to the parent slot

0x55

1

Flags

u8

Boundary flags: DATA_COMPLETE = 0x40, LAST_IN_SLOT = 0x20

0x56

2

Size

u16 LE

Payload size in bytes

0x58

variable

Payload

bytes

Actual entry data

after payload

variable

Merkle Proof

bytes

Merkle proof nodes + chained root

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

1115 bytes

Theoretical maximum payload; actual size varies because the Merkle proof at the end of the packet consumes some of the remaining space

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 FEC set / entry batch

LAST_IN_SLOT

0x20

This is the last data shred in the entire slot

When LAST_IN_SLOT is set, you know the slot is complete and you can reassemble all collected shreds for that slot into the full block data.

Important Notes

  • Data shreds only. ShredStream.com delivers Merkle 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 at offset 0x56 tells you the actual number of payload bytes. This may be less than the full payload area because the Merkle proof occupies space at the end of the packet.

  • Merkle proof. The trailing Merkle proof and chained root are used for cryptographic verification. For most data-extraction use cases, you can safely ignore them and read only the payload bytes indicated by the Size field.

  • Signature. The 64-byte Ed25519 signature at the start of the packet is produced by the block leader and can be used to verify shred authenticity.

Last updated

Was this helpful?