0

我有一个完成的艺术项目,我正在寻找一种将数据存储在链上的方法。比如聋牛。我生成的 6x6 像素图像的来源是图片,因此我无法通过代码重新创建它们。我想我必须以某种形式在链上存储他们的原始数据。

我是区块链的新手。我知道代币存储在链上,我在 hen 和 opensea 上铸造了一些艺术品,但我一般不明白它们在后台是如何运作的。

你能推荐一些关于这个主题的解释清楚的教程或文章吗?

谢谢!

4

1 回答 1

0

Any reason why they need to be stored on-chain? Normally images are stored off chain to reduce the cost of transactions.

You can upload the image onto ipfs via pinata and then create a json file that point to it and upload that through pinata as well. The tokenURI would then be that json file.

For example,

TokenURI=ipfs://<json_file_hash>"

Then in your JSON file:

{
    "image": "<image_file_hash>"
}
于 2021-09-05T16:11:09.423 回答