This is inspired by a patch from @whitslack, which overlapped with this series. Most importantly, there was only one call to bitcoin_tx_simple_input_weight(), and it is better to be explicit with that one. This also changes our funder calculation to assume our own input is taproot, which it is likely to be given we've defaulted to taproot for outputs for change addresses since 23.08. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
These are standard bitcoin manipulation routines which should be provided by any normal bitcoin library in whatever language you choose. The ones here are standalone ones taken from bitcoin core and some I wrote, many taken from bitcoin-iterate and pasted in here.