rustywallet
A comprehensive Rust library ecosystem for cryptocurrency wallet utilities. This umbrella crate provides a unified API for all wallet-related operations including key management, address generation, mnemonic handling, hierarchical deterministic wallets, message signing, and blockchain utilities.
Overview
The rustywallet ecosystem consists of modular crates that work together to provide complete cryptocurrency wallet functionality:
- Cryptographic primitives - Secure key generation and management
- Address generation - Support for Bitcoin, Ethereum, and other cryptocurrencies
- Mnemonic phrases - BIP39 compliant seed phrase generation and validation
- HD wallets - BIP32/BIP44 hierarchical deterministic wallet derivation
- Message signing - ECDSA signature creation and verification
- Blockchain utilities - Address validation, bloom filters, and more
Crates
| Crate | Version | Description |
|---|---|---|
| rustywallet-keys | Private and public key management (secp256k1) | |
| rustywallet-address | Bitcoin and Ethereum address generation | |
| rustywallet-mnemonic | BIP39 mnemonic phrase support | |
| rustywallet-hd | BIP32/BIP44 hierarchical deterministic wallets | |
| rustywallet-signer | ECDSA message signing and verification | |
| rustywallet-checker | Address validation and format checking | |
| rustywallet-bloom | Bloom filter implementation for efficient lookups |
Installation
Add this to your Cargo.toml:
[]
= "0.1.0"
Quick Start
The unified API provides easy access to all wallet functionality:
use *;
// Generate a random private key
let key = random;
let pubkey = key.public_key;
// Generate Bitcoin address
let address = from_public_key;
println!;
println!;
Complete Wallet Workflow
use *;
// 1. Generate mnemonic phrase
let mnemonic = generate;
println!;
// 2. Create HD wallet from mnemonic
let seed = mnemonic.to_seed;
let master = from_seed?;
// 3. Derive account key (BIP44: m/44'/0'/0'/0/0)
let path = parse?;
let account_key = master.derive_path?;
// 4. Generate address
let private_key = account_key.private_key;
let public_key = private_key.public_key;
let address = from_public_key;
// 5. Sign a message
let message = "Hello, Bitcoin!";
let signature = sign_message?;
println!;
println!;
Feature Flags
All features are enabled by default. You can selectively enable only the functionality you need:
[]
= { = "0.1.0", = false, = ["keys", "address"] }
| Feature | Description | Dependencies |
|---|---|---|
keys |
Private/public key management | - |
address |
Address generation and validation | keys |
mnemonic |
BIP39 mnemonic phrase support | - |
hd |
HD wallet derivation (BIP32/BIP44) | keys, mnemonic |
signer |
Message signing and verification | keys |
checker |
Address validation utilities | address |
bloom |
Bloom filter implementation | - |
full |
All features (default) | all above |
Individual Crate Usage
You can also use individual crates directly:
[]
= "0.1.0"
= "0.1.0"
Examples
Key Generation
use *;
let private_key = random;
let public_key = private_key.public_key;
let compressed = public_key.serialize_compressed;
Mnemonic Handling
use *;
let mnemonic = generate;
let seed = mnemonic.to_seed;
Address Validation
use *;
let is_valid = validate;
let format = detect_format;
License
Licensed under the MIT License. See LICENSE for details.