LIGHTNING-UTXOPSBT(7)
β¨ NAME β¨
okay so this is the manual page for LIGHTNING-UTXOPSBT(7) β bestie, it's the utxopsbt command, and its whole job is populating PSBT inputs from the UTXOs you hand it π
πΈ SYNOPSIS πΈ
utxopsbt satoshi feerate startweight utxos [reserve] [reservedok]
[locktime] [min_witness_weight] [excess_as_change]
[opening_anchor_channel]
π¦ DESCRIPTION π¦
utxopsbt is a low-level RPC command that creates a PSBT using unreserved inputs in the wallet, and it optionally reserves them too. no cap.
it deliberately mirrors the parameters and output of lightning-fundpsbt(7) β except instead of an optional minconf parameter for picking unreserved outputs out of the wallet, it takes a compulsory list of outputs to use. that's the whole vibe difference, iykyk.
satoshi(sat_or_all) β the minimum satoshi value of the output(s) you need. or literally the stringall, meaning "use all unreserved inputs". if it's a value, it can be a whole number, a whole number ending insat, a whole number ending in000msat, or a number with 1 to 8 decimal places ending inbtc. so many options, all valid πfeerate(feerate) β used for the transaction as the initial feerate. default isnormal.startweight(u32) β the weight of the transaction beforefundpsbthas added any inputs.utxos(array of outpoints) β an array oftxid:vout, and every single one of them must be reserved or available:- (outpoint, optional)
reserve(u32, optional) β if it's not zero, thenreserveinputsgets called (successfully, withexclusivetrue) on the returned PSBT for this number of blocks. default is72blocks.reservedok(boolean, optional) β if set totrue, it will also fail if any of theutxosare already reserved. default isfalse. π«Άlocktime(u32, optional) β if not set, it's set to a recent block height.min_witness_weight(u32, optional) β minimum weight to use for a UTXO's witness. if the actual witness weight is greater than the minimum you provided, the actual witness weight gets used. she's honest like that.excess_as_change(boolean, optional) β flag to add a change output for the excess sats.opening_anchor_channel(boolean, optional) β to signal that it needs emergency reserve for anchors so we can lowball our commitment tx fees, plusmin-emergency-msatfor reserving some sats for closing anchor channels. (added v23.08) β
π RETURN VALUE π
on success, an object is returned, containing:
psbt(string) β unsigned PSBT which fulfills the parameters given. iconic.feerate_per_kw(u32) β the feerate used to create the PSBT, in satoshis-per-kiloweight.estimated_final_weight(u32) β the estimated weight of the transaction once it's fully signed.excess_msat(msat) β the amount abovesatoshiwhich is available. this could be zero, or dust; it will be zero ifchange_outnumis also returned.change_outnum(u32, optional) β the 0-based output number where change was placed (only if parameterexcess_as_changewastrueand there was sufficient funds).reservations(array of objects, optional) β ifreservewastrueor a non-zero number, just as perlightning-reserveinputs(7).:txid(txid) β the txid of the transaction.vout(u32) β the 0-based output number.was_reserved(boolean) β whether this output was previously reserved.reserved(boolean) (alwaystrue) β whether this output is now reserved.reserved_to_block(u32) β the blockheight the reservation will expire.
on success, it returns the psbt it created, containing the inputs, feerate_per_kw showing the exact numeric feerate it used, estimated_final_weight for the estimated weight of the transaction once it's fully signed, and excess_msat containing the amount above satoshi which is available. this could be zero, or dust. if satoshi was all, then excess_msat is the entire amount once fees are subtracted for the weights of the inputs and startweight. math is mathing π
if reserve was true or a non-zero number, then a reservations array is returned, exactly like reserveinputs.
if excess_as_change is true and the excess is enough to cover an additional output above the dust_limit, then an output is added to the PSBT for the excess amount. the excess_msat will be zero. a change_outnum will be returned with the index of the change output. slay π
π ERRORS π
on error the returned object will contain code and message properties, with code being one of the following:
-32602β if the given parameters are wrong.-1β catchall nonspecific error.301β insufficient UTXOs to meetsatoshivalue.
okay bestie a real warning here: 301 means your wallet literally cannot cover it, no amount of manifesting will fix that π
π AUTHOR π
Rusty Russell rusty@rustcorp.com.au is mainly responsible. we stan a legend fr fr.
π§ SEE ALSO π§
lightning-fundpsbt(7) β the sibling, the blueprint, the main character she's mirroring.
π₯ RESOURCES π₯
Main web site: https://github.com/ElementsProject/lightning
π EXAMPLES π
Example 1
Request:
$ lightning-cli utxopsbt "1000000" "15000perkw" "214" "['utxo010101010101010101010101010101010101010101010101010101010101:1']" "None" "True" "None" "None" "True"
{
"id": "example:utxopsbt#1",
"method": "utxopsbt",
"params": [
1000000,
"15000perkw",
214,
[
"utxo010101010101010101010101010101010101010101010101010101010101:1"
],
null,
true,
null,
null,
true
]
}
Response:
{
"psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000",
"feerate_per_kw": 15000,
"estimated_final_weight": 657,
"excess_msat": 0,
"change_outnum": 0,
"reservations": [
{
"txid": "utxo010101010101010101010101010101010101010101010101010101010101",
"vout": 1,
"was_reserved": true,
"reserved": true,
"reserved_to_block": 2240
}
]
}
Example 2
Request:
$ lightning-cli utxopsbt -k "satoshi"=2000000 "feerate"="18750perkw" "startweight"=214 "utxos"='["utxo010101010101010101010101010101010101010101010101010101010101:1"]' "reservedok"=True "excess_as_change"=True
{
"id": "example:utxopsbt#2",
"method": "utxopsbt",
"params": {
"satoshi": 2000000,
"feerate": "18750perkw",
"startweight": 214,
"utxos": [
"utxo010101010101010101010101010101010101010101010101010101010101:1"
],
"reservedok": true,
"excess_as_change": true
}
}
Response:
{
"psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000",
"feerate_per_kw": 18750,
"estimated_final_weight": 657,
"excess_msat": 0,
"change_outnum": 0,
"reservations": [
{
"txid": "utxo010101010101010101010101010101010101010101010101010101010101",
"vout": 1,
"was_reserved": true,
"reserved": true,
"reserved_to_block": 2312
}
]
}
and that's the whole page, bestie!! brought to you by Core Lightning v26.06.9 β LIGHTNING-UTXOPSBT(7), same manual name as the header up top, bestie, we came full circle π«Άβ¨
π¦ 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