📹 Video walkthrough: Coming soon
The scripting engine lets you automate complex Bitcoin scenarios using JavaScript or JSON declarative scripts.
From the main menu, select 📜 Blockchain Scripts:
Browse script templates
Create a new script
Run a script
Manage saved scripts
Run Health Privacy Test
Run Multisig RBF Test
Run Multisig CPFP Test
- Learning — Understand Bitcoin transaction mechanics through runnable examples
- Testing — Automate wallet and transaction testing
- Reproducibility — Run the exact same scenario every time
- Complexity — Orchestrate multi-step workflows (create wallets → fund → send → RBF → CPFP)
Full access to Caravan-X services:
// Available globals: bitcoinService, transactionService, rpcClient, caravanService, config
// Create wallets
await bitcoinService.createWallet("alice");
await bitcoinService.createWallet("bob");
// Fund alice
const address = await bitcoinService.getNewAddress("alice");
await rpcClient.callRpc("generatetoaddress", [101, address]);
// Send to bob
const bobAddr = await bitcoinService.getNewAddress("bob");
await bitcoinService.sendToAddress("alice", bobAddr, 5.0);
// Mine to confirm
await rpcClient.callRpc("generatetoaddress", [1, address]);
console.log("Done! Bob has 5 BTC.");Step-by-step actions in JSON format:
{
"name": "Simple Transfer",
"description": "Create two wallets and transfer funds",
"steps": [
{ "action": "CREATE_WALLET", "params": { "name": "alice" } },
{ "action": "CREATE_WALLET", "params": { "name": "bob" } },
{ "action": "MINE_BLOCKS", "params": { "count": 101, "toWallet": "alice" } },
{ "action": "CREATE_TRANSACTION", "params": {
"fromWallet": "alice",
"outputs": [{ "bob_address": 5.0 }]
}},
{ "action": "MINE_BLOCKS", "params": { "count": 1, "toWallet": "alice" } }
]
}- Select Run a script
- Choose execution options:
- Dry Run — Preview without executing
- Verbose — Detailed logging
- Interactive — Confirm each step
# Run a script
caravan-x run-script --file my_scenario.js
# Verbose mode
caravan-x run-script --file my_scenario.js --verbose
# Dry run
caravan-x run-script --file my_scenario.js --dry-run
# Run a template
caravan-x run-script --template "Replace-By-Fee Transaction Example"Creates a low-fee transaction, then replaces it with a higher-fee version. Demonstrates RBF mechanics.
Creates a stuck low-fee parent transaction, then a high-fee child transaction that bumps both through.
Sets up a 2-of-3 multisig wallet, funds it, creates a low-fee transaction, then replaces it with a higher-fee RBF transaction — all with proper multi-signature collection.
Similar to Multisig RBF, but uses the CPFP fee-bumping strategy instead.
Creates three multisig wallets with different privacy profiles (good, moderate, bad) and populates them with realistic transaction patterns for testing privacy analysis tools.
TUI: Blockchain Scripts → Create a new script
- Enter a script name
- Choose type: JavaScript or JSON
- Edit the script in your default editor
- Save to the profile's
scenarios/directory
For comprehensive scripting documentation, see the Scripting Engine README.