Crust Wiki

Crust Wiki

  • Docs
  • Shadow
  • Contribute
  • Languages iconEnglish
    • 中文
    • Help Translate

›Crosschain Storage Solution

General

  • Crust Overview
  • Crust Grants
  • Crust Ecosystem Growth
  • CRU Claims
  • LockedCRU Claims
  • LockedCRU Unlock
  • Bridge

    • Ethereum Bridge
    • Elrond Bridge
  • Crust Wallet
  • Glossary
  • Use CRU18 Guarantee
  • Parameters
  • Contributing

Learn

  • Account
  • Crust Tokens
  • New Bond
  • Guarantor
  • Validator
  • GPoS
  • sWorker

    • Overview
    • Entry Network
    • Workload
  • DSM
  • Storage Merchant
  • Identity
  • Governance Guide

Build

  • Builder's Portal
  • Crust Storage 101
  • Basics

    • Developer faucet
    • Crust Rocky Network
    • Store file with Crust Storage API
    • Store file with Crust IPFS Pinning Service API

    Crosschain Storage Solution

    • Crust's XCMP-based cross-chain dStorage solution
    • Crust's Parachain-based cross-chain dStorage solution
    • Crust's Native IPFS cross-chain dStorage solution
    • Crust's Smart contract cross-chain dStorage solution

    Integration Guide

    • DApp Hosting
    • NFTs
    • File Storage

    Node Guide

    • Crust Node
    • Crust Storage Manager

    Toolkits

    • Crust Pinner Github Action
    • Crust Pinner NPM Package
    • IPFS W3Auth Gateway
    • IPFS W3Auth Pinning Service

Build With EVM

  • Overview
  • Build With EVM 101
  • Chains

    • Ethereum
    • Optimism
    • Arbitrum
    • zkSync

    Toolkits

    • SDK

Build With Algorand

  • Overview
  • Build With Algorand 101
  • Algorand applications

Build With TON

  • Overview
  • Build With TON 101
  • TON applications

Node

  • Node Overview
  • Node Hardware Spec
  • Owner Node
  • Member Node
  • Isolation Node
  • Validator Guidance
  • Guarantor Guidance
  • sWorker Version
  • Node Benefits
  • Configure QoS

Storage

  • Overview
  • User Guidance
  • Merchant Guidance
  • Order Settlement
  • Storage Market Benefits
  • Apps Storage Issue

Q&A

  • Basic Knowledge
  • Verifiers and Candidates
  • Guarantor
  • Rewards and Punishments
  • Basic Node Problems
  • Member Node Related
  • Related Groups
  • Fix unstable chain
  • Applications
  • EPID & ECDSA
  • Other
Edit

Crust's Native IPFS cross-chain dStorage solution

Introduction

Decentralized storage(dStorage) is the fundamental of Web3 ecosystem. As a supplement to the costly on-chain storage, dStorage can scale horizontally as distributed network and store unlimited data theoretically.

Ethereum's Web3 stack lists some important considerations about dStorage:

  • Persistence mechanism and incentive structure
  • Data retention enforcement
  • Decentrality
  • Consensus

Based on these thoughts, dStorage projects are usually a standalone blockchain with consensus supporting data retention ability, incentive mechanism, and data persistence. The chart below shows an analysis of several mainstream Storage projects and their strategies for data retention and data persistence.

As the fundamental of Web3 ecosystem, dStorage is designed to serve the entire web3 ecosystem, including DApp hosting, NFT metadata storage, GameFi and social media data storage, even hosting the Metaverse. So we want to use a single web3 identity for DApps and personal data storage rather than multiple accounts. It's very similar to SSO(Single Sign-On) in Web2 world.

There are many smart contract platforms such as Ethereum, Polkadot, Near, Polygon, Solana... Every platform has its own DApp ecosystem. Web3 users use different identities to call smart contracts on each blockchain. And providing dStorage to users on different blockchains becomes a basic requirement for dStorage projects.

Solution

Crust Network provides Native IPFS integrations for all smart contract platforms.

It is a combination of:

  • W3Auth: handling the web3 identity authentication and storage contract authentication
  • IPFS W3Auth gateway: an HTTP-compatible data uploading service
  • IPFS W3Auth pinning service: an HTTP-compatible IPFS remote pinning service interacting with Crust blockchain

The basic workflow is based on 2 standard IPFS widgets - gateway and remote pinning service. Users on these platforms only need to:

  1. Upload data through gateways with Web3Auth , then get IPFS cid. Users' data will temporally be cached on gateways. After Crust IPFS nodes pull the data, the data will be deleted on gateways.
  2. Request remote pinning service with Web3Auth. This service will interact with Crust blockchain, including placing storage orders on Crust and monitoring on-chain file status

