Coder Social home page Coder Social logo

hyperledger-labs / z-mix Goto Github PK

View Code? Open in Web Editor NEW
14.0 11.0 8.0 209 KB

z-mix will offer a generic way to create Zero-Knowledge proofs, proving statements about multiple cryptographic building blocks, containing signatures, commitments, and verifiable encryption.

License: Apache License 2.0

Rust 100.00%

z-mix's Introduction

Lab Name

z-mix

Short Description

z-mix will offer a generic way to create Zero-Knowledge proofs, proving statements about multiple cryptographic building blocks, containing signatures, commitments, and verifiable encryption. z-mix facilitates

Scope of Lab

The goal of z-mix is to become a part of Hyperledger crypto-lib, and eventually be adopted by Hyperledger projects. Multiple existing Hyperledger projects require Zero-Knowledge proofs, e.g., Fabric and Indy. The goal of this library is to provide a single flexible and secure implementation to construct such proofs. z-mix is a C callable library but there are also convenience wrappers for various programming languages.

Initial Committers

  • Manu Drijvers (manudrijvers)
  • Jan Camenisch (jancamenisch)
  • Nathan George (nage)
  • Daniel Hardman (dhh1128)
  • Angelo De Caro (adecaro)
  • Maria Dubovitskaya (dubovitskaya)
  • Jason Law (jasonalaw)
  • Michael Lodder (mikelodder7)
  • Lovesh Harchandani (lovesh)

Sponsors

  • Nathan George
  • Hart Montgomery

Spec

z-mix uses JSON objects to provide a zero knowledge language (ZKL) to express

  • Requests of attested attribute values
  • Resolutions for requests that can be validated
  • Proofs that satisfy requests

Process

z-mix translates a ZKL-ProofSpec and a corresponding ZKL-Witness, both represented as JSON objects, into a ZKL-Proof JSON object.

The ZKL-ProofSpec defines the statement to be proven and contains all public information needed by a verifier [e.g., Credential Definitions, Revocation Authority, Pseudonyms].

The ZKL-Witness contains the secrets required to compute a proof [e.g. secret keys, all attribute values, the credentials involved, the randomness used to compute a pseudonym].

The ZKL Proof is the data that satisfies the statement to be proven.

Examples

z-mix is written in Rust. z-mix can be included into other Rust projects by adding the following to the Cargo.toml:

z_mix = { version = "0.1", git = "https://github.com/hyperledger-labs/z-mix.git" }

An example how to use in your rust project

extern crate z_mix;

use z_mix::zkl::{Parser, ProofSpecBuilder, WitnessBuilder};

fn main() {
    let mut proof_spec_builder = ProofSpecBuilder::new();

    // Add proof spec data

    let mut witness_builder = WitnessBuilder::new();

    // Add witness data

    let proof_spec = proof_spec_builder.finish();
    let witness = witness_builder.finish();

    match Parser::parse(&proof_spec, &witness) {
        Ok(proof) => {
            match proof.verify(&proof_spec) {
                Ok(v) => println!("Proof result - {}", v),
                Err(pe) => panic!("Proof::verify encountered an error - {:?}", pe)
            }
        },
        Err(e) => panic!("Parser::parse encountered an error - {:?}", e)
    };
}

z-mix's People

Contributors

lovesh avatar mikelodder7 avatar tkuhrt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

z-mix's Issues

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.