How to work with Tatum-KMS

tatum-kms --path=wallet.dat --testnet generatemanagedwallet BTC{
"xxx-59be-4792-81c5-yyy": {
"mnemonic": "list of long words",
"xpub": "tpubBCDEF",
"chain": "BTC",
"testnet": true
}
}
tatum-kms --path=wallet.dat --testnet getprivatekey xxx-59be-4792–81c5-yyy 0{
"privateKey": "XXXNAV3tX3vWPG4uThixuqdYYY"
}
tatum-kms --path=wallet.dat --testnet getaddress xxx-59be-4792–81c5-yyy 0{
"address": "AAAA3JPvMuwgpKovMTjBBB"
}
tatum-kms --path=wallet.dat --testnet storemanagedprivatekey BTCEnter private key to store:XXXNAV3tX3vWPG4uThixuqdYYY -> (this is private key from step 2)
Enter password to access wallet store:******
{
"signatureId": "QQQ-4b41-4ec9-b66c-WWW"
}
tatum-kms --path=wallet.dat --testnet export 
Enter the password to access wallet store:******
{
"QQQ-4b41-4ec9-b66c-WWW": {
"privateKey": "XXXNAV3tX3vWPG4uThixuqdYYY",
"chain": "BTC",
"testnet": true
},
"xxx-59be-4792-81c5-yyy": {
"mnemonic": "list of long words",
"xpub": "tpubBCDEF",
"chain": "BTC",
"testnet": true
}
}
curl --location --request POST 'https://api-eu1.tatum.io/v3/bitcoin/transaction' \
--header 'x-api-key: your-tesnet-api-key-from-tatum' \
--header 'Content-Type: application/json' \
--data-raw '{
"fromAddress": [
{
"address": "AAAA3JPvMuwgpKovMTjBBB", -> FROM STEP 3
"signatureId": "QQQ-4b41-4ec9-b66c-WWW" -> FROM STEP 4
}
],
"to": [
{
"address": "any-existing-testnet-bitcoin-address",
"value": 0.00001 -> AMOUNT OF BTC TO SEND
}
]
}'
tatum-kms daemon --path=wallet.dat --testnet --chain=BTC --api-key=your-testnet-api-key --period=10
Processing pending transaction - {
"withdrawalId": null,
"chain": "BTC",
"serializedTransaction": "{\"hash\":\"81e62bdfbfc7bcb66c2a2f17335d033fd98b84c1188a7bb379a2dce9f1cda989\",\"version\":2,\"inputs\":[{\"prevTxId\":\"121702fd7acd1b2cca6bd19658009140730ba26ca67cd222c00f952a111e11f4\",\"outputIndex\":0,\"sequenceNumber\":4294967295,\"script\":\"\",\"scriptString\":\"\",\"output\":{\"satoshis\":2000,\"script\":\"76a914c8e668ee829837a2355c1e234a41f53f86b8156c88ac\"}}],\"outputs\":[{\"satoshis\":1000,\"script\":\"001487c70889f0a1d2f632d216a01472dde71f062aa7\"}],\"nLockTime\":0}",
"hashes": [
"b8eb99cd-ba04-4031-a65f-11d6420ebdd1"
],
"index": null,
"withdrawalResponses": null,
"id": "61fe7c68cf2fbc595cbb89dd"
}.
curl --request GET \
--url https://api-eu1.tatum.io/v3/kms/61fe7c68cf2fbc595cbb89dd \
--header 'x-api-key: your-testnet-api-key-from-tatum'
{
"withdrawalId": null,
"chain": "BTC",
"serializedTransaction": "{\"hash\":\"81e62bdfbfc7bcb66c2a2f17335d033fd98b84c1188a7bb379a2dce9f1cda989\",\"version\":2,\"inputs\":[{\"prevTxId\":\"121702fd7acd1b2cca6bd19658009140730ba26ca67cd222c00f952a111e11f4\",\"outputIndex\":0,\"sequenceNumber\":4294967295,\"script\":\"\",\"scriptString\":\"\",\"output\":{\"satoshis\":2000,\"script\":\"76a914c8e668ee829837a2355c1e234a41f53f86b8156c88ac\"}}],\"outputs\":[{\"satoshis\":1000,\"script\":\"001487c70889f0a1d2f632d216a01472dde71f062aa7\"}],\"nLockTime\":0}",
"hashes": [
"b8eb99cd-ba04-4031-a65f-11d6420ebdd1"
],
"index": null,
"withdrawalResponses": null,
"txId": "f7572ef070d381612b7594940cc73ec008e796b37a73ff031f3855d2a23c9ade",
"id": "61fe7c68cf2fbc595cbb89dd"
}

The end

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store