Skip to content

Commit e53ce2c

Browse files
committed
bolt-02: add endorsement byte to update_add_hltc
Add an endorsement field to allow nodes to signal whether a HTLC is expected to resolve quickly or is unknown to the forwarder. The addition of this field allows for the introduction of local reputation tracking that still allows new and unknown entrants access to resources.
1 parent 3fffab3 commit e53ce2c

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

02-peer-protocol.md

+21-1
Original file line numberDiff line numberDiff line change
@@ -1978,7 +1978,10 @@ is destined, is described in [BOLT #4](04-onion-routing.md).
19781978
1. type: 0 (`blinded_path`)
19791979
2. data:
19801980
* [`point`:`path_key`]
1981-
1981+
1. type: 1 (`endorsed`)
1982+
2. data:
1983+
* [`byte`:`endorsed`]
1984+
19821985
#### Requirements
19831986

19841987
A sending node:
@@ -2016,6 +2019,20 @@ A sending node:
20162019
- MUST increase the value of `id` by 1 for each successive offer.
20172020
- if it is relaying a payment inside a blinded route:
20182021
- MUST set `path_key` (see [Route Blinding](04-onion-routing.md#route-blinding))
2022+
- if it is the original source of the HTLC:
2023+
- if it does not expect immediate fulfillment upon receipt by the
2024+
final destination:
2025+
- SHOULD set `endorsed` to `0`.
2026+
- otherwise:
2027+
- SHOULD set `endorsed` to `1`.
2028+
- MAY choose to set `endorsed` to `0` to mimic endorsement patterns of
2029+
HTLCs it has forwarded.
2030+
- otherwise:
2031+
- if `endorsed` is present and non-zero for the corresponding incoming HTLC
2032+
AND the incoming peer is considered to have sufficient local reputation:
2033+
- SHOULD set `endorsed` to `1`
2034+
- otherwise:
2035+
- SHOULD set `endorsed` to `0`.
20192036

20202037
`id` MUST NOT be reset to 0 after the update is complete (i.e. after `revoke_and_ack` has
20212038
been received). It MUST continue incrementing instead.
@@ -2047,6 +2064,9 @@ A receiving node:
20472064
- MUST respond with an error as detailed in [Failure Messages](04-onion-routing.md#failure-messages)
20482065
- Otherwise:
20492066
- MUST follow the requirements for the reader of `payload` in [Payload Format](04-onion-routing.md#payload-format)
2067+
- if `endorsed` is not provided OR `endorsed` is zero:
2068+
- MAY choose to limit the liquidity and slots available to forward the
2069+
corresponding outgoing HTLC in `onion_routing_packet`, if any.
20502070

20512071
The `onion_routing_packet` contains an obfuscated list of hops and instructions for each hop along the path.
20522072
It commits to the HTLC by setting the `payment_hash` as associated data, i.e. includes the `payment_hash` in the computation of HMACs.

0 commit comments

Comments
 (0)