From 5635a3657e52e75914853849bd1c13b37ef89bdc Mon Sep 17 00:00:00 2001 From: Peter Neuroth Date: Mon, 8 May 2023 22:57:46 +0200 Subject: [PATCH] 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 --- 01-messaging.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/01-messaging.md b/01-messaging.md index db109b5..a86d83b 100644 --- a/01-messaging.md +++ b/01-messaging.md @@ -224,12 +224,12 @@ Various fundamental types are referred to in the message specifications: * `u32`: a 4 byte unsigned integer * `u64`: an 8 byte unsigned integer -Inside TLV records which contain a single value, leading zeros in -integers can be omitted: +For the final value in TLV records, truncated integers may be used. Leading zeros in +truncated integers MUST be omitted: -* `tu16`: a 0 to 2 byte unsigned integer -* `tu32`: a 0 to 4 byte unsigned integer -* `tu64`: a 0 to 8 byte unsigned integer +* `tu16`: a 0 to 2 byte truncated unsigned integer +* `tu32`: a 0 to 4 byte truncated unsigned integer +* `tu64`: a 0 to 8 byte truncated unsigned integer When used to encode amounts, the previous fields MUST comply with the upper bound of 21 million BTC: