lightning-addpsbtoutput

lightning-addpsbtoutput -- Command to populate PSBT outputs from the wallet

SYNOPSIS

addpsbtoutput satoshi [initialpsbt] [locktime] [destination]

DESCRIPTION

Command added in v23.11.

addpsbtoutput is a low-level RPC command which creates or modifies a PSBT by adding a single output of amount satoshi.

This is used to receive funds into the on-chain wallet interactively using PSBTs.

  • satoshi (sat): The satoshi value of the output. It can be a whole number, a whole number ending in sat, or a number with 1 to 8 decimal places ending in btc.
  • initialpsbt (string, optional): Base 64 encoded PSBT to add the output to. If not specified, one will be generated automatically.
  • locktime (u32, optional): If not set, it is set to a recent block height (if no initial psbt is specified).
  • destination (string, optional): If it is not set, an internal address is generated.

RETURN VALUE

On success, an object is returned, containing:

  • psbt (string): Unsigned PSBT which fulfills the parameters given.
  • estimated_added_weight (u32): The estimated weight of the added output.
  • outnum (u32): The 0-based number where the output was placed.

AUTHOR

Dusty <@dusty\_daemon> is mainly responsible.

SEE ALSO

lightning-fundpsbt(7), lightning-utxopsbt(7)

RESOURCES

Main web site: https://github.com/ElementsProject/lightning

EXAMPLES

Example 1: Here is a command to make a PSBT with a 1,000,000 sat output that leads to the on-chain wallet:

Request:

lightning-cli addpsbtoutput -k "satoshi"=1000000 "locktime"=111
{
  "id": "example:addpsbtoutput#1",
  "method": "addpsbtoutput",
  "params": {
    "satoshi": 1000000,
    "locktime": 111
  }
}

Response:

{
  "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQABBQEBAQYBAwH7BAIAAAAAAQMIQEIPAAAAAAABBCJRIO7yw3zIUblRUcdhCLSjdFxJsYHu2s0Y29bT0bGAGdcbAA==",
  "estimated_added_weight": 172,
  "outnum": 0
}

Example 2:

Request:

lightning-cli addpsbtoutput "3333333" "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQABBQECAQYBAwH7BAIAAAAAAQMIQEIPAAAAAAABBCJRIO7yw3zIUblRUcdhCLSjdFxJsYHu2s0Y29bT0bGAGdcbAAEDCNXcMgAAAAAAAQQiUSA2cYCeVGcxdSZII2urHpalr5osmF2lPbYRaw1nKyPcmQA="
{
  "id": "example:addpsbtoutput#2",
  "method": "addpsbtoutput",
  "params": [
    3333333,
    "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQABBQECAQYBAwH7BAIAAAAAAQMIQEIPAAAAAAABBCJRIO7yw3zIUblRUcdhCLSjdFxJsYHu2s0Y29bT0bGAGdcbAAEDCNXcMgAAAAAAAQQiUSA2cYCeVGcxdSZII2urHpalr5osmF2lPbYRaw1nKyPcmQA="
  ]
}

Response:

{
  "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQABBQECAQYBAwH7BAIAAAAAAQMIQEIPAAAAAAABBCJRIO7yw3zIUblRUcdhCLSjdFxJsYHu2s0Y29bT0bGAGdcbAAEDCNXcMgAAAAAAAQQiUSA2cYCeVGcxdSZII2urHpalr5osmF2lPbYRaw1nKyPcmQA=",
  "estimated_added_weight": 172,
  "outnum": 1
}

Example 3:

Request:

lightning-cli addpsbtoutput -k "satoshi"=3333333 "initialpsbt"="cHNidP8BAgQCAAAAAQMEbwAAAAEEAQABBQECAQYBAwH7BAIAAAAAAQMIQEIPAAAAAAABBCJRIO7yw3zIUblRUcdhCLSjdFxJsYHu2s0Y29bT0bGAGdcbAAEDCNXcMgAAAAAAAQQiUSA2cYCeVGcxdSZII2urHpalr5osmF2lPbYRaw1nKyPcmQA=" "destination"="bcrt1p52spc7t99z0wu444elxahxzkcu86gakzvnfp7ugudf567am2uspsuneuq9"
{
  "id": "example:addpsbtoutput#3",
  "method": "addpsbtoutput",
  "params": {
    "satoshi": 3333333,
    "initialpsbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQABBQECAQYBAwH7BAIAAAAAAQMIQEIPAAAAAAABBCJRIO7yw3zIUblRUcdhCLSjdFxJsYHu2s0Y29bT0bGAGdcbAAEDCNXcMgAAAAAAAQQiUSA2cYCeVGcxdSZII2urHpalr5osmF2lPbYRaw1nKyPcmQA=",
    "destination": "bcrt1p52spc7t99z0wu444elxahxzkcu86gakzvnfp7ugudf567am2uspsuneuq9"
  }
}

Response:

{
  "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQABBQEDAQYBAwH7BAIAAAAAAQMIQEIPAAAAAAABBCJRIO7yw3zIUblRUcdhCLSjdFxJsYHu2s0Y29bT0bGAGdcbAAEDCNXcMgAAAAAAAQQiUSA2cYCeVGcxdSZII2urHpalr5osmF2lPbYRaw1nKyPcmQABAwjV3DIAAAAAAAEEIlEgoqAceWUonu5Wtc/N25hWxw+kdsJk0h9xHGppr3dq5AMA",
  "estimated_added_weight": 172,
  "outnum": 2
}

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.