rustywallet
A comprehensive Rust library for cryptocurrency wallet utilities.
Features
- keys - Private and public key management (secp256k1)
- address - Bitcoin and Ethereum address generation
- mnemonic - BIP39 mnemonic phrase support
- hd - BIP32/BIP44 hierarchical deterministic wallets
- signer - ECDSA message signing and verification
Installation
[]
= "0.1"
Feature Flags
All features are enabled by default. You can disable default features and enable only what you need:
[]
= { = "0.1", = false, = ["keys", "address"] }
| Feature | Description | Dependencies |
|---|---|---|
keys |
Private/public key management | - |
address |
Address generation | keys |
mnemonic |
BIP39 mnemonic phrases | - |
hd |
HD wallets (BIP32/BIP44) | keys |
signer |
Message signing | keys |
full |
All features (default) | all |
Quick Start
use *;
// Generate a random private key
let key = random;
let pubkey = key.public_key;
println!;
println!;
Full Wallet Workflow
use *;
// 1. Generate mnemonic
let mnemonic = generate;
println!;
// 2. Derive seed
let seed = mnemonic.to_seed;
// 3. Create HD wallet
let master = from_seed.unwrap;
// 4. Derive child key (BIP44: m/44'/0'/0'/0/0)
let path = parse.unwrap;
let child = master.derive_path.unwrap;
let privkey = child.private_key.unwrap;
println!;
Sub-crates
This umbrella crate re-exports the following crates:
| Crate | Description |
|---|---|
| rustywallet-keys | Key management |
| rustywallet-address | Address generation |
| rustywallet-mnemonic | BIP39 mnemonics |
| rustywallet-hd | HD wallets |
| rustywallet-signer | Message signing |
License
MIT