Bitcoin

Bitcoin Blockchain enables access to the most commonly used Bitcoin 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
  • Testnet3 - a chain used for testing purposes. Coins on the test chain have no value and can be obtained from a faucet, e.g. https://testnet-faucet.mempool.co/

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 wallet

1 credit per API call.


Tatum supports BIP44 HD wallets. Because they can generate 2^31 addresses from 1 mnemonic phrase, they are very convenient and secure. A mnemonic phrase consists of 24 special words in a 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 wallet with derivation path m'/44'/0'/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 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.

403

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

500

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

get/v3/bitcoin/wallet
Request samples
curl -i -X GET \
  'https://api-eu1.tatum.io/v3/bitcoin/wallet?mnemonic=string' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
application/json
{
  • "mnemonic": "urge pulp usage sister evidence arrest palm math please chief egg abuse",
  • "xpub": "xpub6EsCk1uU6cJzqvP9CdsTiJwT2rF748YkPnhv5Qo8q44DG7nn2vbyt48YRsNSUYS44jFCW9gwvD9kLQu9AuqXpTpM1c5hgg9PsuBLdeNncid"
}

Generate Bitcoin deposit address from Extended public key

1 credit per API call.


Generates a Bitcoin deposit address from an Extended public key. The 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.

SecurityX-API-Key
Request
path Parameters
xpub
required
string

Extended public key of a wallet.

Example: xpub6EsCk1uU6cJzqvP9CdsTiJwT2rF748YkPnhv5Qo8q44DG7nn2vbyt48YRsNSUYS44jFCW9gwvD9kLQu9AuqXpTpM1c5hgg9PsuBLdeNncid
index
required
number >= 0

Derivation index of the 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.

403

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

500

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

get/v3/bitcoin/address/{xpub}/{index}
Request samples
curl -i -X GET \
  'https://api-eu1.tatum.io/v3/bitcoin/address/{xpub}/{index}' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
application/json
{
  • "address": "n36h3pAH7sC3z8KMB47BjbqvW2aJd2oTi7"
}

Generate Bitcoin private key

1 credit per API call.


Generates a private key for an address from a mnemonic for a given derivation path index. The 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
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.

403

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

500

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

post/v3/bitcoin/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"
}

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 the Bitcoin developers' guide.

Request
Request Body schema: application/json
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/bitcoin/node
Request samples
application/json
{
  • "jsonrpc": "1.0",
  • "id": "test",
  • "method": "getblockcount",
  • "params": [ ]
}
Response samples
application/json
{
  • "jsonrpc": "1.0",
  • "id": "test",
  • "result": 654321
}

Get Blockchain information

1 credit per API call.


Gets Bitcoin blockchain information. Obtains basic info like the testnet / mainnet version of the chain, the current block number and its 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 perform the required operation due to a logical error or invalid permissions.

500

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

get/v3/bitcoin/info
Request samples
curl -i -X GET \
  https://api-eu1.tatum.io/v3/bitcoin/info \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
application/json
{
  • "chain": "test",
  • "blocks": 1579820,
  • "headers": 1579820,
  • "bestblockhash": "0000000000000106e4c03ca093ce0cf77e796ddff4f3cadc59ca6b0380e3eed4",
  • "difficulty": 6522714.521250089
}

Get Block hash

1 credit per API call.


Gets a Bitcoin block hash. Returns the hash of the block to get the block's details.

SecurityX-API-Key
Request
path Parameters
i
required
number

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

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 perform the required operation due to a logical error or invalid permissions.

500

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

get/v3/bitcoin/block/hash/{i}
Request samples
curl -i -X GET \
  'https://api-eu1.tatum.io/v3/bitcoin/block/hash/{i}' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
application/json
{
  • "hash": "0000000053f225e202cf27fe3046e06719efd3b31b5ab75fc5ef7f853c8b246f"
}

Get Block by hash or height

1 credit per API call.


Gets Bitcoin block detail by block hash or height.

SecurityX-API-Key
Request
path Parameters
hash
required
string

Block hash or height.

Example: 00000000ca231a439a5c0a86a5a5dd6dc1918a8e897b96522fa9499288e70183
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.

404

Block not found.

500

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

get/v3/bitcoin/block/{hash}
Request samples
curl -i -X GET \
  'https://api-eu1.tatum.io/v3/bitcoin/block/{hash}' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
