You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 11-payment-encoding.md
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -140,6 +140,8 @@ Currently defined tagged fields are:
140
140
*`p` (1): `data_length` 52. 256-bit SHA256 payment_hash. Preimage of this provides proof of payment.
141
141
*`s` (16): `data_length` 52. This 256-bit secret prevents forwarding nodes from probing the payment recipient.
142
142
*`d` (13): `data_length` variable. Short description of purpose of payment (UTF-8), e.g. '1 cup of coffee' or 'ナンセンス 1杯'
143
+
*`m` (14): `data_length` variable. Additional metadata to attach to the
144
+
payment.
143
145
*`n` (19): `data_length` 53. 33-byte public key of the payee node
144
146
*`h` (23): `data_length` 52. 256-bit description of purpose of payment (SHA256). This is used to commit to an associated description that is over 639 bytes, but the transport mechanism for the description in that case is transport specific and not defined here.
145
147
*`x` (6): `data_length` variable. `expiry` time in seconds (big-endian). Default is 3600 (1 hour) if not specified.
@@ -216,6 +218,8 @@ A reader:
216
218
- MUST use that as [`payment_secret`](04-onion-routing.md#tlv_payload-payload-format)
217
219
- if the `c` field (`min_final_cltv_expiry`) is not provided:
218
220
- MUST use an expiry delta of at least 18 when making the payment
221
+
- if the `m` field is provided, it MUST send the contents of this field in the
222
+
final hop payload as tlv field 10.
219
223
220
224
### Rationale
221
225
@@ -235,6 +239,9 @@ by which the description is served is as-yet unspecified and will
235
239
probably be transport dependent. The `h` format could change in the future,
236
240
by changing the length, so readers ignore it if it's not 256 bits.
237
241
242
+
The `m` field allows metadata to be attached to the payment. This supports
243
+
spontaneous payments and other applications where the recipient doesn't keep any context for the payment.
244
+
238
245
The `n` field can be used to explicitly specify the destination node ID,
0 commit comments