Skip to content

Commit 5635a36

Browse files
authored
Bolt 1: Clarify the definition of tu fields (#1073)
Truncated integer fields, e.g. tu16 cannot have leading zeros judging by the implementations of the parsers, which are used across the different ln implementations. The `can` imposed that it is not necessary to truncate the fields to values of information. Signed-off-by: Peter Neuroth <[email protected]>
1 parent 50b2df2 commit 5635a36

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

01-messaging.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,12 +224,12 @@ Various fundamental types are referred to in the message specifications:
224224
* `u32`: a 4 byte unsigned integer
225225
* `u64`: an 8 byte unsigned integer
226226

227-
Inside TLV records which contain a single value, leading zeros in
228-
integers can be omitted:
227+
For the final value in TLV records, truncated integers may be used. Leading zeros in
228+
truncated integers MUST be omitted:
229229

230-
* `tu16`: a 0 to 2 byte unsigned integer
231-
* `tu32`: a 0 to 4 byte unsigned integer
232-
* `tu64`: a 0 to 8 byte unsigned integer
230+
* `tu16`: a 0 to 2 byte truncated unsigned integer
231+
* `tu32`: a 0 to 4 byte truncated unsigned integer
232+
* `tu64`: a 0 to 8 byte truncated unsigned integer
233233

234234
When used to encode amounts, the previous fields MUST comply with the upper
235235
bound of 21 million BTC:

0 commit comments

Comments
 (0)