diff --git a/00.md b/00.md index d7184a73..2be98266 100644 --- a/00.md +++ b/00.md @@ -56,11 +56,22 @@ These specifications use elliptic curve public key cryptography over the field a ### Types -Values in these specification are one of: +Values in this specification are one of: - Scalars: integers modulo the curve order `n` - Curve points: elements of the elliptic curve group (including the identity point at infinity) - Byte sequences +- `int` / `u64`: unsigned 64-bit integer in the range: `0..2^64-1`. + +#### Unsigned 64-bit integers in JSON fields + +For JSON fields, `int` / `u64` values may be encoded as a JSON integer number or a base-10 decimal string. + +Implementations **MUST** accept both forms. + +Values greater than `9007199254740991 (2^53-1)` **MUST** be represented as decimal strings. + +This preserves integer precision in environments where JSON numbers use IEEE-754. ### Byte Operations And Encodings diff --git a/01.md b/01.md index 5a85bd2d..5ce8e3d1 100644 --- a/01.md +++ b/01.md @@ -67,7 +67,7 @@ Response `GetKeysResponse` of `Bob`: "input_fee_ppk": , "final_expiry": "keys": { - : , + : , ... } } diff --git a/18.md b/18.md index 34571360..1967afb6 100644 --- a/18.md +++ b/18.md @@ -33,7 +33,7 @@ A Payment Request is defined as follows Here, the fields are - `i`: Payment id to be included in the payment payload -- `a`: The amount of the requested payment +- `a`: The amount of the requested payment as an [unsigned int][00] - `u`: The unit of the requested payment (MUST be set if `a` is set) - `s`: Whether the payment request is for single use - `m`: A set of mints from which the payment is requested diff --git a/24.md b/24.md index 05822628..2417b907 100644 --- a/24.md +++ b/24.md @@ -23,7 +23,7 @@ HTTP servers may respond with the HTTP status code 402 with a `X-Cashu` header c } ``` -- `a`: The amount required in the specified unit +- `a`: The amount required in the specified unit as an [unsigned int][00] - `u`: The currency unit (e.g., "sat", "usd", "api") - `m`: Array of mint URLs that the server accepts tokens from - `nut10`: The required [NUT-10][10] locking condition @@ -40,6 +40,7 @@ The token MUST be from one of the mints listed in the `mints` array, and MUST be If the server receives tokens from a mint that is not in the `mints` array, an incorrect `unit`, an insufficient amount of tokens, or with insufficient locking conditions, it should respond with a HTTP `400` status code. +[00]: 00.md [10]: 10.md [12]: 12.md [18]: 18.md