-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move from "divisible" and "indivisible" to "number of decimal places" #210
Comments
This is an excellent idea. It got me thinking about the time I'd spent exploring the colored coin wallet ChromaWallet. When issuing a new asset one specifies the quantity of atomic units (Satoshis) per unit of the asset. The same idea could be applied here to allow more flexibility - though this may be more novelty than anything else. |
@dexX7 Are you referring to the precision for internally representing fractional portion of the number of coins or for display purposes only? |
Hm. Is there a difference? The number of coins field uses a signed int64 and allows a range between 1 and 9,223,372,036,854,775,807 (let's call this "base units"). "Divisible" or "indivisible" defines how this range is displayed:
The number of "base units" is in both cases the same and I was thinking about: instead of limiting this to "divisible" (0 decimal places) and "indivisible" (8 decimal places), it would be handy to define the number of decimal places explicitly, so it would be possible, for example, to create some EuroCoins which use 2 decimal places (0.01 to ...). P.S.: Yup, same here, I saw this on CoinPrism, a colored coins web wallet. (screenshot) |
I like. |
I opened issue #307 to clarify whether there are any differences other than UI between 'divisible' and 'indivisible'. |
An alternative approach is to remove the distinctions between 'divisible' and 'indivisible' from the Spec entirely and leave it entirely up to convention or to a configurable UI. |
Tokens are created with a "divisible" or "indivisible" flag whereby this flag doesn't influence the total number of "base units" (max: signed int64), but is used as hint for UIs. Divisible tokens are dividend by 100,000,000, so the range is 0.00000001 to somebignumber, instead of 1 to someevenbiggernumber.
There might be the case where one doesn't want to use an "amount modificator" of 10^8 ("divisible") and neither 10^0 ("indivisible"), but something inbetween, for example 10^2, which would have a range of 0.01 to verybignumber. This could be handy for currency-type tokens to represent for example euros or dollars.
So the idea is, instead of using a "divisible" and "indivisible" flag, to use an explicit number to define the number of decimal places.
The text was updated successfully, but these errors were encountered: