ICRC-1 Ledger Supply Limit

The ICPSwap team has pointed out that the ICRC-1 Ledger package limits the max supply of new tokens to 184467440737.00000000. Can someone provide an explanation for this particular number? Is this likely to be changed/updated in the future?

The number you mentioned, 184467440737, doesn’t seem to have any particular significance on its own. However, if we add a few more digits at the end to make it 18446744073709551615, it becomes a special number because it is the maximum value that can be represented by an unsigned 64-bit binary number. This value is equal to 2^64 - 1.

The significance of this value comes up often in computer science and programming because 64-bit computing is the norm in modern computer architectures. This number represents the maximum amount of unique addresses available in a 64-bit system, or the maximum value that can be stored in an unsigned 64-bit integer.

In binary form, this value is represented as 64 consecutive 1’s (11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 in binary), and it’s often used in programming to represent a “max” value or a placeholder for a value that’s supposed to be impossibly high.

4 Likes

Thank you a lot for taking the time to answer.

This number represents the maximum amount of unique addresses available in a 64-bit system

So you believe this limit will not be updated in the future due to the limitation of 64-bit systems?

Not if you want 8 decimal places.

Why isnt 184 billion tokens with 8dp enough?

Not sure why they said that.
Icrc1 works with Nat, not Nat64. From spec:


Nat = Natural numbers with infinite precision.
Maybe their LPs are using Nat64 or the example implementation uses Nat64

1 Like

It’s simply a tradeoff between storage space required and reasonable defaults. There’s nothing stopping anyone from using infinite-precision ints, but it’ll make memory management more complex (read: more can go wrong) and it takes more space (read: you’ll run into problems much earlier)

1 Like

This is not a limitation of ICRC-1, but rather a limitation of the specific implementation. You can modify the implementation to use u128 or u256.

1 Like

Would you be willing to help us out on launching a token under the ICRC-1 Ledger package but modifying the implementation to use NAT, or something like u256?