Skip to main content

Module sync

Module sync 

Source
Expand description

Sync verification primitives for Zcash light clients.

Pure verification logic with no IO, no wallet state, and no network calls. Every function takes data in and returns a verdict. This is the core of the trust model: the server provides claims, these functions verify them against cryptographic proofs anchored to the hardcoded activation block hash.

§Verification flow

header proof bytes ─→ verify_header_proof() ─→ ProvenRoots
                                                   │
                 ┌─────────────────────────────────┼──────────────────────┐
                 │                                 │                      │
                 ▼                                 ▼                      ▼
  verify_commitment_proofs()        verify_nullifier_proofs()   verify_actions_commitment()
  (received notes exist)            (spent/unspent status)      (block action integrity)

All verification functions return Result<T, ZyncError>. An Err means the server is lying or compromised. The caller MUST abort the sync and not persist any data from this session.

§Memo extraction

extract_enc_ciphertext parses raw V5 transaction bytes to find the 580-byte encrypted ciphertext for a specific action. Memo decryption itself requires orchard key types (version-sensitive), so callers handle try_note_decryption directly using their own orchard dependency.

Structs§

CommitmentProofData
Commitment proof from a server, ready for verification.
CrossVerifyTally
Result of cross-verifying a block hash against multiple endpoints.
NullifierProofData
Nullifier proof from a server, ready for verification.
ProvenRoots
Proven NOMT roots extracted from the ligerito header proof. These are the roots that NOMT merkle proofs must verify against.

Functions§

chain_actions_commitment
Compute running actions commitment for a sequence of blocks.
extract_enc_ciphertext
Extract the 580-byte enc_ciphertext for an action matching cmx+epk from raw tx bytes.
hashes_match
Compare two block hashes, accounting for LE/BE byte order differences between native gRPC lightwalletd (BE display order) and zidecar (LE internal).
verify_actions_commitment
Verify the running actions commitment chain against the proven value.
verify_commitment_proofs
Verify a batch of commitment proofs against proven roots.
verify_header_proof
Validate a header proof and extract proven NOMT roots.
verify_nullifier_proofs
Verify a batch of nullifier proofs against proven roots.