Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
712821f
splice: test mutli-channel splice script and fees
ddustin Feb 1, 2026
6299b16
amount: Add decimal format for msats
ddustin Aug 16, 2025
84970dc
amount: Can add sat convenience method
ddustin Feb 1, 2026
00c25e8
splice-script: channel id corner case
ddustin Aug 16, 2025
944f319
splice-script: wetlog / debuglog fix
ddustin Aug 16, 2025
a92ac6a
splice-script: Memleak fix on failure
ddustin Aug 16, 2025
8f9c7e8
channeld: Inform channeld about opening feerate
ddustin Aug 16, 2025
5a22195
channeld: Add new feerate type ‘splice’
ddustin Feb 1, 2026
cee9b91
ld: Expose splice feerate to RPC
ddustin Feb 1, 2026
1e73e86
splice: Add and improve logging
ddustin Feb 1, 2026
5c63ffa
splice: Fix weight calculations & use opening feerate
ddustin Feb 1, 2026
76065e3
splice: Update `tx_abort` for mulitple splices
ddustin Feb 1, 2026
594f35e
splice: Fail earlier on too-few-funds
ddustin Feb 1, 2026
cc70120
gossip: Don’t reset channel on stale annoncement
ddustin Feb 1, 2026
ef968b2
splice: multi channel stfu bugfix
ddustin Jan 29, 2026
efe26e0
splice script: Add new PENDING state and log
ddustin Feb 1, 2026
9d88e8d
splice script: Zero out wallet fund requests
ddustin Feb 1, 2026
5b568a2
splice script: Turn “wallet -> *” into “wallet -> 100%”
ddustin Feb 1, 2026
b2f0c06
splice script: Allow `out_ppm` for wallet
ddustin Feb 1, 2026
fc40836
splice script: Helper functions for dynamic calcs
ddustin Feb 1, 2026
3e7292d
splice script: Switch to splice feerate
ddustin Feb 1, 2026
df3e540
splice script: Improve weight guess calculation
ddustin Feb 1, 2026
a1405bc
splice script: Implement dynamic wallet & fee
ddustin Feb 1, 2026
9808b0d
splice script: Update tests to use dynamic fees
ddustin Feb 1, 2026
5d0914b
splice: Turn on multi-channel, dynamic wallet, smart fees
ddustin Feb 1, 2026
1a8202b
splice: Let RPC stfu take time
ddustin Mar 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .msggen.json
Original file line number Diff line number Diff line change
Expand Up @@ -1690,6 +1690,7 @@
"Feerates.perkb.mutual_close": 4,
"Feerates.perkb.opening": 3,
"Feerates.perkb.penalty": 8,
"Feerates.perkb.splice": 12,
"Feerates.perkb.unilateral_anchor_close": 11,
"Feerates.perkb.unilateral_close": 5
},
Expand All @@ -1708,6 +1709,7 @@
"Feerates.perkw.mutual_close": 4,
"Feerates.perkw.opening": 3,
"Feerates.perkw.penalty": 8,
"Feerates.perkw.splice": 12,
"Feerates.perkw.unilateral_anchor_close": 11,
"Feerates.perkw.unilateral_close": 5
},
Expand Down Expand Up @@ -7319,6 +7321,10 @@
"added": "pre-v0.10.1",
"deprecated": null
},
"Feerates.perkb.splice": {
"added": "v26.04",
"deprecated": null
},
"Feerates.perkb.unilateral_anchor_close": {
"added": "v23.08",
"deprecated": null
Expand Down Expand Up @@ -7379,6 +7385,10 @@
"added": "pre-v0.10.1",
"deprecated": null
},
"Feerates.perkw.splice": {
"added": "v26.04",
"deprecated": null
},
"Feerates.perkw.unilateral_anchor_close": {
"added": "v23.08",
"deprecated": null
Expand Down
45 changes: 43 additions & 2 deletions bitcoin/psbt.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <ccan/ccan/mem/mem.h>
#include <common/utils.h>
#include <wally_psbt.h>
#include <wally_psbt_members.h>
#include <wire/wire.h>


Expand Down Expand Up @@ -480,6 +481,28 @@ void psbt_input_set_witscript(struct wally_psbt *psbt, size_t in, const u8 *wscr
tal_wally_end(psbt);
}

const u8 *psbt_input_get_witscript(const tal_t *ctx,
const struct wally_psbt *psbt,
size_t in)
{
size_t witscript_len, written_len;
u8 *witscript;
if (wally_psbt_get_input_witness_script_len(psbt, in, &witscript_len) != WALLY_OK)
abort();
witscript = tal_arr(ctx, u8, witscript_len);
if (wally_psbt_get_input_witness_script(psbt, in, witscript, witscript_len, &written_len) != WALLY_OK)
abort();
if (witscript_len != written_len)
abort();
return witscript;
}

bool psbt_input_get_ecdsa_sig(const tal_t *ctx,
const struct wally_psbt *psbt,
size_t in,
const struct pubkey *pubkey,
struct bitcoin_signature **sig);

void psbt_elements_input_set_asset(struct wally_psbt *psbt, size_t in,
struct amount_asset *asset)
{
Expand Down Expand Up @@ -592,10 +615,16 @@ struct amount_sat psbt_input_get_amount(const struct wally_psbt *psbt,
}

size_t psbt_input_get_weight(const struct wally_psbt *psbt,
size_t in)
size_t in,
enum PSBT_GUESS guess)
{
size_t weight;
const struct wally_map_item *redeem_script;
struct wally_psbt_input *input = &psbt->inputs[in];
struct wally_tx_output *utxo_out = NULL;

if (input->utxo)
utxo_out = &input->utxo->outputs[input->index];

redeem_script = wally_map_get_integer(&psbt->inputs[in].psbt_fields, /* PSBT_IN_REDEEM_SCRIPT */ 0x04);

Expand All @@ -605,8 +634,20 @@ size_t psbt_input_get_weight(const struct wally_psbt *psbt,
weight +=
(redeem_script->value_len +
varint_size(redeem_script->value_len)) * 4;
} else if ((guess & PSBT_GUESS_2OF2)
&& utxo_out
&& is_p2wsh(utxo_out->script, utxo_out->script_len, NULL)) {
weight = bitcoin_tx_input_weight(false,
bitcoin_tx_2of2_input_witness_weight());
} else if (utxo_out
&& is_p2wpkh(utxo_out->script, utxo_out->script_len, NULL)) {
weight = bitcoin_tx_input_weight(false,
bitcoin_tx_input_witness_weight(UTXO_P2SH_P2WPKH));
} else if (utxo_out
&& is_p2tr(utxo_out->script, utxo_out->script_len, NULL)) {
weight = bitcoin_tx_input_weight(false,
bitcoin_tx_input_witness_weight(UTXO_P2TR));
} else {
/* zero scriptSig length */
weight += varint_size(0) * 4;
}

Expand Down
19 changes: 17 additions & 2 deletions bitcoin/psbt.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ WARN_UNUSED_RESULT bool psbt_input_get_ecdsa_sig(const tal_t *ctx,

void psbt_input_set_witscript(struct wally_psbt *psbt, size_t in, const u8 *wscript);

const u8 *psbt_input_get_witscript(const tal_t *ctx,
const struct wally_psbt *psbt,
size_t in);

/* psbt_input_set_unknown - Set the given Key-Value in the psbt's input keymap
* @ctx - tal context for allocations
* @in - psbt input to set key-value on
Expand Down Expand Up @@ -265,9 +269,20 @@ void psbt_output_set_unknown(const tal_t *ctx,
struct amount_sat psbt_input_get_amount(const struct wally_psbt *psbt,
size_t in);

/* psbt_input_get_weight - Calculate the tx weight for input index `in` */
enum PSBT_GUESS {
PSBT_GUESS_ZERO = 0x0, /* Assume unknown is 0 bytes (fallback) */
PSBT_GUESS_2OF2 = 0x1, /* Assume P2WSH is 2of2 multisig (req prevtx) */
};

/* psbt_input_get_weight - Calculate the tx weight for input index `in`.
*
* @psbt - psbt
* @in - index of input who's weight you want
* @guess - How to guess if we have incomplete information
* */
size_t psbt_input_get_weight(const struct wally_psbt *psbt,
size_t in);
size_t in,
enum PSBT_GUESS guess);

/* psbt_output_get_amount - Returns the value of this output
*
Expand Down
Loading
Loading