Ir al contenido principal

RPC Reference

Complete JSON-RPC API reference for the BTX node.

Elige una ruta

Empieza por el flujo que coincide con el motivo de tu visita.

La documentación es amplia. Estas dos rutas te llevan directo al material para operadores y builders que respalda los nuevos micrositios.

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

EndpointPurpose
/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

Full mining RPC reference →

Service Challenges

MatMul-based proof-of-work for API rate limiting, spam prevention, and AI endpoint gating.

getmatmulservicechallenge getmatmulservicechallengeprofile getmatmulservicechallengeplan issuematmulservicechallengeprofile solvematmulservicechallenge verifymatmulserviceproof redeemmatmulserviceproof verifymatmulserviceproofs redeemmatmulserviceproofs

Referencia completa de service challenges →

Wallet

Wallet creation, backup, key management, and transaction signing.

createwallet backupwallet backupwalletbundle encryptwallet getwalletinfo listdescriptors migratewallet

Full wallet RPC reference →

Network

Peer management, connection info, and ban lists.

getpeerinfo getconnectioncount addnode disconnectnode setban getnetworkinfo

Full network RPC reference →

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:

EndpointFormatDescription
/rest/block/<hash>.json .hex .binBlock data
/rest/tx/<hash>.json .hex .binTransaction lookup
/rest/chaininfo.jsonBlockchain state
/rest/mempool/info.jsonMempool statistics
/rest/getutxos/<txid>-<n>.json .hex .binUTXO query
/rest/blockhashbyheight/<h>.json .hex .binHeight to hash