用户没有登录

How to store data on-chain? Is it practical at all? Read more about data storage and blockchain in this article.

The past year has been dubbed the Year of the NFT, with NFT creators making billions of dollars selling all kinds of digital collectibles to their fans. The uniqueness of each NFT comes from its metadata, which contains a description of the NFT, as well as links to NFT media files.

This information could be stored directly on the blockchain, but undoubtedly this is very expensive, so most NFT projects are stored elsewhere and only return a linked address in the smart contract.

The main existing mainstream storage methods are explained below.

过去的一年被称为NFT元年,NFT创作者向他们的粉丝出售各类数字藏品,赚取了数十亿美元。NFT作为一种非同质化代币,代表了区块链上独特资产的所有权。每一个NFT的独特性来自于它的Metadata,Metadata包含了对NFT的描述,以及指向NFT媒体文件的链接。

这些资料可以直接存储于区块链上,但无疑这种做法非常昂贵,所以大部分的NFT项目都是存储在其他地方,仅在智能合约当中返回一个链接地址。

现有的主流存储方法主要有以下集中:

NFT101 Nouns DAO

中心化存储 Centralized Storage

Centralized storage is the one we are most familiar with. All files and data are stored on a single server, and the owner is responsible for maintaining that server, in Web 2.0 we basically use this way to store data, even if multiple servers are deployed, the so-called distributed deployment, does not guarantee the security of data storage. In particular, the person who controls the server can modify the data content of Metadata without the permission of the NFT owner, which completely defeats the purpose that NFT hopes to achieve, if your digital assets can be seized, changed or viewed at will, then you have no real ownership.

中心化存储是我们最为熟悉的一种方式。所有的文件和数据存储在一台服务器上,而所有者负责维护该服务器,在Web2.0我们基本都是采用这种方式来存储数据,即便部署多台服务器,即所谓的分布式部署,也并不能保证数据存储的安全。尤其是控制服务器的人可以在没有经过NFT所有者许可的情况下修改Metadata的数据内容,这就完全违背了NFT所希望达到的目的,如果你的数字资产可以为任意夺取、更改或查看,那么你就没有真正的所有权。

IPFS

IPFS is a peer-to-peer data storage system that stores files on the network through nodes composed of many computers, and identifies these files with unique hash values. When a file request is made, IPFS finds the node that stores the file based on its hash value and extracts the file to the requestor.

The disadvantage of IPFS is that the continuity of storage is not guaranteed, which means that your files or data are not stored permanently on the network. Data files exist on IPFS only if a node in the network stores the data content and allows access to it, an act of storing data on IPFS known as “Pinning”.

In order to preserve file data on IPFS for the long term, many NFT projects need to manually pinning their data, either using a pinning service to ensure that at least one IPFS node keeps a copy. If the project or platform that maintains NFT’s IPFS data fails and stops Pinning the data, all stored data files will be lost as the node storing the copies clears the data or shuts down.

IPFS是一个点对点的资料存储系统,通过很多计算机组成的节点来存储网络上的文件,并通过唯一的hash值来标识这些文件。IPFS和其他网络存储方案的去别在于IPFS是一个基于存储内容的地址系统,当一个文件请求被提出时,IPFS会根据该文件的hash值找到存储该文件的节点,并将文件提取给到请求者。

IPFS的缺点在于存储的持续性无法被保证,这意味着你的文件或者数据不会永久地保存在网络上。只有当网络中的某一个节点存储了数据内容并允许存取的情况下,数据文件才会存在于IPFS上,这种IPFS存储数据的行为被称为“Pinning”。

为了在IPFS上长期保存文件数据,许多NFT项目都需要手动Pinning他们的数据,要么使用Pinning服务,以确保至少有一个IPFS节点保存副本。如果维护NFT的IPFS数据的项目或者平台故障,并停止了Pinning数据,随着存储副本的节点清除数据或者关闭,所有存储的数据文件将丢失。

AR Weave

Arweave is a decentralized data storage network that guarantees persistence and requires users to pay a one-time fee to offset the cost of storage for 200 years. Of course, 200 years should only be a conservative estimate of time based on the trend of declining storage costs.

Arweave is incentivized by AR tokens that allow miners to “mine” by providing resources to copy and store copies of data. This ensures that files are not lost over time.

Arweave uses a structure called “BlockWeave” to store data, where each new block of data needs to be linked to a previous block of data and a “history block” from the previous history of the blockchain, and miners must prove They must prove that they have access to these randomly selected historical blocks in order to mine for new blocks and receive a reward for doing so, a mechanism that guarantees that older blocks are preserved.

For most NFT projects, a better storage method at this stage is Arweave. Of course the best way is still to store the metadata on the chain, for example: Uniswapp V3 NFT, Blitmaps, NounsDAO and other solutions, but at this stage due to the expensive, may not be practical enough.

Arweave是一个能保证持久性的去中心化的数据存储网络,用户需要支付一次性费用来抵消200年的存储成本。当然,基于存储成本不断下降的趋势,200年应该只是一个保守的估计时间。

Arweave通过AR代币的激励,让矿工通过提供资源去复制和存储数据副本,来进行“挖矿”。这确保了文件不会随着时间推移而丢失。

Arweave使用一种称为“BlockWeave”的结构来保存数据,每个新的数据区块都需要连接到前一个数据区块和一个来自区块链先前历史的“历史区块”,矿工必须证明他们能够访问这些随机选择的历史区块,以挖掘生成新的区块,并以此来获得奖励,这种机制保障较早的区块被保存下来。

对于大部分的NFT项目来说,现阶段比较好的存储方式就是Arweave了。当然最好的方式还是将metadata存储在链上,例如:Uniswapp V3 NFT、Blitmaps、NounsDAO等方案,但是在现阶段由于费用昂贵,可能实用性不够。

NFT101 AR Weave
NFT101 02