cardano-base-rust
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.
Highlights
- Cryptography: Ed25519 (standard and mlocked) parity complete; ECDSA secp256k1 & Schnorr
secp256k1 harnesses passing against embedded vectors (formal cross-language review pending);
Praos VRF parity complete in
cardano-crypto-class and
cardano-vrf-pure.
- Key Evolving Signatures:
SingleKes, Sum{0-7}Kes, and CompactSum{0-7}Kes with Blake2b
hashing, structural + forward-security regressions, serde-gated vectors (tracked periods +
full evolution traces), and boundary/tamper tests in
cardano-crypto-class. Mlocked memory security & perf
benchmarking remain in progress.
- VRF reference implementation ✅: Draft-03 and Draft-13 VRFs over Curve25519 in
cardano-vrf-pure with byte-for-byte parity to Cardano
libsodium. See VRF_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 across the cardano-strict-containers,
base-deriving-via, and orphans-deriving-via
crates.
Build and test
Prerequisites: Rust 1.85 or newer with cargo, installed via
rustup.
cargo build --workspace
cargo test --workspace
cargo fmt --all
cargo clippy --workspace --all-targets -- -D warnings
The full test suite includes VRF and KES golden tests that depend on vectors in
cardano-test-vectors/test_vectors.
Refer to docs/development/testing.md for a curated list of
recommended commands, feature flags, and editor integrations. The repository’s dev
container configuration lives in the workspace-level .devcontainer/ folder when required
for CI parity; if the folder is absent, follow the documented local setup instead.
Documentation
Authoritative documentation lives under docs/:
Status tracking
Progress across parity phases is captured in the repository root:
Security reports should follow the process described in the Cardano engineering handbook
linked from CONTRIBUTING.md; conduct expectations live in
CODE-OF-CONDUCT.md.
Workspace crates
See docs/architecture.md for crate relationships and feature
flags.
Contributing
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 the Cardano engineering handbook guidance linked
from CONTRIBUTING.md.
License
Dual-licensed under the Apache License, Version 2.0 and the MIT license. See
LICENSE and NOTICE for details.
评论