How are Solana shreds signed and verified?
Each Solana shred carries a 64-byte Ed25519 signature attributable to the scheduled slot leader. Legacy variants sign the packet bytes after the signature field. Merkle variants sign a root reconstructed from the packet leaf and proof. Verification requires the correct leader key, variant-specific message extraction, structural validation, and separate handling for conflicting authenticated shreds.
protocol desk · updated 2026-08-31
64 bytes begin every shred
The common shred header begins with a 64-byte Ed25519 signature. That fixed field gives receivers a cryptographic path from raw UDP bytes to the validator expected to lead the claimed slot.
The field alone proves nothing. Verification needs a public key and a message. The public key comes from the leader schedule for the slot. The message depends on the shred variant. 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. The receiver consults its cluster's leader schedule and obtains the validator identity expected to produce that slot. Ed25519 verification uses that identity key.
A packet signed by a real validator that is not the scheduled leader is not an admissible shred for the claimed slot. Signature validity under an arbitrary included or discovered key would only prove 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
Legacy data and coding shreds use packet-local signing. The leader signs the serialized bytes following the signature field over the protocol-defined message range, including relevant padding.
Header fields after the signature are therefore authenticated. Changing the variant, slot, index, version, FEC anchor, type-specific header, payload, or signed padding invalidates the signature. 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 data and coding shred in the set reaches the same root and can carry the same 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 64.130.40.90. 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 under the measured 5,585-packets-per-second 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 packet content differs. Merkle set members deliberately share a signature. The identity key remains slot, shred type, and common index.
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 the Merkle root and verify membership. Verify Ed25519 under the leader key. Enforce FEC-set consistency and conflict rules. Only then let the packet contribute 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 64.130.40.90.
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.
What this does not cover
This page covers leader attribution for current legacy and Merkle shred families. It does not specify Ed25519 implementation APIs, batch sizes, exact chained-message construction, or retransmitter-signature policy. Those details should follow the supported Agave release and active network features.
Signature validity does not establish availability, correct transaction execution, fork choice, confirmation, or finality. The page also does not define how consensus processes duplicate-shred evidence after a receiver detects two authenticated views.
Related questions
- Which key verifies a Solana shred signature?
- The receiver uses the identity public key of the validator scheduled to lead the claimed slot. Verifying under an arbitrary key is insufficient. The leader schedule must match the intended cluster and remain current across schedule boundaries, while the shred version supplies an additional early cluster-lineage check.
- What bytes does a legacy shred sign?
- 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.
- What does a Merkle shred sign?
- A Merkle shred carries the leader's signature over the FEC set's Merkle root. The receiver reconstructs that root from the packet's leaf material, canonical position, and sibling proof. Verification must check both packet membership under the root and the Ed25519 signature under the expected leader key.
- Is the UDP source address enough to trust a shred?
- 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.
- Can two conflicting shreds both have valid signatures?
- Yes. A leader can authenticate conflicting packet bodies or different Merkle roots for the same shred identity or FEC anchor. Signature verification attributes both claims but cannot choose between them. Receivers must isolate the views, retain bounded evidence, and avoid combining their bytes during recovery or ledger assembly.
Read next
Ready to build against this? The documentation covers the implementation.