After that, all the IPFS nodes in Crust will start pulling the data from gateways and do the consensus.

Here are the detailed sub-modules, let's focus on how it works:

platforms

1. W3Auth

W3Auth is an auth widget collection which is responsible for:

  • Verifying the identity of each blockchain
  • Providing contract token deposit/release on each blockchain
  • Charging storage fee on each blockchain

Here are the Auth's node.js packages, these packages are used as authentication layer of gateways and pinning service.

  • auth-ethereum: supporting all EVM-compatible chains, including Ethereum, Polygon, BSC, Heco, Avalanche C-chain, ...
  • auth-substrate: supporting all substrate-based chains, including Polkadot, Kusama, Crust, Acala, Moonriver, ...
  • auth-near: supporting Near
  • auth-solana: supporting Solana
  • auth-flow: supporting Flow
  • auth-avalanche: supporting avalanche X- and P- chain

2. IPFS W3Auth gateway

Crust uses the standard IPFS Authenticated Gateway as data interchange, which allows web3 users to store data without IPFS locally, and because it is a standard IPFS widget. It is compatible with the official IPFS API, you can request it with the same HTTP endpoints, flags, and arguments.

Basically, it exposes the IPFS writable interfaces with W3Auth. The whole process shows below:

gw

Client-side

Let's say Alice(EVM user) wants to upload her file to IPFS, she only needs to do the following steps:

  • Step1. Sign her Pubkey(0x123) with her private key in any Ethereum wallets, then she will get the Sig(0x456)
  • Step2. Call original IPFS API(/api/v0/add) with basic auth header(Basic eth-0x123:0x456) and data-self

Gateway-side

After the W3Auth gateway received Alice's request:

  • Step1. Parse the header, extract ChainType(eth) Pubkey(0c) and Sig(0x456)
  • Step2. Parse Sig with Pubkey with auth-ethereum, then get the Msg(0x123), determine whether the Msg and Pubkey are the same
  • Step3. Call local IPFS add

With gateways, users on all the smart contract platforms can easily upload and cached data on IPFS without running IPFS locally. The detailed usage and deployment process of the IPFS W3Auth gateway can be checked here.

3. IPFS W3Auth pinning service

IPFS remote pinning services allow users to pin their IPFS files to remote stable IPFS nodes to ensure the file's reliability and accessibility. Crust uses this pinning service as a data bridge, which allows Web3 users to place storage orders on Crust with their native platform account.

Generally, this pinning service manages an order pool to send transactions on Crust chain and locally maintain a state database of on-chain order info. Here is the whole process:

ps

Client-side

Let's say Alice(EVM user) wants to pin her IPFS file(cid:QM123), she only needs to do the following steps:

  • Step1. Sign her Pubkey(0x123) with her private key in any Ethereum wallet, then she will get the Sig(0x456)
  • Step2. Call original IPFS pinning service with bearer auth header(Basic eth-0x123:0x456) with cid:QM123
  • Step3. Monitor IPFS file status with querying Crust chain or calling standard IPFS pinning service API

Pinner-side

After the W3Auth pinning service received Alice's request:

  • Step1. Parse the header, extract ChainType(eth) Pubkey(0c) and Sig(0x456)
  • Step2. Parse Sig with Pubkey with auth-ethereum, then get the Msg(0x123), determine whether the Msg and Pubkey are the same
  • Step3. Call on-chain place storage order transaction by order pool
  • Step4. Monitor on-chain file status

With the pinning service, users on all the smart contract platforms can call Crust on-chain interface and distribute the IPFS file through Crust protocol without interacting with the Crust chain. The detailed usage and deployment process of the IPFS W3Auth pinning service can be checked here.

Cases now

Native IPFS integrations are already been used by several platforms including:

  • [Native IPFS] Polygon
  • [Native IPFS] Near
  • [Native IPFS] Heco
  • [Native IPFS] Elrond
  • [Native IPFS] Solana

Also, the IPFS W3Auth gateway(GW) and pinning service(PS) are integrated by several projects including:

  • [PS] Uniswap: take it as release CD flow by using Github Action, details can be checked here
  • [PS] Liquity: take it as the only decentralized frontend, details can be checked here
  • [PS] Polkadot Apps: take it as release CD flow by using node.js script, details can be checked here
  • [PS] IPFS Docs: host by using command-line tool, details can be checked here
← Crust's Parachain-based cross-chain dStorage solutionCrust's Smart contract cross-chain dStorage solution →
  • Introduction
  • Solution
  • Cases now
Docs
Getting StartedCRU ClaimsWebsite Hosting with CrustNFT Data Storage with Crust
Community
DiscordTwitterTelegram
More
CooperationGitHub
Copyright © 2025 Crust Network