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

Lack of clarity regarding Numbers in the Abstract Data Model #435

Closed
jonnycrunch opened this issue Oct 13, 2020 · 2 comments
Closed

Lack of clarity regarding Numbers in the Abstract Data Model #435

jonnycrunch opened this issue Oct 13, 2020 · 2 comments

Comments

@jonnycrunch
Copy link
Contributor

I've finally unraveled the problems regarding representing numbers in the Abstract Data Model and we will need to discuss this more. While we currently don't have properties in the DID document that rely on numbers, we haven't yet gotten to consensus regarding how to unambiguously represent them in the abstract data model and this will lead to errors in implementations especially across core representations.

In particular, JavaScript number system treats all numbers as floating point, which may result in silent loss of precision in decoding integers with more than 53 significant bits.

In comparison, a CBOR-based core representation of the DID document could represent floating-point numbers in any of the three formats (half-precision, single-precision, and double-precision).

In the CBOR representation section I attempted to constrain the model to only double-precision even for integral values. Despite this we still have a disconnect with the CBOR able to represent 64 bits of significance compared to JSON's 53 bits.

@rhiaro
Copy link
Member

rhiaro commented Oct 25, 2020

This is a duplicate of #361 but adds important commentary. Can I suggest merging them?

@jonnycrunch
Copy link
Contributor Author

move to #361

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

2 participants