Nat128,Nat256,Int128,Int256 Type

Is it possible to expand to Nat128, Nat256, Int128, Int256 numeric format? After all, there are many scenarios where blockchain development uses formats above 128

1 Like

It’s possible, but given that we already support unbounded Nat and Int, can you say why you would also want this?

Is it to make it safer to use them without manually checking for overflow?

I vaguely remember a discussion among the Motoko and Candid devs about which types to offer, and I think I was in favor of adding the cryptoesk bit widths, but in the end we decided to stick to what Wasm offers natively. I only found one reference to that discussion, the rest might have been during meetings.

unbounded Nat? Does that means I can use it to store a 256-bit number? thank you.

Yes but you may want to check its value doesn’t exceed 2^256-1.