Skip to main content

Wallet RPCs

RPC commands for wallet management, encryption, key import/export, descriptors, and address generation on the BTX network.

Note: BTX enforces PQ (post-quantum) policy: only descriptor wallets are supported (descriptors=true). Legacy wallets are disabled.

createwallet

Create a new wallet. BTX wallets use descriptor-based key management with post-quantum key support.

ParameterTypeRequiredDescription
wallet_namestringYesName for the new wallet
disable_private_keysbooleanNo (default false)Create a watch-only wallet
blankbooleanNo (default false)Create a blank wallet with no keys or HD seed
passphrasestringNoEncrypt the wallet with this passphrase
avoid_reusebooleanNo (default false)Track coin reuse for improved privacy
descriptorsbooleanNo (default true)Must be true on BTX
load_on_startupbooleanNoAutomatically load wallet on node startup
external_signerbooleanNo (default false)Use an external signer (hardware wallet)
btx-cli createwallet "mywallet"
btx-cli createwallet "encrypted" false false "mypassphrase"

Returns name (wallet name) and warning (any caveats).

loadwallet

Load a wallet from the wallet directory.

ParameterTypeRequiredDescription
filenamestringYesWallet name or path
load_on_startupbooleanNoAutomatically load on startup
btx-cli loadwallet "mywallet"

unloadwallet

Unload a wallet. If no wallet name is given, unloads the default wallet.

ParameterTypeRequiredDescription
wallet_namestringNoWallet name to unload (default: caller's wallet)
load_on_startupbooleanNoUpdate load-on-startup setting
btx-cli unloadwallet "mywallet"

listwallets

Returns a list of currently loaded wallets. For full information on each wallet, use getwalletinfo.

btx-cli listwallets

Returns an array of wallet name strings.

getwalletinfo

Returns an object containing various wallet state information.

btx-cli getwalletinfo

Key response fields:

FieldDescription
walletnameWallet name
walletversionWallet format version
formatDatabase format (sqlite)
balanceConfirmed balance
unconfirmed_balanceUnconfirmed balance
immature_balanceImmature coinbase balance
txcountTotal transaction count
keypoolsizePre-generated external keys
unlocked_untilUnlock expiry (encrypted wallets only)
descriptorsWhether this wallet uses descriptors (always true on BTX)
private_keys_enabledWhether private keys are available
scanningRescan progress or false

backupwallet

Safely copy the current wallet file to the specified destination.

ParameterTypeRequiredDescription
destinationstringYesDestination file path
btx-cli backupwallet "/backups/wallet.dat"

backupwalletbundle

Create a comprehensive wallet bundle backup that includes the wallet database, descriptor metadata, and PQ key material in a single directory.

ParameterTypeRequiredDescription
destinationstringYesDestination directory path
btx-cli backupwalletbundle "/backups/bundle/"

Run z_verifywalletintegrity before backing up to confirm all key material is present.

backupwalletbundlearchive

Create a wallet bundle backup and compress it into a single archive file.

ParameterTypeRequiredDescription
destinationstringYesDestination archive file path
btx-cli backupwalletbundlearchive "/backups/wallet-bundle.tar.gz"

restorewalletbundlearchive

Restore a wallet from a bundle archive previously created by backupwalletbundlearchive.

ParameterTypeRequiredDescription
wallet_namestringYesName for the restored wallet
archive_pathstringYesPath to the bundle archive
btx-cli restorewalletbundlearchive "restored" "/backups/wallet-bundle.tar.gz"

encryptwallet

Encrypts the wallet with a passphrase. This is a one-time operation -- once encrypted, the passphrase cannot be removed, only changed. The node will shut down after encryption; restart it afterward.

ParameterTypeRequiredDescription
passphrasestringYesThe wallet passphrase (must not be empty)
btx-cli encryptwallet "my-secure-passphrase"

Important: Shielded keys require an encrypted wallet. Encrypt before using any shielded features.

walletpassphrase

Unlock the wallet for the specified number of seconds. Required before signing transactions or deriving shielded keys on an encrypted wallet.

ParameterTypeRequiredDescription
passphrasestringYesThe wallet passphrase
timeoutnumberYesSeconds to keep the wallet unlocked (max 1073741824)
btx-cli walletpassphrase "my-secure-passphrase" 600

walletpassphrasechange

Change the wallet passphrase.

ParameterTypeRequiredDescription
oldpassphrasestringYesCurrent passphrase
newpassphrasestringYesNew passphrase
btx-cli walletpassphrasechange "old-passphrase" "new-passphrase"

dumpprivkey

Reveal the private key for a given address in WIF format. The wallet must be unlocked.

ParameterTypeRequiredDescription
addressstringYesBTX address to dump the key for
btx-cli dumpprivkey "btx1z..."

Returns the WIF-encoded private key string.

importprivkey

Add a private key to the wallet.

ParameterTypeRequiredDescription
privkeystringYesWIF-encoded private key
labelstringNo (default "")Label for the address
rescanbooleanNo (default true)Rescan blockchain for transactions
btx-cli importprivkey "5KJvs..."

listdescriptors

List all descriptors imported into a descriptor-enabled wallet. Includes PQ descriptors with pqhd() and mr() key expressions.

ParameterTypeRequiredDescription
privatebooleanNo (default false)Include private key information
btx-cli listdescriptors

Returns wallet_name and an array of descriptors, each with desc (descriptor string), timestamp, active, internal, and range.

getdescriptorinfo

Analyze a descriptor string and return its canonical form, checksum, and properties.

ParameterTypeRequiredDescription
descriptorstringYesThe output descriptor to analyze
btx-cli getdescriptorinfo "wpkh([d34db33f/84'/0'/0']xpub.../0/*)#checksum"

Returns descriptor (canonical form with checksum), checksum, isrange, issolvable, and hasprivatekeys.

getnewaddress

Generate a new receiving address. On BTX, this produces a P2MR (Merklized Root) address backed by post-quantum keys.

ParameterTypeRequiredDescription
labelstringNo (default "")Label for the address
address_typestringNoAddress type (bech32m default on BTX)
btx-cli getnewaddress "donations"

Returns a new BTX address string.

migratewallet

Migrate a legacy wallet to a descriptor wallet. On BTX, this is required since only descriptor wallets are supported.

ParameterTypeRequiredDescription
wallet_namestringNoName of the wallet to migrate (default: current wallet)
passphrasestringNoPassphrase if the wallet is encrypted
btx-cli migratewallet

Returns wallet_name, watchonly_name (if watch-only scripts were separated), solvables_name (if solvable scripts were separated), and backup_path (path to the backup of the original wallet).