mirror of
https://github.com/luxfi/p3q.git
synced 2026-10-30 15:22:47 +00:00
10 crates wired in dependency order, all building under cargo build
--workspace --all-targets and 43 unit tests passing.
p3q-core protocol types, error model, profile dispatch
p3q-field Field trait + Goldilocks (p = 2^64 - 2^32 + 1)
p3q-sha3 FIPS 202 / SP 800-185: cSHAKE256, KMAC256, TupleHash256
p3q-merkle cSHAKE256-based binary Merkle tree + path verifier
p3q-challenger cSHAKE256 Fiat-Shamir transcript
p3q-fri FRI low-degree-test trait surface
p3q-stark AIR trait + StarkProof envelope
p3q-recursion STARK-native recursion trait (no curve wrappers)
p3q-verifier panic-free verifier dispatch (typed errors only)
p3q-zchain HIP-0078 epoch circuits (register / rotate / revoke /
committee / DKG / epoch commitment)
Strict-PQ profile enforced by scripts/lint_forbidden.sh + CI:
no bn254, kzg, groth16, plonk_kzg, halo, blake3, poseidon,
monolith, rescue in imports or dependency tables.
Signed-off-by: Lux Industries Inc <[email protected]>
2.2 KiB
2.2 KiB
Contributing to P3Q
What we accept
P3Q is a strict-PQ profile and fork of Plonky3 for Lux Z-Chain (HIP-0078). Until the audit gate passes, contributions that align with the strict subset are highest priority:
- cSHAKE256 / KMAC256 / TupleHash256 implementations of the Plonky3 Merkle / FRI / Fiat-Shamir primitives.
- Z-Chain circuits in
crates/p3q-zchain/— validator registration, DKG transcript verification, revocation, committee selection, epoch transition. - Verifier-totality fuzzing — every malformed proof returns a typed error; no panics.
- Constant-time analysis of any verifier path that touches secret-derived state.
- Cross-implementation drift detection — KATs in
vectors/compared against an independent implementation. - Audit-prep — code clarity, comment density on cryptographic invariants, test coverage gates.
What we don't accept
Until after the production audit:
- New polynomial-IOP modes outside STARK / FRI.
- Pairing-based wrappers (KZG, Groth16, PLONK/KZG) for "cheaper classical verification". P3Q's whole point is no classical fallback.
- Elliptic-curve recursion stacks. P3Q recursion is STARK-native only.
- BLAKE3 / Poseidon / Monolith / Rescue hash families. Strict-PQ profile is FIPS 202 / SP 800-185 only.
- Optimisations before the encoding freeze.
Process
- Open an issue first. Discuss the change before implementing.
- One concern per PR. Don't bundle a Merkle change with a verifier change.
- CI gate must pass.
cargo build,cargo test,cargo clippy -- -D warnings,scripts/lint_forbidden.sh. - Sign your commits. Real name in
Signed-off-by. - Patent disclosures attach to commits per Apache 2.0 §3.
Coding standards
- Rust 1.79+, stable only. No
nightlyfeatures. unsafe_code = "deny"workspace-wide. Audited subset.- Every public function in
p3q-verifierhas a constant-time annotation (yes / no / not-applicable + rationale). - No
panic!()inside the verifier path — return typed errors viathiserror. - No
unwrap()/expect()on user-controlled input.
License
By contributing you agree to dual MIT / Apache-2.0 licensing and the patent grant in Apache 2.0 §3.