Magport / Substrate-Rollup

This is a Rollup implementation based on the Substrate framework, dedicated to enhancing the scalability and efficiency of substrate blockchain.
MIT No Attribution
0 stars 5 forks source link

The Workflow interpretation of Substrate Rollup #1

Open Acaishiba opened 7 months ago

Acaishiba commented 7 months ago

Magsteam plans to implement three types of Substrate Rollup SDKs:

Ordered from easy to difficult and from urgent to less urgent, we will progressively complete the development in the sequence of OP-rollup, ZK-rollup, and POV-rollup. The workflow interpretation is as follows:

Substrate OP Roll-up workflow:

  1. Users submit transactions to our platform.
  2. Validators process these transactions and generate blocks using the BABE consensus mechanism, mirroring the process used by Substrate’s solo chains.
  3. A set of every N blocks constitutes a checkpoint, also known as a batch.
  4. A checkpoint selection algorithm is necessary to assign the batch processing task to the appropriate validator.
  5. The chosen validator crafts the OP roll-up for all transactions within this batch.
  6. The OP roll-up data is then dispatched to the Avail Network, aligning with standard OP roll-up procedures.
  7. Validators monitor the Avail Network during the challenge period, awaiting confirmation for each OP roll-up batch.
  8. Absent any challenges, Avail will recognize and accept the roll-up batch data.
  9. Once Avail acknowledges the data, the corresponding blocks are designated as finalized.

Substrate ZK Roll-up workflow:

  1. Users submit transactions to our platform.
  2. Validators process these transactions and generate blocks, consistent with the solo-chain model of Substrate, via the BABE protocol.
  3. Checkpoints are established after every N blocks, termed a batch.
  4. We will implement an algorithm to decide which validator is responsible for a given batch.
  5. The validator selected is tasked with generating the ZK proof for the entire batch's transactions.
  6. This ZK proof, along with the transactions and related data, is submitted to the Avail Network, akin to a conventional ZK roll-up.
  7. Validators cast votes regarding the state proofs after they are incorporated by Avail.
  8. Upon a 2/3 majority verification by the validators, the blocks tied to the proof receive a finalized status, a variation of the GRANDPA consensus.

Substrate POV Rollup Workflow:

  1. Users send transactions to our platform.
  2. These transactions are processed by validators who then generate blocks in accordance with the BABE mechanism, as per the standard of Substrate’s solo chains.
  3. Every N blocks form a checkpoint, also defined as a batch.
  4. We aim to select a validator for the batch task via a specific checkpoint algorithm.
  5. The validator designated compiles the POV for these blocks.
  6. These blocks, along with their POVs, are submitted to the relay chain. This requires a modification from the existing parachain protocol—leveraging the current parachain's POV generation mechanism and data, but modifying the POV from one block to N blocks.
  7. Validators listen to the relay chain and vote on the state of the receipt once it's included by the relay chain (for more on receipts and their records, please see the Polkadot Wiki).
  8. Should 2/3 of validators agree on the receipt's acceptance by the relay chain, the blocks related to this receipt are then marked as finalized, which is a variant of the GRANDPA protocol.