Factom-Asset-Tokens / FAT

Factom Asset Tokens - Open tokenization standards on Factom
17 stars 8 forks source link

Change txSalt to string type to reduce ambiguity #4

Closed AdamSLevy closed 6 years ago

AdamSLevy commented 6 years ago

In a transaction entry, the txNonce is computed from djb2a(<Token ID> + txSalt) where addition is defined as string concatenation. However txSalt is defined as a number type which requires converting the number to a string. This conversion leads to potential ambiguity since different programming languages may implement string conversion differently. Additionally a JSON number can be a float with arbitrary precision, which could result in differences in the precision of the string conversion.

By making the txSalt field a string type we remove the necessity of this string conversion and reduce ambiguity of the specification. Additionally the salt field in the Issuance Entry is a string, so this also increases internal consistency of the specification.

drkatz commented 6 years ago

Thanks @AdamSLevy, good catch :+1: