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

711 Commits

Author SHA1 Message Date
Rusty Russell
72ed1b2214 BOLT 1: add TLV types.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-07-09 00:48:46 +00:00
Rusty Russell
6639cef095 Spec: use explicit types, not just bytelengths for fields.
It's trivial to make types->lengths, but not so much the other way.

The types I used here are the ones I found useful in implementation, and
I think add some clarity, though we can certainly argue about them.

There's no normative changes to the spec in here.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-07-09 00:48:46 +00:00
Rusty Russell
d6e477be43 tools/extract-formats.py: rewrite, change output.
Editing the previous mess was horrific.  I gave up and rewrote using a
generator.

Changes to output:
1. subtypes and tlvs now handled.
2. The output format now has explicit prefixes, so readers don't have
   to rely on number of fields to interpret data.
3. Each field is split into type and count; count is empty if there's
   no '*x'.
4. TLV stream typenames are repeated; TLV record type names are not
   necessarily unique.
5. The unused offset field is removed.
6. No arguments taken: everything is always printed, and you can grep if you
   only want some.

[ Fixup by <niftynei@gmail.com> ]
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-07-09 00:48:46 +00:00
Bastien Teinturier
a82dd143f1
Merge pull request #607 from cfromknecht/tlv
BOLT01: TLV proposal
2019-07-08 22:53:22 +02:00
Conner Fromknecht
779664cd82
BOLT01: add TLV spec 2019-06-12 15:14:55 -07:00
Jorge Timón
309e86d471 BOLT2: past fulfillment deadline fails channel 2019-05-21 22:19:13 +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
Rene Pickhardt
7cb708da20 BOLT08: define e and s within the context of the noise handshake
When the notation of the noise protocol framework is being introduced the terms `ck` and `k` are being explained but `e` and `s` are only referred to was public keys. I fixed that by stating what they stand for and noting that `s` is usually the the `nodeid` in the context of the Lightning Network protocol.
2019-04-30 20:00:26 -07:00
David A. Harding
d42b4e2ab6 BOLT2: rephrase cltv_expiry_delta text about accepting HTLCs
Saying "the risk is only to the node *accepting* the HTLC" is confusing
because merely accepting an HTLC is risk-free.  The risk comes from
accepting *responsibility to route the payment*, i.e. offering an HTLC
of your own in the next channel on the path, where a too-small
difference in the HTLC values could end up with you cheated out of a
payment.

This revised paragraph hopefully makes that clearer.
2019-04-29 23:20:37 +02:00
sstone
da71867c84 BOLT 4: fix onion vectors
Final result was correct but intermediary results had not been updated when the payloads were changed.
Fixes #494
2019-02-18 20:20:42 +00:00
Simon Vrouwe
090af1a22d BOLT 2: fix sentence in introduction of chapter Channel Establishment 2019-02-18 10:09:32 +00:00
Richard Bondi
8479a92a4f fix broken links 2019-02-18 10:08:04 +00:00
Orfeas Stefanos Thyfronitis Litos
eabfe2d7c5 Rephrase Forwarding HTLCs Requirements
Uses more specific and consistent language ("the"/"that" instead of "an"
where possible). Also helps avoid confusion with unrelated HTLCs that
serve other payments but are shared by the same two nodes.
2019-02-04 23:45:50 +00:00
Orfeas Stefanos Thyfronitis Litos
835ca46a81 BOLT 4: Correct "16-byte" to "12-byte" (padding) 2019-02-04 23:45:38 +00:00
Antoine Riard
6bd1981fc0 Clarify ownership of max_htlc limits at receiving update_add_htlc 2019-02-04 23:44:45 +00:00
Antoine Riard
6508af5145 Specify OP_DATA to express accepted/offered_htlc_script with same
convention
2019-02-04 23:44:25 +00:00
Orfeas Stefanos Thyfronitis Litos
064d6feed0 Align offered and received HTLC scripts similarly 2019-01-22 21:45:06 +01:00
Orfeas Stefanos Thyfronitis Litos
945051e4b0 Clarify behavior of id field in update_add_htlc
Clarify that the id value is not reset after an update is complete
2019-01-22 21:44:44 +01:00
Rusty Russell
a2480ca138 BOLT 4: remove incorrect_payment_amount altogether.
914ebab908 effectively deprecated this, but
left it for "reject if more than 2x expected amount" case.

Leaving it for gross overpayment still leaves an attack on the current
network in practice (all implementations I know of reject grossly excessive
payments), and removing it causes our code to nicely break when regenerating,
since that error code is now not defined anywhere.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-01-22 21:44:22 +01:00
Pierre-Marie Padiou
1f4538cf9b Update 02-peer-protocol.md
Co-Authored-By: rustyrussell <rusty@rustcorp.com.au>
2019-01-22 21:43:58 +01:00
Rusty Russell
a57ff00e93 BOLT #2: order htlc_signatures by BIP69 + increasing CLTV.
We express it has how the outputs are ordered, but the only way you can
detect that is by the htlc_signatures order, which is the part which really
matters.

