Giter VIP home page Giter VIP logo

hydra-s2-zkps's Introduction


Logo

Hydra-S2 ZKPS

Hydra-S2 Zero-Knowledge Proving Scheme

Made by Sismo

Hydra-S2 is an upgrade of the Hydra-S1 Zero-Knowledge Proving Scheme. The major update concerns the addition of the notion of a vault Identifier (vaultId) used in Sismo Connect.

Additionally, while Hydra-S1 only generates ZK Proofs from a Merkle tree storing groups of accounts with values (e.g group of ENS DAO voters where the account value is the number of votes), Hydra-S2 has a more modular approach. It is possible to only verify specific elements such as the Proof of Ownerships, the vaultId or only the inclusion of a specific account in a group for example.

Therefore, Hydra-S2 enables users to generate ZK proofs for the following statements:

  • Ownerships (optional): They own two accounts, a source account and a destination account. (the two are optional, it is possible to only verify the ownership of a single account, or neither of the two)
  • Account inclusion (optional): Their source account is part of a group (we can choose to not check the Merkle proof)
  • Account value (optional): Their source account holds a specific value
  • Vault Identifier Generation (optional): The vaultIdentifier is generated deterministically from the vault secret and vaultNamespace (an appId), and can be stored by apps to identify the owner of a specific vault for a specific application.
  • Proof Identifier Generation (optional): The proofIdentifier is generated deterministically from the source account and a requestIdentifier. Proof verifiers can store it to ensure that only one ZK proof per account per requestIdentifier is accepted. A request identifier is deterministically generated from an appId, a groupId, a groupTimestamp and a namespace.

You can see additional details in the Hydra-S2 documentation.

Circuits and Package

Hydra-S2 Proving Scheme was developed using circom and snarkjs. This repo contains the circuits.

It outputs an off-chain prover and verifiers (both on-chain and off-chain).

Theses implementations of prover and verifiers are in the @sismo-core/hydra-s2 npm package.

$ yarn add @sismo-core/hydra-s2

Installation

  • Install Circom2 (rust version)
  • Build
$ yarn build

Test

$ yarn test 
$ test:circuits
$ test:verifier-js
$ test:verifier-contract
$ test:prover-js

License

Distributed under the MIT License.

Contribute

Please, feel free to open issues, PRs or simply provide feedback!

Contact

Prefer Discord or Twitter


bottom

hydra-s2-zkps's People

Contributors

adamschinzel avatar leosayous21 avatar yum0e 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.