1
0
mirror of https://github.com/lightning/bolts.git synced 2024-11-19 01:50:03 +01:00

A note on the maximum size of Tagged Fields (#1042)

Make it more obvious to readers of bolt 11 that the maximum length of a Tagged
Field is 639 bytes.
This commit is contained in:
Jesse de Wit 2022-12-22 13:27:15 +01:00 committed by GitHub
parent a0bbe47b02
commit f7dcc32694
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -135,6 +135,8 @@ Each Tagged Field is of the form:
1. `data_length` (10 bits, big-endian)
1. `data` (`data_length` x 5 bits)
Note that the maximum length of a Tagged Field's `data` is constricted by the maximum value of `data_length`. This is 1023 x 5 bits, or 639 bytes.
Currently defined tagged fields are:
* `p` (1): `data_length` 52. 256-bit SHA256 payment_hash. Preimage of this provides proof of payment.