joakim / iota-uri-scheme

IOTA URI Scheme (proposal) – Not set in stone, see open issues:
https://git.io/vpWy0
3 stars 0 forks source link

Support values in SI units? #4

Open joakim opened 6 years ago

joakim commented 6 years ago

Currently the spec requires the value to be specified in IOTAs (i). Would it be better to (also?) allow Ki, Mi, Gi, Ti and Pi units? If so, I suggest only integers, no decimal values (for clarity).

Examples (yes, they're all the same value):

iota:MZLFXAZOHOSGRPIGFSQATWQXTFRWATQTOZXAZIGCRXAGIED9ZCPXMCMSSUHYVEGVTOILQMAD9VZIV9PJCHCCO9YMIW?value=1000000
iota:MZLFXAZOHOSGRPIGFSQATWQXTFRWATQTOZXAZIGCRXAGIED9ZCPXMCMSSUHYVEGVTOILQMAD9VZIV9PJCHCCO9YMIW?value=1000Ki
iota:MZLFXAZOHOSGRPIGFSQATWQXTFRWATQTOZXAZIGCRXAGIED9ZCPXMCMSSUHYVEGVTOILQMAD9VZIV9PJCHCCO9YMIW?value=1Mi

Then there's the question of how apps should handle the value. Should one expect the it to use the same unit as specified in the URI? Or do as the spec currently states, use the most commonly used unit, alternatively the most logical interpretation of the value?

As an example, take 999900i. Should the client display 0.9999Mi assuming Mi is the most common unit? 999.9Ki?

I think it might be best to keep the wording in the spec and let the developers/designers decide:

IOTA clients MAY display the value in any format that is not intended to deceive the user. IOTA clients SHOULD choose a format that is foremost least confusing, and only after that the format that is most reasonable given the value specified.

joakim commented 6 years ago

The nice thing about this is that one could add support for this at a later time, without breaking backward compatibility with values specified in i. Assuming people use up-to-date wallets that add support for this, but that shouldn't be a problem today.