aptos-core icon indicating copy to clipboard operation
aptos-core copied to clipboard

[Token] add an API for creating token with content hash

Open areshand opened this issue 3 years ago • 5 comments

Description

https://github.com/aptos-labs/aptos-core/issues/2939

Test Plan

CICD


This change is Reviewable

areshand avatar Aug 30 '22 20:08 areshand

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.

areshand avatar Sep 07 '22 20:09 areshand

I'd rather our SDK be opinionated here and expect to generate the hash within.

davidiw avatar Sep 08 '22 06:09 davidiw

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.

areshand avatar Sep 09 '22 17:09 areshand

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.

davidiw avatar Sep 11 '22 01:09 davidiw

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.

alinush avatar Sep 12 '22 21:09 alinush