aptos-core
aptos-core copied to clipboard
[Token] add an API for creating token with content hash
I think in the ideal case, you would have the client compute the hash by pointing the SDK to the actual source of data. What are your thoughts?
Yes, that is the best UX. this PR is just to provide people a way to upload the content hash if they generate one.
I'd rather our SDK be opinionated here and expect to generate the hash within.
I'd rather our SDK be opinionated here and expect to generate the hash within.
generating hash within requiring 1. a file as input and 2. committed to one hash algorithm. I would prefer those two can be optional and customizable. I can see the value of having all these done and chosen for the users. But I don't see why that implies we shouldn't build finer granular building blocks like the APIs here.
generating hash within requiring 1. a file as input and 2. committed to one hash algorithm. I would prefer those two can be optional and customizable. I can see the value of having all these done and chosen for the users. But I don't see why that implies we shouldn't build finer granular building blocks like the APIs here.
I'll ask @alinush to chime in here. I think it is absolutely part of the spec and implementation that we dictate the hash function and have these validations here. I am uncomfortable with just having insert string like functionality that is ambiguous in a place meant to provide safety and authenticity.
The SDK is the ideal location to either teach users or to have them at least not have to learn.
Uhm, what's the question exactly? Is it about whether we should specify the hashing algorithm used to compute an NFT's content hash?
If so, that seems reasonable to me as a way of making sure all applications agree.