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

148 Commits

Author SHA1 Message Date
Pierre-Marie Padiou
8f36ee9880
BOLT 2: typo "it need" -> "it needs" (#391) 2018-03-20 13:37:34 +01:00
pm47
2cb41db4a2 consistency: option-data-loss-protect->option_data_loss_protect 2018-03-05 19:20:37 +00:00
pm47
7da77f0687 define initial value for data-loss fields
Clarify that field `channel_reestablish`.`your_last_per_commitment_secret`
should be set to an all-zero array when no `per_commitment_secret` has
been received yet.
2018-03-05 19:20:37 +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
Christian Decker
3e2d275471 BOLT02: Add rationale for 2^24 satoshi per channel limit
Fixes #353
2018-02-09 14:50:52 +01:00
Rusty Russell
120003e553 BOLT #2: bad update_fee after shutdown when all HTLCs cleared.
I got an unexpected update_fee message after `shutdown` exchange,
which is currently legal:

A: shutdown (no htlcs)
                          B: receive shutdown
                          B: reply with shutdown & closing_signed

A: send update_fee & commitment_signed
A: receive shutdown

Simplest to ban any updates (currently, just update_fee) from adding a
new commitment tx while we're at the end of shutdown.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-05 23:47:12 +00:00
Rusty Russell
90241d9cf6 BOLT 2: order closing-signed negotiation by making funder send first.
Fixes: #365
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-02-05 23:38:51 +00:00
practicalswift
4e3074ea5f Fix markdownlint warnings
Fixed warnings:

.copy-edit-stylesheet-checklist.md: 49: MD030/list-marker-space Spaces after list markers [Expected: 1; Actual: 0]
.copy-edit-stylesheet-checklist.md: 1: MD041/first-line-h1 First line in file should be a top level header [Context: "Basic checklist/stylesheet use..."]
02-peer-protocol.md: 161: MD018/no-missing-space-atx No space after hash on atx style header [Context: "#7](07-routing-gossip.md#bolt-..."]
2018-02-05 09:01:00 +00:00
practicalswift
2c3466a2af Remove trailing whitespace 2018-01-30 04:54:31 +00:00
Pierre-Marie Padiou
46c454cb56 clarify that nodes may support early mutual close 2018-01-22 20:14:38 +01:00
MeshCollider
4b5379b2ac Fix formatting of BOLT links 2018-01-22 14:02:01 +01:00
Rusty Russell
7ab1665b2a BOLT 2: clarify that feerate is in *satoshi* per ksipa.
We don't actually say that!

Closes: #336
Reported-by: Matt Corallo
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-09 03:06:29 +00:00
practicalswift
d5b5284b3b Use Markdown numbered list syntax ("1." instead of "1)") 2018-01-08 02:30:34 +00:00
Landon Mutch
641c6ab7b1 stylesheet update and apply to BOLT 2,3 2017-12-21 04:08:33 +00:00
Pierre-Marie Padiou
4e5ec11c4e add a check on counterparty's dust_limit value
Usually the counterparty would only hurt itself if it chooses too low a `dust_limit`, but in the specific scenario of a data loss, we want the counterparty's commitment tx to be relayed and confirmed on the network.
2017-12-11 23:01:34 +00:00
Landon Mutch
5db55df16a BOLT 1,2,3: apply updated stylesheet guidelines for list capitalization, punctuation 2017-12-07 02:36:10 +00:00
Rusty Russell
add074bd2a Typo fixes as suggested by Landon Mutch.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-12-04 05:41:03 +00:00
Rusty Russell
31f6f1e53a fixup! minor indentation
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-12-04 05:41:03 +00:00
Shannon Appelcline
8b7873631f Updates for comments on pull. 2017-12-04 05:41:03 +00:00
Shannon Appelcline
0d8a1a20c4 BOLT-2 Edit
Some slightly larger scale revisions for BOLT-2, notably including a reorganization of the "open_channel" function with the introduction of two missing arguments.

Also, the addition of MSAT to the glossary in BOLT-0.
2017-12-04 05:41:03 +00:00
Rusty Russell
ce4b0f1c9e BOLT 2: which->that
Reported-by: Shannon Appelcline
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-11-28 23:11:55 +00:00
Landon Mutch
7a8a5d88dd BOLT 2,3: fix changes requested 2017-11-28 23:11:55 +00:00
Landon Mutch
124626e693 BOLT 2: update stylesheet for numbers and amounts; 2017-11-28 23:11:55 +00:00
Landon Mutch
f23e3dd56b BOLT 1,2,3: first pass copy-edit;
BOLT 1,2: minor header spacing fixes
BOLT 3: first pass copy edit, according to capitalization, formatting stylesheet guidelines;
2017-11-28 23:11:55 +00:00
Landon Mutch
c00df17214 BOLT 0,2: update stylesheet, apply associated changes, 2nd pass copy-edit
BOLT 0: Update style sheet to reflect correct Bitcoin capitalizations
BOLT 2: Complete second pass copy-edit according to stylesheet guidelines
2017-11-28 23:11:55 +00:00
Rusty Russell
963b103113 BOLT 2: add precommitment to scriptpubkey for mutual close.
This is Fabrice's #243 "BOLT2, BOLT3: reduce attack surface", split
out with minor polishing:

- Made it an optional feature (we can insist on it if we choose even bit).
- Rename from "final_scriptpubkey" to "shutdown_scriptpubkey".
- Make requirements the same as shutdown's scriptpubkey, or zero-len.
- Leave shutdown's scriptpubkey, just make sure it's the same or fail.
- Add to accept_channel as well as open_channel.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-11-28 00:09:57 +00:00
Rusty Russell
072a69fe77 BOLT 2: require that undefined bits in open_channel must be set to 0.
We already say that receiver has to ignore them.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-11-27 23:40:02 +00:00
Rusty Russell
3975a54a1c BOLT 2: note requirements for first_per_commitment_point.
Steal language from next_per_commitment_point requirements.

Closes: #277
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-11-27 23:40:02 +00:00
Rusty Russell
cb78c50b77 BOLT 2: fix terminal node ctlv_expiry calc.
It *is* 2R+G+S, which is 7, not six.  It's also identical to the previous one,
so just say that.

Reported-by: Shannon Appelcline <shannona@skotos.net>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-11-27 23:39:39 +00:00
landonmutch
04301add81
Merge branch 'master' into master 2017-11-15 03:33:36 -08:00
Landon Mutch
c89a54a7da BOLT 0,1,2: fix requested changes;
update stylesheet to reflect appropriate structure of Requirement sub-items and format of digits, numerations, and quantities;
copy edit BOLTs 0,1,2 to adhere to these changes;
2017-11-15 02:55:16 -08:00
Rusty Russell
4f91f0bb2a htlckey: new basepoint avoid holding the payment secret.
This is stolen from @sstone's #243 "reduce attack surface".

This breaks compatibility, as agreed at the 2017-11-13 meeting.
Note also that it does not update the test vectors.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-11-14 22:58:11 +00:00
Landon Mutch
24896d847d make spellcheck.sh happy 2017-11-13 19:18:09 -08:00
Landon Mutch
d99a410d5c BOLT 2: copy edit merged changes 2017-11-13 18:32:13 -08:00
landonmutch
3d67c79235
Merge branch 'master' into master 2017-11-13 17:48:03 -08: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
Landon Mutch
adb13bf689 BOLT 2: first pass copy edit done;
complete first pass copy edit, following .copy-edit-stylesheed-checklist guidelines;
2017-11-10 22:18:53 -08:00
Landon Mutch
03197f2959 BOLT 1, 2: copy edit
BOLT 1: minor list formatting fix;
BOLT 2: copy edit up to line 955;
2017-11-10 18:14:27 -08:00
Landon Mutch
b475639f48 BOLT 0, 1, 2: copy edit
add stylesheet item: prefer typed, not written numbers;
updated BOLT 0, 1 to reflect change;
copy edit BOLT 2 up to line 674;
2017-11-10 14:05:21 -08:00
Landon Mutch
1afc143cd1 BOLT 2: first pass copy edit continued;
Done first pass copy edit, up to line 576 of BOLT 2, according to .copy-edit-stylesheet-checklist.md guidelines;
2017-11-10 11:45:51 -08:00
Landon Mutch
93afa0db9a BOLT 2: first pass copy edit;
Done first pass copy edit, up to line 279 of BOLT 2, according to .copy-edit-stylesheet-checklist.md guidelines;
2017-11-10 00:56:38 -08:00
Rusty Russell
c93cd75d88
BOLT 2,4: allow an error for HTLCs which expire too far away. (#265)
Fixes: #261

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-10-31 00:21:58 +00:00
Rusty Russell
58d4d9bca3 BOLT 2: Details of HTLC Timeouts, ie. cltv_expiry_delta.
Complete rewrite, including a routing example and the new
min_final_cltv expirt.  I hope this makes it clear.

(Thanks to everyone who reviewed and gave feedback; you rock!)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-10-19 12:44:53 -07:00
Pierre-Marie Padiou
465a4cddaf Only cross-signed htlcs can be fulfilled/failed 2017-10-03 11:30:10 +10:30
Jim Posen
9073a5f3de multi: Fix a few typos and grammatical errors. 2017-09-25 12:34:30 +09:30
Rusty Russell
4bcf9dde7e BOLT 2: clarify HTLC handling, esp w/ on-chain.
1. We say you can't fail an HTLC until it's removed outgoing; make it clear
   that this could also be on-chain.
2. Insist that you fail an expired HTLC (we never actually said this!)
3. You MUST fulfill an incoming HTLC for which the output was fulfilled
   (otherwise you'll lose money), and of course, even if fulfilled on-chain.

Add an explanation paragraph to BOLT 5 as well, where it discusses on-chain
HTLC output cases (though the requirements about what to do about incoming
HTLCs is actually in BOLT 2).

[ Extra wording clarification thanks to roasbeef ]
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-08-22 09:59:47 +09:30
Olaoluwa Osuntokun
25fc33bfbb glossary: move definition of chain_hash to BOLT #0
This commit modifies the glossary to add a new entry which defines the
usage of `chain_hash` throughout the remainder of the documents.
Additionally, we now also specify which chain hash we expect for
Bitcoin within the glossary.

This commit also modifies BOLT #2 and #7 to omit the definition of the
expected `chain_hash` value for Bitcoin.
2017-08-08 10:06:21 +09:30
Rusty Russell
094a86ecdb BOLT 2: rework and specify exact shutdown retransmission semantics.
1. Change descriptions of closing tx construction to references to BOLT 3.
2. Recipient *should* check the fee offer has improved in closing_signed.
3. Therefore, sender *must* improve closing offer.
4. Offers do not persist across reconnection, so no state req'd, and
   also helps if fee has changed.
5. You don't need to re-send `shutdown` if you received `closing_signed`
   (implicit acknowledgement).
6. You don't have to accept a `channel_reestablish` which requests the last
   revoke_and_ack be retransmitted if you've already received `closing_signed`
   (which is an implicit acknowledgement).

Closes: #201
Closes: #199
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-08-08 10:05:18 +09:30
Rusty Russell
b574c18f24 BOLT 2: closing fee is based on final commitment "base fee" not actual fee.
The actual fee of the final tx may include eliminated outputs, which can
differ between one side and the other (since they have different thresholds).

Simplify this corner case by using our base fee calculation as the upper bound;
it should be close enough we don't care, but disagreement here could cause
negotiation breakdown.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-07-11 10:40:30 +09:30
Rusty Russell
83aaaedcd5 BOLT 2: make it clear that we set fee, *then* eliminate outputs.
You can't eliminate an output and also guarantee a certain fee, so
we need to define exactly how to do this.

Since the output is (presumably) dust, we might as well just discard it
(effectively increasing the fee).  This avoids the peer directly benefiting
from the elimination as well.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-07-11 10:40:30 +09:30