Build Coldstar

Everything you need to install, build from source, or deploy to an air-gapped machine.

Prerequisites

Coldstar has two required dependencies and one optional one:

Python
Python 3.11+
Required — runs the CLI and wallet logic
USB
USB Drive
Required — any USB drive for encrypted key storage
Rust
Rust 1.70+
Optional — enables memory-locked secure signing
OS
macOS / Windows / Linux
Any desktop OS with USB support

Python Dependencies

These are installed automatically via pip install -r local_requirements.txt:

Quick Install

Get up and running in four commands. Pick your platform:

Terminal — macOS
# Clone the repository
git clone https://github.com/devsyrem/coldstar.git
cd coldstar

# Install Rust and Python (if not already installed)
brew install rust
brew install python

# Install dependencies
pip3 install -r local_requirements.txt

# Launch Coldstar
python3 main.py
That's it

Four commands to a running cold wallet. Coldstar detects your USB drive and walks you through wallet setup. If Rust is installed, the secure signer compiles automatically on first launch — otherwise, the Python fallback signer is used (functional but without memory-locked key handling).

Automated installer

On macOS/Linux, you can also use ./install.sh which handles venv creation, dependency install, and Rust signer compilation in one step.

Build from Source (Manual)

If you want more control over the setup — for example, using a virtual environment or building the Rust signer yourself — follow these steps:

1Clone Repository
Terminal
git clone https://github.com/devsyrem/coldstar
cd coldstar
2Install Python Dependencies
Terminal
# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate

# Install dependencies
pip install -r local_requirements.txt
3Build Rust Signer (Optional)
Terminal
cd secure_signer
cargo build --release
cd ..

Without Rust, Coldstar uses a Python fallback signer (PyNaCl). It works, but Python can't lock memory or guarantee key cleanup — so for real funds, the Rust signer is strongly recommended.

4Launch Coldstar
Terminal
# Interactive chain picker (Solana or Base)
python main.py

# Or launch directly into a specific chain
python main.py --solana
python main.py --base

Rust Secure Signer

This is the security-critical component of Coldstar. The Rust signer handles all private key operations in isolated, locked memory — your key never touches Python, never gets swapped to disk, and is wiped even if the process crashes. It's a standalone Rust crate (coldstar_secure_signer v1.1.0).

Build the Signer

Terminal
cd secure_signer

# Build release binary + shared library
cargo build --release

# Run tests
cargo test

This produces two files:

What each Rust file does

File Purpose
crypto.rs All cryptography — encrypts/decrypts keys (AES-256-GCM), derives passphrase keys (Argon2id), signs transactions (Ed25519 for Solana, secp256k1 for Base)
secure_buffer.rs Locked memory buffers — prevents the OS from swapping key material to disk, overwrites with zeros on cleanup
ffi.rs The bridge between Python and Rust — Python calls these C-compatible functions to encrypt, decrypt, and sign
main.rs Standalone CLI — lets you sign, verify, and generate keys without Python
error.rs Error handling — structured error types so failures are clear, not panics
lib.rs Library root — wires everything together, controls feature flags (FFI mode vs subprocess mode)

Release Profile

The release build is optimized for both speed and small binary size:

Docker

If you don't want to install Python and Rust on your host machine, run Coldstar in a container. The included Dockerfile sets up everything automatically.

Terminal
# Build the Docker image
docker build -t coldstar .

# Run interactively
docker run -it --rm coldstar

USB Device Passthrough (Linux only)

Coldstar needs access to your USB drive. On Linux, pass the device directly into the container:

Terminal
docker run -it --rm \
    --privileged \
    --device=/dev/sdb:/dev/sdb \
    coldstar
macOS / Windows — no direct USB passthrough

Docker Desktop on macOS and Windows runs inside a VM, so it can't access USB devices directly. Instead, mount your USB drive's contents as a volume: docker run -it --rm -v /path/to/usb:/mnt/usb coldstar

Project Structure

Here's how the codebase is organized. The Python layer handles the UI, wallet management, and network calls. The Rust layer handles all private key operations.