I finally reproduced this, BTW, which is why I'm digging it up!

Closes: #448
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-01-22 21:43:58 +01:00
Pierre-Marie Padiou
137106a716 report outgoing HTLC values when appropriate
For some relaying errors it makes more sense to report the values of the outgoing HTLC rather than the incoming HTLC.
2019-01-21 21:16:11 +01:00
Hiroki Gondo
f6df488373 BOLT 2: revocation number not revocation hash. 2019-01-15 22:56:42 +00:00
Hiroki Gondo
f85e75be65 BOLT 2: add a requirement for next_local_commitment_number. 2019-01-15 22:55:51 +00:00
Hiroki Gondo
655a8b3eae BOLT 2: fix a requirement mistake of next_remote_revocation_number. 2019-01-15 22:55:51 +00:00
Antoine Riard
681f3c3621 Fix ambiguity on HTLC transactions spendable by a penalty one
Both HTLC-success/HTLC-timeout can be spent by a valid penalty
transaction
2019-01-15 22:52:30 +00:00
Hiroki Gondo
3fef98d106 BOLT 5: fix the requirements of Revoked Transaction Close Handling. 2019-01-09 15:05:40 -08:00
Hiroki Gondo
96b0ede8c0 BOLT 8: fix typo. 2019-01-07 12:35:20 -08:00
Hiroki Gondo
f47e7e50f3 BOLT 7: fix the requirements of channel_update. 2019-01-07 19:47:24 +00:00
Rusty Russell
cdb275b52e
Merge pull request #523 from nayuta-gondo/pr/20181204-ek_k
BOLT 4: fix the index of `ek`.
2019-01-07 19:42:17 +00:00
Rusty Russell
af2e94b22d
Merge pull request #529 from nayuta-gondo/pr/20181206a-remote_htlcpubkey
BOLT 3: add description of `remote_htlcpubkey` in `Key Derivation`.
2019-01-07 19:40:57 +00:00
Hiroki Gondo
32d0c65063 BOLT 7: fix hashed data range in the node_announcement.
currently the `alias` is not the last field.
2019-01-07 19:40:35 +00:00
Hiroki Gondo
626fff28c9 BOLT 3: fix the rationale of Closing Transaction. 2019-01-07 19:38:55 +00: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
landonMutch
90faaeda89 resolve @rustyrussell requests 2019-01-07 19:34:58 +00:00
Landon Mutch
63b1b46043 finish second pass copy edit to EOF, to bring in line with stylesheet 2019-01-07 19:34:58 +00:00
Landon Mutch
4839cd8e5f second pass copy edit to line 191; 2019-01-07 19:34:58 +00:00
Landon Mutch
2039e977ed second pass edit to line 100; 2019-01-07 19:34:58 +00:00
Landon Mutch
a2ca6c0dbb first pass edit to bring inline with stylesheet 2019-01-07 19:34:58 +00:00
Landon Mutch
4fa013f6f7 clarify purpose of stylesheet; add instructions for executing spellchecker.sh 2019-01-07 19:34:58 +00:00
Hiroki Gondo
eba1c70f6b BOLT 3: fix trivial typo. 2019-01-07 20:18:31 +01:00
Hiroki Gondo
971ee2ade9 BOLT 7: delete duplicate line. 2019-01-07 20:18:19 +01:00
Hiroki Gondo
74bf24be5f BOLT 2: complete the message names in the diagram of Normal Operation. 2019-01-07 20:17:58 +01:00
Hiroki Gondo
c423308886 BOLT 0,2,5: closing transaction not (mutual) close transaction.
Be consistent.
2019-01-07 20:17:45 +01:00
Hiroki Gondo
7f68780c20 BOLT 2: delete unnecessary space. 2019-01-07 20:17:31 +01:00
Hiroki Gondo
353721b65e BOLT 2: update not HTLC in Normal Operation.
In the description here, the target is not only `HTLC`
but also general `update`.
2019-01-07 20:17:31 +01:00
Matt Corallo
914ebab908 Merge incorrect_payment_amount and unknown_payment_hash errors
Because the errors are separate, if an intermediate node sees a
payment hash for relay and has several guesses as to the
destination of the payment, they can check their guesses by sending
HTLCs with the same payment hashes first and seeing the error sent
back.

By adding the htlc_msat that the final node received to
unknown_or_incorrect_payment_details, origin nodes can still
identify bad value-relaying peers.
2018-12-10 22:24:05 +00:00