LIGHTNING-ADDPSBTOUTPUT(7)

๐Ÿ“ฆ
version 26.06.9 ยท 2 versions
, in nixpkgs unstable

๐Ÿ’… LIGHTNING-ADDPSBTOUTPUT(7) โœจ

okay so bestie, welcome to the lightning-addpsbtoutput page of the Core Lightning manual โ€” section 7, we're in the big leagues now ๐ŸŽ€


๐ŸŒธ NAME

addpsbtoutput โ€” the command that populates PSBT outputs straight from your wallet, no cap ๐Ÿ’–


๐Ÿฆ‹ SYNOPSIS

addpsbtoutput satoshi [initialpsbt] [locktime] [destination]

โœจ DESCRIPTION

So this command literally got added in v23.11 โ€” it's giving fresh-out-the-oven energy ๐Ÿ”ฅ

addpsbtoutput is a low-level RPC command (yes, low-level, meaning the big kids use it directly) that creates or modifies a PSBT by adding exactly one output worth satoshi.

What's the vibe? It's how you receive funds into your on-chain wallet interactively using PSBTs ๐Ÿซถ like, you're hand-crafting the transaction instead of letting the wallet do everything behind your back.

Here's the rundown of what you can pass in, iconically bulleted:

  • 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. Math queen behavior honestly ๐Ÿงฎ
  • initialpsbt (string, optional) โ€” a Base 64 encoded PSBT you want to add the output to. Don't have one? Don't stress โ€” if you skip it, one gets generated automatically for you ๐Ÿ’–
  • locktime (u32, optional) โ€” if you don't set it, it's set to a recent block height (but only if no initial PSBT was specified, iykyk โฐ)
  • destination (string, optional) โ€” if you don't set it, an internal address is generated. Slay, the wallet's got you ๐ŸŽ€

๐Ÿ‘‘ RETURN VALUE

On success (and bestie, we love success), you get an object back containing:

  • psbt (string) โ€” the unsigned PSBT which fulfills the parameters you gave it ๐ŸŒˆ
  • estimated_added_weight (u32) โ€” the estimated weight of the output that got added. Not the real weight, the estimated one, so don't come for me ๐Ÿ’€
  • outnum (u32) โ€” the 0-based number where they placed the output. Zero-based, bestie, so the first one is 0 โญ

๐Ÿงš AUTHOR

Dusty @dusty_daemon is mainly responsible. Iconic, honestly ๐Ÿ‘‘


๐Ÿ“ SEE ALSO

go read those next, they're literally the sibling commands ๐Ÿ’œ


๐Ÿ”ฅ RESOURCES

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


๐Ÿ’… EXAMPLES

Example 1

Here's 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": "cHNidP8BAgpsbt1001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101",
  "estimated_added_weight": 172,
  "outnum": 1
}

Example 2

Request:

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

Response:

{
  "psbt": "cHNidP8BAgpsbt20020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202",
  "estimated_added_weight": 172,
  "outnum": 1
}

Example 3

Request:

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

Response:

{
  "psbt": "cHNidP8BAgpsbt300303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303",
  "estimated_added_weight": 172,
  "outnum": 1
}

okay that's the whole page!! this is Core Lightning v26.06.9, LIGHTNING-ADDPSBTOUTPUT(7), and yeah that's the date spot on the footer โ€” go forth and PSBT, bestie ๐Ÿฆ‹๐Ÿ’œ periodt.

๐Ÿ“ฆ where this page comes from