Skip to content
fundamentals

How are Solana shreds signed and verified?

Each Solana shred begins with an Ed25519 signature occupying 64 bytes and attributable to the scheduled slot leader. Legacy variants authenticate packet bytes following that field; Merkle variants authenticate a root reconstructed from leaf and proof. Verification requires the correct leader key, variant-aware message extraction, structural validation, and conflict isolation.

protocol desk · updated 2026-08-31

64 bytes begin every shred

An Ed25519 signature occupies the first 64 bytes of the shared shred header. It gives receivers a cryptographic path from raw UDP bytes to the validator expected to lead the claimed slot.

The field alone proves nothing. Verification requires both message and public key. Leader schedule supplies the slot's key, while variant determines the message construction. Legacy and Merkle shreds put the same signature type in the same header location but authenticate different byte structures.

This is the first trust boundary in a direct shred consumer. UDP source addresses identify transport paths. They do not identify the block producer. A relay can faithfully forward bytes from many leaders through one stable IP. Leader attribution remains an end-to-end protocol operation performed on the shred itself.

Leader schedule selects the key

The slot field identifies a leader opportunity. From its cluster schedule, the receiver obtains the validator expected for that slot and uses that identity key in Ed25519 verification.

A real validator's signature remains inadmissible when that validator was not scheduled for the claimed slot. Verification under an arbitrary included or discovered key only proves that some key holder signed the bytes. Solana needs attribution to the scheduled producer.

Leader schedule data must stay current across epoch boundaries and fork context. Receivers can precompute near-future slot-to-key mappings and retain a bounded past window. If the expected key is unavailable, the packet should remain pending or be dropped by policy, not marked valid under a guessed identity.

Legacy signatures cover packet bytes

Both legacy shred types use packet-local signing. The leader authenticates a protocol-defined serialized range following the signature field, including relevant padding.

Header fields after the signature are therefore authenticated. Changing any field invalidates the signature. This includes the variant and slot, the index and version, the FEC anchor, the type-specific header, payload, and signed padding. Receivers must pass the exact original byte range to Ed25519 verification.

Re-serializing a parsed struct is risky. Different padding, field defaults, or serialization behavior can produce a byte string that is semantically similar but not the signed message. Verify against slices of the received packet after minimum-length and variant checks.

Merkle signatures cover a recovered root

Merkle variants authenticate one FEC-set root. The packet provides leaf material and a branch. The receiver hashes the leaf, walks the branch at the packet's canonical tree position, and reconstructs the root. The leader signature is verified over that root.

Every consistent member, source or parity, reaches the same root and may carry an identical 64-byte signature. This differs sharply from legacy packets, where different bodies normally produce different signatures.

The branch and structure are part of verification. Checking a signature over a root value supplied without recomputing membership would not bind the current packet to that root. Root recovery must include domain separation, hash truncation, left-right order, proof length, and variant-specific leaf boundaries.

Signature verification follows sanitization

Ed25519 verification is not the first operation. A receiver first checks datagram length, decodes a supported variant, parses bounded fields, rejects version mismatches, applies slot-horizon limits, and validates obvious index or proof constraints.

These checks are cheaper and prevent malformed bytes from causing out-of-range reads or expensive work. They also narrow which leader key and signed-message extractor should be used.

Sanitization before signature verification does not mean trusting the fields. It means treating them as untrusted values subject to safe bounds. Authentication then upgrades the candidate from structurally plausible to attributable. Later set consistency, recovery, and entry decoding add further states.

Verification is not consensus

A valid signature proves that the expected leader authenticated a legacy packet message or Merkle root for the claimed slot. It does not prove that the slot will become canonical.

Leaders can produce duplicate or conflicting shreds. A proposed block can lose its fork. Transactions can fail execution. Votes and roots occur after shred production. Cryptographic attribution is earlier and narrower than consensus commitment.

Name the state signature_valid or leader_authenticated. Avoid confirmed, accepted, or final. Downstream strategies can choose to act on early authenticated data while separately tracking execution and commitment. Precise names prevent a fast signal from silently acquiring stronger semantics.

Transport identity is a different layer

