RPC Reference
Complete JSON-RPC API reference for the BTX node.
Connecting to the RPC Interface
The BTX node exposes a JSON-RPC interface on port 19334 (mainnet). Authentication uses a .cookie file auto-generated on startup, or explicit rpcuser/rpcpassword in btx.conf.
# Using btx-cli (recommended)
btx-cli -rpcport=19334 getmininginfo
# Using curl
curl --user __cookie__:$(cat ~/.btx/.cookie) \
--data-binary '{"jsonrpc":"2.0","method":"getmininginfo","params":[]}' \
-H 'content-type: text/plain;' \
http://127.0.0.1:19334/ Security: The RPC interface has no built-in encryption. Never expose it on a public network. Use SSH tunneling or a VPN for remote access.
API Endpoints
| Endpoint | Purpose |
|---|---|
/ | Default RPC endpoint (non-wallet + single-wallet) |
/wallet/<name>/ | Wallet-specific endpoint (required for multi-wallet) |
Command Categories
Blockchain
Query chain state, blocks, headers, and UTXO set.
getbestblockhash getblock getblockcount getblockhash getblockheader getblockstats getchaintips getchaintxstats gettxout gettxoutsetinfo verifychain
Full blockchain RPC reference →
Mining & Difficulty
Block template construction, submission, and difficulty health monitoring.
getblocktemplate submitblock getmininginfo getnetworkhashps getdifficultyhealth getmatmulchallenge generatetoaddress
Service Challenges
MatMul-based proof-of-work for API rate limiting, spam prevention, and AI endpoint gating.
getmatmulservicechallenge verifymatmulserviceproof redeemmatmulserviceproof verifymatmulserviceproofs redeemmatmulserviceproofs
Full service challenge reference →
Wallet
Wallet creation, backup, key management, and transaction signing.
createwallet backupwallet backupwalletbundle encryptwallet getwalletinfo listdescriptors migratewallet
Network
Peer management, connection info, and ban lists.
getpeerinfo getconnectioncount addnode disconnectnode setban getnetworkinfo
Transactions
Raw transaction creation, decoding, signing, and PSBT operations.
createrawtransaction decoderawtransaction sendrawtransaction signrawtransactionwithkey createpsbt finalizepsbt
Full transaction RPC reference →
Shielded Pool
SMILE v2 shielded transaction operations and bridge settlement.
z_verifywalletintegrity bridge_planin bridge_planbatchin bridge_planout bridge_buildshieldtx bridge_submitshieldtx
Full shielded pool RPC reference →
REST API
BTX also provides unauthenticated REST endpoints for common queries:
| Endpoint | Format | Description |
|---|---|---|
/rest/block/<hash> | .json .hex .bin | Block data |
/rest/tx/<hash> | .json .hex .bin | Transaction lookup |
/rest/chaininfo | .json | Blockchain state |
/rest/mempool/info | .json | Mempool statistics |
/rest/getutxos/<txid>-<n> | .json .hex .bin | UTXO query |
/rest/blockhashbyheight/<h> | .json .hex .bin | Height to hash |