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

61 Commits

Author SHA1 Message Date
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
Rusty Russell
36c099e0d4 BOLT 5: don't fulfill offered HTLCs if peer not committed to it.
Nasty corner case which I got wrong; we can fulfill but then we risk
a reorg removing it.  And anyway, fulfilling reveals that we are
the endpoint in practice.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-09-19 10:44:36 +09:30
Conner Fromknecht
e1652819a0 BOLT 5: clarifies penalty txn weight calculation
Attempts to clarify the weight calculation of penalty
  transactions, and makes sweeping the `to_remote` output
  optional without breaking any existing constraints. Assuming
  these figures are correct, the decision to sweep the
  `to_remote` _does not_ change the current unidirectional
  limit of 483 HTLCs.  Thus, the option to do so can be made
  independently by either party/implemenation.

  The previous equation used to calculate `max_num_htlcs`
  slightly underestimated the theoretical maximum weight,
  since non-witness data was treated as 1:1 with witness
  data.  Ultimately, this had no effect on the computed
  results, but figured we should be more specific here for
  the purpose of properly estimating transaction fees.

  This commit also modifies the `to_local_script` to use the
  latest construction; the derived weights have been updated
  accordingly.
2017-09-05 14:47:58 +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
Rusty Russell
b3b7a96872 BOLT 5: clarify exactly when to use HTLC transactions.
TL;DR: we only need to do it if it's our commitment tx.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-08-22 09:59:47 +09:30
Rusty Russell
72b2d4e6c2 BOLT 5: define what "failing a channel" means.
We talk about failing a channel, or channels, but we never spelled
out what a node does in that case.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-05-18 09:48:53 +09:30
Rusty Russell
1b4195c842 BOLT 5: specifically use to_local instead of to-self.
Not all of them: sometimes we refer to to-self including HTLCs which we're
spending ourselves, but in three places we're explicitly referring to
the `to_local` output.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-05-15 12:54:53 -07:00
Rusty Russell
f0da3978e9 Underscores for all terms, not just fields.
Plus a few more missing ones, and some consistency fixes in names
as pointed out by Roasbeed and Fabrice.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-05-15 12:54:53 -07:00
Rusty Russell
67efbd0872 BOLT 5: Add TOC, Authors section, add BOLT URL references.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-05-11 11:20:36 +09:30
Rusty Russell
ab530266e4 BOLT 5: underscores and backticks everywhere.
One minor change to refer to field name:
	preserves `to_self` delay
to:
	preserves `to_self_delay` requirement.

Typo fixes:
1. revocation -> revoke_and_ack
2. ctlv_expiry -> cltv_expiry.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-05-11 11:20:36 +09:30
Rusty Russell
a9c1f06cd4 BOLT 5: typo fixes.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-05-03 13:08:07 +09:30
Rusty Russell
392008a7d3 BOLT 3,5: update weight calculations for revocation key hash in script.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-03-08 05:50:44 +10:30