@@ -407,23 +407,10 @@ specifies a version number that it doesn't support.
407
407
For packets with supported version numbers, the processing node first parses the
408
408
packet into its individual fields.
409
409
410
- The processing node:
411
- - if the ephemeral public key is NOT on the ` secp256k1 ` curve:
412
- - MUST abort processing the packet.
413
- - MUST report a route failure to the origin node.
414
-
415
410
Next, the processing node computes the shared secret using the private key
416
411
corresponding to its own public key and the ephemeral key from the packet, as
417
412
described in [ Shared Secret] ( #shared-secret ) .
418
413
419
- The processing node:
420
- - if the packet has previously been forwarded or locally redeemed, i.e. the
421
- packet contains duplicate routing information to a previously received packet:
422
- - if preimage is known:
423
- - MAY immediately redeem the HTLC using the preimage.
424
- - otherwise:
425
- - MUST abort processing and report a route failure.
426
-
427
414
The above requirements prevent any hop along the route from retrying a payment
428
415
multiple times, in an attempt to track a payment's progress via traffic
429
416
analysis. Note that disabling such probing could be accomplished using a log of
@@ -437,11 +424,6 @@ Next, the processing node uses the shared secret to compute a _mu_-key, which it
437
424
in turn uses to compute the HMAC of the ` hops_data ` . The resulting HMAC is then
438
425
compared against the packet's HMAC.
439
426
440
- The processing node:
441
- - if the computed HMAC and the packet's HMAC differ:
442
- - MUST abort processing.
443
- - MUST report a route failure.
444
-
445
427
Comparison of the computed HMAC and the packet's HMAC MUST be
446
428
time-constant to avoid information leaks.
447
429
@@ -456,11 +438,6 @@ The first 65 bytes of the resulting routing information become the `per_hop`
456
438
field used for the next hop. The next 1300 bytes are the ` hops_data ` for the
457
439
outgoing packet.
458
440
459
- The processing node:
460
- - if the ` realm ` is unknown:
461
- - MUST drop the packet.
462
- - MUST signal a route failure.
463
-
464
441
A special ` per_hop ` ` HMAC ` value of 32 ` 0x00 ` -bytes indicates that the currently
465
442
processing hop is the intended recipient and that the packet should not be forwarded.
466
443
@@ -470,14 +447,28 @@ by blinding the ephemeral key with the processing node's public key along with t
470
447
shared secret and by serializing the ` hops_data ` .
471
448
The resulting packet is then forwarded to the addressed peer.
472
449
450
+ ## Requirements
451
+
473
452
The processing node:
453
+ - if the ephemeral public key is NOT on the ` secp256k1 ` curve:
454
+ - MUST abort processing the packet.
455
+ - MUST report a route failure to the origin node.
456
+ - if the packet has previously been forwarded or locally redeemed, i.e. the
457
+ packet contains duplicate routing information to a previously received packet:
458
+ - if preimage is known:
459
+ - MAY immediately redeem the HTLC using the preimage.
460
+ - otherwise:
461
+ - MUST abort processing and report a route failure.
462
+ - if the computed HMAC and the packet's HMAC differ:
463
+ - MUST abort processing.
464
+ - MUST report a route failure.
465
+ - if the ` realm ` is unknown:
466
+ - MUST drop the packet.
467
+ - MUST signal a route failure.
474
468
- MUST address the packet to another peer that is its direct neighbor.
475
469
- if the processing node does not have a peer with the matching address:
476
470
- MUST drop the packet.
477
471
- MUST signal a route failure.
478
-
479
- [ TODO: separate processing node requirements into ` Requirements ` section]
480
-
481
472
# Shared Secret
482
473
483
474
The origin node performs ECDH with each hop of the route, in order to establish a secret.
0 commit comments