SignPSBTInput

Signs a PSBTInput, verifying that all provided data matches what is being signed.

Synopsis

Declared in <psbt.h>

[[nodiscard]]
util::Expected<void, common::PSBTError>
SignPSBTInput(
    SigningProvider const& provider,
    PartiallySignedTransaction& psbt,
    int index,
    PrecomputedTransactionData const* txdata,
    common::PSBTFillOptions const& options,
    SignatureData* out_sigdata = nullptr);

Description

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.

Return Value

Success, or a PSBTError describing why signing failed.

NOTE

The return value should not be discarded.

Parameters

NameDescription
providerThe source of keys and scripts used to sign.
psbtThe PSBT containing the input.
indexThe index of the input to sign.
txdataPrecomputed transaction data, or nullptr for a dummy signature.
optionsOptions controlling how fields are filled.
out_sigdataOptional output receiving the resulting signature data.