Coldstar Documentation

CLI-first cold wallet system that transforms any USB drive into a disposable, RAM-only signing medium for Solana.

Introduction

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.

Key Concept

Unlike traditional hardware wallets where keys persist on the device forever, Coldstar decrypts keys only in RAM for the brief moment needed to sign a transaction. Once complete, keys are immediately erased from memory.

Core Idea

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:

Private keys are:

Important

The USB drive is not a signing device. It is encrypted storage only.

Key Properties

RAM-Only
Private Key Exposure
Keys exist decrypted only in volatile memory
No Hardware
Proprietary Chips
Use any standard USB drive
Disposable
USB Storage
Rotate or destroy at minimal cost
CLI-First
Automation Ready
Scriptable and headless
Open Source
Fully Auditable
Inspect and verify the codebase
Asset-Agnostic
All Solana Assets
SOL, SPL tokens, NFTs, staking

How It Works

  1. A standard USB drive is initialized using the Coldstar CLI
  2. Cryptographic key pairs are generated and encrypted directly onto the USB
  3. When signing is required:
    • Encrypted key material is loaded into memory
    • Decryption occurs only in RAM
    • The transaction is signed
  4. Decrypted key material is immediately erased from memory
  5. No plaintext keys persist on disk or hardware
USB
Encrypted Keys
AES-256-GCM
->
RAM
Brief Decryption
~100 microseconds
->
TX
Signed Transaction
Broadcast ready

Encryption & Key Generation

Coldstar's security model depends on understanding exactly where sensitive data exists in physical hardware and how it's protected at each stage.

Key Generation and Encryption (Initial Setup)

During wallet initialization, the following steps occur:

  1. Random Seed Generation: CPU's hardware RNG (/dev/urandom) generates a 32-byte Ed25519 seed
  2. Passphrase Entry: User provides a passphrase for encryption
  3. Key Derivation (Argon2id): Memory-hard operation (64 MB, 3 iterations) derives a 32-byte AES key
  4. AES-256-GCM Encryption: Private key is encrypted with a 12-byte random nonce
  5. Immediate Zeroization: All plaintext keys are overwritten with zeros in RAM
Component Algorithm Purpose
Key Encryption AES-256-GCM Encrypts private keys at rest
Key Derivation Argon2id Derives encryption key from password (64MB memory-hard)
Signing Ed25519 Solana transaction signatures

Encrypted Container Format

keypair.json
{
  "version": 1,
  "salt": "base64_encoded_32_bytes",
  "nonce": "base64_encoded_12_bytes",
  "ciphertext": "base64_encoded_48_bytes",
  "public_key": "base58_encoded_pubkey"
}
Security Guarantee
  • Private key NEVER stored in plaintext on USB
  • USB can be read without exposing private key
  • USB can be physically seized without key compromise

Transaction Signing (Decryption)

When signing a transaction, the following secure process occurs:

  1. Read Encrypted Container: Encrypted data read from USB to Python memory space
  2. FFI Call to Rust: Encrypted data passed to isolated Rust memory space
  3. Key Re-Derivation: Argon2id derives AES key from passphrase in mlock'd RAM
  4. AES-256-GCM Decryption: Private key decrypted into locked memory buffer
  5. Ed25519 Signing: Transaction signed (~100 microseconds in CPU)
  6. Automatic Cleanup: Rust Drop trait zeroizes all sensitive data
  7. Return to Python: Only signature (public data) crosses FFI boundary
Critical Security Property

Plaintext private key NEVER enters Python memory space. It exists only in isolated Rust mlock'd buffers and is automatically zeroized even on panic.

Memory Protection Mechanisms

mlock() - Preventing Swap to Disk

Private keys are stored in mlock'd memory pages that cannot be swapped to disk by the operating system:

Memory Zeroization

Before deallocation, all sensitive buffers are overwritten with zeros:

Panic Safety

Rust's Drop trait guarantees cleanup runs even if the signing operation panics:

Data States Across Hardware

Location Data State Duration
USB NAND Flash Encrypted Permanent
USB -> Computer Encrypted Microseconds
Python RAM Encrypted Seconds
Rust mlock'd RAM PLAINTEXT ~100 microseconds
CPU Registers/Cache PLAINTEXT ~10 nanoseconds
Network Signature only Never contains private key

Threat Model

What Coldstar Protects Against

What Coldstar Does NOT Protect Against

Security Boundary

Coldstar assumes you control your operating system and can verify the Coldstar codebase. For maximum security, use an air-gapped machine and verify builds.

First Instance Boot Process

Every time you plug your USB cold wallet into a machine, Coldstar automatically:

This is not a restoration function - it's an intelligent boot detection mechanism that ensures wallet integrity across different machines and reboots.

How First Boot Works

  1. Boot Detection: Generates unique boot instance ID from machine hostname + process + timestamp
  2. File Verification: Checks critical files for existence and corruption (0-byte detection)
  3. Smart Restoration: Only restores files if actually missing or corrupted
  4. Automatic Backups: Creates backups in .coldstar/backup/ directory on USB

USB Storage Structure

USB Drive/
  wallet/ # Main wallet directory
    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

Supported Use Cases

Coldstar is asset-agnostic and designed to support modern on-chain workflows:

System Architecture

Coldstar consists of three main layers:

User Application Layer

Integration Layer

Rust Signing Core

Detailed Signing Flow

The signing process consists of 10 phases:

  1. Input Preparation: Load encrypted container, get passphrase, prepare unsigned TX
  2. Enter Rust Secure Zone: Encrypted data crosses FFI boundary
  3. Key Derivation: Argon2id computes AES key, passphrase zeroized
  4. Memory Allocation: SecureKeyBuffer created with mlock()
  5. Decryption: AES-256-GCM decryption to temporary buffer
  6. Secure Transfer: Copy to locked buffer, zeroize temp buffer
  7. Signing: Ed25519 signature generation
  8. Result Preparation: Build signed transaction
  9. Automatic Cleanup: Drop trait zeroizes all buffers
  10. Return to Python: Only public signature crosses boundary

Integration Modes

FFI Mode (Recommended for Production)

CLI Mode (Maximum Isolation)

Operation FFI Mode CLI Mode
Overhead ~0.1ms ~10-50ms
Memory Safety Good Excellent
Portability Medium High

Comparison with Hardware Wallets

Aspect Coldstar Hardware Wallets
Persistent key storage No (RAM only) Yes (secure element)
Physical attack surface Disposable USB + computer RAM Permanent device
Decryption location System RAM (mlock'd) Inside secure chip
Key lifetime Microseconds Years
Supply chain risk Low (commodity USB) High (proprietary)
OS compromise impact Vulnerable Protected by hardware
Automation support CLI-first, scriptable Limited
Open source Fully verifiable Varies

Trust Model

Coldstar's trust model is fundamentally different from hardware wallets:

What You Trust Coldstar Hardware Wallets
Proprietary Hardware No Yes
Vendor Firmware No Yes
Open Source Code Yes (auditable) Varies
Your Operating System Yes Partially
Supply Chain Minimal (any USB) Vendor-dependent

Disclaimer

Coldstar is experimental software. Users are responsible for understanding the risks, verifying the code, and operating within the documented security assumptions.

View on GitHub · Build Guide · Back to Home