Skip to main content

decodePSBT

Overview

The 'decodePSBT' method is utilized to decode a PSBT (Partially Signed Bitcoin Transaction) into a human-readable format, providing detailed information about the transaction in JSON format. This method is essential for developers and users who want to understand the transaction details before it is broadcasted to the network.

Request

wget --no-check-certificate --quiet \
--method POST \
--timeout=0 \
--header 'Content-Type: application/json' \
--header 'accept: application/json' \
--header 'X-CoinAPI-Key: 4303fb63-adec-42dc-b571-74bc2f2a5167' \
--body-data '{"jsonrpc":"2.0","id":1,"method":"decodePSBT","params": [ ]}' \
'https://bitcoin-mainnet.node.coinapi.io'

Request Parameters

  • psbt (string): The PSBT string that needs to be decoded.

Response

{
"tx": {
"decoded network-serialized unsigned transaction": "..."
},
"unknown": {
"key": "hex",
"value": "..."
},
"inputs": [
{
"non_witness_utxo": {
"decoded network transaction for non-witness UTXOs": "..."
},
"witness_utxo": {
"amount": "n",
"scriptPubKey": {
"asm": "str",
"hex": "hex",
"type": "str",
"address": "str"
}
},
"partial_signatures": {
"pubkey": "str",
"signature": "..."
},
"sighash": "str",
"redeem_script": {
"asm": "str",
"hex": "hex",
"type": "str"
},
"witness_script": {
"asm": "str",
"hex": "hex",
"type": "str"
},
"bip32_derivs": [
{
"master_fingerprint": "str",
"path": "str"
}
],
"final_scriptsig": {
"asm": "str",
"hex": "str"
},
"final_scriptwitness": ["hex"],
"unknown": {
"key": "hex",
"value": "..."
}
}
],
"outputs": [
{
"redeem_script": {
"asm": "str",
"hex": "hex",
"type": "str"
},
"witness_script": {
"asm": "str",
"hex": "hex",
"type": "str"
},
"bip32_derivs": [
{
"pubkey": "str",
"master_fingerprint": "str",
"path": "str"
}
],
"unknown": {
"key": "hex",
"value": "..."
}
}
],
"fee": "n"
}

Errors

  • Invalid Request: This error is returned if the request format is incorrect.
  • Internal Error: This error is returned if there's a server-side issue processing the request.

Rate Limits

Please note that there are rate limits applied to the API to ensure fair usage. Free-tier users are limited to 100 requests per day, while premium users can make up to 1000 or more requests per day.

Support

If you encounter any issues or have further questions regarding the decodePSBT method, please contact our support team at [email protected].