1
0
Commit Graph

17907 Commits

Author SHA1 Message Date
ThomasV
ee42e09387 anchor channels: unlock wallet on startup if the wallet has channels 2024-12-20 10:10:07 +01:00
ThomasV
693210edbe Qt: stop support for password-protected wallets without
storage encryption.

The password will be needed on startup with anchor channels.

Note that it remains possible to use non-encrypted storage
and keystore encryption with the command line.
2024-12-20 09:24:45 +01:00
ThomasV
692a777da8 coins tab: if we do not know whether we can swap a utxo, assume we can 2024-12-17 17:43:43 +01:00
ThomasV
77ec49ac67 make_unsigned_transaction: ensure coins and inputs do not overlap
(follow-up 8bec974a39)
2024-12-17 10:54:21 +01:00
ThomasV
bae2bbf35d lnsweep: sweep anchor outputs 2024-12-16 12:13:39 +01:00
ThomasV
67470b92b7 lnchannel: fix extract_preimage for MPP.
- enforce MPP in the corresponding regtest.
 - fix get_invoice_status returning inflight if it was settled onchain
2024-12-15 10:46:18 +01:00
ThomasV
62af1ee887 fixes for txin.make_witness:
- add witness_sizehint
  - fix make_unsigned_transaction
  - do not remove witness_script in tx.finalize()
2024-12-13 14:44:35 +01:00
ThomasV
05266da707 lnwatcher: special-case non-anchor first stage htlcs 2024-12-12 10:52:21 +01:00
ThomasV
3b1dc194e4 Refactor lnsweep:
- txins have an optional make_witness method
 - instead of gen_tx, SweepInfo has a txin and
   an optional txout, for 1st stage HTLCs
 - sweep transactions are created by lnwatcher

The purpose of this change is to allow combining several
inputs in the same sweep transaction.
2024-12-11 17:14:14 +01:00
ThomasV
0e3b730cd9 lnsweep: remove dead code (we never sweep to_remote in non-anchor channels) 2024-12-11 10:56:27 +01:00
ThomasV
1da937f103 swaps: set nsequence in create_claim_tx (follow-up previous commit) 2024-12-11 10:24:40 +01:00
ThomasV
0599254e1f lnsweep and submarine_swaps: set txin.nsequence, instead of
calling set_rbf. set_rbf must be avoided if we batch transactions,
because it blindly overwrites nsequence of all txins.
2024-12-11 09:56:42 +01:00
ThomasV
6598507d3c lnwatcher: replace inspect_tx_candidate with get_spender.
inspect_tx_candidate assumes that htlc transactions have
only one input, which is not true for anchor channels.

inspect_tx_candidate is still used by the watchtower, because
it does not have access to channel information.
2024-12-11 09:33:47 +01:00
ThomasV
26ed696479 swaps: follow-up d838b6c9b9b4d669c81832f5be256aca148c89d7 2024-12-08 10:41:55 +01:00
ThomasV
ab583c9b7e cirrus: follow-up previous commit 2024-12-08 10:16:28 +01:00
ThomasV
0d632348b9 cirrus: disable python3.8 unittests
see #9239
2024-12-08 10:08:33 +01:00
ThomasV
8bec974a39 wallet: add inputs and base_tx parameters to make_unsigned_transaction 2024-12-08 09:54:10 +01:00
ThomasV
7b72655fba tx serialization: breakup tx witness into elements 2024-12-08 09:29:59 +01:00
ThomasV
62331aeb56 coin_chooser: make BIP69_sort optional 2024-12-04 11:24:06 +01:00
ThomasV
8bf505fc4b coin_chooser: allow to pass empty outputs to make_tx.
coins will be sent to a change address if there are no outputs.
2024-12-04 11:06:27 +01:00
ThomasV
9aa7222c5c swaps: let plugin override self.is_server (config variable may be ser and plugin not active) 2024-12-01 09:16:16 +01:00
ThomasV
acbb57036f Merge pull request #9327 from hishope/master
chore: fix 404 status URL
2024-11-29 10:42:36 +01:00
ThomasV
81baaa52cd CLI: raise UserFacingException when passed unknown channel point. fixes #9326 2024-11-29 10:38:57 +01:00
hishope
2a9ec0764d chore: fix 404 status URL
Signed-off-by: hishope <csqiye@126.com>
2024-11-29 17:09:29 +08:00
ThomasV
86c9eb4858 psbt_nostr: minor fix 2024-11-28 11:16:49 +01:00
bitromortac
dbfc27d73b watchtower: only send first-stage HTLC justice txs
Due to malleability of HTLC-transactions, we can't send presigned
justice transactions for the second-stage HTLC transactions, which is
why we now send first-stage justice transactions for anchor channels.
2024-11-26 10:00:21 +01:00
bitromortac
d535821516 htlctx: deal with possible peer htlctx batching
Due to anchor channel's sighash.SINGLE and sighash.ANYONECANPAY,
several HTLC-transactions can be combined. This means we must watch for
revoked outputs in the HTLC transaction not only at index 0 but at any
index.
2024-11-26 09:28:00 +01:00
bitromortac
9c277802e9 sweep: rename sweep creation functions
naming scheme: tx(s)_our/their_ctx/htlctx_output-description

