Bitcoin Cash - JSON-RPC

JSON-RPC methods supported on Bitcoin Cash Mainnet and Bitcoin Cash Testnet through Tatum RPC Gateway, with base URLs and an example request.

Call Bitcoin Cash JSON-RPC methods through Tatum RPC Gateway. Send an HTTP POST request with a JSON-RPC 2.0 body to the network's base URL, with your API key in the x-api-key header. See Authentication.

Bitcoin Cash has 2 JSON-RPC interfaces, each with its own base URLs and methods: Bitcoin Cash Node and Rostrum.

Bitcoin Cash Node

Base URLs

NetworkBase URL
Bitcoin Cash Mainnethttps://bitcoin-cash-mainnet.gateway.tatum.io
Bitcoin Cash Testnethttps://bitcoin-cash-testnet.gateway.tatum.io

Example request

curl 'https://bitcoin-cash-mainnet.gateway.tatum.io' \
  --header 'content-type: application/json' \
  --header 'x-api-key: {YOUR_API_KEY}' \
  --data '{"jsonrpc":"2.0","method":"getblockcount","params":[],"id":1}'

Methods

32 methods. Parameters and responses are described in the Bitcoin Cash Node JSON-RPC reference; linked method names go to their page there.

MethodDescription
createrawtransactionCreates an unsigned raw transaction that spends the given inputs to the given outputs.
decoderawtransactionDecodes a hex-encoded raw transaction into JSON.
decodescriptDecodes a hex-encoded script.
estimatefeeEstimates the fee per kilobyte needed for a transaction to confirm. Deprecated in favor of estimatesmartfee on most nodes.
estimatesmartfeeEstimates the fee rate needed for a transaction to confirm within a target number of blocks.
getbestblockhashReturns the hash of the best (tip) block in the most-work chain.
getblockReturns a block by hash, as hex or JSON at the requested verbosity.
getblockchaininfoReturns the state of the blockchain: chain, height, difficulty, verification progress and more.
getblockcountReturns the height of the most-work chain.
getblockhashReturns the hash of the block at a given height.
getblockheaderReturns a block header by hash.
getblockstatsReturns statistics for a block: fees, sizes, transaction counts and more.
getchaintipsReturns information about all known chain tips, including stale branches.
getdifficultyReturns the proof-of-work difficulty as a multiple of the minimum difficulty.
getmempoolancestorsReturns the in-mempool ancestors of a mempool transaction.
getmempoolclusterReturns the mempool cluster that a transaction belongs to.
getmempooldescendantsReturns the in-mempool descendants of a mempool transaction.
getmempoolentryReturns mempool data for a transaction.
getmempoolfeeratediagramReturns the fee rate diagram of the mempool.
getmempoolinfoReturns details on the state of the mempool: size, usage and minimum fee rates.
getnetworkinfoReturns the node's P2P network state: version, protocol, connections and relay fee.
getrawmempoolReturns the IDs of all transactions in the mempool.
getrawtransactionReturns a raw transaction by ID, as hex or JSON.
gettxoutReturns details about an unspent transaction output.
gettxoutproofReturns a hex-encoded proof that one or more transactions were included in a block.
searchrawtransactionsReturns the transactions that involve a given address.
sendrawtransactionSubmits a signed raw transaction to the node and the network.
submitpackageSubmits a package of related raw transactions to the node's mempool.
testmempoolacceptChecks whether raw transactions would be accepted by the mempool, without submitting them.
validateaddressReturns information about an address and whether it is valid.
verifymessageVerifies a message signed with an address's private key.
verifytxoutproofVerifies a proof created by gettxoutproof and returns the transactions it commits to.

The gateway lists its supported methods at runtime:

Rostrum

Base URLs

NetworkBase URL
Bitcoin Cash Mainnethttps://bitcoin-cash-mainnet-rostrum.gateway.tatum.io
Bitcoin Cash Testnethttps://bitcoin-cash-testnet-rostrum.gateway.tatum.io

Example request

curl 'https://bitcoin-cash-mainnet-rostrum.gateway.tatum.io' \
  --header 'content-type: application/json' \
  --header 'x-api-key: {YOUR_API_KEY}' \
  --data '{"jsonrpc":"2.0","method":"blockchain.headers.tip","params":[],"id":1}'

Methods

31 methods. Parameters and responses are described in the Electrum protocol reference; linked method names go to their page there.

MethodDescription
blockchain.address.decodeDecodes an address and returns its type and script hash.
blockchain.address.get_balanceReturns the confirmed and unconfirmed balance of an address.
blockchain.address.get_historyReturns the confirmed and mempool transaction history of an address.
blockchain.address.get_mempoolReturns the mempool transactions that involve an address.
blockchain.address.listunspentReturns the unspent outputs of an address.
blockchain.address.subscribeSubscribes to status changes of an address.
blockchain.address.unsubscribeUnsubscribes from status changes of an address.
blockchain.block.getReturns a raw block by height or hash.
blockchain.block.headerReturns the header of the block at a given height.
blockchain.block.headersReturns a range of consecutive block headers.
blockchain.estimatefeeEstimates the fee rate needed for a transaction to confirm within a target number of blocks.
blockchain.headers.subscribeSubscribes to new block headers and returns the current tip.
blockchain.headers.tipReturns the header of the current chain tip.
blockchain.relayfeeReturns the minimum fee rate the server relays transactions with.
blockchain.scripthash.get_balanceReturns the confirmed and unconfirmed balance of a script hash.
blockchain.scripthash.get_historyReturns the confirmed and mempool transaction history of a script hash.
blockchain.scripthash.get_mempoolReturns the mempool transactions that involve a script hash.
blockchain.scripthash.listunspentReturns the unspent outputs of a script hash.
blockchain.scripthash.subscribeSubscribes to status changes of a script hash.
blockchain.scripthash.unsubscribeUnsubscribes from status changes of a script hash.
blockchain.transaction.broadcastBroadcasts a signed raw transaction to the network.
blockchain.transaction.getReturns a raw transaction by ID, as hex or JSON.
blockchain.transaction.get_merkleReturns the Merkle branch of a confirmed transaction.
blockchain.transaction.id_from_posReturns the ID of the transaction at a given position in a block.
mempool.countReturns the number of transactions in the mempool.
mempool.get_fee_histogramReturns a histogram of mempool fee rates.
server.bannerReturns the server banner.
server.donation_addressReturns the server's donation address.
server.featuresReturns the server's features: protocol versions, genesis hash, hash function and more.
server.pingPings the server to keep the connection alive.
server.versionReturns the server software version and negotiates the protocol version.

The gateway lists its supported methods at runtime:

Method unavailable?

If you need a method we don't support yet, contact support.