application/json
{
  • "hash": "00000000ca231a439a5c0a86a5a5dd6dc1918a8e897b96522fa9499288e70183",
  • "height": 15235,
  • "depth": 1567867,
  • "version": 1,
  • "prevBlock": "000000006e79360d7b2519410fe5a73e8e08393fd7166620c73c711e4507d9fd",
  • "merkleRoot": "480c227c5042377dbd54464d33e1f59c19fe02fe76d7f55b6955db438479aece",
  • "time": 1338861927,
  • "bits": 486604799,
  • "nonce": 1193572362,
  • "txs": [
    ]
}

Get transaction by hash

1 credit per API call.


Get Bitcoin Transaction detail 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 perform the required operation due to a logical error or invalid permissions.

500

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

get/v3/bitcoin/transaction/{hash}
Request samples
curl -i -X GET \
  'https://api-eu1.tatum.io/v3/bitcoin/transaction/{hash}' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
application/json
{
  • "hash": "4c7846a8ff8415945e96937dea27bdb3144c15d793648d725602784826052586",
  • "witnessHash": "4c7846a8ff8415945e96937dea27bdb3144c15d793648d725602784826052586",
  • "fee": 4540,
  • "rate": 20088,
  • "mtime": 1575663337,
  • "blockNumber": 1611609,
  • "block": "00000000000001e13fe1eb3977f3379e3d0f6577fc6e087d27db46597ebddb8b",
  • "time": 1575663091,
  • "index": 1,
  • "version": 2,
  • "inputs": [
    ],
  • "outputs": [
    ],
  • "locktime": 1611608
}

Get mempool transactions

1 credit per API call.


Gets Bitcoin transaction IDs in the mempool.

SecurityX-API-Key
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 perform the required operation due to a logical error or invalid permissions.

500

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

get/v3/bitcoin/mempool
Request samples
curl -i -X GET \
  https://api-eu1.tatum.io/v3/bitcoin/mempool \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
application/json
[
  • "4c7846a8ff8415945e96937dea27bdb3144c15d793648d725602784826052586"
]

Get transactions by address

1 credit per API call.


Gets a Bitcoin transaction by address.

SecurityX-API-Key
Request
path Parameters
address
required
string

Address

Example: 2MsM67NLa71fHvTUBqNENW15P68nHB2vVXb
query Parameters
pageSize
required
number [ 1 .. 50 ]

Max number of items per page is 50.

Example: pageSize=10
offset
number

Offset to obtain the next page of data.

Example: offset=0
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 perform the required operation due to a logical error or invalid permissions.

500

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

get/v3/bitcoin/transaction/address/{address}
Request samples
curl -i -X GET \
  'https://api-eu1.tatum.io/v3/bitcoin/transaction/address/{address}?pageSize=10&offset=0' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
application/json
[
  • {
    }
]

Get the balance of an address

1 credit per API call.


Gets the Bitcoin balance of the address.

SecurityX-API-Key
Request
path Parameters
address
required
string

Address

Example: 2MsM67NLa71fHvTUBqNENW15P68nHB2vVXb
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 perform the required operation due to a logical error or invalid permissions.

500

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

get/v3/bitcoin/address/balance/{address}
Request samples
curl -i -X GET \
  'https://api-eu1.tatum.io/v3/bitcoin/address/balance/{address}' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
application/json
{
  • "incoming": "0.1234",
  • "outgoing": "0.1"
}

Get UTXO of transaction

1 credit per API call.


Get the UTXO of given transaction and output index. UTXO means Unspent Transaction Output, which in blockchain terminology means assets that a user has received at a specific address and has not yet spent.
In bitcoin-like blockchains (BTC, LTC, DOGE, BCH), every transaction is built from a list of previously unspent transactions connected to the address. If a user owns address A, and receives 10 BTC in transaction T1, they can spend a UTXO T1 with a total value of 10 BTC in the next transaction. The user can spend multiple UTXOs from different addresses in one transaction.
If the UTXO is not spent, the data are returned, or a 404 error code is generated.

SecurityX-API-Key
Request
path Parameters
hash
required
string = 64 characters

TX Hash

Example: 53faa103e8217e1520f5149a4e8c84aeb58e55bdab11164a95e69a8ca50f8fcc
index
required
number >= 0

Index of tx output to check if it has been spent or not

