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

101 Commits

Author SHA1 Message Date
Christian Decker
0616c29bed bolt04: Introduce the destination_signal to the tlv_payload
As discussed during the spec meeting this allows us not to use the 32 byte
HMAC to identify the last hop, and use a 2-byte signal instead.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
2019-07-26 11:38:33 +02:00
Christian Decker
6cdbedb649 bolt04: Add the TLV types for the new payload format
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2019-07-26 11:38:33 +02:00
Christian Decker
10c345bcf4 bolt04: Remove in-spec test vector in favor of JSON test vector
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2019-07-26 11:38:33 +02:00
Christian Decker
ecaf591bca bolt04: Amend the filler generation and onion decoding to varpayload
This actually introduces the variable size shift and filler generation.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
2019-07-26 11:38:33 +02:00
Christian Decker
a148abbad5 bolt04: Describe the variable size hop_payload
Signed-off-by: Christian Decker <decker.christian@gmail.com>
2019-07-26 11:38:33 +02:00
Christian Decker
3ac0091ef9 bolt04: Formatting cleanup and fold clarifications into conventions
The clarifications were tacked on after the fact, but they should really be
part of the conventions. I also updated the links to use the reference style,
which results in better text flow and makes it easier to read the source.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
2019-07-26 11:38:33 +02:00
Orfeas Stefanos Thyfronitis Litos
238c06282d Rephrase last node payload requirements (#615)
Mention that `outgoing_cltv_value` has to be equal to
`min_final_cltv_expiry` and `amt_to_forward` has to be equal to
`amount` if the [BOLT #11](11-payment-encoding.md) invoice is used
2019-07-22 22:42:00 +02:00
Rusty Russell
6f6ea63233 BOLT 1,2,4,7: remove pubkey fundamental type in favor of point.
And remove `secret` and `preimage` types in favor of open-coding.

Agreed-at: http://www.erisian.com.au/meetbot/lightning-dev/2019/lightning-dev.2019-07-08-20.05.html

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
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
Orfeas Stefanos Thyfronitis Litos
835ca46a81 BOLT 4: Correct "16-byte" to "12-byte" (padding) 2019-02-04 23:45:38 +00: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
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
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
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
Hiroki Gondo
88b0000a91 BOLT 4: fix the index of ek. 2018-12-04 18:05:49 +09:00
Conner Fromknecht
7163c52d93 04-onion-routing: document non-strict forwarding
This commit documents the allowance of non-strict
forwarding, permitting forwarding nodes to select
between any available outgoing channel with the peer
that would otherwise be specified by the
short_channel_id in the onion packet.

It also includes recommendations for fee schedules
when using non-strict forwarding, either by using
a uniform fee schedule with a peer or only
considering like-policied channels, to ensure the
channel is truly equivalent in terms of fee revenue
for the forwarder.
2018-11-29 04:21:46 +00:00
araspitzu
2b2e5632ca BOLT 4 Add clarifications about the longest route 2018-11-29 04:12:36 +00:00
araspitzu
90ba6ddbc5 Explicit the number of intermediate nodes in the longest route supported by the spec 2018-11-29 04:12:36 +00:00
araspitzu
a01efdd65e BOLT 4: clarify the maximum length of the route 2018-11-29 04:12:36 +00:00
Rusty Russell
bca814e270 BOLT 4: final_incorrect_htlc_amount should be 64-bits.
Fixes: #469
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-10-18 05:17:48 +00:00
sstone
6e6c28dae5 BOLT4: fix description of incorrect_cltv_expiry error
The explanation in the requirements section is correct but the
error message description was probably copy-pasted from
`final_incorrect_cltv_expiry`
2018-10-01 13:22:58 -07:00
ueno
3f2c747955 fix typos 2018-08-07 00:07:42 +00:00
Fabrice Drouin
33698608da Add changes requested by @cdecker 2018-05-14 01:03:44 +00:00
Fabrice Drouin
cac009cf7b BOLT4: channel_update is mandatory in UPDATE error messages 2018-05-14 01:03:44 +00:00
ueno
d52e54e1a4 the amount paid is less than the amount expected 2018-04-16 23:28:03 +02:00
Olaoluwa Osuntokun
71630b4766 BOLT 4: update sphinx packet test vector (#372)
* BOLT 4: update sphinx packet test vector

In this commit, we update the test vector for the final onion packet. In
commit 068b0bccf9, the per-hop payloads
were updated to use 8 byte amounts everywhere. However, the test vectors
were not updated. In 578573f92f the test
vectors were updated to use the proper version prefix. However, this
assumed that the state of the vectors as is was correct.

To remedy this, we've updated the test vectors to reflect the final
result using the current format for encoding the per-hop payloads. This
final test vector was generated using the original tool that we used to
confirm compatibility between the C and Go versions.
2018-04-16 16:41:04 +02:00
Jim Posen
c4e42bcfd6 BOLT 4: Rearrange sections, moving dependent concepts lower. 2018-03-05 20:11:32 +01:00
Jim Posen
3927ae3fd1 BOLT 4: Update onion construction reference code.
The description now suggests the use of an ephemeral private key, so
the reference code is simplified by using that concept. The reference
code is also updated to make fewer calls to undefined functions.
2018-03-05 20:11:32 +01:00
Jim Posen
5a3b5ce0bd BOLT 4: Clarify the onion construction section.
The new description introduces the concept of an ephemeral private key,
which I find easier to reason about and suggests a linear instead of
quadratic construction algorithm.
2018-03-05 20:11:32 +01:00
Jim Posen
745629d0f2 BOLT 4: Correct blinding factor calculation.
The instructions reference nodepk_k instead of epk_k.
2018-03-05 20:11:32 +01:00
Jim Posen
f7eb7e4d96 BOLT 4: Correct shared secret calculation.
Reference code and all implementations hash the ECDH output point with SHA256.
2018-03-05 20:11:32 +01:00
practicalswift
2c3466a2af Remove trailing whitespace 2018-01-30 04:54:31 +00:00
Rusty Russell
f6a91fbb11 BOLT 4: the failure codes are not one long enumerated list.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-01-30 03:47:32 +00:00
Shannon Appelcline
29ae44ec6e BOLT-4 Re-Edits
Minor edits, clarifications, and standardizations.
2018-01-30 03:33:48 +00:00
MeshCollider
4b5379b2ac Fix formatting of BOLT links 2018-01-22 14:02:01 +01:00
Landon Mutch
6586287d88 BOLT 4: fix requested changes by @rustyrussell 2017-12-14 02:07:36 +00:00
Landon Mutch
c4c77235ef BOLT 4: seperate out returning errors requirements, copy edit changes 2017-12-14 02:07:36 +00:00
Landon Mutch
91fbda6cb1 BOLT 4: seperate error messages from requirements 2017-12-14 02:07:36 +00:00
Landon Mutch
08f23a7515 BOLT 4: add packet forwarding requirements section 2017-12-14 02:07:36 +00:00
Landon Mutch
e840fdbded BOLT 4: couple last fixes and TODOs added 2017-12-07 02:36:10 +00:00
Landon Mutch
8165f28692 fix changes requested by @rustyrussell and @shannona in pr-299-rebased branch 2017-12-07 02:36:10 +00:00
Landon Mutch
aed4b11423 make spell check happy 2017-12-07 02:36:10 +00:00
Landon Mutch
54b49c09db BOLT 4: complete second-pass copy edit, introduced new terminology 'erring node', require a few clarifications 2017-12-07 02:36:10 +00:00
Landon Mutch
051f98a75e BOLT 4: second pass copy edit, update node terminology;
second pass copy edit to line 253, according to stylesheet
update node terminology to remove ambiguity; update conventions section and implement consistent usage of terms: origin node, final node, processing node, hop, sending peer, and receiving peer
2017-12-07 02:36:10 +00:00
Landon Mutch
4381f38279 BOLT 4: complete first pass copy edit by applying stylesheet guidelines 2017-12-07 02:36:10 +00:00
Landon Mutch
fe53690a9d BOLT 4: copy edit to line 735 2017-12-07 02:36:10 +00:00
Landon Mutch
a66fcf684c BOLT 4: first pass copy edit to line 600 2017-12-07 02:36:10 +00:00
Landon Mutch
94f717410f BOLT 4: first pass copy edit to line 366 2017-12-07 02:36:10 +00:00
Landon Mutch
7ce3341254 BOLT 4: apply stylesheet updates, first pass copy edit to line 128 2017-12-07 02:36:10 +00:00