LIGHTNING-SETPSBTVERSION(7)

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

πŸ’… LIGHTNING-SETPSBTVERSION(7) β€” setpsbtversion

okay so bestie, you're in the lightning-setpsbtversion section 7 manual page and honestly? it's a little baddie. it's the setpsbtversion command, and its whole lewk is "Command for setting PSBT version" ✨


🌸 SYNOPSIS 🌸

setpsbtversion psbt version

like, two args. that's it. she's low maintenance. πŸŽ€


πŸ’– DESCRIPTION πŸ’–

so the setpsbtversion RPC command does exactly what it says on the tin: it converts the PSBT you hand it to the version you asked for, and it returns the base64 result of that conversion. slay. πŸ”₯

but listen β€” if version is invalid, it does not manifest a cute little PSBT for you. it returns an error. periodt. πŸ’€

  • psbt (string) β€” the PSBT you want to change versions. your little base64 baby. πŸ¦‹
  • version (u32) β€” the version you want to set it to. an unsigned 32-bit int, no cap. ✨

πŸ‘‘ RETURN VALUE πŸ‘‘

on success, you get an object back, containing:

  • psbt (string) β€” a converted PSBT of the requested version. it's giving "glow up complete". πŸ’…

😭 ERRORS 😭

the following error codes may occur, and yes you should know them:

  • -32602 β€” Parameter missed or malformed. i.e. you forgot something or you fumbled the format. we've all been there bestie, just fix it and rerun. πŸ™ˆ

🫢 AUTHOR 🫢

Gregory Sanders gsanders87@gmail.com is mainly responsible. give him his flowers. πŸŒΈπŸ‘‘


🌈 SEE ALSO 🌈

the whole PSBT friend group honestly, go say hi to all of them. πŸ’œ


⭐ RESOURCES ⭐

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


✨ EXAMPLES ✨

Example 1 πŸŽ€

Request:

$ lightning-cli setpsbtversion -k "psbt"="cHNidP8BAgpsbt1001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101" "version"=0
{
  "id": "example:setpsbtversion#1",
  "method": "setpsbtversion",
  "params": {
    "psbt": "cHNidP8BAgpsbt1001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101",
    "version": 0
  }
}

Response:

{
  "psbt": "cHNidP8BADUCAAAAAAFAQg8AAAAAACJRIO7yw3zIUblRUcdhCLSjdFxJsYHu2s0Y29bT0bGAGdcbbwAAAAAA"
}

like look at that conversion. ate. πŸ’…

Example 2 πŸ¦‹

Request:

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

Response:

{
  "psbt": "cHNidP8BAgpsbt20020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202"
}

and that's the whole page bestie β€” no notes, it's iconic. 🧚


that's a wrap on LIGHTNING-SETPSBTVERSION(7)! this little masterpiece ships with Core Lightning v26.06.9, so go forth and version your PSBTs responsibly. mwah. πŸ’‹πŸ“
πŸ“¦ where this page comes from