cardano-base-rust

cardano-base

100% Pure Rust Tests Zero C Dependencies Security Hardened

Complete Haskell β†’ Rust Migration: βœ… DONE

This repository contains the pure Rust foundations that back Cardano’s consensus components. The migration from Haskell to Rust is 100% complete, with all C and Haskell code removed.

πŸ”’ Security Update: Comprehensive security hardening completed (Oct 2025). See IMPROVEMENTS_SUMMARY.md for details.

πŸ“š Documentation

Comprehensive documentation is available in the GitHub Wiki

Quick links:

🎯 Pure Rust Achievement

This project has achieved 100% pure Rust with:

πŸ“¦ Workspace Packages

Core Cryptographic

Core Data & Serialization

Utilities

Each package includes comprehensive documentation, unit tests, and integration tests.

πŸš€ Quick Start

Building

Install a stable Rust toolchain (rustup) and build:

# Build all packages
cargo build --workspace

# Build with optimizations
cargo build --workspace --release

Testing

Run the comprehensive test suite (148 tests):

# All tests
cargo test --workspace

# Specific package
cargo test --package cardano-vrf-pure

# With output
cargo test --workspace -- --nocapture

Documentation

Generate and view documentation:

# Generate docs for all packages
cargo doc --workspace --no-deps --open

# Specific package
cargo doc --package cardano-crypto-class --open

πŸ” VRF Implementation

The pure Rust VRF implementation (cardano-vrf-pure) provides:

See VRF API Documentation for detailed usage.

πŸ› οΈ Development

All packages target Rust edition 2021 and follow standard Rust conventions:

# Check code
cargo check --workspace

# Format code
cargo fmt --all

# Lint code (with security-focused checks)
cargo clippy --workspace --all-targets -- -D warnings

# Security audit
cargo audit

# License/dependency checking
cargo deny check

Code Quality

The workspace enforces strict quality standards:

See SECURITY_PRACTICES.md for security guidelines and PRE_COMMIT_CHECKLIST.md for commit requirements.

🀝 Contributing

We welcome contributions! Please see:

πŸ“„ License

This project is dual-licensed under Apache-2.0 and MIT licenses. See LICENSE files in individual packages for details.

πŸŽ‰ Migration Complete

The Haskell β†’ Rust migration is complete! All functionality has been successfully ported to pure Rust with enhanced type safety, memory safety, and performance.