LIGHTNING-RESERVEINPUTS(7)

πŸ“¦
version 26.06.9 Β· 2 versions
, in nixpkgs unstable

πŸ’… LIGHTNING-RESERVEINPUTS(7) β€” reserveinputs

okay bestie, welcome to the lightning-reserveinputs page of the Core Lightning manual πŸŽ€ this is the one that goes and claims your UTXOs for a transaction before it's even signed, so nobody else can swoop in and spend them. main character energy for your coins, honestly πŸ‘‘


✨ NAME ✨

reserveinputs β€” build a transaction and reserve up the UTXOs it spends. literally claiming your bag πŸ’…


🌸 SYNOPSIS 🌸

reserveinputs psbt [exclusive] [reserve]

πŸ¦‹ DESCRIPTION πŸ¦‹

so the reserveinputs RPC command puts (or bumps up) reservations on any inputs that are specified in psbt and that are known to lightningd. that's the whole vibe ✨

it'll fail with an error if any of the inputs are known to be spent, and it just ignores inputs that are unknown β€” not its problem, not its business πŸ™ˆ

normally the command fails (and makes no reservations at all, like, zero) if an input is already reserved.

  • psbt (string) β€” the PSBT you want to reserve inputs from πŸ’–
  • exclusive (boolean, optional) β€” if you set this to False, existing reservations are simply extended instead of causing failure. lowkey the chill option 😌
  • reserve (u32, optional) β€” how many blocks to reserve for. by default, reservations are for the next 72 blocks (that's roughly 6 hours ⏰)

πŸ’– RETURN VALUE πŸ’–

on success you get an object containing reservations β€” it's an array of objects, and each one has:

  • txid (txid) β€” the input transaction id.
  • vout (u32) β€” the input index output number that got reserved.
  • was_reserved (boolean) β€” whether the input was already reserved (like, before you showed up πŸ‘€).
  • reserved (boolean) (always true) β€” whether the input is now reserved. spoiler: yes, queen πŸ’…
  • reserved_to_block (u32) β€” the blockheight where the reservation expires. tick tock ⏳

πŸ’€ ERRORS πŸ’€

on failure, an error gets reported and no UTXOs are reserved. none. zero. nada 😭

  • -32602 β€” invalid parameter, like specifying a spent/reserved input in psbt. not the vibe fr fr.

πŸ‘‘ AUTHOR πŸ‘‘

Lisa Neigut niftynei@gmail.com is mainly responsible. queen behavior, we stan 🫢


🌈 SEE ALSO 🌈

lightning-unreserveinputs(7), lightning-signpsbt(7), lightning-sendpsbt(7)


⭐ RESOURCES ⭐

main web site: https://github.com/ElementsProject/lightning β€” go be nosy, iykyk 🧚


πŸ“ EXAMPLES πŸ“

Example 1

Request:

$ lightning-cli reserveinputs -k "psbt"="cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100"

{
  "id": "example:reserveinputs#1",
  "method": "reserveinputs",
  "params": {
    "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100"
  }
}

Response:

{
  "reservations": [
    {
      "txid": "channeltxid111200111200111200111200111200111200111200111200111200",
      "vout": 1,
      "was_reserved": false,
      "reserved": true,
      "reserved_to_block": 226
    }
  ]
}

Example 2

Request:

$ lightning-cli reserveinputs -k "psbt"="cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200"

{
  "id": "example:reserveinputs#2",
  "method": "reserveinputs",
  "params": {
    "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200"
  }
}

Response:

{
  "reservations": [
    {
      "txid": "txidocsigned1011000110001100011000110001100011000110001100011000",
      "vout": 1,
      "was_reserved": false,
      "reserved": true,
      "reserved_to_block": 226
    }
  ]
}

and that's the whole page, bestie 🫢 this was Core Lightning v26.06.9, LIGHTNING-RESERVEINPUTS(7), signing off β€” go reserve those inputs, slay πŸ’œβœ¨

πŸ“¦ where this page comes from