lightning-upgradewallet -- Command to spend all P2SH-wrapped inputs into a Native Segwit output
SYNOPSIS
upgradewallet [feerate] [reservedok]
DESCRIPTION
upgradewallet
is a convenience RPC which will spend all p2sh-wrapped Segwit deposits in a wallet into a single Native Segwit P2WPKH address.
- feerate (feerate, optional): 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 reserved ones. (added v23.02)
USAGE
The caller is trying to buy a liquidity ad but the command keeps failing. They have funds in their wallet, but they're all P2SH-wrapped outputs.
The caller can call upgradewallet
to convert their funds to native segwit outputs, which are valid for liquidity ad buys.
RETURN VALUE
On success, an object is returned, containing:
- 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 <[email protected]> is mainly responsible.
SEE ALSO
lightning-utxopsbt(7), lightning-reserveinputs(7), lightning-unreserveinputs(7)
RESOURCES
Main web site: https://github.com/ElementsProject/lightning
EXAMPLES
Example 1:
Request:
lightning-cli upgradewallet
{
"id": "example:upgradewallet#1",
"method": "upgradewallet",
"params": {}
}
Response:
{
"upgraded_outs": 0
}
Example 2:
Request:
lightning-cli upgradewallet -k "feerate"="urgent" "reservedok"=True
{
"id": "example:upgradewallet#2",
"method": "upgradewallet",
"params": {
"feerate": "urgent",
"reservedok": true
}
}
Response:
{
"tx": "0200000001e3148821838724c371613dfe954620b99b689803f29b17e33b85f655afc812170000000000fdffffff0135143101000000002251206c27e1956acfa61e68292c80908880e813450f754132e8a2ac471a86bf1326b566000000",
"txid": "52b8957df7b017c4c187641491b80ca209c52b286eba60afac7292a868fdf9d0",
"psbt": "cHNidP8BAgQCAAAAAQMEZgAAAAEEAQEBBQEBAQYBAwH7BAIAAAAAAQBzAgAAAAEJawGuY9Yx4yHwOdSd9MWwVc46+mVaPVwiwqhZT0H1zQAAAAAA/f///wIALTEBAAAAABepFGVXKPNs/jbQGqUNMjZwRGn4SlVAh3HE1CgBAAAAF6kUfN+wjm5E/BFSxPQjIl0rcUgkip2HZQAAAAEBIAAtMQEAAAAAF6kUZVco82z+NtAapQ0yNnBEafhKVUCHIgICucDGhE4SpTHJaOVcVQeOwW2b92vpKQ/YfRzKcrSDmhdHMEQCIBsJrbJqp2dLLklUvvheXUy1uu4eIMkebSbbYkQHWItOAiBEuulzciFVMVB7Rkt5eOb53CX5hq7Vq2LbwBHB6ApUTwEBBBYAFNa5adNt/9rZhpGT9mPuSA39xzSIIgYCucDGhE4SpTHJaOVcVQeOwW2b92vpKQ/YfRzKcrSDmhcI1rlp0wAAAAABDiDjFIghg4ckw3FhPf6VRiC5m2iYA/KbF+M7hfZVr8gSFwEPBAAAAAABEAT9////AAEDCDUUMQEAAAAAAQQiUSBsJ+GVas+mHmgpLICQiIDoE0UPdUEy6KKsRxqGvxMmtSEHWnm7u0BtS8KN8F+mqHMoz7AqfhN0O+zc0d/P4HHC4BAJAH0I2ZcFAAAAAA==",
"upgraded_outs": 1
}