SyncWave

Bootstrap a fresh node by downloading an untrusted state snapshot and verifying it cryptographically against a checkpoint block header. The peer is a pipe; the header is the anchor; the hash check is the proof.

Read Research Paper (PDF)

1. Formal Definition

A SyncWave bootstrap is a transfer protocol between two nodes: a serving node with full state at some block, and a fresh node with empty state. The protocol succeeds if and only if the fresh node ends with state whose SMT root matches the checkpoint header's account_commitment.

Bootstrap protocol: (Server, Client) → { accept, reject }

Definition 1.1 (SyncWave snapshot)

  A SyncWave snapshot S for block B is a tuple:

    S = ( metadata, smt_nodes, account_states )

  where:
    metadata.block_hash      = B
    metadata.account_root    = B.account_commitment
    metadata.total_smt_nodes = |smt_nodes|
    metadata.total_accounts  = |account_states|
    metadata.chunk_size      = entries per chunk
    metadata.total_chunks    = ceil((total_smt_nodes + total_accounts) / chunk_size)

  smt_nodes      : [(H256, SyncWaveNode)]  -- content-addressed
  account_states : [(H256, SyncWaveState)]  -- content-addressed

Definition 1.2 (Verification)

  Verify(S) = ⊤  ⟺
    (∀(h, node) ∈ smt_nodes : node.content_hash() = h)
    ∧ (Walk(B.account_commitment, smt_nodes) resolves all references)
    ∧ (visited_count = total_smt_nodes)
    ∧ (∀(h, state) ∈ account_states : state.content_hash() = h)

  If Verify(S) = ⊤, then the SMT reconstructed from smt_nodes
  hashes to account_root, and therefore equals the state committed
  by B.

Definition 1.3 (Client trust anchor)

  The client trusts exactly one input: block header H_B, verified
  independently (PoW + DAG ordering). All other inputs — every peer,
  every chunk, every state — are untrusted and verified locally.

The protocol is safe if and only if the client verifies the header before starting the download. A client that trusts an unverified header is trusting whichever snapshot the peer chose to serve — the cryptographic check provides no protection without a trusted anchor.

2. The Bootstrap Problem

A fresh node has empty state. To validate new blocks it must reconstruct the current state — every balance, every account — from somewhere. Two naive approaches exist, both fail:

Approach 1: Replay from genesis

  Cost:   hours to days, growing with chain length
  Trust:  zero
  Failure mode: the replay window never closes on a
                growing chain

Approach 2: Trust a peer's state

  Cost:   seconds
  Trust:  full (the peer can lie arbitrarily)
  Failure mode: peer can fabricate balances, omit
                accounts, or serve a stale fork

Approach 3 (SyncWave): Download untrusted, verify cryptographically

  Cost:   seconds (download) + milliseconds (verify)
  Trust:  only the checkpoint header
  Failure mode: none — cryptographic verification rejects
                any snapshot that doesn't match the root

The insight: state is content-addressed. An SMT root commits to a specific set of leaves. Any peer that serves a set of leaves producing that root has served the state at that root — whether or not it is honest. The peer's honesty is irrelevant.

3. The Snapshot Structure

pub struct SyncWaveSnapshot {
    pub metadata:       SyncWaveMetadata,
    pub smt_nodes:      Vec<(H256, SyncWaveNode)>,
    pub account_states: Vec<(Hash, SyncWaveState)>,
}

pub struct SyncWaveMetadata {
    pub block_hash:      Hash,     // checkpoint block
    pub block_height:    u64,      // DAG blue score
    pub account_root:    Hash,     // == header.account_commitment
    pub total_smt_nodes: u64,
    pub total_accounts:  u64,
    pub chunk_size:      u32,
    pub total_chunks:    u32,
}

pub enum SyncWaveNode {
    Leaf   { key: H256, value: H256 },
    Branch { left: H256, right: H256 },
}

pub struct SyncWaveState {
    pub balance:        u64,
    pub recent_flashes: Vec<SyncWaveFlashEntry>,
}

Every node's key is its content-address, computed as:

Leaf address:   Poseidon2("SAHYADRI_SMT_LEAF_V1"   ‖ key ‖ value)
Branch address: Poseidon2("SAHYADRI_SMT_BRANCH_V1" ‖ left ‖ right)

Domain prefixes prevent second-preimage attacks that would otherwise
allow a leaf hash to be substituted for a branch hash. Enforced at
the crate level.

4. Transfer Protocol

The transfer is metadata-first. The client fetches a few hundred bytes of metadata before committing to a transfer that may be hundreds of megabytes.

Server side (per snapshot request):

  export(block_hash) → SyncWaveSnapshot

    - Fetch block header from headers_store
    - Extract account_commitment (SMT root)
    - DFS from root, collecting all reachable SMT nodes
    - For each leaf, fetch AccountState from account_states_store
    - Return snapshot + metadata

Client side (bootstrap flow):

  1. get_sync_wave_metadata(block_hash) → metadata
  2. Verify checkpoint header H_B independently (PoW + DAG)
  3. Check: metadata.account_root == H_B.account_commitment
  4. download_sync_wave_chunk(block_hash, i) for i in 0..total_chunks
  5. Reassemble snapshot, run Verify(S)
  6. If Verify(S) = ⊤: insert into local stores
  7. Resume sync from H_B forward to current tip

The header verification in step 2 is the client's only trusted input. Everything else is data that either verifies or is rejected.

5. Verification Algorithm

Verification runs locally. It makes no network calls and requires only the snapshot and the trusted root.

Algorithm 5.1 (Verify)

  Input:  snapshot S = (metadata, smt_nodes, account_states)
  Output: accept or reject

  Step 1: Content-address check

    for (h, node) in S.smt_nodes:
        if node.content_hash() ≠ h:
            return reject

  Step 2: Walk from root

    visited = {}
    walk(S.metadata.account_root, S.smt_nodes, visited)

    walk(h, nodes, visited):
        if h ∈ visited: return
        visited.add(h)
        match nodes[h]:
            Leaf(k, v): return
            Branch(l, r):
                walk(l, nodes, visited)
                walk(r, nodes, visited)

  Step 3: Count check

    if |visited| ≠ S.metadata.total_smt_nodes:
        return reject

  Step 4: State content-hash check

    for (h, state) in S.account_states:
        if state.content_hash() ≠ h:
            return reject

  return accept

Each step defends against a specific attack:

Step 1 defends against:  A node whose bytes have been corrupted in transit.
                         The corrupt node's hash won't match its key.

Step 2 defends against:  A snapshot that references a node it didn't include.
                         Any dangling reference halts the walk with a
                         missing-node error.

Step 3 defends against:  A snapshot that declares more nodes than it carries.
                         The declared count must equal the visited count.

Step 4 defends against:  A state whose bytes don't match its committed value.
                         State hash binds each account to a specific
                         leaf value in the tree.

6. Atomic Load

Once verified, the snapshot is inserted into local stores. The design is crash-safe: a node killed mid-load should not require a full re-download.

load(S):

    // SMT nodes — content-addressed, so writes are idempotent
    for (h, node) in S.smt_nodes:
        smt_nodes_store.insert_sync(h, node)

    // Account states — content-addressed by state hash
    for (h, state) in S.account_states:
        account_states_store.insert_sync(h, state)

    // Root mapping — non-idempotent, wrapped in a write batch
    batch = WriteBatch()
    account_roots_store.insert_batch(batch, S.metadata.block_hash, S.metadata.account_root)
    db.write(batch)

Nodes and states are content-addressed: writing (h, v) twice is a no-op. A crash leaves a partial but self-consistent store. Re-running completes it. The root mapping is the only non-idempotent write, wrapped in a batch so it either lands fully or not at all.

7. RPC Endpoints

get_sync_wave_metadata(
    block_hash: Option<Hash>,     // defaults to current tip
) -> {
    block_hash:      Hex,
    block_height:    u64,
    account_root:    Hex,
    total_smt_nodes: u64,
    total_accounts:  u64,
    chunk_size:      u32,
    total_chunks:    u32,
}

download_sync_wave_chunk(
    block_hash:  Hash,
    chunk_index: u32,
) -> {
    data:         Vec<u8>,     // bincode(SyncWaveChunkWire)
    chunk_index:  u32,
    total_chunks: u32,
}

Both are read-only. Both are available on any full node that retains state at the requested block. No consensus interaction, no state mutation, no mining impact.

8. CLI

sahyadrid     --sync-wave grpc://seed-node:27113     --sync-wave-checkpoint <hash>      # optional

  --sync-wave <URL>              Bootstrap from this peer
  --sync-wave-checkpoint <hash>  Load this checkpoint (defaults to peer tip)

Behavior:
  - Bootstrap runs before RPC and P2P ports open
  - On success: node is synced to the checkpoint by the time it serves
  - On failure: process exits with a clear error, no partial state

First-run only. Subsequent restarts use local stores.

9. Measured Behavior

SyncWave has been observed end-to-end on a local 2-node testnet. The measurements below are from a specific configuration. Larger state would change the download cost; verification cost is dominated by disk I/O, not tree traversal.

Test configuration:

  Node A: mining node, DAG height 258, producing blocks at 1 BPS
  Node B: fresh node, empty data directory
  Environment: 16 GB RAM, local gRPC on 127.0.0.1
  State size: 5 SMT nodes, 2 account states (~200 bytes)

Measured phases:

  gRPC handshake:                  ~4 ms
  Fetch metadata:                  ~1 ms
  Download chunk (5 + 2 entries):  ~1 ms
  SMT verification:                < 1 ms
  Atomic load:                     < 1 ms
  ─────────────────────────────────────
  Total bootstrap time:            ~10 ms

Verification result: PASS
  Node B's reconstructed root == Node A's checkpoint root at height 258.

The verification pass is cryptographic evidence that state was transferred intact — not merely that transfer completed. If any node, any state, or any reference had been corrupted or fabricated, verification would have failed.

10. Scaling Projections

The 10 ms measurement above is for a minimal state. The scaling table below is a projection, not a measurement. It assumes linear state growth with account count and consumer download bandwidth as the dominant cost.

