converttopsbt

converttopsbt "hexstring" ( permitsigdata iswitness )

Converts a network-serialized transaction into a PSBT (Partially Signed Bitcoin Transaction). This should only be used with createrawtransaction and fundrawtransaction. For new applications, use createpsbt or walletcreatefundedpsbt.

Argument #1 – hexstring

Type: string, required

The hex string of a raw transaction

Argument #2 – permitsigdata

Type: boolean, optional, default=false

If set to true, any signatures in the inputs will be discarded, and the conversion will proceed.

If false, the RPC will fail if any signatures are detected.

Argument #3 – iswitness

Type: boolean, optional, default=depends on heuristic tests

Specifies whether the transaction hex is a serialized witness transaction.
  • If iswitness is not provided, heuristic tests will be used to determine the format during decoding.
  • If true, only witness deserialization will be attempted.
  • If false, only non-witness deserialization will be attempted.

This boolean should indicate whether the transaction contains inputs (e.g., fully valid or on-chain transactions), if known to the caller.

Result

Name

Type

Description

str

string

The resulting raw transaction (base64-encoded string)

Examples

Create a transaction:

bitcoinevo-cli createrawtransaction "[{\"txid\":\"myid\",\"vout\":0}]" "[{\"data\":\"00010203\"}]"

Convert the transaction to a PSBT:

bitcoinevo-cli converttopsbt "rawtransaction"