A terminal-based development toolkit for Bitcoin developers who are tired of the "it works on my machine" problem.
Caravan-X creates reproducible Bitcoin regtest environments, manages Caravan-compatible multisig wallets, and lets you share exact blockchain states with your team โ all from a beautiful terminal interface.
- What is Caravan?
- What is Caravan-X?
- Why Caravan-X Exists
- Architecture Overview
- Key Concepts
- Installation
- Quick Start
- Modes of Operation
- Documentation
- CLI Reference
- Configuration
- Roadmap
- Troubleshooting
- Contributing
- License
Caravan is a free, open-source Bitcoin ecosystem monorepo maintained by Unchained Capital. It provides tools for creating and managing multisig Bitcoin wallets โ including a web-based coordinator for building transactions, collecting signatures from multiple hardware wallets, and broadcasting to the Bitcoin network.
Caravan is powerful, but setting up a local development environment to test against it is complex. You need to manually install Bitcoin Core, configure a regtest network, set up nginx proxies for CORS, create descriptor wallets with the right format, and ensure every team member has an identical blockchain state. That's where Caravan-X comes in.
Caravan-X is the developer tooling layer that sits underneath Caravan. Think of it as the "backend setup script" that handles everything Caravan needs to function in a development/testing context:
- One-command regtest environments โ Docker spins up Bitcoin Core, nginx, and everything pre-configured
- Caravan-compatible wallets โ Generates
sortedmultidescriptors with proper fingerprints and derivation paths that Caravan expects - Shareable blockchain states โ Package your entire regtest environment (blockchain data, wallets, keys, transaction history) into a
.caravan-envarchive and hand it to a teammate - Pre-built test scenarios โ RBF, CPFP, multisig signing flows, privacy analysis โ all ready to run
- Scripting engine โ Automate complex Bitcoin scenarios with JavaScript or JSON scripts
- Profile isolation โ Run multiple independent regtest environments simultaneously with Docker
If you've ever tried to test Bitcoin multisig workflows, you know the pain:
- Setup hell โ Installing Bitcoin Core, writing
bitcoin.conf, configuring RPC auth, setting up CORS proxies, generating initial blocks, creating descriptor wallets with the exact right format... - "Works on my machine" โ Your teammate's regtest has different wallets, different block heights, different UTXOs. Bug reproductions become impossible.
- Descriptor nightmares โ Caravan expects
sortedmultidescriptors with[fingerprint/48'/1'/0'/2']xpub/0/*format. One wrong character and nothing works. - No reproducibility โ You spend 30 minutes setting up the perfect test state, then need to recreate it from scratch the next day.
Caravan-X eliminates all of this. One command, and you have a fully configured regtest environment that's identical every time and shareable with anyone on your team.
src/
โโโ cli.ts # CLI entry point (Commander.js commands)
โโโ index.ts # Main application class (CaravanRegtestManager)
โโโ commands/ # User-facing command handlers
โ โโโ wallet.ts # Bitcoin wallet operations
โ โโโ multisig.ts # Caravan multisig wallet management
โ โโโ transaction.ts # PSBT creation, signing, broadcasting
โ โโโ docker.ts # Docker container management
โ โโโ snapshot.ts # Blockchain state save/restore
โ โโโ scenario.ts # Pre-built test scenario execution
โ โโโ environment.ts # Environment export/import (.caravan-env)
โ โโโ settings.ts # Configuration and profile management
โ โโโ system.ts # Mining, system info, data export/import
โโโ core/ # Business logic and service layer
โ โโโ rpc.ts # Bitcoin Core RPC client
โ โโโ bitcoin.ts # Bitcoin operations (wallet, address, tx)
โ โโโ caravan.ts # Caravan-specific wallet/descriptor logic
โ โโโ docker.ts # Docker container orchestration + nginx
โ โโโ profiles.ts # Profile isolation system
โ โโโ snapshot.ts # Snapshot create/restore/compare logic
โ โโโ environment.ts # .caravan-env archive export/import
โ โโโ transaction.ts # Transaction building, PSBT handling
โโโ scripting/ # Automation engine
โ โโโ ScriptEngine.ts # JS + JSON script executor
โ โโโ cli-integration.ts # Script commands for TUI/CLI
โ โโโ templates/ # Built-in scenario templates
โ โโโ README.md # Scripting documentation
โโโ types/ # TypeScript type definitions
โ โโโ config.ts # Configuration, profile, docker types
โ โโโ environment.ts # Environment sharing types
โโโ ui/ # Terminal UI components
โ โโโ mainMenu.ts # Interactive menu system
โ โโโ setupWizard.ts # First-run configuration wizard
โโโ utils/ # Shared utilities
โโโ errors.ts # Centralized error handling + categorization
โโโ logger.ts # Multi-level logging system
โโโ terminal.ts # Terminal formatting helpers
- User interacts with the TUI (arrow keys + Enter) or CLI commands
- Command handlers (
src/commands/) validate input and orchestrate operations - Core services (
src/core/) execute the actual logic (RPC calls, Docker commands, file operations) - Bitcoin Core receives RPC commands through the nginx proxy (Docker) or directly (Manual)
- Results are formatted and displayed back to the user with progress indicators
The command layer handles user-facing display, while the service layer uses log.debug() for internal tracing. Errors bubble up from services to commands, where they're transformed into user-friendly messages with specific troubleshooting suggestions.
Every Caravan-X configuration is a profile โ an isolated directory containing everything for that specific setup:
~/.caravan-x/
โโโ profiles/
โโโ a1b2c3d4/ # Docker Profile "My Test Setup"
โ โโโ config.json # Profile-scoped configuration
โ โโโ docker-data/ # Bitcoin Core blockchain data
โ โ โโโ bitcoin-data/
โ โ โโโ nginx/
โ โโโ wallets/ # Caravan wallet JSON configs
โ โโโ keys/ # Private key files
โ โโโ snapshots/ # Saved blockchain states
โ โโโ scenarios/ # Custom test scripts
โ โโโ logs/ # Profile-specific logs
โโโ e5f6g7h8/ # Docker Profile "Fee Bumping Tests"
โโโ ... (completely isolated)
Why profiles matter:
- No data leakage โ Wallets from Profile A never appear in Profile B's exports
- Simultaneous Docker profiles โ Each gets its own container with unique ports
- Manual mode limit โ Only one Manual profile is allowed (since all Manual profiles share the same
bitcoindinstance) - Switch instantly โ Change between profiles in Settings without losing anything
| Feature | Docker Mode | Manual Mode |
|---|---|---|
| Bitcoin Core setup | Automatic | You manage it |
| nginx CORS proxy | Included | You configure it |
| Multiple profiles | Yes (each gets own container) | One profile max |
| Snapshots | Yes | Not available |
| Environment sharing | Full support | Limited |
| Port conflicts | Auto-resolved | Manual resolution |
| Caravan integration | Pre-configured | Manual CORS setup |
Caravan-X generates descriptors in the exact format Caravan expects:
wsh(sortedmulti(2,[fingerprint1/48'/1'/0'/2']xpub1/0/*,[fingerprint2/48'/1'/0'/2']xpub2/0/*))
Key requirements that Caravan-X handles automatically:
- Uses
sortedmultiinstead ofmulti(Caravan requirement) - Includes full derivation paths with fingerprints:
[abcd1234/48'/1'/0'/2'] - Obtains checksums from Bitcoin Core via
getdescriptorinfobefore importing - Creates both receive (
/0/*) and change (/1/*) descriptors
You'll need Node.js v22 or later. Then install globally via npm:
npm install -g caravan-xThat's it. Run caravan-x and you're off to the races.
git clone https://github.com/Legend101Zz/CaravanX.git
cd CaravanX
npm install
npm run build
npm link # Makes 'caravan-x' available globallycaravan-x --versionFor development (if you want to contribute or modify):
git clone https://github.com/Legend101Zz/CaravanX.git
cd CaravanX
npm install
npm run build
npm link # Makes caravan-x available globallycaravan-x- Select "Docker Mode (Recommended)"
- Accept defaults or customize RPC credentials, ports, container name
- Name your profile (e.g., "My Dev Setup")
- Wait ~30 seconds for Bitcoin Core + nginx to spin up
- You now have a running regtest with 101 blocks and spendable coins
caravan-x- Select "Manual Mode"
- Enter your Bitcoin Core RPC connection details (host, port, user, pass)
- Point to your Bitcoin Core data directory
- Start using wallet and transaction features immediately
Prerequisite for Manual Mode: Bitcoin Core must already be running in regtest mode. See Manual Mode Setup Guide.
Docker mode is fully automated. When you create a Docker profile, Caravan-X:
- Checks Docker is installed and running
- Detects system architecture (handles ARM64/Apple Silicon with
--platform linux/amd64) - Creates a Docker network (
caravan-x-network) - Scans for port conflicts and auto-assigns alternatives if 18443/18444/8080 are busy
- Generates
bitcoin.confwith your RPC credentials - Starts the
bitcoin/bitcoin:27.0container with proper volume mounts - Waits for Bitcoin Core to be ready (with retry logic)
- Starts an nginx container with CORS headers for Caravan browser access
- Creates a
mining_walletand generates 101 blocks (coins become spendable) - Creates a watch-only wallet for Caravan integration
- Tests the full RPC connection chain
Your node is then accessible at http://localhost:8080 (or whichever port was assigned).
For developers who want full control. You provide the RPC connection details and Caravan-X connects to your existing Bitcoin Core. You get all features except Docker management, snapshots, and environment sharing.
Minimal bitcoin.conf for Manual Mode:
# Global settings (must be at root level)
rpcuser=your_username
rpcpassword=your_password
server=1
# Regtest-specific settings (must be in [regtest] section)
[regtest]
rpcport=18443
rpcbind=0.0.0.0
rpcallowip=0.0.0.0/0
โ ๏ธ Modern Bitcoin Core (v0.17+) requires network-specific settings likerpcportto be in the[regtest]section, while auth credentials remain global.
Detailed user guides live in the docs/ folder:
| Guide | Description |
|---|---|
| Getting Started | First-time setup walkthrough |
| Docker Mode Guide | Docker profiles, multiple environments, container management |
| Manual Mode Guide | Connecting to your own Bitcoin Core |
| Basic Wallets | Creating, viewing, funding, and sending with basic wallets |
| Caravan Multisig | Creating multisig wallets, funding, spending, signing PSBTs |
| Transactions | PSBT creation, signing, finalizing, and broadcasting |
| Environment Sharing | Exporting and importing .caravan-env archives |
| Snapshots | Saving and restoring blockchain states |
| Scripting Engine | Automating scenarios with JS/JSON scripts |
| Test Scenarios | Built-in RBF, CPFP, and multisig scenarios |
| Visualization | Blockchain activity visualization (Manual mode) |
| Working with Caravan | Connecting Caravan-X to the Caravan web UI |
| Profiles & Settings | Managing multiple configurations |
| Troubleshooting | Common issues and solutions |
๐น Each guide includes video walkthroughs. Videos coming soon!
Every TUI feature is also available as a direct command โ useful for scripting and CI/CD.
caravan-x list-wallets # List all wallets
caravan-x create-wallet --name my_wallet # Create a regular wallet
caravan-x create-wallet --name my_watch --watch-only # Watch-only wallet
caravan-x fund-wallet --name my_wallet --blocks 10 # Mine blocks to fund
caravan-x send --from wallet_a --to wallet_b --amount 1.5caravan-x create-caravan # Interactive multisig creation wizard
caravan-x list-caravan # List all Caravan wallets
caravan-x sign-caravan-psbt --file transaction.psbt --key
caravan-x import-caravan --file wallet_config.jsoncaravan-x create-psbt # Create a new PSBT
caravan-x mine --blocks 6 --wallet my_walletcaravan-x run-script --file my_scenario.js
caravan-x run-script --file my_scenario.js --verbose
caravan-x run-script --file my_scenario.js --dry-run
caravan-x create-script --name "my_test" --type jscaravan-x env export --name "team-setup" --output ./team-setup.caravan-env
caravan-x env import ./team-setup.caravan-env
caravan-x env inspect ./team-setup.caravan-envcaravan-x system-info
caravan-x simulate --blocks 5 --transactions 3Configuration is stored per-profile at ~/.caravan-x/profiles/<id>/config.json:
{
"mode": "docker",
"bitcoin": {
"protocol": "http",
"host": "localhost",
"port": 8080,
"user": "caravan_user",
"pass": "caravan_pass",
"dataDir": "~/.caravan-x/profiles/a1b2c3d4/docker-data/bitcoin-data"
},
"docker": {
"enabled": true,
"image": "bitcoin/bitcoin:27.0",
"containerName": "caravan-x-bitcoin-a1b2c3d4",
"ports": { "rpc": 18443, "p2p": 18444, "nginx": 8080 },
"network": "caravan-x-network"
},
"snapshots": {
"enabled": true,
"directory": "~/.caravan-x/profiles/a1b2c3d4/snapshots",
"autoSnapshot": false
}
}You can edit configuration through the TUI: Settings โ Edit Current Config.
- Docker mode with automated Bitcoin Core setup
- Manual mode for existing installations
- nginx proxy with CORS for Caravan integration
- Pre-configured test scenarios (RBF, CPFP, Multisig)
- Snapshot and restore for blockchain states
- Caravan-compatible descriptors (
sortedmultiwith proper paths) - Privacy profile testing (good/moderate/bad wallets)
- JavaScript and JSON scripting engine
- Profile isolation system
- Interactive setup wizard
- Mode-specific menus
- Improved mempool.space-style visualization
- Better transaction flow diagrams
- Real-time UTXO updates
- Basic snapshot export
-
.caravan-envarchive format for complete environments - One-command environment import into isolated profiles
- Version-controlled environment definitions
- Natural language commands via LLM integration
- Support for OpenRouter, Claude, OpenAI, Ollama
- Generate scripts from descriptions
- Automated scenario creation
Caravan-X is designed to work seamlessly with Caravan (the web-based multisig coordinator).
- Start Caravan-X in Docker mode
- In Caravan's settings, set the Bitcoin node URL to
http://localhost:8080 - Use the same RPC credentials you configured in Caravan-X
When you create a multisig wallet in Caravan-X:
- A configuration file is saved to
~/.caravan-x/wallets/ - In Caravan, go to Wallet > Import
- Load the configuration JSON file
- Caravan will recognize the descriptors and show your addresses
- Create a spending transaction in Caravan
- Export the PSBT
- In Caravan-X, go to Caravan Multisig > Sign Caravan PSBT
- Sign with the appropriate key
- The signature JSON is copied to clipboard
- In Caravan, import the signature
See the full Troubleshooting Guide. Common issues:
Docker won't start: Make sure Docker Desktop is running. Check docker --version.
Port already in use: Caravan-X auto-detects and reassigns ports. If it persists: lsof -i :8080 to find what's using the port.
Can't connect to Bitcoin Core (Manual): Verify bitcoind -regtest is running, check RPC credentials match bitcoin.conf, ensure server=1 is set.
Caravan can't see wallets: Use Docker mode (includes nginx CORS proxy), or manually configure CORS on your setup. Set Caravan's node URL to http://localhost:8080.
Descriptors not importing: Ensure you're using Bitcoin Core v0.17+ with descriptor wallets. Caravan-X uses sortedmulti format automatically.
Caravan-X is open source and contributions are welcome. Here's how to get involved:
- Fork the repository
- Create a feature branch
- Make your changes
- Run
npm run lintandnpm test - Submit a pull request
Areas where help is appreciated: test scenario templates, improved mempool visualization, documentation, bug fixes.
Report issues: GitHub Issues
MIT License - see LICENSE file for details.
Built with care for the Bitcoin development community by Mrigesh Thakur.


