Skip to main content

librustzcash Onboarding

Automatically generated content

This documentation is automatically generated using Claude Code. Errors, omissions, and inaccuracies may have been introduced during generation. Treat every claim as a starting point for your own reading of the source, not as authoritative.

The code is the law, always. When in doubt, refer to:

If you spot an error, please open an issue or a pull request on the onboarding branch.

A graduate-level reading course on librustzcash, with strong focus on the cryptography. Each chapter combines protocol theory (with LaTeX math), pointers into the actual Rust code in the workspace, and references to the canonical specifications (ZIPs, the Zcash Protocol Specification, original papers).

The chapters are ordered as a study plan: you can read them in sequence, but each is also written to be useful on its own as a reference once you know your way around.

How to read this course

LaTeX is rendered via KaTeX (configured in this site). The math is the substance of the chapters, not decoration.

Every chapter has the same skeleton:

  1. Motivation in 3-5 sentences.
  2. The math: definitions, equations, security games.
  3. The implementation: which crates, which modules, which functions.
  4. Pointers to the spec (ZIPs, protocol PDF) and seminal papers.
  5. Exercises with answers in the code.

Chapters

The course splits into three parts. Part I is the reading course (narrative). Part II goes deeper into bugs, side channels, audits, and operational rigour. Part III is authoritative reference material (key catalog, circuit walk-through).

Part I - Reading course

#TitleFocus
01Overview and roadmapCrate graph, layering, how the pieces fit
02Zcash protocol foundationsConsensus, value pools, network upgrades, transaction shape
03Cryptography primerGroups, pairings, Pedersen, BLAKE2, RedDSA, ZK primer
04Sprout and SaplingJoinSplit math, Sapling Spend/Output, Jubjub, BLS12-381, Groth16
05Orchard and Halo 2Pointer chapter. The technical material lives in the dedicated orchard and halo2 courses.
06Keys, addresses, ZIP 32, unified addressesHD derivation, viewing keys, F4Jumble
07Transactions, sighash, builder, PCZTv4/v5/v6 layout, sighash trees, PCZT roles
08Note encryptionIn-band secret distribution, OutCiphertext, KDF
09Equihash and consensus rulesGeneralised birthday, history tree, PoW math
10Wallet stackclient_backend, scanning, fees, SQLite storage
11Study plan and exercisesWeek-by-week schedule with self-tests

Part II - Deep dives and operational rigour

#TitleFocus
12Historical bugs and security incidents2018 counterfeit bug, ZIP 212, audit findings catalog
13Cofactors, subgroups, canonical encodingsJubjub cofactor 8, ZIP 216, subgroup checks
14Side channels and constant-timesubtle, zeroize, vartime APIs to avoid
15Trusted setup ceremoniesPowers of Tau, Sapling MPC, toxic waste, Halo 2 alternative
16Pedersen hash deep diveWindowed encoding, generators, constraint counts
17Halo 2 deep divePointer chapter. The technical material lives in the dedicated halo2 course.
18Anonymity set and metadataPrivacy beyond cryptography: behaviour, network, dummies
19ZIP catalog and reading orderCurated index of the ZIPs you must know
20Audits and cross-implementation testingPublic audit reports, test vectors, Zebra / zcashd parity
21Active research and the road to NU7v6 tx, ZSAs, ZIP 233 burn, recursion, PQ
22Cryptographer's code review checklistThe operational checklist for every crypto PR

Part III - Authoritative references

#TitleFocus
23The complete key catalogEvery key symbol defined, derived, typed, and located in code
24Circuits, constraint by constraintSapling Spend, Sapling Output, Orchard Action: every clause with its constraint count and the attack each clause prevents

Notation used throughout

  • Fp\mathbb{F}_p: a prime field of order pp.
  • G\mathbb{G}: a cyclic group of prime order qq written additively.
  • [k]P[k]P: scalar multiplication of point PP by scalar kk.
  • H()H_\ell(\cdot): a hash function with output length \ell bits.
  • ,\langle \cdot, \cdot \rangle: a pairing e:G1×G2GTe : \mathbb{G}_1 \times \mathbb{G}_2 \to \mathbb{G}_T when used in pairing contexts.
  • Com(m;r)\mathsf{Com}(m; r): a commitment to message mm with randomness rr.
  • Enck,Deck\mathsf{Enc}_k, \mathsf{Dec}_k: symmetric encryption/decryption with key kk.
  • \stackrel{\}{\leftarrow}$: uniform random sampling.
  • aba \mathbin{\|} b: byte-string concatenation.

Canonical references