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

72 Commits

Author SHA1 Message Date
t-bast
3e9b5728cc
Clean-up: follow-up on removing spec features
This is a follow-up to https://github.com/lightning/bolts/pull/1092
that fixes the following issues:

- fix a few typos
- remove non-zero-fee anchors test cases
- remove `remote_pubkey` rotation
2024-05-21 10:58:55 +02: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
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
Ken Sedgwick
d975de1ba5
Clarify the sighash types for HTLC Success and Timeout transactions (#954) 2022-01-31 21:05:20 +01:00
lightning-developer
29db92f334
Removed requirement to broadcast an outdated commitment transaction (#942)
If a node has to fail a channel but knows that its latest commitment transaction is outdated it should not be required to send it but rather wait for the peer to unilaterally close the channel. 

The proposed solution is not so clean because it might produce a deadlock in which two peers assume they have outdated state and send `error` back and forth without actually force closing. Maybe in such a scenario we could create a protocol that mutually closes with split balance? 

Also replaced the word use with broadcast as it seems more accurate.

Co-authored-by: t-bast <bastuc@hotmail.fr>
2022-01-17 20:09:28 +01:00
Matt Corallo
c878cd8e1d
s/send a warning/warn the user/ in BOLT 5 to avoid confusion (#951)
Prior to the addition of `warning` messages, BOLT 5 specified a
few cases where users should be warned that funds may have been
lost. However, it used the phrasing "send a warning" which can now
be confused  with `warning` messages. Nodes should not generally
inform their counterparty that they have been robbed.
2022-01-17 19:40:47 +01:00
Rusty Russell
eb6f3084c5 Make it explicit when to send warnings, errors, fail channel and close connection.
And make most places warn or error.  Places where we're operating
on a channel tend to be "warn and close connection" since we want to
forget the mistake they just sent, and closing the connection does that.

We now use the same words everywhere:
1. "fail channel" means to go onchain (if necessary).
2. "send `error`" means to send an error message.
3. "send `warning`" means to send a warning message.
4. "close connection" means close the connection.

These are all spelled out explicitly, rather than having "fail channel"
imply sending an error packet, for example.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-12-14 10:32:22 +10:30
Johan T. Halseth
fdc078f845
feature: define option_zero_htlc_tx_fee (feature 22/23) (#824)
This PR adds a new feature bit to define the new and improved anchor outputs commitment format.
2021-08-30 13:50:25 -07:00
Antoine Riard
01b56742de
Require to claim revoked local output in its own penalty tx post-anchor (#803)
If `option_anchor_outputs` applies, the cheating node can pin spends of its
HTLC-timeout/HTLC-success outputs thanks to SIGHASH_SINGLE malleability.
Using a single penalty transaction for all revoked outputs is thus unsafe as it
could be blocked to propagate long enough for the `_local node's main output_ 's
relative timelock to expire and the cheating party escaping the penalty on this
output.
2020-12-07 19:52:00 +01:00
Antoine Riard
dcf6b0f359
Prevent preimage reveal collision while claiming onchain incoming HTLC (#808)
See CVE-2020-26896 for context.
2020-11-10 08:49:18 +01:00
Jan Xie
57e5545bbc
BOLT-05: fix typo in 'HTLC Output Handling' section 2020-11-06 16:50:24 -08:00
Joost Jager
1739746afa
Anchor outputs
This commit extends the specification with a new commitment format that
adds two anchor outputs to the commitment transaction. Anchor outputs
are a safety feature that allows a channel party to unilaterally increase
the fee of the commitment transaction using CPFP and ensure timely
confirmation on the chain. There is no cooperation required from the
remote party.
2020-08-19 15:27:21 +02:00
Jorge Timón
42073b6314 f'BOLT5: Unify two practically redundant paragraphs' 2019-05-21 22:18:14 +02:00
Jorge Timón
1958ad866e BOLT5: Unify two practically redundant paragraphs 2019-05-21 22:18:14 +02:00
Orfeas Stefanos Thyfronitis Litos
b9aa458852 BOLT 5: Homogenize Local/Remote Commitment
Make them look similar, choosing the best parts of each
2019-05-13 21:59:36 +02:00
Hiroki Gondo
3fef98d106 BOLT 5: fix the requirements of Revoked Transaction Close Handling. 2019-01-09 15:05:40 -08:00
Hiroki Gondo
a53aca85f2 BOLT 5: fix the requirements of HTLC Output Handling. 2019-01-07 19:38:03 +00:00
Hiroki Gondo
c5d3296dd6 BOLT 5: fix a note of Unilateral Close Handling. 2019-01-07 19:38:03 +00:00
Hiroki Gondo
c423308886 BOLT 0,2,5: closing transaction not (mutual) close transaction.
Be consistent.
2019-01-07 20:17:45 +01:00
pm47
2cb41db4a2 consistency: option-data-loss-protect->option_data_loss_protect 2018-03-05 19:20:37 +00:00
practicalswift
316882fcc5 Use a vs an consistently 2018-02-20 01:12:29 +00:00
Rusty Russell
4c8cb512d0 BOLT 2,3,5: always refer to shared/pubkey/private key.
Make it clear what kind of key we're talking about.  We use the abbreviation
pubkey for public key (as it's quite common to use in field names), but
generally spell out 'private'.

(I generally prefer 'secret' to 'private' but we use private far more often
already, and we use 'secret' for things which don't directly derive keys).

Fixes: #368
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-20 01:10:38 +00:00
MeshCollider
4b5379b2ac Fix formatting of BOLT links 2018-01-22 14:02:01 +01:00
Landon Mutch
205d521682 BOLT 5: fixed requested changes by @shannona 2017-12-22 00:24:48 +00:00
Landon Mutch
a5fb3ed46b BOLT 5: fix change requests by @rustyrussell 2017-12-22 00:24:48 +00:00
Landon Mutch
b704ed490d BOLT 5: finish first pass copy edit according to stylesheet guidelines 2017-12-22 00:24:48 +00:00
Landon Mutch
e20e5405b2 BOLT 5: copy edit to line 524, replace A/B with local/remote terminology 2017-12-22 00:24:48 +00:00
Landon Mutch
85f31e1b95 BOLT 5: first pass copy edit to line 400 2017-12-22 00:24:48 +00:00
Landon Mutch
572bbccaca BOLT 5: first pass copy edit to line 368 2017-12-22 00:24:48 +00:00
Rusty Russell
1cb19fab70 BOLT 5: fix annotation for to-local weight (no change in result).
Closes: #314
Reported-by: nayuta-ueno (@ueno)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-12-18 21:39:14 -06:00
Landon Mutch
db336a0ed1 BOLT 5: first pass copy edit to line 320, replace we/they terminology with local/remote; 2017-12-18 19:13:21 +00:00
Landon Mutch
46fcc15756 BOLT 5: fix changes requested by @shannona, except for second half "us/them" terminology 2017-12-18 19:13:21 +00:00
Landon Mutch
bd1fc7dfef BOLT 5: fix requested changes by @rustyrussell 2017-12-18 19:13:21 +00:00
Landon Mutch
1a2021ea91 BOLT 5: first pass copy edit to line 248, further implement local/remote terminology; 2017-12-18 19:13:21 +00:00
Landon Mutch
6a2b1dd841 BOLT 5: change us/them terminology to local/remote; 2017-12-18 19:13:21 +00:00
Landon Mutch
9c6ca1b722 BOLT 5: first pass copy edit to line 177, further modify emphasis scheme; 2017-12-18 19:13:21 +00:00
Landon Mutch
11abe4724e BOLT 5: first pass copy edit to line 113, change ephasis scheme; 2017-12-18 19:13:21 +00:00
Landon Mutch
cc7811cea8 BOLT 5: copy edit ToC and headers 2017-12-18 19:13:21 +00:00
Landon Mutch
e085f0c036 BOLT 5: justify lines to ~81 character lengths for easier review, remove double spaces, remove double new lines; 2017-12-18 19:13:21 +00:00
Rusty Russell
f1ac62c065 BOLT 5: fix reversed penalty HTLC handling clauses, make it clearer.
HTLC outputs can be resolved by (1) using revocation key,
(2) timeout/preimage use if that's possible, or (3) the cheating party's
HTLC-success/HTLC-timeout tx (which we also specify that you have to
spend using revocation key).

Hopefully this is now clearer.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-12-11 05:53:32 +00:00
Shannon Appelcline
faba9241ac Manual rebase of Shannon's PR-294 rewrite.
This got a little messy as some changes now needed to be applied in
two places, and other wording has been completely removed.  Another
pass on top will be required.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-12-08 01:09:42 +00:00
Rusty Russell
433de81d24 BOLT 5: spell out each HTLC case.
The proof-readers rightly noted how confusing the current treatment of
HTLCs is.  There are four different cases, but I tried to address them
in two separate sections, with conditionals.

This expands it out, separating sections for Our Commitment Tx and
Their Commitment Tx, then subsections for our HTLCs and their HTLCs
in each one.

It means some duplicated requirements and rationales, but it should now
be very clear.

As a side effect, we no longer refer to A and B at all: it's all US and THEM.
This needs further clearing up, but for now makes it clear what *we* need to do
for all cases.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-12-08 01:09:42 +00:00
ueno
5989128977 HTLC maximum limit : 511 --> 483
0d7cf77970
2017-11-29 01:57:27 +00:00
Renlord Yang
2e87b35303 Update 05-onchain.md
added permalink to reference implementation code for coinbase maturity check.
2017-11-22 01:21:01 +00:00
Rusty Russell
046f5acb16 BOLT 2: option-data-loss: limited data loss protection.
This is the best I could come up with.  You can't know future
revocation secrets, so if you send onw I know you're ahead of me
somehow.  That means I *MUST NOT* broadcast my latest commitment
transaction, but at least if you're not malicious I'll salvage
something.

We adapt BOLT 5 in a fairly trivial way to specify to say you should
try to handle as much as you can (in fact, you should always be able
to collect their commitment transaction's direct-to-you output).

Fixes: #209
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-11-13 11:10:32 -08:00
Rusty Russell
fc9900c101 BOLT 5: require to fail incoming HTLCs if HTLCs time out on chain.
We talked about this below in the Rationale:

    The fulfillment of an on-chain HTLC delivers the `payment_preimage`
    required to fulfill the incoming HTLC...
    Otherwise, it needs to send the `update_fail_htlc` (presumably with
    reason `permanent_channel_failure`) as detailed in [BOLT
    02](https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md#forwarding-htlcs).

But we didn't actually *say* you MUST fail incoming HTLCs after reasonable
depth!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-10-03 11:30:18 +10:30
Jim Posen
9073a5f3de multi: Fix a few typos and grammatical errors. 2017-09-25 12:34:30 +09:30
Rusty Russell
fae35903ae BOLT 5: "MUST spending" -> "MUST spend"
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-09-22 14:41:29 +09:30
Rusty Russell
149cf020d6 BOLT 5: requirement to fail HTLCs which don't have outputs in the commit tx.
BOLT 5 only talks in terms out HTLC outputs, but not all HTLCs have outputs.

HTLCs which are dust for both sides are easy, but others require the
commit tx to be buried before we can consider the HTLC failed.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-09-20 10:22:49 +09:30