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
| Network | Base URL |
|---|---|
| Bitcoin Cash Mainnet | https://bitcoin-cash-mainnet.gateway.tatum.io |
| Bitcoin Cash Testnet | https://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.
| Method | Description |
|---|---|
createrawtransaction | Creates an unsigned raw transaction that spends the given inputs to the given outputs. |
decoderawtransaction | Decodes a hex-encoded raw transaction into JSON. |
decodescript | Decodes a hex-encoded script. |
estimatefee | Estimates the fee per kilobyte needed for a transaction to confirm. Deprecated in favor of estimatesmartfee on most nodes. |
estimatesmartfee | Estimates the fee rate needed for a transaction to confirm within a target number of blocks. |
getbestblockhash | Returns the hash of the best (tip) block in the most-work chain. |
getblock | Returns a block by hash, as hex or JSON at the requested verbosity. |
getblockchaininfo | Returns the state of the blockchain: chain, height, difficulty, verification progress and more. |
getblockcount | Returns the height of the most-work chain. |
getblockhash | Returns the hash of the block at a given height. |
getblockheader | Returns a block header by hash. |
getblockstats | Returns statistics for a block: fees, sizes, transaction counts and more. |
getchaintips | Returns information about all known chain tips, including stale branches. |
getdifficulty | Returns the proof-of-work difficulty as a multiple of the minimum difficulty. |
getmempoolancestors | Returns the in-mempool ancestors of a mempool transaction. |
getmempoolcluster | Returns the mempool cluster that a transaction belongs to. |
getmempooldescendants | Returns the in-mempool descendants of a mempool transaction. |
getmempoolentry | Returns mempool data for a transaction. |
getmempoolfeeratediagram | Returns the fee rate diagram of the mempool. |
getmempoolinfo | Returns details on the state of the mempool: size, usage and minimum fee rates. |
getnetworkinfo | Returns the node's P2P network state: version, protocol, connections and relay fee. |
getrawmempool | Returns the IDs of all transactions in the mempool. |
getrawtransaction | Returns a raw transaction by ID, as hex or JSON. |
gettxout | Returns details about an unspent transaction output. |
gettxoutproof | Returns a hex-encoded proof that one or more transactions were included in a block. |
searchrawtransactions | Returns the transactions that involve a given address. |
sendrawtransaction | Submits a signed raw transaction to the node and the network. |
submitpackage | Submits a package of related raw transactions to the node's mempool. |
testmempoolaccept | Checks whether raw transactions would be accepted by the mempool, without submitting them. |
validateaddress | Returns information about an address and whether it is valid. |
verifymessage | Verifies a message signed with an address's private key. |
verifytxoutproof | Verifies a proof created by gettxoutproof and returns the transactions it commits to. |
The gateway lists its supported methods at runtime:
Rostrum
Base URLs
| Network | Base URL |
|---|---|
| Bitcoin Cash Mainnet | https://bitcoin-cash-mainnet-rostrum.gateway.tatum.io |
| Bitcoin Cash Testnet | https://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.
| Method | Description |
|---|---|
blockchain.address.decode | Decodes an address and returns its type and script hash. |
blockchain.address.get_balance | Returns the confirmed and unconfirmed balance of an address. |
blockchain.address.get_history | Returns the confirmed and mempool transaction history of an address. |
blockchain.address.get_mempool | Returns the mempool transactions that involve an address. |
blockchain.address.listunspent | Returns the unspent outputs of an address. |
blockchain.address.subscribe | Subscribes to status changes of an address. |
blockchain.address.unsubscribe | Unsubscribes from status changes of an address. |
blockchain.block.get | Returns a raw block by height or hash. |
blockchain.block.header | Returns the header of the block at a given height. |
blockchain.block.headers | Returns a range of consecutive block headers. |
blockchain.estimatefee | Estimates the fee rate needed for a transaction to confirm within a target number of blocks. |
blockchain.headers.subscribe | Subscribes to new block headers and returns the current tip. |
blockchain.headers.tip | Returns the header of the current chain tip. |
blockchain.relayfee | Returns the minimum fee rate the server relays transactions with. |
blockchain.scripthash.get_balance | Returns the confirmed and unconfirmed balance of a script hash. |
blockchain.scripthash.get_history | Returns the confirmed and mempool transaction history of a script hash. |
blockchain.scripthash.get_mempool | Returns the mempool transactions that involve a script hash. |
blockchain.scripthash.listunspent | Returns the unspent outputs of a script hash. |
blockchain.scripthash.subscribe | Subscribes to status changes of a script hash. |
blockchain.scripthash.unsubscribe | Unsubscribes from status changes of a script hash. |
blockchain.transaction.broadcast | Broadcasts a signed raw transaction to the network. |
blockchain.transaction.get | Returns a raw transaction by ID, as hex or JSON. |
blockchain.transaction.get_merkle | Returns the Merkle branch of a confirmed transaction. |
blockchain.transaction.id_from_pos | Returns the ID of the transaction at a given position in a block. |
mempool.count | Returns the number of transactions in the mempool. |
mempool.get_fee_histogram | Returns a histogram of mempool fee rates. |
server.banner | Returns the server banner. |
server.donation_address | Returns the server's donation address. |
server.features | Returns the server's features: protocol versions, genesis hash, hash function and more. |
server.ping | Pings the server to keep the connection alive. |
server.version | Returns 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.