PoA Consensus on Substrate

We are pleased to announce that Canyon Labs had received an open grant from the Web3 Foundation to implement Proof-of-Access (PoA) consensus on Substrate a month ago. Today, we are announcing the grant delivery of this round, which showcases the ability to run a local development Substrate node with PoA consensus enabled. This is the first crucial step towards our ultimate goal of launching Canyon Network in the Polkadot ecosystem.

What’s Canyon Network

Canyon is a permanent storage network built on Substrate, which records the hashes of files on-chain and stores the actual files off-chain. By combining PoS with the PoA consensus, Canyon greatly reduces the barriers to entry for the storage miners, who are incentivized to store as much data as possible for winning more rewards. Being a PoS system, Canyon has more chances to become a platform that is capable of providing a high quality of storage services in a trustless way as long as we design an effective slashing and rewarding mechanism. The mission of Canyon Network is to become a truly usable and sustainable storage infrastructure for Web3.0.

What’s Proof of Access

The Proof of Access consensus was initially adopted by the project Arweave, a permanent data storage protocol, serving as an enhancement of Proof of Work in which the entire recall block data is included in the material to be hashed for the input to the proof of work. The recall block is a random block in the block history, selected based on the previous block hash. To mine a new block, the miner must have the new block’s recall block data to create a storage proof demonstrating the miner has access to the recall block.

For a blockchain-based decentralized storage network, there are normally two kinds of consensus in the system: one is the traditional blockchain consensus for solving the leader selection problem and collectively maintaining the ledger such as PoS, PoW, to name a few, the other is a storage-oriented consensus to make sure the data can be properly stored onto the network like Filecoin’s ZK proof and Crust’s TEE solution. Comparing with the other storage consensus, PoA is super light and has a pretty low entry for the storage miners. Please refer to the white paper (still incomplete and subject to change) for further analysis.

PoA on Substrate

In this grant, we have implemented a prototype of PoA consensus by developing several client and runtime modules, which will be the basis of future work. The main modules are depicted as follows:

  • cc-rpc: This module provides the RPC interfaces for users to submit and retrieve the transaction data.
  • cc-datastore: this module is responsible for the persistence of transaction data, it is currently implemented based on the off-chain db.
  • cc-consensus-poa: This module implements the core algorithm of PoA. PoA is typically used as a requirement of the block construction, hence the implementation of an inherent data provider is also provided. The verification is achieved by creating a nested block import. Please see the white paper or the rustdoc of this crate for the details of the PoA workflow.
  • pallet-poa: this pallet is used to process the PoaOutcome containing an optional storage proof generated from cc-consensus-poa on each block, which will deposit a consensus log using the consensus id POA: if the network data is not empty. This module records the history depth info that can be used to estimate the storage ratio of each validator, which is the key element of the future slashing and rewarding design.

Please check out the testing guide to run a local node and test the above features.

Future work

  • Implement the transaction data sync in the network.
  • Implement cc-datastore using a standalone rocksdb database.
  • Record a recent history depth info on chain aside from the global one.
  • Implement an explorer to show the data distribution in the network.
  • Research the relationship between the minimum storage ratio of each validator and the theoretical lower bound of replicas per file.
  • and more.

A permanent storage layer for Web3.0, with high data durability and retrievability