vauban_claim/lib.rs
1//! # Vauban Claim Algebra — reference implementation
2//!
3//! Implements `draft-vauban-claim-algebra-00` (IETF Internet-Draft).
4//! See `specs/draft-vauban-claim-algebra-00.md` for the full specification
5//! and `specs/cddl/claim.cddl` for the normative grammar.
6//!
7//! ## Claim sextuplet
8//!
9//! Every Vauban Claim is the irreducible 6-tuple
10//! `(Subject, Predicate, Evidence, TemporalFrame, RevelationMask, Anchor)`.
11//!
12//! ## Six non-negotiable properties
13//!
14//! 1. **Auditable** — full chain of custody, queryable post-hoc.
15//! 2. **Verifiable** — independently verifiable without product access.
16//! 3. **Composable** — five operators (∧, →, ⊕, ▷, ¬) form a closed algebra.
17//! 4. **Privacy-preserving** — selective disclosure with Poseidon commitments.
18//! 5. **Post-quantum** — STARKs only; SNARKs explicitly excluded.
19//! 6. **Sovereignty-preserving** — exit plan documented per dependency.
20//!
21//! ## Scope (v0.1.0)
22//!
23//! Encoding/decoding (CBOR canonical RFC 8949 §4.2.1, JSON), structural
24//! invariants, the five composition operators with their algebraic and
25//! validity rules, and ≥85 conformance test vectors. Cryptographic
26//! verification of `Evidence` payloads (STARK / BBS+ / SD-JWT-VC / mdoc
27//! / TEE) and on-chain `Anchor` resolution are deferred to subsequent
28//! crates per the architecture: this crate is the *grammar* and *algebra*,
29//! not the prover or the verifier core.
30
31#![cfg_attr(not(feature = "std"), no_std)]
32#![deny(unsafe_code)]
33#![warn(missing_docs)]
34
35extern crate alloc;
36
37pub mod builder;
38pub mod claim;
39pub mod codec;
40pub mod composition;
41pub mod error;
42pub mod primitives;
43pub mod transcript;
44pub mod validator;
45#[cfg(feature = "poseidon")]
46pub mod poseidon;
47#[cfg(feature = "transcript-v2")]
48pub mod transcript_v2;
49
50pub use crate::builder::ClaimBuilder;
51pub use crate::claim::{Claim, ClaimRef, ClaimRefAlg};
52pub use crate::composition::{
53 ClaimComposition, CompositionRecord, OperatorBody, OperatorTag,
54};
55pub use crate::error::{CompositionError, EncodingError, TranscriptError};
56pub use crate::validator::{validate, ValidationReport, Violation};
57#[cfg(feature = "transcript-v2")]
58pub use crate::transcript_v2::TranscriptVersion;
59#[cfg(feature = "transcript-v2")]
60pub use crate::claim::TranscriptResult;
61pub use crate::primitives::{
62 anchor::{Anchor, AnchorEntry, AnchorType},
63 evidence::{Evidence, EvidenceEnvelope, EvidenceScheme, StarkProofEnvelope},
64 predicate::{EncodedMembership, EncodedRange, Predicate, PredicateType},
65 revelation_mask::{CommittedField, HashAlgTag, RevelationMask},
66 subject::{Subject, SubjectId, SubjectType},
67 temporal::TemporalFrame,
68};