简体   繁体   English

IPFS 是否像区块链网络一样使用链表系统?

[英]Does IPFS use a linked list system like blockchain networks do?

I'm in the process of developing a blockchain-based application for a client that wishes to store files securely.我正在为希望安全存储文件的客户开发基于区块链的应用程序。 For this purpose I am using IPFS to store the files and the blockchain(more specifically an ethereum network) to store the hashes for the files.为此,我使用 IPFS 来存储文件,并使用区块链(更具体地说是以太坊网络)来存储文件的哈希值。 As is the case in most such applications.与大多数此类应用程序一样。

However, the client is insistent on storing the files directly on the blockchain because of the linked list feature that ensures that the hash of every block on the blockchain is dependent on the previous block and as such every single hash depends on each other.但是,客户端坚持将文件直接存储在区块链上,因为链表功能确保区块链上每个块的 hash 都依赖于前一个块,因此每个 hash 都相互依赖。

Does IPFS have a similar feature in it's data structure? IPFS 在其数据结构中是否具有类似的功能? I realize that the Merkle Tree system ensure that any tampering with any of the data chunks that the root hash references will change the root hash and as such allows verification of shared files.我意识到默克尔树系统确保任何篡改根 hash 引用的任何数据块都会更改根 hash,因此允许验证共享文件。 However, is there any feature that makes the hashes of files dependent on each other?但是,是否有任何功能可以使文件的哈希值相互依赖?

Perhaps if the files were in some sort of directory structure?也许如果文件在某种目录结构中?

IPFS blocks form a DAG - Directed Acyclic Graph. IPFS 块形成 DAG - 有向无环图。 A blockchain is a specific kind of DAG where each node has only one child.区块链是一种特定类型的 DAG,其中每个节点只有一个子节点。 As you say, the root block of a file contains an array of the hashes of the component blocks.正如您所说,文件的根块包含组件块的哈希数组。 Similarly, a directory object contains a dictionary that maps filenames to the hashes of those root blocks.同样,目录 object 包含一个字典,将文件名映射到这些根块的哈希值。 So, if you add a directory to ipfs, you will have a single hash that validates the entire contents of the directory.因此,如果您将目录添加到 ipfs,您将拥有一个 hash 来验证目录的全部内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM