From a5b3818204fcee7f52170837dc1f79a0aeb351d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorkil=20V=C3=A6rge?= Date: Thu, 14 Nov 2019 08:38:53 +0100 Subject: [PATCH 1/3] Specify that resolution of amount is msat When the `p` multiplier is used, the amount MUST be divisible by 10 since the resolution used internally is millisatoshi. This addresses but does not close #692. --- 11-payment-encoding.md | 1 + 1 file changed, 1 insertion(+) diff --git a/11-payment-encoding.md b/11-payment-encoding.md index b03409311..66da25a28 100644 --- a/11-payment-encoding.md +++ b/11-payment-encoding.md @@ -64,6 +64,7 @@ A writer: - if a specific minimum `amount` is required for successful payment: - MUST include that `amount`. - MUST encode `amount` as a positive decimal integer with no leading 0s. + - MUST request `amount` divisible by ten if the `p` multiplier is used. - SHOULD use the shortest representation possible, by using the largest multiplier or omitting the multiplier. From 798ff4bdec8381f61f1f38d0680c2979bdf8d4df Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Tue, 21 Jan 2020 13:57:40 +0100 Subject: [PATCH 2/3] fixup! Specify that resolution of amount is msat --- 11-payment-encoding.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/11-payment-encoding.md b/11-payment-encoding.md index 66da25a28..e5ba6844f 100644 --- a/11-payment-encoding.md +++ b/11-payment-encoding.md @@ -64,7 +64,7 @@ A writer: - if a specific minimum `amount` is required for successful payment: - MUST include that `amount`. - MUST encode `amount` as a positive decimal integer with no leading 0s. - - MUST request `amount` divisible by ten if the `p` multiplier is used. + - If the is `p` multiplier is used the `amount` the last decimal MUST be `0`. - SHOULD use the shortest representation possible, by using the largest multiplier or omitting the multiplier. @@ -90,6 +90,9 @@ Donation addresses often don't have an associated amount, so `amount` is optional in that case. Usually a minimum payment is required for whatever is being offered in return. +The `p` multiplier would allow to specify sub-millisatoshi amounts, which cannot be transferred on the network, since HTLCs are denominated in millisatoshis. +Requiring a trailing `0` decimal ensures that the `amount` represents an integer number of millisatoshis. + # Data Part The data part of a Lightning invoice consists of multiple sections: From 29f138699515d896b283da6fa53a5e16205eb2aa Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Tue, 21 Jan 2020 14:01:04 +0100 Subject: [PATCH 3/3] fixup! Specify that resolution of amount is msat --- 11-payment-encoding.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/11-payment-encoding.md b/11-payment-encoding.md index e5ba6844f..54487e2b6 100644 --- a/11-payment-encoding.md +++ b/11-payment-encoding.md @@ -64,7 +64,7 @@ A writer: - if a specific minimum `amount` is required for successful payment: - MUST include that `amount`. - MUST encode `amount` as a positive decimal integer with no leading 0s. - - If the is `p` multiplier is used the `amount` the last decimal MUST be `0`. + - If the `p` multiplier is used the `amount` the last decimal MUST be `0`. - SHOULD use the shortest representation possible, by using the largest multiplier or omitting the multiplier.