-
Notifications
You must be signed in to change notification settings - Fork 44
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
[LSP8] Add explanation of hashed tokenId #136
Comments
But token if can be anything. From maybe we should introduce more token types, rather than adding a second key (which would make it more expensive to deploy) |
I would give an example. For Universal Page we require a user provided name to track pages. Each name is then hashed keccak256. The hash becomes a token id. This works great, because we do not have a min nor maximum requirements for possible names (more than 32 bytes). Token type id I still think this type For example, ENS does similar thing: ETHRegistrarController.sol |
I think it's rather the description in the LSP8 standard that is misleanding. 1: The hash digest can be the hash of anything really. In your case @lykhonis , it's the hash of user provided name.
Adding a new metadata key does not make sense to me in this case, because this standard data key only applies if tokenId type is 3. We should not create standard metadata keys if they exist only in a specific scenarios, but rather if they apply to any scenarios, no matter implementation details. Otherwise, we would end up creating many metadata keys each for specific scenarios and it would not be standard anymore. I think this information can simply be added either:
|
Overview
LSP8 requires to set an explanation of what
tokenId
content means. The explanation is currently documented to be an integer of key LSP8TokenIdType:address
another contractuint256
a number, which may be an incrementing count where each minted token is assigned the next numberbytes32
a hashed value (ie. serial number)Problem
In a case of
3
whentokenId
represents a hashed value, dapps and other contracts may need to be able to retrieve actual value (prior to it's been hashed).Improvement Proposal
LSP8TokenIdHashFunction
Explains a hashing function applied to generate a tokenId.
possible values:
keccak256(bytes)
LSP8TokenIdValue:TokenId
Contains a value that's hashed to generate a tokenId.
If value is a string, it must be encoded in
utf8
and read asWeb3.utils.hexToUtf8(hexValue)
The text was updated successfully, but these errors were encountered: