| Crates.io | tenzro-ledger |
| lib.rs | tenzro-ledger |
| version | 0.1.0 |
| created_at | 2024-12-30 16:39:55.442616+00 |
| updated_at | 2024-12-30 16:39:55.442616+00 |
| description | A quantum-resistant distributed ledger with hardware-rooted security |
| homepage | |
| repository | https://github.com/tenzro/tenzro-ledger |
| max_upload_size | |
| id | 1499284 |
| size | 59,530 |
A quantum-resistant distributed ledger system with hardware-rooted security. This implementation focuses on core ledger functionality with post-quantum cryptography and hardware security integration.
Add this to your Cargo.toml:
[dependencies]
tenzro-ledger = "0.1.0"
git clone https://github.com/tenzro/tenzro-ledger
cd tenzro-ledger
cargo build --release
The ledger provides both interactive and command-line modes.
cargo run
# Or after installation:
tenzro-ledger interactive
Available commands in interactive mode:
add <data> - Add a new transaction with the specified data
list - List all transactions
help - Show help message
quit/exit - Exit the program
Example session:
> add Hello, Tenzro!
Transaction added successfully. ID: 123e4567-e89b-12d3-a456-426614174000
> add This is transaction #2
Transaction added successfully. ID: 987fcdeb-51d3-12d3-a456-426614174000
> list
Transactions:
ID: 123e4567-e89b-12d3-a456-426614174000
Timestamp: 2024-12-30 10:30:00 UTC
Data: Hello, Tenzro!
ID: 987fcdeb-51d3-12d3-a456-426614174000
Timestamp: 2024-12-30 10:30:05 UTC
Data: This is transaction #2
Previous Transaction: 123e4567-e89b-12d3-a456-426614174000
# Add a transaction
tenzro-ledger add "Hello, Tenzro!"
# List all transactions
tenzro-ledger list
# Show help
tenzro-ledger --help
use tenzro_ledger::Chain;
fn main() -> tenzro_ledger::Result<()> {
// Create a new chain
let mut chain = Chain::new("My Ledger".to_string());
// Add transactions
let tx_id = chain.add_transaction(b"Hello, Tenzro!".to_vec())?;
println!("Added transaction: {}", tx_id);
// Verify a transaction
let tx = chain.get_transaction(&tx_id).unwrap();
assert!(chain.verify_transaction(tx)?);
// Get all transactions
let transactions = chain.get_all_transactions();
for tx in transactions {
println!("Transaction {} - Data: {}",
tx.id,
String::from_utf8_lossy(&tx.data));
}
Ok(())
}
Tenzro Ledger uses the Dilithium digital signature algorithm from the pqcrypto family of crates. Dilithium is a lattice-based signature scheme that is considered resistant to attacks from both classical and quantum computers.
The system includes placeholders for hardware security integration through the HardwareAttestation interface. This allows system integrators to implement their own hardware security module (HSM), Trusted Platform Module (TPM), or secure enclave interactions.
Example hardware integration points:
Each transaction includes:
# Run all tests
cargo test
# Run tests with output
cargo test -- --nocapture
# Run specific test
cargo test test_name
git checkout -b feature/feature)git commit -am 'Add feature')git push origin feature/feature)This software includes post-quantum cryptographic algorithms but has not undergone a formal security audit. Users should:
This project is licensed under the Apache License, Version 2.0 - see the LICENSE file for details.
pqcrypto family of crates for post-quantum cryptography