coldstar/ ├── main.py # Start here — picks Solana or Base chain, then launches the TUI ├── main.py # Solana wallet TUI (menus, balance, send, receive) ├── base_cli.py # Base L2 wallet TUI (same features, different chain) ├── config.py # Settings: RPC endpoints, chain IDs, directory paths ├── install.sh # One-command installer (venv + deps + Rust signer) ├── Dockerfile # Run Coldstar in a container without local install ├── local_requirements.txt ├── src/ # Python modules │ ├── wallet.py # Creates wallets, encrypts keys, manages keypair files │ ├── usb.py # Finds and mounts USB drives across macOS/Linux/Windows │ ├── transaction.py # Builds Solana transactions (SOL transfers, SPL tokens) │ ├── network.py # Sends RPC calls to Solana validators │ ├── ui.py # Terminal UI: menus, tables, status bars (Rich library) │ ├── secure_memory.py # Python-side memory cleanup utilities │ ├── iso_builder.py # Builds bootable Alpine Linux USBs for air-gapped use │ ├── backup.py # Automatic encrypted backups of wallet files │ ├── jupiter_integration.py # Token swaps via Jupiter aggregator │ └── pyth_integration.py # Live price feeds from Pyth oracle └── secure_signer/ # Rust crate — all private key operations happen here └── src/ ├── crypto.rs # Encryption, key derivation, and signing algorithms ├── secure_buffer.rs # Memory-locked buffers with automatic zeroization ├── ffi.rs # Python-to-Rust bridge (C-compatible function exports) ├── main.rs # Standalone CLI (sign, verify, keygen without Python) ├── lib.rs # Library root and feature flags └── error.rs # Structured error types

Configuration

All settings live in config.py. You can edit this file to change RPC endpoints, directory paths, or the default chain. No environment variables or external config files needed.

Setting Default What it does
ACTIVE_CHAIN "solana" Which blockchain to use — set automatically by the chain picker on launch
SOLANA_RPC_URL devnet Solana RPC endpoint — change to a mainnet URL when ready for real funds
BASE_RPC_URL mainnet.base.org Base L2 RPC endpoint for Coinbase's Ethereum L2
WALLET_DIR /wallet Where encrypted wallet files are stored on your USB drive
INBOX_DIR /inbox Drop unsigned transactions here for air-gapped signing
OUTBOX_DIR /outbox Signed transactions appear here, ready to broadcast from an online machine

Air-Gapped Setup

For maximum security, run Coldstar on a dedicated machine that has never been connected to the internet. This eliminates the main weakness in Coldstar's threat model (OS compromise during signing) because there's no network for an attacker to reach through.

Coldstar enforces this with a kernel module whitelist — only USB storage, filesystem, and keyboard/mouse drivers are allowed to load. All network drivers (WiFi, Ethernet, Bluetooth) are blocked by default.

1Prepare Source USB

On an online machine, clone the repo and all dependencies to a USB drive.

Online Machine
# Clone and download all dependencies offline
git clone https://github.com/devsyrem/coldstar /media/usb/coldstar
cd /media/usb/coldstar
pip download -r local_requirements.txt -d ./packages/
2Install on Air-Gapped Machine

Transfer the USB to the offline machine and install from local packages.

Air-Gapped Machine
cd /media/usb/coldstar
python3 -m venv .venv
source .venv/bin/activate
pip install --no-index --find-links=./packages/ -r local_requirements.txt
3Sign and Broadcast Transactions

Use the USB drive to shuttle transactions between your online and air-gapped machines:

  1. Build the transaction on your online machine (Coldstar creates an unsigned TX file)
  2. Save it to the USB drive's /inbox directory
  3. Move the USB to your air-gapped machine
  4. Sign the transaction — Coldstar reads from /inbox, signs it, and writes the result to /outbox
  5. Move the USB back to your online machine
  6. Broadcast the signed transaction to the Solana network
Why this works

Your private key never touches a machine with internet access. The only data that moves between machines is the unsigned transaction (public) and the signature (public). The private key stays on the air-gapped machine, encrypted on the USB, decrypted only for microseconds during signing.

USB ISO Builder

Don't have a spare computer for air-gapped signing? Coldstar can build a bootable USB that turns any machine into a dedicated signing device. Plug it in, boot from USB, and you have an air-gapped Coldstar environment — no hard drive, no network, no other software.

Requires root to build

Creating the ISO and writing it to USB requires root/admin privileges. The included flash_usb.py script handles device detection and safe writing — it won't let you accidentally overwrite the wrong drive.


View on GitHub · Documentation · Back to Home