shredstream.sh sends the feed and verification datagrams from 203.23.178.228. That address is useful for firewall policy and confirms the delivery path configured for the product.

It is not the Solana slot leader's IP and should never replace shred signature verification. A packet can be corrupted before reaching a relay, forwarded from another source, or malformed while still arriving from the expected service address. Conversely, the same valid leader packet may reach a receiver through several transport paths.

Record transport source, local receive interface, and protocol leader identity separately. The first diagnoses routing and service configuration. The second attributes ledger content.

Batch verification trades queueing for throughput

Ed25519 implementations can verify batches more efficiently than isolated calls, especially when vectorized. Batching can raise packet throughput for a sustained feed.

Batch size also creates delay. Waiting for 256 packets during a quiet or lossy interval can add more latency than the cryptographic work saves. A dual trigger based on a small count or short deadline gives bounded queueing.

Merkle roots offer another optimization. After one root signature is verified for a set, later packets reaching the identical root still need branch validation, but root-signature work can be cached under a careful key. Never skip packet membership because the signature bytes were seen before.

Caches require complete keys

A leader schedule cache is keyed by slot or schedule range and cluster context. A root-verification cache needs leader key, slot, FEC anchor, root, and relevant variant context. A negative cache needs a short bounded lifetime.

Caching by signature bytes alone is unsafe. One signature value can repeat across all members of a Merkle set by design. Cache hits must not turn an unverified branch into an admitted packet.

Slot horizons naturally bound memory. Drop cache entries after the receiver no longer accepts packets for those slots, while retaining minimal conflict evidence under a separate operational policy. Attacker-selected slots and roots must not create permanent entries.

Duplicate signatures are not duplicate shreds

Legacy packet signatures usually differ when content differs. Merkle group members deliberately share one. Packet identity still combines common index with slot and shred type.

Two packets with the same identity and byte-for-byte content are duplicates. Two packets with different indexes but one Merkle signature are normal peers in a set. Two packets with the same identity but different authenticated content are conflicts.

Metrics should distinguish duplicate datagrams, repeated Merkle root signatures, invalid signatures, and authenticated identity conflicts. Treating them as one duplicate category hides both normal protocol behavior and serious evidence.

Conflicting valid signatures need evidence

Two different legacy shreds can verify under the same scheduled leader key while claiming the same slot, type, and index. Two Merkle set views can reach different roots that both carry valid leader signatures.

Authentication cannot choose between them because the leader authenticated both. The receiver must isolate their bytes and avoid merging them in ordered assembly or Reed-Solomon recovery. Consensus duplicate handling determines the network consequence.

Keep a bounded record containing identities, hashes, roots, signatures, receive times, and sources. Raw packet retention can be short if storage cost matters, but a hash-only alert may be insufficient for later protocol diagnosis. Never resolve the conflict with arrival order and call the latest copy correct.

Recovered shreds inherit no shortcut

Reed-Solomon reconstructs missing source bytes from an authenticated, consistent set. The resulting data shred still needs structural validation and authentication linkage.

For Merkle sets, the receiver must establish that reconstructed leaf material belongs to the committed root under the protocol's recovery rules. For legacy sets, recreated packet bytes must satisfy the expected signature relationship and set consistency.

Mark recovered provenance separately for observability, then admit the shred through the normal ordered-data interface. A recovered packet is not less useful after validation, but its reconstruction path is relevant when diagnosing loss, latency, and decoder faults.

Failure reasons should be explicit

bad_signature is only one failure. unknown_leader, unsupported_variant, invalid_proof, root_mismatch, wrong_shred_version, impossible_index, truncated_message, and chain_link_failure require different operator responses.

If every failure appears as signature invalid, a stale leader schedule looks like an attack and a Merkle offset bug looks like packet corruption. Count the stage at which admission failed. Sample bounded packet hashes and header claims without logging full high-rate payloads.

Compare failures across transport sources and software versions. A sudden rise limited to one variant suggests decoder compatibility. Failures across every variant at an epoch boundary suggest schedule state. Invalid packets from arbitrary public sources suggest admission pressure rather than feed corruption.

The secure verification pipeline

