1
0
mirror of https://github.com/lightning/bolts.git synced 2024-11-19 01:50:03 +01:00
Commit Graph

1032 Commits

Author SHA1 Message Date
Rusty Russell
fce8bab931 BOLT 9: Assume gossip_queries.
Supported by all but 11 nodes*.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
[* there are 449 three-year old LND nodes which advertize `2200` as their features, which have already been trimmed from most gossip for not having htlc_maximum_msat in their channel_updates]
2024-05-20 15:06:27 -05:00
Rusty Russell
e042c615ef BOLT 9: assume var_onion_optin.
Advertized as supported by all but 6 nodes (and those can no longer
route payments since people only send the modern onion these days)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-20 15:06:27 -05:00
Rusty Russell
c48b4e3b27 BOLT 9: rename option_anchors_zero_fee_htlc_tx to option_anchors.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-20 15:06:27 -05:00
Rusty Russell
d745028f65 BOLT 9: Remove option_anchor_outputs, in favor of option_anchors_zero_fee_htlc_tx.
It's supported only by pre-23.05 core-lightning nodes built with
EXPERIMENTAL_FEATURES.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-20 15:06:27 -05:00
Rusty Russell
91f4bd2383 BOLT 9: option_data_loss_protect and option_static_remotekey are now assumed.
These still have names and numbers, since they appear in `channel_type`.  They are somewhat tangled with each other, so let's tie them together as assumed.

option_data_loss_protect is advertized by all by 11 nodes(*), and option_static_remotekey all but 16 nodes.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
[* there are 449 three-year old LND nodes which advertize `2200` as their features, which have already been trimmed from most gossip for not having htlc_maximum_msat in their channel_updates]
2024-05-20 15:06:27 -05:00
Rusty Russell
b750c3d8f9 BOLT 9: Add ASSUMED marker we can use on features.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-05-20 15:06:27 -05:00
Bastien Teinturier
5f8fea8dc3
gossip: 12-blocks delay channel closed follow-up (#1156)
We introduced a 12-blocks delay for channel closing in #1004, but we
didn't update the requirement in the section about pruning.
2024-05-07 09:45:44 +02:00
Olaoluwa Osuntokun
db278ab9b2
Merge pull request #1151 from Roasbeef/blinded-paths-notation
BOLT-04: use underscores in place of parens for blinded paths notation
2024-04-22 13:21:55 -07:00
Olaoluwa Osuntokun
ed012edc15
BOLT-04: convert blinded paths syntax to use LaTeX rendering
Github now supports inline LaTeX rendering:
https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/writing-mathematical-expressions

In this commit, we use this new feature to improve the rendering of the
routines for blinded paths.
2024-03-27 18:30:37 -07:00
Olaoluwa Osuntokun
25e7dbd5ed
BOLT-04: use underscores in place of parens for blinded paths notation
In this commit, we propose a purely syntactical change to the current
blinded paths specification. Rather than denote the public key of the i-th
node as `E(i)`, we propose that instead it's denoted as: `E_i`. This results
in less overall characters, and is more similar to notation customarily
used in LaTeX.

My personal preference is that the proposed notation is easier to scan at a
glance, and also less ambiguous (doesn't look like a function call).
2024-03-27 18:30:31 -07:00
Erik De Smedt
08ce2f6f83
Fix broken link in BOLT-2 (#1148) 2024-03-14 11:48:03 +01:00
Carla Kirk-Cohen
78e5a6b066
04-onion-routing: strict validation of scid for blinded payments (#1147)
This commit updates bolt04 to more strictly enforce that encrypted_data
that is part of a blinded payment only has short_channel_id set. On
the reader side, we disallow setting of both short_channel_id and
next_node_id (which is intended for use in the context of onion
messages), and on the writer side we specify that next_node_id should
not be included by recipients.
2024-03-12 09:56:54 +01:00
Trigger
60de4a0972
BOLT 7: correct the default min_final_cltv_expiry_delta in routing example (#1143) 2024-02-22 10:01:47 +01:00
Rusty Russell
8fc3ba9f0c
BOLT 4: It's Check Lock Time Verify not Check Time Lock Verify. (#1141)
I always get this wrong too, so CLN actually has a source check for this, and it triggered when importing the latest spec!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-02-19 09:34:00 +01:00
jrakibi
ec525cc418 Update Signet port to correct hex value in BOLT #1 spec 2024-02-16 08:57:36 +10:30
niftynei
0bdaa8b9f6 dual-fund: add require_confirmed_inputs to RBF messages
Make `require_confirmed_inputs` explicit for RBF regnegotiation.

Requested-By: @t-bast
2024-02-13 11:55:23 -06:00
niftynei
6018a4d43b dual-fund, verbiage: clarify situation for closing a underfunded channel
Moved up some rationale from the Rationale section and added a
bit of clarification to when you'd want to close/cancel an open.

Reported-By: @morehouse
2024-02-13 11:55:23 -06:00
niftynei
bd1460d8cf dual-fund, wording: move sighash_all into existing verbiage
Suggested-By: @morehouse
2024-02-13 11:55:23 -06:00
niftynei
d9c571d25d dual-fund, nit: change wording on common input heuristic
Suggested-By: @devrandom
2024-02-13 11:55:23 -06:00
niftynei
f0c9ff732f tx-signatures: address comments regarding underpyament of fees
Reported-By: @morehouse
2024-02-13 11:55:23 -06:00
niftynei
076f21d65e nit: verbiage + wording
Suggested-By: @morehouse
2024-02-13 11:55:23 -06:00
niftynei
fa879e325c tx-complete: clarify that the total input/total output incl funding
Found-by: @morehouse
2024-02-13 11:55:23 -06:00
niftynei
11dea59504 tx-abort: port over meaning of the data field from warning
`tx_abort`'s structure comes from the `warning`/`error` messages,
but we failed to port over the rationale/rules for the `data` field.

Suggested-By: @morehouse
2024-02-13 11:55:23 -06:00
Dustin Dettmer
71e67e6d46 Bolt 2: Make interactive-tx explicitly use SIGHASH_ALL
This was previously assumed but adding it to the spec makes it explicit, should we ever want to change it in the future.

Suggested-By: @morehouse
2024-02-13 11:55:23 -06:00
niftynei
c51ef43fee interactive-tx: highlight MUST of serial_id sorting
Suggested-By: @dunxen
2024-02-13 11:55:23 -06:00
Duncan Dean
2ddddbd7c2 Use bitcoin wire encoding for witnesses 2024-02-13 11:55:23 -06:00
t-bast
c7af874f3d Store state when sending commitment_signed
If we only store state when sending `tx_signatures`, there are cases where
we cannot reconcile states if a disconnection occurs during the signing
steps: one side will have sent `tx_signatures` and thus must wait for the
transaction to be spent or double-spent, while the other side has already
forgotten that channel because they haven't sent `tx_signatures`.

This is fixed by storing state when sending `commitment_signed`, and
adding a `next_funding_txid` field to `channel_reestablish` to ask our
peer to retransmit signatures that we haven't received.
2024-02-13 11:55:23 -06:00
t-bast
1e48543ff1 Add section about liquidity griefing
This issue is non-trivial and worth mentioning, otherwise implementations
may forget to handle this which would result in an easy way of attacking
node's on-chain liquidity, creating a large opportunity cost.
2024-02-13 11:55:23 -06:00
t-bast
03a0eab139 Add require_confirmed_inputs TLV
This lets any side of the protocol require the other side to use confirmed
inputs, to avoid paying the fees of a low feerate unconfirmed ancestor.
2024-02-13 11:55:23 -06:00
niftynei
0bc22790ea v2 opens: proposal to get rid of the minimum estimated fee
Prior versions of the v2 dual-funding protocol assumed a 'minimum fee'
payment for any witness stack of any input, as a way to simplify fee
checks.

The suggested min feerate didn't make sense for taproot spend paths etc;
instead we remove this check entirely.
2024-02-13 11:55:23 -06:00
niftynei
cf9a5fcfe5 peer-protocol: send first+second commit point in openchanv2 + accept
Repeat the second commit point in the initial openchannel2 +
acceptchannel2 messages.

Suggested-By: @pm47
2024-02-13 11:55:23 -06:00
t-bast
811e55cd9e Use signed amounts in RBF messages
While dual funding only needs unsigned funding amounts, other protocols
that leverage interactive-tx may use signed funding amounts, for example
to take funds out of an existing channel (splice-out).

It is thus more future-proof to use signed amounts in `tx_init_rbf` and
`tx_ack_rbf`.
2024-02-13 11:55:23 -06:00
t-bast
180e4764ce Clarify RBF funding requirements 2024-02-13 11:55:23 -06:00
niftynei
3f1d142471 v2 opens: add a tx_abort message
Requested-by: @t-bast
2024-02-13 11:55:23 -06:00
niftynei
c00c0dd7bc interactive-tx: Add dual-funding flow, using the interactive tx protocol
This commit adds the interactive transaction construction protcol, as
well as the first practical example of using it, v2 of channel
establishment.

Note that for v2 we also update the channel_id, which now uses the hash
of the revocation_basepoints. We move away from using the funding
transaction id, as the introduction of RBF* makes it such that a single
channel may have many funding transaction id's over the course of
its lifetime.

*Later, also splicing
2024-02-13 11:55:23 -06:00
niftynei
15fb2df63a spelling: fix spelling mistakes + add new words to ignore spelling 2024-02-13 11:55:23 -06:00
xiaolou86
9f55ccdfee
Fix typos (#1130)
* BOLT 04: fix typos
* proposals: fix typos
2024-01-30 06:54:54 +01:00
Bastien Teinturier
a4b6357bad
Add min_final_expiry_delta to blinded route example (#1131)
Payment recipients must ensure that they have a few blocks
before fulfilling the payment, in case the inbound channel
force-closes.
2024-01-30 06:52:29 +01:00
Olaoluwa Osuntokun
8a64c6a1ce
Merge pull request #1086 from ariard/2023-06-specify-max-cltv-expiry-delta
BOLT4: Specify max HTLC nLocktime for expiry_too_far
2023-10-23 12:08:39 -07:00
Olaoluwa Osuntokun
7620072cef
Merge pull request #1109 from rustyrussell/define-negotiated
BOLT 1: define what `offered` and `negotiated` mean.
2023-10-23 12:07:48 -07:00
Antoine Riard
bccab9afc2 Specify max HTLC nLocktime for expiry_too_far 2023-09-25 21:26:16 +01:00
Keagan McClelland
4dcc377209 Clarify the semantics of max_htlc_value_in_flight_msat
Prior wording of the description of this parameter left room for
ambiguity around whether it capped the total value offered by both
channel peers combined or if it was solely capping the total value
of HTLCs offered by the remote.
2023-09-26 05:50:01 +09:30
Rusty Russell
6649f51228 CONTRIBUTING.md: modern feature bit assignment.
1. Put it in the PR title so everyone can see.
2. Deploy with +100 while it's still unratified, in case it changes.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-09-26 05:42:35 +09:30
Rusty Russell
95f2bbf2e2 BOLT 1: define what offered and negotiated mean.
i.e. it was present in the init feature bits.  We use this in several places, but assume everyone knows what it means.

It's particularly fraught with required features: it's explicitly legitimate to assume these are accepted if
the node keeps talking to you after init!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-09-13 12:02:14 +09:30
ProofOfKeags
6e85df448b
BOLT2: change "reject" to "fail" in channel opening requirements (#1104)
Since "reject" isn't defined anywhere in the spec and "fail" does
have a definition laid out in BOLT1 that includes special
provisions for channels that have not yet been established, BOLT2
is amended to clarify the requirements for the receiver of
`accept_channel`
2023-08-28 14:13:59 +02:00
Antoine Riard
a1870e136e
Add a max_dust_htlc_exposure_msat (#919)
* Bound exposure to trimmed in-flight HTLCs
* Reject update_fee beyond max_dust_htlc_exposure_msat

Co-authored-by: t-bast <bastuc@hotmail.fr>
2023-08-14 23:08:10 +02:00
Olaoluwa Osuntokun
8cb9b890cc
Merge pull request #1095 from vincenzopalazzo/macros/specify-multiple-fields
bol09: Specify behavior when a node specifies both optional and required features
2023-08-14 13:18:07 -07:00
Vincenzo Palazzo
ec59f7c1ca
bol09: Specify behavior when a node specifies both optional and required features
While reviewing a patch on lnprototest, I encountered a scenario
where the BOLT 9 specification needed to provide clear guidance.

As a result, this commit adds specific requirements to
determine the appropriate behaviour when a node specifies
both optional and required features.

Additionally, if this situation appears to be an
implementation bug, it will be taken care of accordingly.

Reported-by: lnprototest
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-08-14 22:04:10 +02:00
valentinewallace
fbd19efe1f
Clarify computation of final outgoing_expiry in route blinding (#1069)
BOLT 12 invoices do not include a max_cltv_expiry field, so it's good to
clarify how senders can compute the final outgoing cltv expiry.
2023-08-11 17:29:37 +02:00
dni ⚡
7dda8f84ed
Bolt11: min_final_cltv_expiry_delta is optional, not required (#1100) 2023-08-09 11:35:28 +02:00