lightning-signpsbt

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"="cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000"
{
  "id": "example:signpsbt#1",
  "method": "signpsbt",
  "params": {
    "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000"
  }
}

Response:

{
  "signed_psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000"
}

Example 2:

Request:

lightning-cli signpsbt "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000"
{
  "id": "example:signpsbt#2",
  "method": "signpsbt",
  "params": [
    "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000"
  ]
}

Response:

{
  "signed_psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000"
}

Core Lightning (previously c-lightning) is a lightweight, highly customizable and standard compliant implementation of the Lightning Network protocol.

© 2023 Core Lightning
All rights reserved.

Discussion Forum

The official Core Lightning forum is hosted at discuss.corelightning.org

BuildonL2 Community

The official BuildOnL2 community lives at community.corelightning.org. Join us and build the future of bitcoin on lightning.

Mailing List

For general discussions about CLN implementation, use [email protected]. For the Lightning Network, use [email protected]

Telegram

Community-driven telegram group where most of the node operators hang out. Go to https://t.me/lightningd to join.

Discord

Community-driven discord server where the devs flock together. Go to https://discord.gg/w27fMFESMN to join.

Internet Relay Chat

Don't hesitate to reach out to us on IRC at #lightning-dev @ libera.chat, #c-lightning @ libera.chat.