Skip to content
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

Open
dexX7 opened this issue Jun 17, 2014 · 6 comments
Open

Move from "divisible" and "indivisible" to "number of decimal places" #210

dexX7 opened this issue Jun 17, 2014 · 6 comments

Comments

@dexX7
Copy link
Member

dexX7 commented Jun 17, 2014

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.

@LOLLOLOOLOL
Copy link

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.

@marv-engine
Copy link

@dexX7 Are you referring to the precision for internally representing fractional portion of the number of coins or for display purposes only?

@dexX7
Copy link
Member Author

dexX7 commented Jun 17, 2014

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:

Indivisible:
1          to 9223372036854775807          (0 decimal places)

Divisible:
0.00000001 to         92233720368.54775807 (8 decimal places)

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)

@ripper234
Copy link
Contributor

I like.

@msgilligan
Copy link
Member

I opened issue #307 to clarify whether there are any differences other than UI between 'divisible' and 'indivisible'.

@msgilligan
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants