This repo contains a toy model of Zeropool's Sharded Storage solution. A public instance of this toy model is currently running on https://storage.zeropool.network/.
The toy model consists of the following components:
- Smart-contract,
./smart-contracts/
. Holds the hash of current state and verifies zkSNARK transactions. - Sequencer,
./sequencer/
. Batches transactions together, generates zkSNARK proofs for the contract. - Client node
./client-app/
. Runs in the browser of each client, sends sequencer the transactions to manage accounts and files, move balances and upload new files. - Storage node
./storage-node/
. Stores the contents of client's files, continuously mines on the stored data and collects mining rewards.
Directory ./circuits/
contains the code of zkSNARK circuit in Noir,
while ./crypto-sdk/
, ./poseidon2-bn256/
and ./common/
are modules shared by the components above.
The toy model is limited in scope and intentionally makes a few simplifying assumptions compared to the Sharded Storage Proposal.
The core concept this toy example demonstrates is
storing the transactions of Sharded Storage rollup inside Sharded Storage itself.
Each time the rollup (sequencer) applies a block of transactions
In other words, the rollup convinces the smart-contract that the transaction was done correctly and that the transaction data is safely stored using a single zkSNARK proof.
Coordinating multiple storage nodes is out of the scope of this toy model. We run only one storage node that always stays online and centrally keeps the data of all clients, and do not implement fault-tolerance or deduplication protection (plotting).