Skip to content

Commit 73c7654

Browse files
committed
Clarify about the length of r field in a invoice
* In current spec, route-hint can't express more than 3 hops. * From a reader's point of view, what can not be done in a spec is often more important than what can be done. Thus clarify about its limitation.
1 parent a9db80e commit 73c7654

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

11-payment-encoding.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,14 @@ Currently defined tagged fields are:
145145
* `x` (6): `data_length` variable. `expiry` time in seconds (big-endian). Default is 3600 (1 hour) if not specified.
146146
* `c` (24): `data_length` variable. `min_final_cltv_expiry` to use for the last HTLC in the route. Default is 18 if not specified.
147147
* `f` (9): `data_length` variable, depending on version. Fallback on-chain address: for Bitcoin, this starts with a 5-bit `version` and contains a witness program or P2PKH or P2SH address.
148-
* `r` (3): `data_length` variable. One or more entries containing extra routing information for a private route; there may be more than one `r` field
149-
* `pubkey` (264 bits)
150-
* `short_channel_id` (64 bits)
151-
* `fee_base_msat` (32 bits, big-endian)
152-
* `fee_proportional_millionths` (32 bits, big-endian)
153-
* `cltv_expiry_delta` (16 bits, big-endian)
148+
* `r` (3): `data_length` variable. One or more entries containing extra routing information for a private route; there may be more than one `r` field.
149+
* Fields are
150+
* `pubkey` (264 bits)
151+
* `short_channel_id` (64 bits)
152+
* `fee_base_msat` (32 bits, big-endian)
153+
* `fee_proportional_millionths` (32 bits, big-endian)
154+
* `cltv_expiry_delta` (16 bits, big-endian)
155+
* Be aware that `data_length` can express `2^10` (=1024 bits) as the longest, and a sigle hop will be 51 bytes (= 408 bits). So currently there is no way to specify a hint with more than two hops.
154156
* `9` (5): `data_length` variable. One or more 5-bit values containing features
155157
supported or required for receiving this payment.
156158
See [Feature Bits](#feature-bits).

0 commit comments

Comments
 (0)