1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
//! # rustywallet
//!
//! A comprehensive Rust library for cryptocurrency wallet utilities.
//!
//! This crate provides a unified API for working with cryptocurrency wallets,
//! including key management, address generation, mnemonic phrases, HD wallets,
//! and message signing.
//!
//! ## 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
//!
//! All features are enabled by default. You can disable default features and
//! enable only what you need:
//!
//! ```toml
//! [dependencies]
//! rustywallet = { version = "0.1", default-features = false, features = ["keys", "address"] }
//! ```
//!
//! ## Quick Start
//!
//! ```rust
//! use rustywallet::prelude::*;
//!
//! // Generate a random private key
//! let key = PrivateKey::random();
//! let pubkey = key.public_key();
//!
//! println!("Private key: {}", key.to_hex());
//! println!("Public key: {}", pubkey.to_hex(PublicKeyFormat::Compressed));
//! ```
//!
//! ## Full Wallet Workflow
//!
//! ```rust,ignore
//! use rustywallet::prelude::*;
//!
//! // 1. Generate mnemonic
//! let mnemonic = Mnemonic::generate(WordCount::Words12);
//! println!("Mnemonic: {}", mnemonic.phrase());
//!
//! // 2. Derive seed
//! let seed = mnemonic.to_seed("");
//!
//! // 3. Create HD wallet
//! let master = ExtendedPrivateKey::from_seed(seed.as_bytes(), HdNetwork::Mainnet).unwrap();
//!
//! // 4. Derive child key (BIP44: m/44'/0'/0'/0/0)
//! let path = DerivationPath::parse("m/44'/0'/0'/0/0").unwrap();
//! let child = master.derive_path(&path).unwrap();
//! let privkey = child.private_key().unwrap();
//!
//! println!("Private key: {}", privkey.to_hex());
//! println!("Public key: {}", privkey.public_key().to_hex(PublicKeyFormat::Compressed));
//! ```
//!
//! ## Module Overview
//!
//! | Module | Feature | Description |
//! |--------|---------|-------------|
//! | [`keys`] | `keys` | Private/public key management |
//! | [`address`] | `address` | Address generation (Bitcoin, Ethereum) |
//! | [`mnemonic`] | `mnemonic` | BIP39 mnemonic phrases |
//! | [`hd`] | `hd` | BIP32/BIP44 HD wallets |
//! | [`signer`] | `signer` | Message signing and verification |
// Re-export sub-crates
pub use rustywallet_keys as keys;
pub use rustywallet_address as address;
pub use rustywallet_mnemonic as mnemonic;
pub use rustywallet_hd as hd;
pub use rustywallet_signer as signer;