Skip to content

Commit

Permalink
A note on the maximum size of Tagged Fields (#1042)
Browse files Browse the repository at this point in the history
Make it more obvious to readers of bolt 11 that the maximum length of a Tagged
Field is 639 bytes.
  • Loading branch information
JssDWt authored Dec 22, 2022
1 parent a0bbe47 commit f7dcc32
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions 11-payment-encoding.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit f7dcc32

Please sign in to comment.