@@ -673,7 +673,7 @@ If the final destination does not support `encrypted_trampinfo` it will ignore t
673
673
1 . type: 8 (` incoming_payment_secret ` )
674
674
2 . data:
675
675
* [ ` 32*byte ` :` payment_secret ` ]
676
- 1 . type: 10 (` incoming_payment_metadata ` )
676
+ 1 . type: 10 (` payment_metadata ` )
677
677
2 . data:
678
678
* [ ` ...*byte ` :` payment_metadata ` ]
679
679
1 . type: 12 (` incoming_amount_msat ` )
@@ -685,9 +685,6 @@ If the final destination does not support `encrypted_trampinfo` it will ignore t
685
685
1 . type: 16 (` outgoing_payment_secret ` )
686
686
2 . data:
687
687
* [ ` 32*byte ` :` payment_secret ` ]
688
- 1 . type: 18 (` outgoing_payment_metadata ` )
689
- 2 . data:
690
- * [ ` ...*byte ` :` payment_metadata ` ]
691
688
1 . type: 20 (` blinded_paths ` )
692
689
2 . data:
693
690
* [ ` ...*blinded_path ` :` paths ` ]
@@ -697,21 +694,20 @@ If the final destination does not support `encrypted_trampinfo` it will ignore t
697
694
698
695
## Requirements
699
696
700
- The initial sender of a "minitramp" payment builds it backwards from final destination:
697
+ The initial sender of a "minitramp" payment builds it * backwards* from final destination:
701
698
- MUST create a ` trampinfo ` (#1 ) for the payment destination:
702
699
- MUST NOT set ` amount_to_send ` , ` next_cltv_value ` , ` next_node ` , ` blinded_paths ` , ` blinded_payinfo ` or ` minitramp ` .
703
- - MUST set ` outgoing_payment_secret ` , ` outgoing_payment_metadata ` , ` total_amount_msat ` to the values which would normally set in the final ` payload ` .
700
+ - MUST set ` outgoing_payment_secret ` , ` payment_metadata ` , ` total_amount_msat ` to the values which would normally set in the final ` payload ` .
704
701
- If the payment destination is known to support ` option_minitrampoline ` :
705
702
- SHOULD set ` incoming_payment_secret ` to the SHA256 hash of ` outgoing_payment_secret ` .
706
- - SHOULD set ` incoming_payment_metadata ` to random data (16 bytes in the case of ` incoming_payment_metadata ` ).
707
703
- Otherwise:
708
- - MUST set ` incoming_payment_secret ` and ` incoming_payment_metadata ` to ` outgoing_payment_secret ` and ` outgoing_payment_metadata ` .
704
+ - MUST set ` incoming_payment_secret ` to ` outgoing_payment_secret ` .
709
705
- MAY use ` padding ` to disguise that this is the final destination.
710
706
- MUST create a ` trampinfo ` (#2 ) for the previous trampoline:
711
707
- MUST set ` minitramp ` .` trampkey ` to the public key of a random secret.
712
708
- MUST set ` minitramp ` .` encrypted_trampinfo ` to the encrypted ` trampinfo ` created for the payment destination.
713
709
- MUST set ` outgoing_payment_secret ` to ` incoming_payment_secret ` in ` trampinfo ` #1 .
714
- - MUST set ` outgoing_payment_metadata ` to ` incoming_payment_metadata ` in ` trampinfo ` # 1 .
710
+ - MAY set ` payment_metadata ` to a random value .
715
711
- MUST set ` amount_to_send ` and ` next_cltv_value ` to the values expected by the payment destination.
716
712
- MUST set ` blinded_paths ` and ` blinded_payinfo ` as supplied by the invoice.
717
713
- If it sets ` blinded_paths ` :
@@ -721,19 +717,19 @@ The initial sender of a "minitramp" payment builds it backwards from final desti
721
717
- MUST set ` incoming_amount_msat ` and ` incoming_ctlv ` to the values expected at this destination.
722
718
- MUST set ` total_amount_msat ` to the ` incoming_amount_msat ` of ` trampinfo ` #1
723
719
- MUST set ` next_cltv_value ` to the ` incoming_ctlv ` of ` trampinfo ` #1
724
- - SHOULD set ` incoming_payment_secret ` and ` incoming_payment_metadata ` to random data (16 bytes in the case of ` incoming_payment_metadata ` ) .
720
+ - SHOULD set ` incoming_payment_secret ` and to random data.
725
721
- If it creates another ` trampinfo ` (#3 onwards);
726
722
- MUST set ` minitramp ` .` trampkey ` to the public key of a random secret.
727
723
- MUST set ` minitramp ` .` encrypted_trampinfo ` to the encrypted previous ` trampinfo `
728
724
- MUST set ` outgoing_payment_secret ` to ` incoming_payment_secret ` in the previous ` trampinfo ` .
729
- - MUST set ` outgoing_payment_metadata ` to ` incoming_payment_metadata ` in the previous ` trampinfo ` .
730
- - SHOULD set ` incoming_payment_secret ` and ` incoming_payment_metadata ` to random data (16 bytes in the case of ` incoming_payment_metadata ` ) .
725
+ - MAY set ` payment_metadata ` to a random value .
726
+ - SHOULD set ` incoming_payment_secret ` to random data.
731
727
- MUST set ` total_amount_msat ` to the ` incoming_amount_msat ` of the previous ` trampinfo `
732
728
- MUST set ` next_cltv_value ` to the ` incoming_ctlv ` of the previous ` trampinfo `
733
729
- MUST set ` next_node ` to the node id of the next trampoline
734
730
- MUST create a payment to the first trampoline node:
735
731
- MUST put the last-produced ` minitramp ` into the final ` payload ` for each payment part.
736
- - MUST set ` payment_secret ` and ` payment_metadata ` to the ` incoming_payment_secret ` and ` incoming_payment_metadata ` of the last-produced ` trampinfo ` .
732
+ - MUST set ` payment_secret ` to the ` incoming_payment_secret ` of the last-produced ` trampinfo ` .
737
733
738
734
The recipient:
739
735
- MUST process all parts of the payment as normal.
@@ -742,14 +738,13 @@ The recipient:
742
738
- If ` encrypted_trampinfo ` does not decrypt into a valid ` trampinfo ` :
743
739
- Fail all HTLCs with ` incorrect_or_unknown_payment_details ` .
744
740
- Check for trampoline misbehaviour (below)
745
- - If ` trampinfo ` .` incoming_amount_msat ` or ` trampinfo ` .` incoming_ctlv ` are not equal to the incoming HTLC
741
+ - If ` trampinfo ` .` incoming_amount_msat ` or ` trampinfo ` .` incoming_ctlv ` are less than the incoming HTLC
746
742
- Fail all HTLCs with ` incorrect_or_unknown_payment_details ` .
747
743
- If neither ` node_id ` nor ` blinded_paths ` are present (we are the final destination):
748
744
- If ` payment_secret ` in ` payload ` is not equal to ` trampinfo ` .` incoming_payment_secret ` :
749
745
- Reject payment
750
746
- Check for trampoline misbehaviour (below)
751
- - If ` payment_metadata ` in ` payload ` is not equal to ` trampinfo ` .` incoming_payment_metadata ` :
752
- - Reject payment
747
+ - SHOULD process the payment as if the ` payload ` contained the ` minitramp ` ` payment_secret ` and ` payment_metadata ` .
753
748
- Otherwise: (forwarding):
754
749
- If both ` next_node ` and ` blinded_paths ` are present:
755
750
- Reject payment
0 commit comments