-
Notifications
You must be signed in to change notification settings - Fork 76
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
Make TokenSDK support high-precision assets #211
Comments
Do you have some examples of asset classes where 63 bits of precision aren't sufficient? It would be great to ground this in some concrete problems. Arbitrary precision maths is intellectually more satisfying (I wrote a C++ library to do just this a few years ago) but is not without its own set of quirks, especially around conversions to other types. |
Thanks @dave-hudson. Corda then applies a factor to adjust the value for the number of decimal places. Let's now consider ETH (and the bulk of Ethereum based tokens). These have 256 bits of precision. It's for I've discussed this matter with our trader clients. The suggestion of rounding all transactions so that they fit within the 63bit (19 sf) range was met with a non-satisfactory response. Every penny/cent/wei counts. I recognise the complexities of engineering for high-precision assets - you can see my implementation in the Cordite project. There we represented amounts as Hope this helps give some context. |
@dazraf thanks for this - I will take a look at it. The complexity comes from maintaining compatibility with existing tokens out there. |
Thanks @roastario. Yes, compatibility is tricky. Perhaps we can do a f2f chat about it. Happy to be of help. |
As the the worlds of traditional and crypto assets gradually converge, we need to be prepared for firms (and notably large institutional firms) looking to trade a variety of asset classes including those that require high-precision amounts. These classically include BTC, Ripple, ETH and also the vast majority of Ethereum tokens. TokenSDK, being steeped in the Corda
Amount
, usesLong
s to represent amounts (using a divisor) which are insufficient to represent the aforementioned asset types. This request is for TokenSDK to formally supportBigDecimal
amounts.The text was updated successfully, but these errors were encountered: