A native Rust CLI wallet for RustChain cryptocurrency. Secure key management, balance queries, and transaction signing.
- π BIP39 Seed Phrases - Generate and import 24-word mnemonic seed phrases
- π Ed25519 Cryptography - Secure key generation and transaction signing
- π AES-256-GCM Encryption - Encrypted keystore files with password protection
- π° Balance Queries - Check wallet balance from RustChain node
- π€ Transfer Signing - Sign and submit transactions
- π Transaction History - Query recent transactions
- π₯οΈ Cross-Platform - Works on Linux, macOS, and Windows
cargo install rustchain-walletgit clone https://github.com/ma-moon/rustchain-wallet-cli.git
cd rustchain-wallet-cli
cargo build --releaseThe binary will be at target/release/rustchain-wallet.
rustchain-wallet create --name my-walletThis will:
- Generate a new 24-word seed phrase
- Derive Ed25519 keypair
- Prompt for encryption password
- Save encrypted keystore to
~/.rustchain/wallets/my-wallet.json
From seed phrase:
rustchain-wallet import --seed --name imported-walletFrom private key:
rustchain-wallet import --key --name key-importrustchain-wallet balance --name my-walletrustchain-wallet send --from my-wallet --to RTC1234567890abcdef... --amount 100 --memo "Payment"rustchain-wallet listrustchain-wallet export --name my-wallet --output backup.jsonrustchain-wallet <COMMAND>
Commands:
create Create a new wallet with BIP39 seed phrase
import Import wallet from seed phrase or private key
balance Query wallet balance
send Send RTC to another address
history Query transaction history
list List all wallets
export Export wallet keystore
help Print help
Options:
--node-url <NODE_URL> RustChain node URL [env: RUSTCHAIN_NODE_URL]
[default: https://50.28.86.131]
-h, --help Print help
-V, --version Print version
| Component | Specification | Rust Crate |
|---|---|---|
| Key Generation | Ed25519 | ed25519-dalek |
| Seed Phrases | BIP39 (24 words, English) | bip39 |
| Key Derivation | PBKDF2-SHA256, 100,000 iterations | pbkdf2 + sha2 |
| Keystore Encryption | AES-256-GCM | aes-gcm |
| Address Format | RTC + SHA256(pubkey)[:40] hex |
sha2 |
| Signature Format | 128-char hex Ed25519 signature | ed25519-dalek |
Wallets are stored as encrypted JSON files:
{
"version": 1,
"address": "RTCa1b2c3d4...",
"public_key": "0123456789abcdef...",
"salt": "base64...",
"nonce": "base64...",
"ciphertext": "base64...",
"created": "2026-03-15T00:00:00Z"
}Keystores are stored in ~/.rustchain/wallets/.
RUSTCHAIN_NODE_URL- Override the default RustChain node URL
- Seed Phrase Security: Never share your seed phrase. Store it offline in a secure location.
- Password Strength: Use a strong, unique password for keystore encryption.
- Memory Safety: Sensitive data (seed phrases, private keys) is zeroized after use.
- TLS: The wallet accepts self-signed certificates for the default node. For production use, configure a node with valid TLS.
cargo testAll 10 unit tests cover:
- Address generation
- Key derivation
- Encryption/decryption roundtrip
- Password validation
- BIP39 mnemonic generation and parsing
- Signature creation and verification
- Keystore serialization
- Rust 1.70 or later
- Cargo
# Debug build
cargo build
# Release build (optimized)
cargo build --release
# Run tests
cargo test
# Run clippy (linter)
cargo clippy
# Format code
cargo fmtThis wallet is designed to be interoperable with the Python RustChain wallet implementation:
- Same BIP39 seed phrase β Same address
- Same private key β Same signature
- Keystore files can be exchanged between implementations
The default node may be unavailable. Set a custom node URL:
export RUSTCHAIN_NODE_URL=https://your-node.example.com
rustchain-wallet balance --name my-walletKeystore decryption failed. Ensure you're using the correct password. There is no password recovery - if you lose the password, you'll need to re-import using your seed phrase.
MIT License - see LICENSE for details.
Contributions are welcome! Please feel free to submit a Pull Request.
- RustChain community for the protocol specification
ed25519-dalekteam for the excellent Ed25519 implementation- All contributors to the Rust cryptographic ecosystem