Multi-chain secure cryptocurrency key generation and sharing CLI with Shamir's Secret Sharing
A beautiful, modern terminal tool for generating, managing, and securing cryptocurrency private keys across Ethereum, Bitcoin, and Solana with advanced features like Shamir's Secret Sharing, encrypted keystores, QR code generation, and an intuitive TUI interface.
| Category | Badge |
|---|---|
| License | |
| Rust | |
| Build |
- Colorful Terminal Output: Beautiful, Python-like CLI with color-coded information
- Interactive TUI: Full-screen terminal UI with arrow key navigation
- Script-Friendly: Silent mode for automation and trading bots
- Cross-Platform: Works on macOS, Linux, and Windows
- 3 Blockchains Supported: Ethereum, Bitcoin, and Solana
- Secure Generation: CSPRNG-based private key generation with optional user entropy
- BIP-39 Mnemonics: Generate 12/24-word recovery phrases with checksum validation
- HD Wallets: BIP-32 (secp256k1) and SLIP-0010 (ed25519) hierarchical deterministic key derivation
- Bitcoin Address Types: Legacy (P2PKH), SegWit (P2WPKH), and Taproot (P2TR)
- Solana Support: Ed25519 keys with Base58 address encoding
- Keystore V3: Password-encrypted JSON keystores (Ethereum Web3 Secret Storage)
- Load & Decrypt: Import existing keystores via TUI or CLI
- M-of-N Splitting: Split keys into N shares, requiring M to recover
- Visual Share Management: TUI with scrolling for 5+ shares
- Dynamic Share Recovery: Configurable 3-10 share slots with add/remove capability
- Secure Recovery: Combine shares to reconstruct original key
- Post-Recovery Options: View key, save to encrypted keystore, or return to menu
- QR Code Export: Generate QR codes for shares (terminal ASCII or SVG file)
- Arrow Key Navigation: Navigate menus with β/β, confirm with Enter
- Chain Selection: Choose Ethereum, Bitcoin, or Solana before generation
- Bitcoin Address Types: Select Legacy, SegWit, or Taproot format
- Load Keystore Screen: Import and decrypt existing wallets
- Generate β Split Workflow: Seamless key generation and sharing
- Combine β Save β View: Recover shares and optionally save/view key
- Security Warnings: Prominent alerts before displaying sensitive data
- Generate: Create new wallets with various options
- Split/Combine: Shamir secret sharing operations
- Keystore Decrypt: Extract private keys from encrypted files
- Keystore Inspect: View keystore metadata without password
- Derive: Generate addresses from mnemonics
- Verify: Validate BIP-39 mnemonic phrases
- Memory Safety: Rust's ownership system + automatic zeroization
- No Copy-Paste: Direct memory transfers in TUI workflows
- Encrypted Storage: Scrypt KDF with AES-128-CTR encryption
- Input Validation: All keys validated against secp256k1 curve order
- Standards Compliant: BIP-39, BIP-32, BIP-44, EIP-55, Web3 Secret Storage
# Clone the repository
git clone https://github.com/aviksaikat/sigil.git
cd sigil
# Build release binary
cargo build --release
# Run
./target/release/sigil --helpUsing Make:
make help # Show all commands
make build # Build release binary
make tui # Launch interactive TUI
make share # π Generate & split (RECOMMENDED)
make test # Run all testsUsing Just (modern Rust tool):
# Install: cargo install just
just # List all commands
just build # Build release binary
just tui # Launch interactive TUI
just share # π Generate & split (RECOMMENDED)Launch the beautiful Terminal User Interface:
sigil tuiMain Menu:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π Sigil - Secure Key Management
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Menu
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βΊ 1. Generate New Wallet
2. Load Existing Keystore [NEW!]
3. Split Key (Shamir's Secret Sharing)
4. Combine Shares
Q. Quit
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β/β or number keys to select | ENTER to confirm | Q to quit
Navigation:
- Arrow Keys: β/β to navigate, Enter to confirm
- Number Shortcuts: Press 1, 2, 3, 4 for quick access
- ESC: Go back to previous screen
- Q or Ctrl+C: Quit application
All CLI commands feature colorful, modern output:
sigil generate --words 24Output:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π GENERATING NEW WALLET (24 words)
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π Mnemonic Phrase
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
1. abandon 2. ability 3. able 4. about
5. above 6. absent 7. absorb 8. abstract
... [24 words total - BRIGHT MAGENTA + BOLD]
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π Derived Addresses
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Address #0
Address: 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb0 [GREEN + BOLD]
Path: m/44'/60'/0'/0/0 [CYAN]
Private Key: 0x1234567890abcdef... [YELLOW + BOLD]
β οΈ SECURITY WARNING [RED + BOLD]
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β’ Write down your mnemonic phrase on paper
β’ Store it in a secure location
β’ Never share it with anyone
β’ This mnemonic gives full access to your funds
sigil keystore decrypt --file wallet.jsonOutput:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π DECRYPTING KEYSTORE
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βΉ File: wallet.json
π Keystore Information
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Address: 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb0 [GREEN]
UUID: 550e8400-e29b-41d4-a716-446655440000 [CYAN]
Enter keystore password: ********
π Decrypting with scrypt...
β Keystore decrypted successfully! [GREEN]
π Private Key (hex)
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
0x1234567890abcdef... [YELLOW + BOLD]
π Ethereum Address
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb0 [GREEN]
# Generate 24-word mnemonic (recommended)
sigil generate --words 24
# Generate with encrypted keystore
sigil generate --words 24 --output wallet.json
# Generate multiple addresses
sigil generate --words 24 --addresses 5# Decrypt keystore (interactive)
sigil keystore decrypt --file wallet.json
# Silent mode for scripts (outputs only hex key)
sigil keystore decrypt --file wallet.json --silent
# Inspect keystore without password
sigil keystore inspect --file wallet.jsonSilent Mode Example:
# Capture key in variable for trading bots
KEY=$(sigil keystore decrypt --file trading.json --silent)
echo "Key loaded: ${KEY:0:10}..."
# Use in automated scripts
./trading_bot --key "$KEY" --exchange binance# Split key from encrypted keystore (RECOMMENDED - no copy-paste)
sigil split --threshold 2 --shares 3 --file wallet.json
# Split key directly (DEPRECATED - legacy support)
sigil split --threshold 2 --shares 3 --key 0xYOUR_PRIVATE_KEY
# Combine shares to recover key
sigil combine --shares SHARE1 SHARE2Bitcoin Addresses:
# Generate Bitcoin wallet (choose address type in TUI)
sigil tui
# β Select "Generate New Wallet"
# β Choose "Bitcoin"
# β Select address type:
# - Legacy (P2PKH): Starts with 1...
# - SegWit (P2WPKH): Starts with bc1q... (recommended)
# - Taproot (P2TR): Starts with bc1p...Solana Addresses:
# Generate Solana wallet with ed25519 keys
sigil tui
# β Select "Generate New Wallet"
# β Choose "Solana"
# β Address will be Base58-encoded (44 characters)Chain-Specific Derivation Paths:
- Ethereum:
m/44'/60'/0'/0/0 - Bitcoin Legacy:
m/44'/0'/0'/0/0 - Bitcoin SegWit:
m/84'/0'/0'/0/0 - Bitcoin Taproot:
m/86'/0'/0'/0/0 - Solana:
m/44'/501'/0'/0'
# Derive address from mnemonic
sigil derive --mnemonic "word1 word2 ... word24" --path "m/44'/60'/0'/0/0"
# Verify mnemonic validity
sigil verify --mnemonic "word1 word2 ... word24"Using Make/Just (Fastest):
# One command to generate and split
make share
# Custom configuration (3-of-5 shares)
make share-custom THRESHOLD=3 SHARES=5 WORDS=24Using TUI (Interactive):
sigil tui
# 1. Select: "1. Generate New Wallet"
# 2. Choose: "2. 24 words (recommended)"
# 3. (Optional) Add entropy by typing random characters
# 4. (Optional) Save encrypted keystore
# 5. Select: "2. Split key into Shamir shares"
# 6. Configure threshold (e.g., 2-of-3)
# 7. Shares generated - write them down!TUI Method:
sigil tui
# 1. Select: "2. Load Existing Keystore"
# 2. Enter file path: wallet.json
# 3. Enter password: ********
# 4. Choose action:
# - View private key (for trading platforms)
# - Split into Shamir shares (for backup)
# - Return to menuCLI Method:
# View keystore info (no password)
sigil keystore inspect --file wallet.json
# Decrypt and view key
sigil keystore decrypt --file wallet.json
# Extract key for scripts
KEY=$(sigil keystore decrypt --file wallet.json --silent)Using TUI:
sigil tui
# 1. Select: "4. Combine Shares"
# 2. Paste shares (minimum 2+ for 2-of-3)
# 3. System shows recovered address
# 4. Choose action:
# - View private key (β οΈ sensitive)
# - Save to encrypted keystore (β
RECOMMENDED)
# - Return to menu
# 5. If saving:
# - Enter filename: recovered_wallet.json
# - Enter password: ********
# - β
Keystore saved!
# - View key now? Yes/NoUsing CLI:
sigil combine --shares "SHARE1" "SHARE2"#!/bin/bash
# trading_startup.sh - Automated trading bot launcher
set -e
KEYSTORE_DIR="$HOME/.keystores"
echo "π€ Starting Trading Bot..."
# Load multiple wallets for different exchanges
BINANCE_KEY=$(sigil keystore decrypt --file "$KEYSTORE_DIR/binance.json" --silent)
COINBASE_KEY=$(sigil keystore decrypt --file "$KEYSTORE_DIR/coinbase.json" --silent)
echo "β All wallets loaded"
# Start trading bot with keys
./trading_bot \
--binance-key "$BINANCE_KEY" \
--coinbase-key "$COINBASE_KEY" \
--mode live
# Keys automatically cleared when script exits- CSPRNG: OS-level cryptographically secure random number generator
- Enhanced Entropy: Optional user input mixed with TWO independent OS CSPRNG sources
- Formula:
Keccak256(os_csprng_1 || user_input || os_csprng_2) - Prevents manipulation: Even if user input is predictable, OS entropy ensures security
- Formula:
- secp256k1: rust-bitcoin implementation (wraps libsecp256k1 - Bitcoin Core's library)
- Memory Safety: Rust ownership + automatic zeroization on drop
- Input Validation: All keys validated against secp256k1 curve order
- Hidden Input: Passwords never echoed to screen
- No Command History: Not stored in terminal history or process list
- Confirmation Required: Enter password twice to prevent typos
- Minimum Requirements: 8+ characters enforced
- In-Memory Operations: Generate β Split workflow keeps keys in memory
- No Clipboard: Primary workflows eliminate copy-paste exposure
- Security Warnings: Prominent warnings before displaying sensitive data
- Automatic Cleanup: Keys zeroized on screen exit
- View Confirmations: Explicit "Are you sure?" prompts before showing keys
- BIP-39: Mnemonic code for generating deterministic keys
- BIP-32: Hierarchical Deterministic Wallets
- BIP-44: Multi-Account Hierarchy for Deterministic Wallets
- EIP-55: Mixed-case checksum address encoding
- Web3 Secret Storage: Ethereum Keystore V3 format
Sigil uses the standard Ethereum Keystore V3 format, compatible with:
- β MetaMask
- β MyEtherWallet
- β Geth
- β Parity
- β Any Web3-compatible wallet
Encryption Parameters:
- KDF: scrypt (N=262144, r=8, p=1)
- Cipher: AES-128-CTR
- MAC: Keccak-256
- Encryption Time: ~2-3 seconds (intentionally slow for security)
cargo test./quick_test.shExpected: All 6 tests pass (generate, split, combine, verify recovery)
# 1. Generate wallet
sigil generate --words 12
# 2. Split the private key
sigil split --threshold 2 --shares 3 --key 0xYOUR_KEY
# 3. Combine any 2 shares
sigil combine --shares "SHARE1" "SHARE2"
# 4. Verify recovered key matches original| Operation | Time |
|---|---|
| Key generation | ~80ΞΌs |
| Public key derivation | ~60ΞΌs |
| Mnemonic generation | ~50ms |
| Keystore encryption | ~2-3s (scrypt N=262144) |
| Keystore decryption | ~2-3s (scrypt N=262144) |
Using rust-secp256k1 (2x faster than pure Rust k256)
Bitcoin Support:
- 3 Address Types: Legacy (P2PKH), SegWit (P2WPKH), Taproot (P2TR)
- Standard Derivation Paths: BIP-44 (Legacy), BIP-84 (SegWit), BIP-86 (Taproot)
- Network: Bitcoin mainnet (easily configurable for testnet)
- TUI Integration: Address type selection screen with descriptions
Solana Support:
- Ed25519 Curve: SLIP-0010 key derivation for Solana
- Base58 Encoding: Standard Solana address format (44 characters)
- Derivation Path:
m/44'/501'/0'/0'(BIP-44 compatible) - Full Validation: Address parsing and verification
QR Code Generation:
- Terminal ASCII: Display QR codes directly in terminal using Unicode
- SVG Export: Save QR codes as image files
- Use Cases: Share addresses, backup Shamir shares
- Address QR Codes: All three blockchains supported
Enhanced CLI:
- Split from Keystore:
sigil split --file wallet.json(recommended, no copy-paste) - Legacy Key Support:
sigil split --key 0x...(deprecated but functional) - Security Warnings: Prominent alerts when using deprecated methods
Dynamic Share Recovery:
- Configurable Slots: 3-10 share input slots
- Add/Remove Slots: TAB to add, DEL to remove
- Minimum 3 Slots: Increased from 2 for better UX
- Visual Feedback: Shows current/max slot count
Automated Builds:
- 7 Platforms: Linux (x64/ARM), macOS (Intel/ARM), Windows (x64/ARM), FreeBSD
- GitHub Releases: Automated binary releases on tag push
- Release Notes: Auto-generated changelog from PR labels
- Beautiful output inspired by Python's
richlibrary - Color-coded information: Success (green), warnings (yellow), errors (red)
- Professional formatting: Headers, dividers, visual hierarchy
- Script-friendly: Silent mode disables colors for automation
- Full TUI navigation with Up/Down arrows
- Enter to confirm selections
- Number key shortcuts still work (backward compatible)
- Consistent UX across all screens
- Import existing wallets via TUI
- Decrypt interactively with password prompt
- Post-load options:
- View private key (hex format for trading platforms)
- Split into Shamir shares (create backup)
- Return to menu
keystore decrypt: Extract private key from encrypted filekeystore inspect: View metadata without password--silentmode: Output only hex key for scripts
- Combine screen improvement: After saving recovered keystore, option to view key
- Security-conscious: Explicit confirmation before displaying
- One-time opportunity: View key immediately after save, then secure
- 5+ Shamir shares: Auto-scrolling in TUI
- Visual indicators: "β² Scroll up" / "βΌ Scroll down"
- Smart viewport: Shows current position (e.g., "viewing 1-4 of 7")
IMPORTANT:
β οΈ Never share your mnemonic phrase - it grants full access to fundsβ οΈ Write mnemonics on paper - don't store digitallyβ οΈ Store keystore passwords separately from keystore filesβ οΈ Test with small amounts first before using for real fundsβ οΈ Audit the code - this is alpha softwareβ οΈ Clear terminal history after viewing private keysβ οΈ Use at your own risk - no warranty provided
- Core cryptography (CSPRNG, secp256k1, ed25519)
- BIP-39 mnemonics (12/24 words)
- HD key derivation (BIP-32/44, SLIP-0010)
- Shamir's Secret Sharing (M-of-N)
- Ethereum Keystore V3 encryption
- Interactive TUI with secure workflows
- Enhanced entropy collection
- Arrow key navigation
- Load Keystore screen
- Keystore CLI commands (decrypt, inspect)
- Silent mode for scripting
- Colorful CLI output
- Scrolling support for 5+ shares
- View-after-save confirmation
- Bitcoin address support (P2PKH, SegWit, Taproot)
- Solana ed25519 keys with Base58 encoding
- Multi-chain support (Ethereum, Bitcoin, Solana)
- QR code generation for addresses and shares
- Dynamic share recovery (3-10 configurable slots)
- TUI chain selection with Bitcoin address type picker
- Automated cross-platform builds (Linux, macOS, Windows, FreeBSD)
- Enhanced CLI split command (keystore file input)
- Hardware wallet export
- Age encryption for shares
- WIF format support
- Batch keystore operations
- Configuration file support
- Additional chains (Cosmos, Polkadot, etc.)
- Plugin system
Contributions welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Add tests for new functionality
- Ensure
cargo testpasses - Format code with
cargo fmt - Lint with
cargo clippy - Submit a pull request
Code Style:
- Follow Rust conventions
- Add documentation for public APIs
- Include examples in doc comments
- Write comprehensive tests
MIT License - see LICENSE file for details
Aviksaikat
- GitHub: @aviksaikat
- BIP Standards: BIP-39, BIP-32, BIP-44 specifications
- Ethereum: Web3 Secret Storage specification
- Cryptography: Adi Shamir (Secret Sharing algorithm)
- Libraries:
- rust-bitcoin/rust-secp256k1
- RustCrypto elliptic curves
- ratatui (TUI framework)
- colored (CLI colors)
- clap (argument parsing)
Current Version: 0.3.0 Status: Alpha - Active Development Stability: Use for testing, not production funds yet Test Coverage: 96/96 tests passing Supported Chains: Ethereum, Bitcoin (3 address types), Solana
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π Sigil - Secure Key Management
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βΊ 1. Generate New Wallet
2. Load Existing Keystore
3. Split Key (Shamir's Secret Sharing)
4. Combine Shares
Q. Quit
β/β or number keys to select | ENTER to confirm | Q to quit
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β VERIFYING MNEMONIC
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Mnemonic is VALID
π Mnemonic Details
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Word Count: 24
Checksum: β Valid
Built with β€οΈ using Rust π¦
