[#SignPSBTInput] = SignPSBTInput :mrdocs: Signs a PSBTInput, verifying that all provided data matches what is being signed. == Synopsis Declared in `<psbt.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[nodiscard]] xref:util/Expected-0b.adoc[util::Expected<void, common::PSBTError>] SignPSBTInput( xref:SigningProvider.adoc[SigningProvider] const& provider, xref:PartiallySignedTransaction.adoc[PartiallySignedTransaction]& psbt, int index, xref:PrecomputedTransactionData.adoc[PrecomputedTransactionData] const* txdata, xref:common/PSBTFillOptions.adoc[common::PSBTFillOptions] const& options, xref:SignatureData.adoc[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 https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^]. ==== == Parameters [cols="1,4"] |=== | Name| Description | *provider* | The source of keys and scripts used to sign. | *psbt* | The PSBT containing the input. | *index* | The index of the input to sign. | *txdata* | Precomputed transaction data, or nullptr for a dummy signature. | *options* | Options controlling how fields are filled. | *out_sigdata* | Optional output receiving the resulting signature data. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#