Bitcoin Core 28.99.0
P2P Digital Currency
|
#include <psbt.h>
#include <node/types.h>
#include <policy/policy.h>
#include <script/signingprovider.h>
#include <util/check.h>
#include <util/strencodings.h>
Go to the source code of this file.
Functions | |
bool | PSBTInputSigned (const PSBTInput &input) |
Checks whether a PSBTInput is already signed by checking for non-null finalized fields. More... | |
bool | PSBTInputSignedAndVerified (const PartiallySignedTransaction psbt, unsigned int input_index, const PrecomputedTransactionData *txdata) |
Checks whether a PSBTInput is already signed by doing script verification using final fields. More... | |
size_t | CountPSBTUnsignedInputs (const PartiallySignedTransaction &psbt) |
Counts the unsigned inputs of a PSBT. More... | |
void | UpdatePSBTOutput (const SigningProvider &provider, PartiallySignedTransaction &psbt, int index) |
Updates a PSBTOutput with information from provider. More... | |
PrecomputedTransactionData | PrecomputePSBTData (const PartiallySignedTransaction &psbt) |
Compute a PrecomputedTransactionData object from a psbt. More... | |
bool | SignPSBTInput (const SigningProvider &provider, PartiallySignedTransaction &psbt, int index, const PrecomputedTransactionData *txdata, int sighash, SignatureData *out_sigdata, bool finalize) |
Signs a PSBTInput, verifying that all provided data matches what is being signed. More... | |
void | RemoveUnnecessaryTransactions (PartiallySignedTransaction &psbtx, const int &sighash_type) |
Reduces the size of the PSBT by dropping unnecessary non_witness_utxos (i.e. More... | |
bool | FinalizePSBT (PartiallySignedTransaction &psbtx) |
Finalizes a PSBT if possible, combining partial signatures. More... | |
bool | FinalizeAndExtractPSBT (PartiallySignedTransaction &psbtx, CMutableTransaction &result) |
Finalizes a PSBT if possible, and extracts it to a CMutableTransaction if it could be finalized. More... | |
bool | CombinePSBTs (PartiallySignedTransaction &out, const std::vector< PartiallySignedTransaction > &psbtxs) |
Combines PSBTs with the same underlying transaction, resulting in a single PSBT with all partial signatures from each input. More... | |
std::string | PSBTRoleName (PSBTRole role) |
bool | DecodeBase64PSBT (PartiallySignedTransaction &psbt, const std::string &base64_tx, std::string &error) |
Decode a base64ed PSBT into a PartiallySignedTransaction. More... | |
bool | DecodeRawPSBT (PartiallySignedTransaction &psbt, Span< const std::byte > tx_data, std::string &error) |
Decode a raw (binary blob) PSBT into a PartiallySignedTransaction. More... | |
bool CombinePSBTs | ( | PartiallySignedTransaction & | out, |
const std::vector< PartiallySignedTransaction > & | psbtxs | ||
) |
Combines PSBTs with the same underlying transaction, resulting in a single PSBT with all partial signatures from each input.
[out] | out | the combined PSBT, if successful |
[in] | psbtxs | the PSBTs to combine |
Definition at line 511 of file psbt.cpp.
size_t CountPSBTUnsignedInputs | ( | const PartiallySignedTransaction & | psbt | ) |
bool DecodeBase64PSBT | ( | PartiallySignedTransaction & | psbt, |
const std::string & | base64_tx, | ||
std::string & | error | ||
) |
Decode a base64ed PSBT into a PartiallySignedTransaction.
Definition at line 536 of file psbt.cpp.
bool DecodeRawPSBT | ( | PartiallySignedTransaction & | psbt, |
Span< const std::byte > | tx_data, | ||
std::string & | error | ||
) |
Decode a raw (binary blob) PSBT into a PartiallySignedTransaction.
Definition at line 546 of file psbt.cpp.
bool FinalizeAndExtractPSBT | ( | PartiallySignedTransaction & | psbtx, |
CMutableTransaction & | result | ||
) |
Finalizes a PSBT if possible, and extracts it to a CMutableTransaction if it could be finalized.
[in] | psbtx | PartiallySignedTransaction |
[out] | result | CMutableTransaction representing the complete transaction, if successful |
Definition at line 495 of file psbt.cpp.
bool FinalizePSBT | ( | PartiallySignedTransaction & | psbtx | ) |
Finalizes a PSBT if possible, combining partial signatures.
[in,out] | psbtx | PartiallySignedTransaction to finalize return True if the PSBT is now complete, false otherwise |
Definition at line 480 of file psbt.cpp.
PrecomputedTransactionData PrecomputePSBTData | ( | const PartiallySignedTransaction & | psbt | ) |
Compute a PrecomputedTransactionData object from a psbt.
Definition at line 358 of file psbt.cpp.
bool PSBTInputSigned | ( | const PSBTInput & | input | ) |
bool PSBTInputSignedAndVerified | ( | const PartiallySignedTransaction | psbt, |
unsigned int | input_index, | ||
const PrecomputedTransactionData * | txdata | ||
) |
std::string PSBTRoleName | ( | PSBTRole | role | ) |
void RemoveUnnecessaryTransactions | ( | PartiallySignedTransaction & | psbtx, |
const int & | sighash_type | ||
) |
bool SignPSBTInput | ( | const SigningProvider & | provider, |
PartiallySignedTransaction & | psbt, | ||
int | index, | ||
const PrecomputedTransactionData * | txdata, | ||
int | sighash = SIGHASH_ALL , |
||
SignatureData * | out_sigdata = nullptr , |
||
bool | finalize = true |
||
) |
Signs a PSBTInput, verifying that all provided data matches what is being signed.
txdata should be the output of PrecomputePSBTData (which can be shared across multiple SignPSBTInput calls). If it is nullptr, a dummy signature will be created.
Definition at line 375 of file psbt.cpp.
void UpdatePSBTOutput | ( | const SigningProvider & | provider, |
PartiallySignedTransaction & | psbt, | ||
int | index | ||
) |
Updates a PSBTOutput with information from provider.
This fills in the redeem_script, witness_script, and hd_keypaths where possible.
Definition at line 338 of file psbt.cpp.