Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
zk-encryption-circuits
The post-quantum channel as one building block for noir-zk pipelines: the circuits, the wallet library that seals and opens what they seal, and the mapping between the two. A target project depends on this crate alone.
What the layer is
Circuits (circuits/manifest.toml, frozen by noir-zk freeze --library zk-encryption@0.1.3, bytecode bundled: no packs, no download):
| family | circuit | record | what it does |
|---|---|---|---|
channel/session |
channel_session |
[ctx, C_t, E.x, E.y, tag, ct_commitment], all public, no link |
The channel's key agreement: the handshake KEM against the receiver's keys (Grumpkin DH plus the lattice encryption over its ML-KEM-768 key) on a handshake, against a throwaway key on a ratchet transfer, so every transfer has one shape; C_t = H(COMMIT, S_t). ctx is a public input it passes through: the envelopes and the transfer are bound to it by the kernel. |
channel/envelope |
channel_envelope |
[payload_commitment, ctx, C_t, domain, c × 6]; link in PayloadCommitment, bound to the session's ctx and C_t, domain pinned to "pq-ratchet/key-payload/v1", publishes c_id0..5 |
Seals a six-field payload (DG1's plaintext) whose hiding commitment a previous step left as the link: K = H(KEY, S_t, ctx, domain), c = Duplex(K, C_t, ctx, payload). |
channel/note_envelope |
channel_envelope |
the same, domain pinned to "pq-ratchet/key-note/v1", publishes c_note0..5 |
The same circuit sealing a note opening. |
One envelope circuit, two families: the payload domain is an input the app writes into its record, and each family pins it with a constant binding (bind_const) the kernel enforces, so the sender doesn't choose it, the two envelopes of one transfer never share a keystream, and a pipeline that would fold the circuit twice under one domain is refused at build (noir-zk codegen).
Wallet library (wallet: zk-encryption re-exported): Sender (accept a bundle, handshake, advance), Receiver (keys, windows, scan), Bundle, Payload<N> with Ratchet::{payload_commitment, seal_payload, open_payload}, the Envelope event, Dg1 and NoteOpening as payloads, serde persistence behind the serde feature. zk-encryption stays a standalone crate (no circuits, no noir-zk dependency) for wallets that only need the crypto.
Mapping (session, envelope): session::inputs(&ChannelWitness, ctx) and envelope::inputs(domain, payload, salt, ctx, s) render the circuits' Prover.toml; session::Outputs { ctx, c_t, e_x, e_y, tag, ct_commitment } (read from a pipeline's typed outputs) plus the carried lattice ciphertext and the envelopes' outputs give the Envelope event a receiver scans (Outputs::envelope(ct, c_note, c_id), which checks ct against ct_commitment).
In a pipeline
[[]] # in the combining registry's manifest
= "channel"
= "session"
= "zk-encryption-circuits" # the wrapped registry: `noir_zk_codegen::wrapped(LIBRARY, REGISTRY, FAMILIES)`
[[]]
= "transfer_only"
= ["zk-encryption-circuits/channel/session", "emit-circuits/emit/transfer", "zk-encryption-circuits/channel/note_envelope"]
use ;
use ;
let pool = new;
let = fold?
.app?
.app? // bound to ctx; leaves the note commitment
.app?
.hiding?;
let o = verify?;
let event = Outputs
.envelope?;
The session must come before any position bound to ctx/C_t; the envelope's link is the payload commitment the previous linking step left (a document step for DG1, the transfer for the note), so the DG1 envelope follows the document step and precedes the transfer.
Layout
circuits/manifest.toml,resources/: the frozen registry (written bynoir-zk freeze; the families are hand-written and kept).assets/: the bundled bytecode (written by freeze,include_bytes!through codegen).src/lib.rs:circuits(generated),wallet,artifacts,session,envelope.