Decentralized storage system in Polkadot
Polkadot生态研究院
2022-09-22 03:14
本文约2621字,阅读全文需要约10分钟
Against the background of the data explosion, decentralized storage will become an important infrastructure service for the next generation Internet.

picture

Polkadot Knowledge GraphpicturePolkadot Knowledge Graph

With the exponential growth of data in the Web3 era, the demand for decentralized storage has also been strengthened. Projects such as IPFS and Crust storage will become important infrastructure services for the next generation Internet

Storage is an integral part of modern computer systems, and the same is true for distributed and decentralized systems like blockchains. When interacting with the Polkadot ecosystem, it will be helpful if you are familiar with the current Web3 approach to decentralized storage and how these systems can support your work.

first level title

DCS (Decentralized Cloud Storage)

A key attribute of centralized cloud storage is the location of the data.

In decentralized cloud storage, the key attribute becomes the data itself, not the location of the data.

This can be seen as a shift from a location-centric approach to centralized storage to a content-centric approach to decentralized storage.

IPFS (Interplanetary File System)

The purpose of IPFS is to solve the obstacles of the current HTTP-based Internet.

picture

Filecoin

picture

Like IPFS, Filecoin is a protocol developed by Protocol Labs that provides a decentralized storage network. Filecoin's main focus is storage itself, and uses IPFS as a (complementary) backend protocol.

first level title

Substrate storage

RocksDB:

https://rocksdb.org/;

Substrate adopts a hierarchical storage method, uses key-value (key-value) data storage, and implements a modified Merkle tree supported by a database. Substrate's higher-layer storage abstraction is built on top of key-value stores.

https://github.com/paritytech/parity-db

The key-value data store is backed by RocksDB, which also supports the experimental Parity database.

Experimental Parity database:https://docs.substrate.io/build/runtime-storage/

Notice

This database is used for components that require persistent storage, including Substrate clients, Substrate light clients, and off-chain workers. For more information, check out the Substrate Documentation Storage page:

When building on Substrate, runtime developers can take advantage of Substrate's FRAMEStorage pallet, which provides access to Substrate's storage API.

These storage items support values ​​encoded by Parity's SCALE (Simple Concatenated Aggregate Little-Endian) codec.There is a Storage Value API for storing a single value, a Storage Map API for a key-value hashmap, and a Storage Double Map API for creating a Storage Map with two keys to provide efficient deletion of all The ability to create entries; there is also a Storage N Map API that can be used to store hashmaps with an arbitrary number of keys.https://docs.substrate.io/build/runtime-storage/

These layered APIs act as runtime storage, allowing you to store data in the blockchain

. More information can be found on the runtime storage page of the Substrate Developer Center:

Crust storage

Crust Network provides a Web3.0 decentralized storage network for Metaverse. It aims to realize the core values ​​of decentralization, privacy and security.

Crust supports multiple storage layer protocols such as IPFS, and provides users with instantly accessible on-chain storage functions. Crust's technology stack can also support data manipulation and computation.

Crust provides an XCMP-based local cross-chain communication pallet called xStorage.

The protocol also supports most smart contracts, including Ethereum, with its cross-chain dStorage solution.

Crust Network Wiki:

https://wiki.crust.network/en

Learn more about Crust

https://wiki.crust.network/docs/en/build101

To learn more about Crust, check out the Crust Network Wiki. Follow their Crust Storage 101 guide to try integrating with Crust.

Crust Storage 101 Guide:.PolkadotJS storage

https://polkadot.js.org/docs/substrate/storage/

The storage methods provided by the PolkadotJS API are part of the default Substrate runtime. They pass api.query.

public. See the official documentation for more details:Substrate file

Allow users based on the Substrate chain to upload their files to the IPFS W3Auth Gateway and use the IPFS W3Auth Pinning service to pin their files on the Crust Network

picture

picture

picture

picture

picture

picture

picture

and the file status:

picture

Notice:

Notice:

picture

The entire file module is decentralized, so your file directory is only cached in the browser. If you switch to a new browser or clear your browser cache, the file directory information will not be visible. The storage module allows you to export file directory information from the current browser and import it into the new browser.https://github.com/polkadot-js/apps/pull/6106

picture

NOTE: The above image was taken from this pull requestAt present, after experiencing explosive growth, data production continues to grow exponentially, and data storage has gradually changed from traditional hardware storage to cloud storage. Centralization of rights, lack of security and transparency, and data sovereignty have become problems that urgently need to be resolved.With the advent of the Web 3.0 era, the way of storage and data sharing has also undergone tremendous changes.

In the face of massive data, a secure, high-availability, low-cost and easy-to-use decentralized storage infrastructure will be an important part of the next generation Internet

https://t.me/polkadot_eri

. Therefore, with the vision of becoming a Web3 infrastructure, Polkadot provides a broad development space for decentralized data storage projects.

https://mirror.xyz/0x9A259b3a2316281Cc948cE2Cf1Ac610a79844f05

Polkadot生态研究院
作者文库