function names are shortened to whether a single (tx) or several sweep
transactions (txs) are generated
2024-11-25 19:24:51 +01:00
bitromortac
de9fee706d unit tests: tests for both anchors and old ctx types
* in test_lnutil, patch htlc weight to pass original anchor commitment
  test vectors
* activate tests for both commitment types
2024-11-25 12:31:38 +01:00
ThomasV
19e993f39b fix test_lnchannel (follow-up ea584e13fc) 2024-11-25 12:05:06 +01:00
ThomasV
cdc746713e lnwatcher: if broadcast is successful, add tx immediately, so that second-stage htlc can be added as well 2024-11-25 11:39:12 +01:00
bitromortac
ea584e13fc anchors: switch to zero-fee-htlcs
* sets the weight of htlc transactions to zero, thereby putting a zero
  fee for the htlc transactions
* add inputs to htlc-tx for fee bumping
* switches feature flags
* disable anchor test vectors, which are now partially invalid
2024-11-25 10:56:50 +01:00
bitromortac
d4222432f4 enable anchor_channels for regtest
* lower the final balance of the backup regtest, which is due to additional
  sweep transactions

* adapt ctx index
2024-11-23 12:03:37 +01:00
ThomasV
6735ae5ec8 fix unit test (follow-up 78d19c6e2f) 2024-11-23 11:58:29 +01:00
ThomasV
78d19c6e2f amchor outputs: fixes after rebase 2024-11-23 11:26:04 +01:00
ThomasV
efa239cc9b follow-up ece1fb39d2 2024-11-23 11:25:54 +01:00
ThomasV
ece1fb39d2 enable anchor outputs via config option 2024-11-23 10:10:16 +01:00
bitromortac
a3dc2b847e unit tests: test anchors in lnpeer and lnchannel
* testing of anchor channels is controlled via TEST_ANCHOR_CHANNELS
* rewrite tests in test_lnchannel.py
2024-11-22 12:23:51 +01:00
bitromortac
3a3f5059b4 backups: restore from closing tx, sweep to_remote
* add a method for backups to sweep to_remote
* to_remote sweeping needs the payment_basepoint's private key
  to sign the sweep transaction
* we restore the private key from our funding multisig pubkey
  (pubished with the closing transaction) and a static payment key secret
2024-11-21 12:18:53 +01:00
bitromortac
f746e2cc6b qt: add anchor channel icon
source: https://tabler-icons.io/anchor
2024-11-21 11:59:06 +01:00
bitromortac
9bfeffcdd1 lnsweep: update sweeps to_remote and htlcs
* sweep to_remote output, as this is now a p2wsh (previously internal
  wallet address)
* sweep htlc outputs with new scripts
2024-11-21 11:54:07 +01:00
bitromortac
b6e224c864 lnwatcher: add field for onchain htlc settlement control 2024-11-21 10:58:41 +01:00
bitromortac
18f81d0080 lnwatcher: renaming and comments for clarity 2024-11-21 10:43:09 +01:00
ThomasV
4d26fb552b fixes after rebase 2024-11-20 15:02:05 +01:00
bitromortac
8f7c11f295 tests: add anchor commitment test vectors from rfc 2024-11-20 12:05:14 +01:00
ThomasV
122740ad7b lnutil minor fix after rebase 2024-11-20 12:05:05 +01:00
bitromortac
7aa3dc1e40 lnutil+lnchannel: add anchors, adapt to_remote
* to_remote has now an additional csv lock of 1
* anchor outputs are added if to_local/remote outputs are present
* funder balance is reduced to accomodate anchors
2024-11-20 11:54:55 +01:00
bitromortac
7907b9c05d lnchannel+lnutil: change htlc output, send new sig
* changes the htlc outputs' witness script to have a csv lock of 1
* send signatures for remote ctx with ANYONECANPAY|SINGLE
* refactor htlc weight (useful for zero-fee-htlc)
2024-11-20 11:03:48 +01:00
bitromortac
c8bf515953 lnutil: update ctx fee calculation for anchors 2024-11-20 10:53:00 +01:00
bitromortac
22f5ff0d0e add static payment key
* in order to be able to sweep to_remote in an onchain backup scenario
  we need to retain the private key for the payment_basepoint
* to facilitate the above, we open a channel derived from a static
  secret (tied to the wallet seed), the static_payment_key combined with
the funding pubkey (multisig_key), which we can restore from the channel
closing transaction
2024-11-20 10:08:26 +01:00