Bitcoin Cash

Bitcoin Cash Blockchain enables access to the most commonly used Bitcoin Cash methods. These methods bring a small level of abstraction and are used for applications that communicate with the blockchain directly. Some of the methods are used alongside Tatum Private Ledger to connect the blockchain and the private ledger, like wallet generation or getting information about transactions.
Tatum supports 2 chains:

  • Mainnet - a regular live chain
  • Testnet - a chain used for testing purposes. Coins on the test chain have no value and can be obtained from a faucet, e.g. https://faucet.fullstack.cash/
Tatum supports BIP44 HD wallets. Because they can generate 2^31 addresses from 1 mnemonic phrase, they are very convenient and secure. It is possible to generate this type of wallet with 1 simple API call.

Generate Bitcoin Cash wallet

5 credits per API call.


Tatum supports BIP44 HD wallets. It is very convenient and secure, since it can generate 2^31 addresses from 1 mnemonic phrase. Mnemonic phrase consists of 24 special words in defined order and can restore access to all generated addresses and private keys.
Each address is identified by 3 main values:

  • Private Key - your secret value, which should never be revealed
  • Public Key - public address to be published
  • Derivation index - index of generated address

Tatum follows BIP44 specification and generates for Bitcoin Cash wallet with derivation path m'/44'/145'/0'/0. More about BIP44 HD wallets can be found here - https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki. Generate BIP44 compatible Bitcoin Cash wallet.

SecurityX-API-Key
Request
query Parameters
mnemonic
string <= 500 characters

Mnemonic to use for generation of extended public and private keys.

Responses
200

OK

400

Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.

401

Unauthorized. Not valid or inactive subscription key present in the HTTP Header.

500

Internal server error. There was an error on the server while processing the request.

get/v3/bcash/wallet
Request samples
Response samples
application/json
{
  • "mnemonic": "urge pulp usage sister evidence arrest palm math please chief egg abuse",
  • "xpub": "xpub6EsCk1uU6cJzqvP9CdsTiJwT2rF748YkPnhv5Qo8q44DG7nn2vbyt48YRsNSUYS44jFCW9gwvD9kLQu9AuqXpTpM1c5hgg9PsuBLdeNncid"
}

JSON RPC HTTP driverDeprecated

2 credits per API call

This endpoint is deprecated. Use the HTTP-based JSON RPC driver instead.


Use this endpoint URL as an http-based JSON RPC driver to connect directly to the node provided by Tatum. To learn more about JSON RPC, visit Bitcoin Cash developers' guide.

SecurityX-API-Key
Request
Request Body schema: application/json
required
jsonrpc
string

Version of the JSON RPC.

id
string

ID of the request, could be any arbitrary identifier.

method
string

Method to invoke on the node.

params
Array of arrays

Params to the method call, if required.

Responses
200

OK

400

Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.

401

Unauthorized. Not valid or inactive subscription key present in the HTTP Header.

500

Internal server error. There was an error on the server while processing the request.

post/v3/bcash/node
Request samples
application/json
{ }
Response samples
application/json
{
  • "jsonrpc": "1.0",
  • "id": "test",
  • "result": 654321
}

Get Bitcoin Cash Blockchain Information

5 credits per API call.


Get Bitcoin Cash Blockchain Information. Obtain basic info like testnet / mainnet version of the chain, current block number and it's hash.

SecurityX-API-Key
Responses
200

OK

401

Unauthorized. Not valid or inactive subscription key present in the HTTP Header.

403

Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.

500

Internal server error. There was an error on the server while processing the request.

get/v3/bcash/info
Request samples
Response samples
application/json
{
  • "chain": "main",
  • "blocks": 609604,
  • "bestblockhash": "0000000000000000024997c878c5a90bd73cd50060877c4f70eef1f2e92243f5",
  • "difficulty": 375206303347.133
}

Get Bitcoin Cash Block hash

5 credits per API call.


Get Bitcoin Cash Block hash. Returns hash of the block to get the block detail.

SecurityX-API-Key
Request
path Parameters
i
required
number

The number of blocks preceding a particular block on a block chain.

Example: 1580117
Responses
200

OK

400

Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.

401

Unauthorized. Not valid or inactive subscription key present in the HTTP Header.

403

Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.

500

Internal server error. There was an error on the server while processing the request.

get/v3/bcash/block/hash/{i}
Request samples
Response samples
application/json
{
  • "hash": "0000000053f225e202cf27fe3046e06719efd3b31b5ab75fc5ef7f853c8b246f"
}

Get Bitcoin Cash Block by hash

5 credits per API call.


Get Bitcoin Cash Block detail by block hash or height.

SecurityX-API-Key
Request
path Parameters
hash
required
string

Block hash or height

Example: 00000000000000cfb22714715f09b3721f89819a325f7f4d39b2c22a061d1be8
Responses
200

OK

400

Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.

401

Unauthorized. Not valid or inactive subscription key present in the HTTP Header.

403

Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.

500

Internal server error. There was an error on the server while processing the request.

get/v3/bcash/block/{hash}
Request samples
Response samples
application/json
{
  • "hash": "000000000000000005e14d3f9fdfb70745308706615cfa9edca4f4558332b201",
  • "size": 81577,
  • "height": 500000,
  • "version": 536870912,
  • "merkleroot": "4af279645e1b337e655ae3286fc2ca09f58eb01efa6ab27adedd1e9e6ec19091",
  • "tx": [
    ],
  • "time": 1509343584,
  • "nonce": 3604508752,
  • "difficulty": 113081236211.45331,
  • "confirmations": 109602,
  • "previousblockhash": "0000000000000000043831d6ebb013716f0580287ee5e5687e27d0ed72e6e523",
  • "nextblockhash": "00000000000000000568f0a96bf4348847bc84e455cbfec389f27311037a20f3"
}

Get Bitcoin Cash Transaction by hash

5 credits per API call.


Get Bitcoin Cash Transaction by transaction hash.

SecurityX-API-Key
Request
path Parameters
hash
required
string

Transaction hash

Example: 1451692ebbfbea1a2d2ec6fe6782596b6aa2e46c0589d04c406f491b5b46bc6a
Responses
200

OK

400

Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.

401

Unauthorized. Not valid or inactive subscription key present in the HTTP Header.

403

Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.

500

Internal server error. There was an error on the server while processing the request.

get/v3/bcash/transaction/{hash}
Request samples
Response samples
application/json
{
  • "txid": "fe28050b93faea61fa88c4c630f0e1f0a1c24d0082dd0e10d369e13212128f33",
  • "version": 1,
  • "locktime": 0,
  • "vin": [
    ],
  • "vout": [
    ]
}

Get Bitcoin Cash Transactions by addressDeprecated

5 credits per API call.


Get Bitcoin Cash Transaction by address. Limit is 50 transaction per response.

SecurityX-API-Key
Request
path Parameters
address
required
string

Address

Example: 2MsM67NLa71fHvTUBqNENW15P68nHB2vVXb
query Parameters
skip
integer

Define, how much transactions should be skipped to obtain another page.

Example: skip=2
Responses
200

OK

400

Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.

401

Unauthorized. Not valid or inactive subscription key present in the HTTP Header.

403

Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.

500

Internal server error. There was an error on the server while processing the request.

get/v3/bcash/transaction/address/{address}
Request samples
Response samples
application/json
[
  • {
    }
]

Generate Bitcoin Cash deposit address from Extended public key

5 credits per API call.


Generate Bitcoin Cash deposit address from Extended public key. Deposit address is generated for the specific index - each extended public key can generate up to 2^31 addresses starting from index 0 until 2^31 - 1. Generates new format of address starting with bitcoincash: in case of mainnet, bchtest: in case of testnet..

SecurityX-API-Key
Request
path Parameters
xpub
required
string

Extended public key of wallet.

Example: xpub6EsCk1uU6cJzqvP9CdsTiJwT2rF748YkPnhv5Qo8q44DG7nn2vbyt48YRsNSUYS44jFCW9gwvD9kLQu9AuqXpTpM1c5hgg9PsuBLdeNncid
index
required
number

Derivation index of desired address to be generated.

Responses
200

OK

400

Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.

401

Unauthorized. Not valid or inactive subscription key present in the HTTP Header.

500

Internal server error. There was an error on the server while processing the request.

get/v3/bcash/address/{xpub}/{index}
Request samples
Response samples
application/json
{
  • "address": "bitcoincash:qrd9khmeg4nqag3h5gzu8vjt537pm7le85lcauzezc"
}

Generate Bitcoin Cash private key

5 credits per API call.


Generate private key for address from mnemonic for given derivation path index. Private key is generated for the specific index - each mnemonic can generate up to 2^32 private keys starting from index 0 until 2^31 - 1.

SecurityX-API-Key
Request
Request Body schema: application/json
required
index
required
integer <= 2147483647

Derivation index of private key to generate.

mnemonic
required
string [ 1 .. 500 ] characters

Mnemonic to generate private key from.

Responses
200

OK

400

Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.

401

Unauthorized. Not valid or inactive subscription key present in the HTTP Header.

500

Internal server error. There was an error on the server while processing the request.

post/v3/bcash/wallet/priv
Request samples
application/json
{
  • "index": 0,
  • "mnemonic": "urge pulp usage sister evidence arrest palm math please chief egg abuse"
}
Response samples
application/json
{
  • "key": "cTmS2jBWXgFaXZ2xG9jhn67TiyTshnMp3UedamzEhGm6BZV1vLgQ"
}

Send BCH to Bitcoin Cash addresses

10 credits per API call

Send BCH to blockchain addresses.

Bitcoin Cash transactions are based on UTXOs. "UTXO" stands for "Unspent Transaction Output". A UTXO is the amount of BCH that remains at a Bitcoin Cash address after a cryptocurrency transaction involving this address has been performed. The UTXO can then be used as input for a new cryptocurrency transaction. For more information the UTXO, see the Bitcoin user documentation.

You build a BCH transaction by sending BCH from UTXOs. Each UTXO is included in the transaction.

When an UTXO is entered into a transaction, the whole UTXO amount is included and must be spent. For example, address A receives two transactions, T1 with 1 BCH and T2 with 2 BCH. A transaction that consumes the UTXOs from both T1 and T2 will have an available amount of 3 BCH to spend:
1 BCH (from T1) + 2 BCH (from T2) = 3 BCH (to spend in total)

You can send the assets to one or multiple recipients in one transaction. If you send the assets to multiple addresses, each address must have its own amount to receive.

Paying the gas fee and receiving the change
When the amount that the recipients should receive is lower than the amount from the UTXOs, the difference between these two amounts is by default used as the gas fee for the transaction. Because this amount may be considerable and you may not want to spend it all on the gas fee, you can explicitly specify the fee amount and the blockchain address where any extra funds remaining after covering the fee will be sent (the fee and changeAddress parameters in the request body, correspondingly).

Signing a transaction
When sending BCH, you are charged a fee for the transaction, and you must sign the transaction with the private key of the blockchain address from which the fee will be deducted.

Providing the private key in the API is not a secure way of signing transactions, because the private key can be stolen or exposed. Your private keys should never leave your security perimeter. You should use the private keys only for testing a solution you are building on the testnet of a blockchain.

For signing transactions on the mainnet, we strongly recommend that you use the Tatum Key Management System (KMS) and provide the signature ID instead of the private key in the API. Alternatively, you can use the Tatum JavaScript client.

SecurityX-API-Key
Request
Request Body schema: application/json
required
One of:
required
Array of objects

The array of transaction hashes, indexes of its UTXOs, and the private keys of the associated blockchain addresses

Array
txHash
required
string = 64 characters

The transaction hash of the UTXO to be spent

index
required
number [ 0 .. 2147483647 ]

The index of the UTXO to be spent

privateKey
required
string = 52 characters

The private key of the blockchain address that holds the UTXO to be spent

required
Array of objects

The array of blockchain addresses to send the assets to and the amounts that each address should receive (in BCH). The difference between the UTXOs calculated in the fromUTXO section and the total amount to receive calculated in the to section will be used as the gas fee. To explicitly specify the fee amount and the blockchain address where any extra funds remaining after covering the fee will be sent, set the fee and changeAddress parameters.

Array
address
required
string [ 30 .. 60 ]

The blockchain address to receive the assets

value
required
number >= 0

The amount to receive (in BCH)

fee
string

The fee to be paid for the transaction (in BCH); if you are using this parameter, you have to also use the changeAddress parameter because these two parameters only work together.

changeAddress
string [ 30 .. 60 ]

The blockchain address to send any extra assets remaning after covering the fee; if you are using this parameter, you have to also use the fee parameter because these two parameters only work together.

Responses
200

OK

400

Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.

401

Unauthorized. Not valid or inactive subscription key present in the HTTP Header.

403

Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.

500

Internal server error. There was an error on the server while processing the request.

post/v3/bcash/transaction
Request samples
application/json
{
  • "fromUTXO": [
    ],
  • "to": [
    ]
}
Response samples
application/json
{
  • "txId": "c83f8818db43d9ba4accfe454aa44fc33123d47a4f89d47b314d6748eb0e9bc9"
}

Broadcast signed Bitcoin Cash transaction

5 credits per API call.


Broadcast signed transaction to Bitcoin Cash blockchain. This method is used internally from Tatum KMS or Tatum client libraries. It is possible to create custom signing mechanism and use this method only for broadcasting data to the blockchain.

SecurityX-API-Key
Request
Request Body schema: application/json
required
txData
required
string [ 1 .. 500000 ] characters

Raw signed transaction to be published to network.

signatureId
string <uuid>

ID of prepared payment template to sign. Required only, when broadcasting transaction signed by Tatum KMS.

index
number [ 0 .. 2147483647 ]

(Only if the signature ID is mnemonic-based and you run KMS v6.2 or later) The index of the address to send the assets from that was generated from the mnemonic

Responses
200

OK

400

Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.

401

Unauthorized. Not valid or inactive subscription key present in the HTTP Header.

403

Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.

500

Internal server error. There was an error on the server while processing the request.

post/v3/bcash/broadcast
Request samples
application/json
{
  • "txData": "62BD544D1B9031EFC330A3E855CC3A0D51CA5131455C1AB3BCAC6D243F65460D"
}
Response samples
application/json
{
  • "txId": "c83f8818db43d9ba4accfe454aa44fc33123d47a4f89d47b314d6748eb0e9bc9"
}