Network scale    Accounts    Est. payload   Est. bootstrap   Status

Devnet           10          ~1 KB          < 50 ms          Measured pattern
Testnet          10,000      ~1 MB          < 500 ms         Projected
Production       1,000,000   ~100 MB        ~10 s            Projected
Large-scale      10,000,000  ~1 GB          ~100 s           Projected

Assumptions for projection:

  - Payload scales linearly with account count (~100 bytes/account)
  - Download at 10 MB/s consumer bandwidth (dominant cost)
  - Verify remains O(depth), < 1 s at production scale
  - Load remains O(payload), dominated by disk writes

These are projections. Independent benchmarking at production scale
is planned and will be published separately.

The key invariant — verification cost is O(depth), independent of state size — is what makes the projection plausible. Tree traversal touches one path per leaf, but the total work is linear in the number of leaves times the path length, which for a balanced tree is O(n · log n). Download of the leaf set dominates at scale.

11. Security Analysis

The threat model is simple: the client trusts exactly one input (the verified checkpoint header) and verifies everything else.

Threat                           Mitigation

Forged snapshot (fabricated)     Root committed in PoW-protected header.
                                 Fabrication requires Poseidon2 preimage.

Truncated snapshot (missing)     Walk from root fails on dangling reference.

Inflated metadata (DoS)          Declared node count must equal walk count.

Stale snapshot (old block)       Client binds download to specific block hash.

Malicious peer mid-download      Chunks are self-contained. Bad chunk caught
                                 at reassembly. Client rotates peers.

Replay across forks              Each block has a unique root. Cross-fork
                                 proofs fail reconstruction.

Reorg after checkpoint           Checkpoint chosen deep enough that reorg
                                 past it is improbable. Client falls back
                                 to earlier checkpoint if needed.

Data corruption in transit       Content-addressed nodes: corrupt bytes don't
                                 hash to expected key. Client drops chunk.

The serving peer is not trusted to provide correct state. The client relies on an independently trusted checkpoint hash and the checkpoint source's consensus and finality guarantees. SyncWave verifies the snapshot relative to that checkpoint; it does not independently establish checkpoint finality.

12. Comparison with Full IBD

PropertyFull IBDSyncWave
Data downloadedAll blocks + txs since genesisOne SMT snapshot + headers forward
Bootstrap time (1 BPS)Hours to daysSeconds to minutes
Verification workRe-execute every transactionOne hash comparison per node
Disk requiredFull chain archiveState + headers only
Trust in peersZeroZero
Historical block accessYesNo — only state, not history

SyncWave does not replace full IBD. It makes full IBD optional for operators who do not need to serve historical blocks. Exchanges, hot wallets, and validating full nodes can use SyncWave. Block explorers and historical indexers must continue to run archival nodes.

13. Limitations

What SyncWave does not do, stated plainly:

Not solved:

  1. Historical blocks.
     A SyncWave node does not serve blocks it never downloaded.
     Historical indexers must run full IBD.

  2. Checkpoint trust and stability.
     The checkpoint hash must come from an independent trusted source.
     That source/client must apply the network's consensus and finality
     policy; snapshot verification alone does not establish finality.

  3. Query privacy.
     The peer serving the snapshot learns which accounts the
     client downloaded. Privacy requires blinded snapshots,
     outside current scope.

  4. State-only transfer.
     Transaction history is not part of a snapshot. A node that
     needs history must run full IBD.

  5. Serving peer's state.
     The peer must have retained state at the requested block.
     A pruning node may have discarded old SMT nodes.

  6. Header trust anchor.
     A client that doesn't verify headers is trusting whichever
     header it was given. SyncWave's security is relative to
     the client's header verification.

14. Archival Node Requirement

SyncWave requires at least one serving node with state at the checkpoint block. This is what archival nodes provide.

Archival node:

  - Retains full chain and full state history
  - Serves SyncWave snapshots for any historical checkpoint
  - Storage grows with chain (GB to TB over years)
  - Any operator can run one (no permission required)
  - Network benefits from geographic diversity (3+ continents)

Command:

  sahyadrid --archival

A network with no archival nodes cannot serve SyncWave. A network
with one archival node can serve all fresh nodes. Two or more
provide geographic resilience.

15. Summary

SyncWave collapses fresh-node bootstrap from hours of full IBD to seconds of verified download. The mechanism is cryptographic: the snapshot is verified against the checkpoint header, not trusted because a peer served it. The peer has zero trust weight; the header is the only trust anchor.

Measured bootstrap on a local 2-node testnet with 5 SMT nodes and 2 accounts: ~10 ms end-to-end. Projections at production scale (1 million accounts, ~100 MB snapshot, ~10 s bootstrap) assume linear download scaling. Verification work grows with the supplied snapshot: the verifier checks SMT nodes, traverses the reachable tree, and validates account and DID state entries. Production-scale performance requires benchmarking with realistic state sizes.

The protocol assumes the client has an independently trusted checkpoint hash. Without that, snapshot verification proves only that the snapshot matches the supplied header, not that the header is valid or finalized. Checkpoint validity and finality are the load-bearing trust assumptions; snapshot verification establishes consistency with that checkpoint.