Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skunkworks Project Suggestion: Exploring ways to integrate ZKPs(Zero-knowledge proof) into scroll technology aiming to reduce gas fee and transaction cost, increasing throughput while maintaining strong privacy guarantee #1921

Open
raonick5 opened this issue Apr 14, 2024 · 0 comments

Comments

@raonick5
Copy link

Name of the project

Exploring ways to integrate Zkps

Project abstract

This skunkworks project proposes the exploration and implementation of zero-knowledge proofs (ZKPs) within Layer 2 blockchain solutions to address scalability and privacy challenges. The project aims to leverage ZKPs to develop a novel scaling solution that enhances transaction throughput while preserving user privacy on the blockchain. By integrating ZKPs into existing Layer 2 frameworks, the project seeks to achieve efficient transaction processing without compromising data confidentiality. The initiative will involve research, design, and prototyping phases to assess the feasibility and effectiveness of ZKP integration within Layer 2 architectures. Ultimately, the project endeavors to advance the scalability and privacy capabilities of Layer 2 blockchain networks, paving the way for broader adoption and improved user experiences in decentralized applications and digital asset transactions.

Specification

integrating ZK snarks
this an example using libsnark library in C++
#include <libsnark/gadgetlib1/gadget.hpp>
#include <libsnark/gadgetlib1/protoboard.hpp>
#include <libsnark/gadgetlib1/gadgets/hashes/sha256/sha256_gadget.hpp>

using namespace libsnark;

// Define a simple circuit for demonstrating zk-SNARKs
void zkSNARKDemoCircuit() {
// Create a protoboard
protoboard pb;

// Define input variables
pb_variable input_variable;
pb_variable output_variable;

// Allocate input variables
input_variable.allocate(pb, "input");
output_variable.allocate(pb, "output");

// Define constraints: output = SHA256(input)
sha256_two_to_one_hash_gadget hash_gadget(pb, input_variable, SHA256_bits);
hash_gadget.generate_r1cs_constraints();
hash_gadget.generate_r1cs_witness();

// Generate and output a zk-SNARK proof
const r1cs_primary_input primary_input = pb.primary_input();
const r1cs_auxiliary_input auxiliary_input = pb.auxiliary_input();
const r1cs_constraint_system constraint_system = pb.get_constraint_system();
const r1cs_variable_assignment full_variable_assignment = pb.full_variable_assignment();
const r1cs_primary_input primary_input_assignment = pb.primary_input();
const r1cs_auxiliary_input auxiliary_input_assignment = pb.auxiliary_input();
// Generate proof...
// Verify proof...
}

int main() {
zkSNARKDemoCircuit();
return 0;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant