GithubHelp home page GithubHelp logo

kay404 / zkmega Goto Github PK

View Code? Open in Web Editor NEW

This project forked from patractlabs/zkmega

0.0 0.0 0.0 249 KB

Zero-knowledge Tools for the Polkadot Ecosystem

Home Page: https://patractlabs.github.io/zkmega/

License: Apache License 2.0

Rust 100.00%

zkmega's Introduction

zkMega

zkMega is a zero-knowledge proof tool set building for the Polkadot ecology.

ZK Rollup Introduction

Compared with the privacy function, the performance improvement brought by Rollup is the early application direction of zero-knowledge proof. At present, the Layer 2 expansion plan of the blockchain is to transfer a considerable part of the on-chain workload to off-chain to complete, and the most watched one is ZK Rollup. The essence of ZK Rollup is to compress the application on-chain state and store it in a Merkle tree, and move the state transition funtions to off-chain. At the same time, the correctness of the off-chain state transition process is guaranteed through the proof of zkSNARK. Compared with the high cost of directly processing state changes on the chain, the ZK Proof's on-chain smart contract verification is extremely cost low. At the same time, the compressed information will also be submitted to the chain together with the proof, which ensures data availability and obtains the same level of security as Layer 1.

The Ethereum Layer 2 protocols related to ZK Rollup are: zkSync, aztec, etc. Their contract verification modules share a part of the elliptic curve's basic algorithms. In 2017, Ethereum integrated three basic cryptographic calculation units of the alt bn128 curve in the form of pre-compiled contracts, which are EIP196’s ADD and Scalar_MUL algorithms, and EIP197’s Pairing algorithm. On top of this, due to the lack of rapid upgrade capabilities of Ethereum, the community can only encapsulate some tool libraries through costly Solidity contracts. On top of these basic contract libraries, many DApps can combine ZK Rollup technology to achieve some innovations, such as loopring, gitcoin and uniswap etc. However, in the past 3 years, ZK technology has further developed, such as the more practical BLS curve, and PLONK algorithm etc. Ethereum has not yet supported it.

Summary of zkMega's plan

  • v0.1: Provide on-chain support for elliptic curve alt_bn128 、 bls12_381 、 BLS12-377 and BW6_761

    • Integrate addition (ADD), scalar multiplication (MUL) and Pairing functions of the curves in Native layer and Runtime WASM layer.
    • Provide these three functions to the upper Runtime Pallets and Contracts to call.
    • In the Runtime layer and the Ink! contract layer, provide two zkSNARK Verify upper-layer interfaces ( verification function of groth16, similar to the Verifier library of ethsnarks).
    • Start the Metis project and implement EdDSA, MerkleTree, MiMC Hash, etc. contract library on the Ink! contract layer.
  • v0.2: Provide off-chain toolbox support for Ink! contract

    • ZoPatract_core integrates arkworks-g16、arkworks-bls12_381、arkworks-bn254
    • Implement CLI command for the whole phase of Zksnarks agreement (Zopatract_cli)
    • The Ink smart contract template ink_verifier.rs that implements the verifier function is connected to Zopatract_cli's export-verifier.
    • Modify the Zopatract JavaScript toolkit
    • Test CLI's use of Arkworks groth16 algorithm and curve Bls12_381 and Bn254 curve package
    • Test CLI on compile, setup, compute-witness, generate-proof, export-verifier commands in ink! smart contract environments.
  • v0.3: Create a sample payment DApp based on Megaclite

Current Development Progress

At present, we have completed the 0.2 version development.

You Can view:

LICENSE

Apache-2.0

zkmega's People

Contributors

clearloop avatar zk616153275 avatar koushiro avatar kay404 avatar yuelipeng avatar atenjin avatar toxotguo avatar tylerztl avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.