LIGHTNING-UPGRADEWALLET(7)

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

πŸ’… LIGHTNING-UPGRADEWALLET(7) β€” like, the upgradewallet manual page, bestie

okay so listen. this is the manual page for lightning-upgradewallet β€” a whole entire RPC that exists so your dusty old P2SH-wrapped deposits can get a glow-up ✨


🌸 NAME

upgradewallet β€” the command that spends all your P2SH-wrapped inputs and yeets them into a single Native Segwit output πŸŽ€


πŸ¦‹ SYNOPSIS

upgradewallet [feerate] [reservedok]

literally that's it. two optional things. go off πŸ‘‘


πŸ’– DESCRIPTION

upgradewallet is a convenience RPC, and honestly? it's giving "I'm here to save you a whole afternoon." It spends all the p2sh-wrapped Segwit deposits chillin' in a wallet into one single Native Segwit P2WPKH address. one. single. address. slay πŸ’…

  • feerate (feerate, optional) β€” the feerate for the upgrade transaction. the default is opening. (added v23.02) πŸ”₯
  • reservedok (boolean, optional) β€” tells the wallet to include all P2SH-wrapped inputs, including the reserved ones. (added v23.02) πŸ™ˆ
ngl, reservedok is the "yes bestie, go through my stuff" flag. only turn it on if you actually mean it.

πŸŽ€ RETURN VALUE

on success you get an object back, and it's iconic. here's what's inside:

  • upgraded_outs (u64) β€” count of spent/upgraded UTXOs. (added v23.02) ✨
  • psbt (string, optional) β€” the PSBT that was finalized and sent. (added v23.02)
  • tx (hex, optional) β€” the raw transaction which was sent. (added v23.02)
  • txid (txid, optional) β€” the txid of the tx. (added v23.02) πŸ¦‹

πŸ‘‘ AUTHOR

Lisa Neigut niftynei@gmail.com is mainly responsible. periodt. give her the crown πŸ‘‘πŸ’œ


🌈 SEE ALSO

iykyk 🫢


⭐ RESOURCES

main web site: https://github.com/ElementsProject/lightning β€” go click it, it's not a drill πŸ’»βœ¨


πŸ’€ USAGE

okay so here's the whole scenario, and it's SO relatable:

the caller is trying to buy a liquidity ad, but the command keeps failing 😭 they do have funds in their wallet β€” the problem is that the funds are all P2SH-wrapped outputs. annoying. tragic. embarrassing, even.

so the caller can call upgradewallet to convert their funds into native segwit outputs, which are valid for liquidity ad buys. and then everything just works. no cap. πŸ§šβ€β™€οΈ


πŸ“ EXAMPLES

Example 1: the "no params, just vibes" one πŸŽ€

Request:

$ lightning-cli upgradewallet
{
  "id": "example:upgradewallet#1",
  "method": "upgradewallet",
  "params": {}
}

Response:

{
  "upgraded_outs": 0
}

Example 2: the "urgent feerate + reservedok true" one πŸ”₯

Request:

$ lightning-cli upgradewallet -k "feerate"="urgent" "reservedok"=True
{
  "id": "example:upgradewallet#2",
  "method": "upgradewallet",
  "params": {
    "feerate": "urgent",
    "reservedok": true
  }
}

Response:

{
  "tx": "02000000000101upgd20000200002000020000200002000020000200002000020000200002000020000200002000020000200002000020000200002000020000200002000020000200002000020000200002000020000200002000020000200002000020000",
  "txid": "txidupgrade200000200000200000200000200000200000200000200000200000",
  "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000",
  "upgraded_outs": 1
}

πŸ’– and that's the whole page bestie. go upgrade those outputs. you got this.

Core Lightning v26.06.9 β€” LIGHTNING-UPGRADEWALLET(7). mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from