Skip to main content

analyzepsbt

Overview

The 'analyzepsbt' method is used to inspect a PSBT (Partially Signed Bitcoin Transaction) and return information about its current state. It helps in understanding the transaction's inputs, estimated size, fee rate, and the role of the next person in the transaction process.

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":"analyzepsbt","params": [ ]}' \
'https://bitcoin-mainnet.node.coinapi.io'

Request Parameters

  • psbt (string): The PSBT in base64 format that needs to be analyzed.

Response

{
"result": null,
"error": {
"code": -1,
"message": "analyzepsbt \"psbt\"\n\nAnalyzes and provides information about the current status of a PSBT and its inputs\n\nArguments:\n1. psbt (string, required) A base64 string of a PSBT\n\nResult:\n{ (json object)\n \"inputs\" : [ (json array, optional)\n { (json object)\n \"has_utxo\" : true|false, (boolean) Whether a UTXO is provided\n \"is_final\" : true|false, (boolean) Whether the input is finalized\n \"missing\" : { (json object, optional) Things that are missing that are required to complete this input\n \"pubkeys\" : [ (json array, optional)\n \"hex\", (string) Public key ID, hash160 of the public key, of a public key whose BIP 32 derivation path is missing\n ...\n ],\n \"signatures\" : [ (json array, optional)\n \"hex\", (string) Public key ID, hash160 of the public key, of a public key whose signature is missing\n ...\n ],\n \"redeemscript\" : \"hex\", (string, optional) Hash160 of the redeemScript that is missing\n \"witnessscript\" : \"hex\" (string, optional) SHA256 of the witnessScript that is missing\n },\n \"next\" : \"str\" (string, optional) Role of the next person that this input needs to go to\n },\n ...\n ],\n \"estimated_vsize\" : n, (numeric, optional) Estimated vsize of the final signed transaction\n \"estimated_feerate\" : n, (numeric, optional) Estimated feerate of the final signed transaction in BTC/kvB. Shown only if all UTXO slots in the PSBT have been filled\n \"fee\" : n, (numeric, optional) The transaction fee paid. Shown only if all UTXO slots in the PSBT have been filled\n \"next\" : \"str\", (string) Role of the next person that this psbt needs to go to\n \"error\" : \"str\" (string, optional) Error message (if there is one)\n}\n\nExamples:\n> bitcoin-cli analyzepsbt \"psbt\"\n"
},
"id": 1
}