Coldstar is a CLI-first cold wallet system that transforms any standard USB drive into a disposable, RAM-only signing medium. It eliminates long-lived private key exposure by ensuring keys are decrypted only in volatile memory and only for the duration of transaction signing.
Coldstar is designed for developers, traders, and operators who value verifiability, automation, and explicit control over convenience-oriented hardware wallets.
This repository contains the core implementation, documentation, and tooling required to initialize USB-based cold wallets and perform offline transaction signing.
Traditional hardware wallets rely on permanent devices that store private keys for their entire lifetime. This creates persistent trust anchors, supply-chain risk, and physical attack surfaces.
Coldstar challenges this model by removing permanent trusted hardware entirely.
Instead of trusting devices, Coldstar trusts:
- Open-source, auditable software
- User-controlled operating systems
- Extremely short-lived key exposure in RAM
Private keys are:
- Encrypted at rest on user-supplied USB storage
- Decrypted only in system memory
- Explicitly wiped after signing completes
The USB drive is not a signing device. It is encrypted storage only.
- RAM-only private key exposure
- No proprietary hardware
- Disposable, deniable USB storage
- CLI-first and automation-native
- Fully scriptable and headless
- Open-source and auditable
- Asset-agnostic by design
-
A standard USB drive is initialized using the Coldstar CLI
-
Cryptographic key pairs are generated and encrypted directly onto the USB
-
When signing is required:
- Encrypted key material is loaded into memory
- Decryption occurs only in RAM
- The transaction is signed
-
Decrypted key material is immediately erased from memory
-
No plaintext keys persist on disk or hardware
At no point does any powered device permanently store a usable private key.
π See ARCHITECTURE.md for detailed technical architecture and system design.
Coldstar's security model depends on understanding exactly where sensitive data exists in physical hardware and how it's protected at each stage.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β HARDWARE: CPU + System RAM (Volatile) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β Step 1: Random Seed Generation β
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β CPU's Hardware RNG (/dev/urandom) β β
β β β 32 bytes Ed25519 seed β β
β β β Generated in CPU registers β β
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β (copied to RAM) β
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β Rust Secure Buffer (mlock'd RAM) β β
β β β’ Memory page locked (cannot swap) β β
β β β’ 32-byte plaintext private key β β PLAINTEXT HERE β
β β β’ Protected by OS memory isolation β β
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β Step 2: User Passphrase Entry β
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β Keyboard β Terminal β RAM buffer β β
β β Passphrase: "user_secret_password" β β
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β Step 3: Key Derivation (Argon2id) β
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β CPU executes Argon2id: β β
β β β’ 64 MB memory-hard operation β β
β β β’ 3 iterations β β
β β β’ 32-byte random salt β β
β β β Produces 32-byte AES-256 key β β
β β β Stored in mlock'd RAM β β PLAINTEXT HERE β
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β Step 4: AES-256-GCM Encryption β
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β CPU encrypts: β β
β β β’ Input: 32-byte plaintext key β β
β β β’ Key: Derived AES key β β
β β β’ Nonce: 12-byte random β β
β β β’ Output: 48-byte ciphertext + auth tag β β
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β Step 5: Immediate Zeroization β
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β Plaintext key OVERWRITTEN in RAM: β β
β β 0x42...A7 β 0x00000000000000000000 β β
β β Derived AES key β 0x000000000000 β β
β β Passphrase buffer β 0x000000000000 β β
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β (only encrypted data remains) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β HARDWARE: USB Flash Storage (Non-Volatile) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β JSON File Written to NAND Flash: β
β { β
β "version": 1, β
β "salt": "base64_encoded_32_bytes", β
β "nonce": "base64_encoded_12_bytes", β
β "ciphertext": "base64_encoded_48_bytes", β ENCRYPTED ONLY β
β "public_key": "base58_encoded_pubkey" β
β } β
β β
β β οΈ Private key NEVER stored in plaintext on USB β
β β USB can be read without exposing private key β
β β USB can be physically seized without key compromise β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β HARDWARE: USB Flash Storage (Non-Volatile) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Step 1: Read Encrypted Container from USB β
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β USB NAND Flash β USB Controller β β β
β β USB Bus β OS Kernel β Python Process β β
β β β β
β β Encrypted data (48 bytes ciphertext) β β ENCRYPTED ONLY β
β β + Salt (32 bytes) β β
β β + Nonce (12 bytes) β β
β ββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β (encrypted data copied to RAM)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β HARDWARE: System RAM - Python Memory Space β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β Python dict object in heap: β β
β β { β β
β β "ciphertext": [bytes], β ENCRYPTED β β
β β "salt": [bytes], β β
β β "nonce": [bytes] β β
β β } β β
β β β β
β β β οΈ NO PLAINTEXT KEY IN PYTHON MEMORY β β
β ββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β (FFI call: Python β Rust)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β HARDWARE: System RAM - Rust Memory Space (Isolated) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Step 2: Passphrase Entry β
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β User types passphrase β β
β β β Passed to Rust via FFI β β
β β β Copied into Rust String β β
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β Step 3: Key Re-Derivation (Argon2id) β
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β Rust Secure Buffer (mlock'd): β β
β β β β
β β Argon2id(passphrase, salt) β β β
β β 32-byte AES-256 key β β PLAINTEXT HERE β
β β β β
β β β’ mlock() called - RAM locked β β
β β β’ Cannot be swapped to disk β β
β β β’ Python CANNOT access this memory β β
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β Step 4: AES-256-GCM Decryption β
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β CPU decrypts in Rust mlock'd buffer: β β
β β β β
β β Ciphertext (48 bytes) β β β
β β AES-GCM-Decrypt(key, nonce) β β β
β β 32-byte Ed25519 seed β β PLAINTEXT HERE β
β β β β
β β β’ Plaintext key ONLY in locked RAM β β
β β β’ NEVER copied to Python β β
β β β’ NEVER written to disk β β
β β β’ NEVER in swap file β β
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β Step 5: Ed25519 Signature Generation β
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β CPU executes Ed25519 signing: β β
β β β β
β β Private Key (32 bytes) + β β PLAINTEXT HERE β
β β Transaction Message (N bytes) β β β
β β CPU Ed25519 ops β β β
β β 64-byte signature β β
β β β β
β β β’ Signing in CPU registers + L1 cache β β
β β β’ Private key in mlock'd RAM β β
β β β’ Duration: ~100 microseconds β β
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β Step 6: Immediate Zeroization β
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β Rust Drop trait executes: β β
β β β β
β β Private key buffer β 0x00000000000000 β β
β β Derived AES key β 0x00000000000000 β β
β β Passphrase β 0x00000000000000 β β
β β β β
β β β’ Guaranteed even on panic β β
β β β’ munlock() called - RAM unlocked β β
β β β’ Memory returned to OS β β
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β (only signature returned) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β (FFI return: Rust β Python)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β HARDWARE: System RAM - Python Memory Space β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β Python receives: β β
β β β’ 64-byte signature (PUBLIC) β β SAFE β
β β β’ Transaction with signature attached β β SAFE β
β β β β
β β β οΈ Private key NEVER entered Python β β
β ββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Normal RAM page: mlock'd RAM page:
ββββββββββββββββ ββββββββββββββββ
β RAM (active) β β RAM (locked) β
ββββββββ¬ββββββββ ββββββββββββββββ
β OS may swap β
β β
ββββββββββββββββ Cannot be moved
β Swap file on β to disk by OS
β disk/SSD β
ββββββββββββββββ
Private keys ONLY in mlock'd pages β Never touch persistent storage
Before Zeroization: After Zeroization:
RAM Address: 0x7F3A8000 RAM Address: 0x7F3A8000
ββββββββββββββββββββββββ ββββββββββββββββββββββββ
β 0x42 (private key) β β 0x00 (zeroed) β
β 0x8F β β 0x00 β
β 0xA7 β β 0x00 β
β ... (32 bytes) β β ... (32 bytes) β
ββββββββββββββββββββββββ ββββββββββββββββββββββββ
β’ Overwrites with zeros before deallocation
β’ Prevents recovery from heap analysis
β’ Protects against cold boot attacks (partially)
ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Operating System (Kernel Space) β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β βββββββββββββββββββ ββββββββββββββββββββ β
β β Python Process β β Other Processes β β
β β PID: 1234 β β PID: 5678, ... β β
β βββββββββββββββββββ€ ββββββββββββββββββββ β
β β Python heap β β β
β β (encrypted data)β β β
β ββββββββββ¬βββββββββ β β
β β FFI call β β
β β β β
β βββββββββββββββββββ β β
β β Rust library β β β
β β (same process) β β β
β βββββββββββββββββββ€ β β
β β mlock'd buffer β β OS blocks access β
β β (plaintext key) β β β
β βββββββββββββββββββ β β
β β β
β β’ Rust memory isolated from Python by design β
β β’ mlock'd pages protected by OS kernel β
β β’ Other processes cannot access this memory β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Location | Data State | Duration | Hardware |
|---|---|---|---|
| USB NAND Flash | Encrypted | Permanent (until deleted) | Non-volatile flash memory |
| USB β Computer | Encrypted | Microseconds (transfer) | USB bus, PCIe controller |
| Python RAM | Encrypted | Seconds (during signing) | DRAM (swappable) |
| Rust mlock'd RAM | PLAINTEXT | ~100 microseconds | DRAM (locked, non-swappable) |
| CPU Registers/Cache | PLAINTEXT | ~10 nanoseconds | L1/L2 cache, registers |
| Network transmission | Signature only | N/A | Never contains private key |
β What is protected:
- Private key never stored in plaintext on any persistent storage
- Private key never exists in Python-accessible memory
- Private key automatically erased after signing (even on crash/panic)
- Private key cannot be swapped to disk during signing
- Encrypted container can be safely copied, backed up, or transmitted
- Memory dumps while private key is in RAM (requires root access + precise timing)
- Compromised operating system with kernel-level access
- Hardware keyloggers capturing passphrase
- Cold boot attacks (if RAM is physically extracted within seconds)
- Physical tampering with CPU/RAM hardware
π See SECURE_SIGNER_README.md for detailed information on the Rust-based secure signer implementation.
| Aspect | Hardware Wallet | Coldstar |
|---|---|---|
| Persistent key storage | Yes (secure element) | No (RAM only during signing) |
| Physical attack surface | Permanent device | Disposable USB + computer RAM |
| Decryption location | Inside secure chip | System RAM (mlock'd) |
| Key lifetime | Years | Microseconds |
| Supply chain risk | High (proprietary hardware) | Low (commodity USB + open source) |
| OS compromise impact | Protected by hardware | Vulnerable |
Coldstar is asset-agnostic and designed to support modern on-chain workflows, including:
- Native Solana transactions
- SPL tokens
- Stablecoins
- Tokenized commodities (e.g. PAXG)
- Tokenized equities (xStocks)
- Custom program instructions
- Solana staking and delegation
All assets are handled under the same cold-signing security model.
Hardware wallets improved security, but introduced new problems:
- Permanent key storage
- Vendor trust assumptions
- Firmware and supply-chain risk
- Poor automation support
- Manual, GUI-driven workflows
Coldstar removes the concept of a permanent trusted device entirely.
Any USB drive can be:
- Rotated
- Destroyed
- Replaced
- Treated as disposable
There are no serial numbers, proprietary chips, or vendor lock-in.
π See whitepaper.md for the complete technical whitepaper and theoretical foundations.
Coldstar is explicit about its security boundaries.
It protects against:
- Long-lived key exposure
- Firmware backdoors
- Hardware supply-chain manipulation
- Persistent device compromise
- Seizure or fingerprinting of signing hardware
It assumes:
- The user controls their operating system
- The runtime environment is not fully compromised
- Users are capable of auditing and understanding CLI-based tooling
Coldstar does not attempt to hide these assumptions behind hardware abstractions.
New Feature: Automatic file integrity and restoration system.
Every time you plug your USB cold wallet into a machine, Coldstar automatically:
- β Detects if this is the first time on this machine/session
- β Verifies all critical wallet files (keypair.json, pubkey.txt)
- β Restores missing or corrupted files from backup (if needed)
- β Creates/updates backups of valid files
- β Updates boot instance markers
This is not a restoration function - it's an intelligent boot detection mechanism that ensures wallet integrity across different machines and reboots.
- Boot Detection: Generates unique boot instance ID from machine hostname + process + timestamp
- File Verification: Checks critical files for existence and corruption (0-byte detection)
- Smart Restoration: Only restores files if actually missing or corrupted
- Automatic Backups: Creates backups in
.coldstar/backup/directory on USB
USB Drive
βββ wallet/
β βββ keypair.json # Encrypted private key
β βββ pubkey.txt # Public address
βββ inbox/ # Unsigned transactions
βββ outbox/ # Signed transactions
βββ .coldstar/ # Hidden system directory
βββ last_boot_id # Boot instance tracker
βββ backup/ # Automatic backups
βββ keypair.json
βββ pubkey.txt
- Zero User Intervention - Everything happens automatically
- Cross-Machine Compatibility - USB works seamlessly on any machine
- Corruption Detection - Catches file system errors immediately
- Protection Against Accidents - Files can be recovered from backup
- Performance Optimized - Only runs when needed
π Documentation:
- FIRST_BOOT_PROCESS.md - Detailed technical specification
- FIRST_BOOT_IMPLEMENTATION.md - Implementation details and code walkthrough
- FIRST_BOOT_QUICKSTART.md - Quick start guide for users
Coldstar compared to traditional hardware wallets:
- No permanent signing device
- No secure element
- No firmware approval process
- No vendor trust anchor
- Full automation support
- Deterministic and scriptable workflows
Compared to open-source hardware wallets, Coldstar removes the final dependency: the device itself.
Coldstar is built for:
- Headless environments
- CI/CD pipelines
- Automated trading systems
- Air-gapped workflows
- Deterministic scripting
This is not a consumer wallet and does not aim to be one.
There is no GUI dependency, browser extension, or background daemon.
Coldstar is built for:
- Developers signing complex transactions
- Traders managing significant on-chain value
- Operators who require explicit control
- Security-conscious users who understand their environment
It is not intended for beginners or retail-first UX.
Coldstar is designed to be:
- Fully inspectable
- Deterministically buildable
- Auditable by design
Security claims are meant to be verifiable, not trusted.
π Integration Documentation:
- INTEGRATION_GUIDE.md - Guide for integrating Coldstar into your projects
- INTEGRATION_STATUS.md - Current integration status and compatibility
- RUST_INTEGRATION_COMPLETE.md - Rust signer integration details
π Project Status:
- PROJECT_COMPLETE.md - Project completion status and milestones
- DELIVERABLES.md - Project deliverables and roadmap
cli/ Core command-line interface
crypto/ Key generation, encryption, memory handling
signing/ Transaction signing logic
docs/ Architecture, threat model, design notes
scripts/ Automation and example workflows
No Python or Rust installed? No problem! The installer handles everything automatically.
Windows (PowerShell):
.\install.ps1macOS (Terminal):
chmod +x install.sh && ./install.shLinux (Terminal):
chmod +x install.sh && ./install.shThe installer will automatically:
- β Install Python 3.7+ (if missing)
- β Install Rust/Cargo (if missing)
- β Install all Python dependencies
- β Build Rust components
- β Verify the installation
π See INSTALL.md for detailed installation instructions and troubleshooting.
For development and testing:
- test_first_boot.py - First boot functionality tests
- test_transaction.py - Transaction signing tests
Legacy Setup Scripts:
- Windows: quickstart.ps1 - PowerShell setup script (requires Rust/Python pre-installed)
- Linux/Mac: quickstart.sh - Bash setup script (requires Rust/Python pre-installed)
Coldstar is experimental software.
Users are responsible for understanding the risks, verifying the code, and operating within the documented security assumptions.
Open-source. See the LICENSE file for details.