rkvc is a library for building anonymous credentials from algebraic MACs, based on the techniques described in Revisiting Keyed-Verification Anonymous Credentials, and in prior works1.
The project consists of several components:
-
src/: Core library implementationattributes.rs: Attributes system for credential datacmz.rs: CMZ credential scheme implementationhash.rs: Cryptographic hashing utilitiespederson.rs: Pedersen commitment schemerange.rs: Range proofs with Bulletproofszkp.rs: Zero-knowledge proof primitives
-
derive/: Procedural macros for attribute definitions -
examples/: Sample implementations demonstrating library usage
- Rust 1.85 or later
cargo expandis required for macro testscargo install --locked cargo-expand
cargo buildcargo test --workspaceWhen developing the macro implementation, test vectors can be updated with the following command.
TRYBUILD=overwrite MACROTEST=overwrite cargo test -p rkvc-derive
Examine the changes and check commit them with git if they are as expected.
# Code linting
cargo clippy
# Code formatting
cargo fmtdefault: Includesderivefeaturederive: Enables derive macros for attributesstd: Standard library support (disabled by default for no_std compatibility)
Several examples are provided to demonstrate library usage:
- expiration.rs: A simple credential with an ID and expiration time.
- lox.rs: Example implementation of Lox.
- ooni.rs: Example implementation targeting the use case of OONI.
Run examples with:
cargo run --manifest-path examples/Cargo.toml --bin ${EXAMPLE:?}Footnotes
-
TODO: List prior works e.g. CMZ'14 and BBDT'16 ↩