nft.storage icon indicating copy to clipboard operation
nft.storage copied to clipboard

To support string as the data type of `token.image`

Open zkengine opened this issue 4 years ago • 4 comments

It would be great nft.storage SDK to support the image field be a string data type besides the File and Blob types in the .store request payload as sometimes the NFT images were uploaded to IPFS already or even in a centralized storage server but the user just want to save the NFT's metadata to IPFS, right now there is not a way to do it if using nft.storage SDK.

zkengine avatar Oct 08 '21 13:10 zkengine

It's unlikely that we'll be able to download image / asset from a remote URL into the service that's not already in IPFS - there's just too much outside of the service's control in that case (we already see this enough with data supposedly in IPFS that NFT.Storage is asked to pin but is not actually hosted anywhere).

However, think it's a great idea to allow uploads of metadata where the user already knows the ipfs:// address. This will probably have to come with some warning labels (e.g., this does not store the assets onto NFT.Storage, make sure the data is persisted, etc.) and validation since it creates room for user error (e.g., pasting a slightly off version of the IPFS address which will mess up the metadata CID), so it probably makes sense to create a different flavor of the store() method for this.

In the future, we can also pull in any assets that are referenced in the metadata, but think starting with just the metadata upload makes sense.

dchoi27 avatar Oct 11 '21 23:10 dchoi27

Another use case for this: Pinning multiple "editions" of the same large image on IPFS. In this case, metadatas will be unique but the image uri will be the same for all tokens. client.store will unnecessarily reupload the image on every call. Would be nice to be able to specify the ipfs:// address that was pinned before.

Thegaram avatar Apr 22 '22 03:04 Thegaram

@Thegaram it's trivial to already do this with client.storeBlob! you just have to include the ipfs:// address your self

dchoi27 avatar Apr 22 '22 03:04 dchoi27

Oh that's good to know, thanks :)

Thegaram avatar Apr 22 '22 07:04 Thegaram

We're closing this issue. If you still need help please open a new issue.

elizabeth-griffiths avatar Apr 17 '24 22:04 elizabeth-griffiths