Example: 0
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 perform the required operation due to a logical error or invalid permissions.

500

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

get/v3/bitcoin/utxo/{hash}/{index}
Request samples
curl -i -X GET \
  'https://api-eu1.tatum.io/v3/bitcoin/utxo/{hash}/{index}' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
application/json
{
  • "version": 1,
  • "height": -1,
  • "value": 30000000,
  • "script": "76a91400ba915c3d18907b79e6cfcd8b9fdf69edc7a7db88ac",
  • "address": "R9M3aUWCcKoiqDPusJvqNkAbjffLgCqYip",
  • "coinbase": false,
  • "hash": "53faa103e8217e1520f5149a4e8c84aeb58e55bdab11164a95e69a8ca50f8fcc",
  • "index": 0
}

Send Bitcoin to blockchain addresses

2 credits per API call.


Send Bitcoin to blockchain addresses. It is possible to build a blockchain transaction in 2 ways:

  • fromAddress - assets will be sent from the list of addresses. For each of the addresses, the last 100 transactions will be scanned for any unspent UTXO to be included in the transaction.
  • fromUTXO - assets will be sent from the list of unspent UTXOs. Each of the UTXOs will be included in the transaction.
In bitcoin-like blockchains, a transaction is created from the list of previously unspent UTXOs. Every UTXO contains the amount of funds that can be spent. When the UTXO is entered into the transaction, the whole amount is included and must be spent. For example, address A receives 2 transactions, T1 with 1 BTC and T2 with 2 BTC. The transaction, which will consume the UTXOs for T1 and T2, will have an available amount to spend of 3 BTC = 1 BTC (T1) + 2 BTC(T2).

There can be multiple recipients of the transactions. In the to section, every recipient address has its own corresponding amount. When the amount of funds that the recipient should receive is lower than the amount of funds from the UTXOs, the difference is used as a transaction fee.

This operation requires the private key of the blockchain address. Every time the funds are transferred, the transaction must be signed with the corresponding private key. No one should ever send their private keys to the Internet because there is a strong possibility that they will be stolen and the funds will be lost. In this method, it is possible to enter a privateKey or signatureId. The privateKey should be used only for quick development on testnet versions of blockchains when there is no risk of losing funds. In production, Tatum KMS should be used to ensure the highest level of security, and the signatureId should be present in the request. Alternatively, it is also possible to use the Tatum Client Library for supported languages.

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

Array of addresses and corresponding private keys. Tatum will automatically scan last 100 transactions for each address and will use all of the unspent values. We advise to use this option if you have 1 address per 1 transaction only.

Array
address
required
string [ 30 .. 50 ]

Address to send assets from.

privateKey
required
string [ 52 .. 52 ]

Private key of the address to send assets from. Private key, or signature Id must be present.

required
Array of objects

Array of addresses and values to send bitcoins to. Values must be set in BTC. Difference between from and to is transaction fee.

Array
address
required
string [ 30 .. 60 ]

Destination address.

value
required
number >= 0

Amount to be sent, in BTC.

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 perform the required operation due to a logical error or invalid permissions.

500

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

post/v3/bitcoin/transaction
Request samples
application/json
{
  • "fromAddress": [
    ],
  • "to": [
    ]
}
Response samples
application/json
{
  • "txId": "c83f8818db43d9ba4accfe454aa44fc33123d47a4f89d47b314d6748eb0e9bc9",
  • "failed": false
}

Broadcast signed Bitcoin transaction

2 credits per API call.


Broadcasts a signed transaction to the Bitcoin blockchain. This method is used internally from Tatum KMS, Tatum Middleware or Tatum Client Libraries. It is possible to create a custom signing mechanism and only use this method for broadcasting data to the blockchain.

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

Raw signed transaction to be published to network.

signatureId
string <uuid> = 36 characters

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

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 perform the required operation due to a logical error or invalid permissions.

500

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

post/v3/bitcoin/broadcast
Request samples
application/json
{
  • "txData": "62BD544D1B9031EFC330A3E855CC3A0D51CA5131455C1AB3BCAC6D243F65460D",
  • "signatureId": "1f7f7c0c-3906-4aa1-9dfe-4b67c43918f6"
}
Response samples
application/json
{
  • "txId": "c83f8818db43d9ba4accfe454aa44fc33123d47a4f89d47b314d6748eb0e9bc9",
  • "failed": false
}