Receive into a buffer large enough for the 1,228-byte product maximum. Capture monotonic arrival time. Check datagram length and decode the variant. Parse safe header fields. Reject wrong version and implausible slot or index claims.

Resolve the expected leader. Extract the legacy signed slice or reconstruct and validate the Merkle root. Check Ed25519 with the leader key, then enforce FEC consistency and conflict rules. Only an admitted packet may contribute source data or parity.

The pipeline should remain explicit in code and metrics. Combining it into one boolean verify function makes fast rejection convenient but removes the evidence needed to tune latency or explain a disagreement with an Agave node.

Key readiness belongs on the latency path

Signature work cannot begin until the receiver knows the expected leader key. Looking up that key through a remote RPC call per packet would add network latency and create a dependency loop during congestion.

Precompute the schedule across the active receive horizon. Store compact slot ranges because leaders receive runs of assigned slots. Refresh before an epoch boundary and verify the schedule source against the intended cluster context. A generation number on the cache makes updates observable to worker threads.

When a packet arrives for a slot slightly beyond the prepared horizon, place it in a small time-bounded pending queue or reject it according to policy. Do not verify it under the last known leader. Likewise, do not let attacker-selected distant slots trigger synchronous schedule fetches.

Measure schedule_lookup, message_or_root_construction, Ed25519_queue, and Ed25519_compute separately. A signature stage reported as 300 microseconds may contain 280 microseconds of cache miss and queueing. The optimization then belongs in key readiness or scheduling, not cryptographic code.

At an epoch transition, compare invalid-signature and unknown-leader rates. A sharp unknown-leader rise indicates schedule preparation. Valid key lookup followed by failures across otherwise sane packets points toward cluster context, message extraction, or incoming traffic.

Retain bounded verification traces for both successful and failed packets so production behavior remains reproducible.

In practice

Slot 343,118,990 is assigned to validator identity L. A receiver gets 64 Merkle shreds for one 32 plus 32 FEC set through the relay address 203.23.178.228.

The first packet's six-node proof reconstructs root R. Its 64-byte signature verifies over R under L. The receiver caches that root-verification result for the slot and FEC anchor. The next 47 packets independently prove membership under R, so they can reuse the verified root result after their branches pass.

Packet identity data index 14 arrives again with different leaf bytes and reconstructs root Q. Q also has a valid signature under L. The receiver records an authenticated conflict and keeps Q out of the R recovery set. Transport source equality does not resolve which leader proposal consensus will accept.

Scope of this page

This page covers leader attribution for current legacy and Merkle shred families. Ed25519 APIs, batch sizes, exact chained-message construction, and retransmitter policy are outside its scope. Follow the supported Agave release and active network features for those details.

A valid signature establishes neither availability nor transaction execution, and says nothing about later fork choice or commitment. The page also does not define how consensus processes duplicate-shred evidence after a receiver detects two authenticated views.

Related questions

The receiver uses the identity key for that claimed slot's scheduled validator. Verification under an arbitrary key is insufficient. The leader schedule must match the intended cluster and remain current across schedule boundaries, while shred version supplies another early lineage check.

A legacy shred signs the protocol-defined packet bytes following the 64-byte signature field, including relevant padding. Receivers should verify the original received slice after safe layout checks. Re-serializing parsed fields can change padding or representation and produce a message different from the one the leader signed.

A Merkle shred authenticates its FEC group's root with the leader signature. The receiver reconstructs that root from leaf material, canonical position, and sibling proof. Verification checks both packet membership and Ed25519 validity under the expected leader key.

No. A UDP source address identifies the immediate transport sender, such as a relay, and supports firewall policy. It does not authenticate the Solana leader or packet content. End-to-end trust comes from variant-aware shred verification against the scheduled leader identity, followed by set consistency and later consensus reconciliation.

Yes. A leader can authenticate conflicting packet bodies or different Merkle roots for one shred identity or FEC anchor. Signature verification attributes both claims but cannot choose between them. Receivers must isolate views, preserve limited evidence, and keep their bytes separate during recovery and ledger assembly.

Read next

Ready to build against this? The documentation covers the implementation.