lightning-signpsbt -- Command to sign a wallet's inputs on a provided bitcoin transaction (PSBT).
SYNOPSIS
signpsbt psbt [signonly]
DESCRIPTION
signpsbt is a low-level RPC command which signs a PSBT as defined by BIP-174.
By default, all known inputs are signed, and others ignored: with signonly, only those inputs are signed, and an error is returned if one of them cannot be signed.
Note that the command will fail if there are no inputs to sign, or if the inputs to be signed were not previously reserved.
- psbt (string): The psbt to be signed.
- signonly (array of u32s, optional): Input numbers to sign.:
- (u32, optional)
RETURN VALUE
On success, an object is returned, containing:
- signed_psbt (string): The fully signed PSBT.
ERRORS
On failure, one of the following error codes may be returned:
- -32602: Error in given parameters, or there aren't wallet's inputs to sign, or we couldn't sign all of signonly, or inputs are not reserved.
AUTHOR
Vincenzo Palazzo <[email protected]> wrote the initial version of this man page,
but many others did the hard work of actually implementing this rpc command.
SEE ALSO
lightning-fundpsbt(7), lightning-sendpsbt(7)
RESOURCES
Main web site: https://github.com/ElementsProject/lightning
EXAMPLES
Example 1:
Request:
lightning-cli signpsbt -k "psbt"="cHNidP8BAgQCAAAAAQMEmAAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQBxAgAAAAGXS8Ixc7e8qbBg2sEqvRuxWOjtaaPnTU9q9ZGbFfV3LAAAAAAA/f///wJ6H/TSAAAAABYAFJq4HdQFbYJVeXL2XWxTpoyZUCr4AMLrCwAAAAAWABQDz+yHFeH0BKNuwBHkI4+GMp+QnJcAAAABAR8AwusLAAAAABYAFAPP7IcV4fQEo27AEeQjj4Yyn5CcAQ4gswU80whDZOoIHS/lfyxwmHh5USHBwbcjWHaJ9/XU+78BDwQBAAAAARAE/f///wz8CWxpZ2h0bmluZwEIQCsNB0i02NIAAQMIQVncCwAAAAABBCJRIDvhN+WjzUt2EEWojAco0yQ1GDbwTtWd/aN5uNhGRlK3DPwJbGlnaHRuaW5nAQgwkgFDAVpmeAABAwhAQg8AAAAAAAEEIgAgybxcBjyu+/emx4FEB7Vie0+BqLVuy+kyxoL5y6wNGd8M/AlsaWdod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