This repository contains simplified implementations of a Blockchain, Merkle Tree, Zk-SNARK, and Zk-Rollup.
Simplified implementations use Vec<u8> for all data and variables to keep things straightforward. Here's what we've got:
Our zksnark module includes:
ProvingKeystructVerificationKeystructcreate_proof()functionverify_proof()function
The merkle_tree module provides:
MerkleTreestruct- Root calculation
- Leaf inclusion verification
The ZkRollupTransaction struct includes:
inputs,outputs,public_inputs,snark_proof, andsnark_inputfieldsnew()function for generationverify()function for verification
Our Blockchain struct offers:
- Storage of
ZkRollupTransactions in a HashMap new()function for creating a new blockchain instanceadd_transactionmethod for adding new transactions
This project is licensed under the MIT License - see the LICENSE.md file for details.