LIGHTNING-UPGRADEWALLET(7)
π 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 isopening. (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
- nixpkgs unstable: clightning 26.06.9
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms