A pure-Rust port of selected components from the Haskell
cardano-base project. The workspace
provides cryptographic primitives (VRF, KES, DSIGN), Cardano-specific slotting utilities,
CBOR serialisation helpers, and strictness libraries that underpin Rust services in the
Cardano ecosystem.
- Cryptography: Ed25519, Ed25519 (mlocked), ECDSA secp256k1, Schnorr secp256k1, and
Praos VRF implementations in
cardano-crypto-class. - Key Evolving Signatures:
SingleKes,Sum{0-7}Kes, and compact variants with Blake2b hashing and serialisation helpers. - VRF reference implementation ✅: Draft-03 and Draft-13 VRFs over Curve25519 in
cardano-vrf-purewith byte-for-byte parity to Cardano libsodium. SeeVRF_PARITY_COMPLETE.md. - CBOR tooling: Strict CBOR serialisation with tag-24 helpers in
cardano-binary. - Slotting primitives: Epoch and time arithmetic in
cardano-slotting. - Strictness utilities: Strict containers,
NoThunks,NFData, and deriving helpers for predictable evaluation.
Prerequisites: Rust 1.70 or newer with cargo, installed via
rustup.
cargo build --workspace
cargo test --workspace
cargo fmt --all
cargo clippy --workspace --all-targets -- -D warningsThe full test suite includes VRF and KES golden tests that depend on vectors in
test_vectors/.
The repository ships with .devcontainer/devcontainer.json, preloading the
mcr.microsoft.com/devcontainers/base:bookworm image and the official Rust feature.
To (re)build the environment in VS Code:
- Install the Dev Containers extension.
- Open the command palette and choose
Dev Containers: Rebuild and Reopen in Container. - Wait for the Rust toolchain to install automatically (no manual
rustupsteps required).
The container bundles the same tool versions used in CI, ensuring repeatable
cargo builds and tests.
Authoritative documentation lives under docs/:
- Architecture overview
- Cryptography reference
- Development: testing checklist
- Development: release checklist
Comprehensive audit documentation comparing this Rust implementation with the official Haskell cardano-base:
- Audit Report - Detailed comparison and accuracy assessment
- Compatibility Matrix - Algorithm-by-algorithm compatibility
- Missing Features - Tracking of unimplemented features
- Action Plan - Prioritized recommendations and timeline
Security and conduct policies remain at the repository root:
SECURITY.md and CODE-OF-CONDUCT.md.
| Crate | Description |
|---|---|
cardano-crypto-class |
Cryptographic primitives, secure memory, hashing |
cardano-vrf-pure |
Curve25519 VRF implementations |
cardano-binary |
CBOR serialisation helpers |
cardano-slotting |
Epoch and slot arithmetic |
cardano-base |
Feature-flag wiring |
cardano-strict-containers |
Strict container types |
deepseq, nothunks |
Evaluation traits |
measures, heapwords |
Measurement helpers |
base-deriving-via, orphans-deriving-via |
Deriving utilities |
cardano-git-rev |
Embeds build git revision |
See docs/architecture.md for crate relationships and feature flags.
Please read CONTRIBUTING.md for workflow guidance. Pull requests
should:
- Update documentation alongside code changes where relevant.
- Pass
cargo fmt,cargo clippy, and the full test suite shown above. - Include new tests or vectors when introducing cryptographic behaviour changes.
Security-sensitive reports should follow SECURITY.md.
Dual-licensed under the Apache License, Version 2.0 and the MIT license. See
LICENSE and NOTICE for details.