Send Bitcoin to blockchain addresses

POST {{baseUrl}}/v3/bitcoin/transaction

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 or Tatum Middleware with a custom key management system.

Request Body

{"to"=>[{"address"=>"2MzNGwuKvMEvKMQogtgzSqJcH2UW3Tc5oc7", "value"=>0.02969944}, {"address"=>"2MzNGwuKvMEvKMQogtgzSqJcH2UW3Tc5oc7", "value"=>0.02969944}], "fromAddress"=>[{"address"=>"2N9bBiH2qrTDrPCzrNhaFGdkNKS86PJAAAS", "privateKey"=>"cVX7YtgL5muLTPncHFhP95oitV1mqUUA5VeSn8HeCRJbPqipzobf"}, {"address"=>"2N9bBiH2qrTDrPCzrNhaFGdkNKS86PJAAAS", "privateKey"=>"cVX7YtgL5muLTPncHFhP95oitV1mqUUA5VeSn8HeCRJbPqipzobf"}]}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring

RESPONSES

status: OK

{"txId":"c83f8818db43d9ba4accfe454aa44fc33123d47a4f89d47b314d6748eb0e9bc9","failed":false}