Giter VIP home page Giter VIP logo

nzcp-circom's Introduction

NZCP.circom

ZK proof of NZ COVID Pass identity written in Circom.

This circuit allows to prove that a unique identity is part of an NZ COVID Pass without revealing that identity.

How it works

The circuit takes in the following private inputs:

The circuit outputs the following public inputs:

  • credSubjSha256 - the SHA256 hash of the credential subject of the NZ COVID Pass. That is your given name, family name and date of birth delimited by comma.
  • toBeSignedSha256 - the SHA256 hash of the toBeSigned value.
  • exp - the expiry date of the NZ COVID Pass.

NZ COVID Pass verification

The circuit does not verify the signature of the NZ COVID Pass. It merely proves that an identity is associated with the NZ COVID Pass, be it signed or unsigned. The user may not be in a possession of a valid signature for the ToBeSigned value that is provided.

While it is theoretically possbile to verify the signature (using a circuit similar to circom-ecdsa for NIST P-256 curves), it is outside the scope of this project.

Limitations

For live passes:

  • The length of the ToBeSigned value is limited to 355 bytes.
  • The length of the credential subject string (defined as ${familyName},${givenName},${dob}) is limited to 64 bytes.

Tests

  • Create .env file in the root directory of the project
  • Populate it with at least 1 live pass URI.
    • Use .env.example as a reference.
  • Run make test

Usage

See the test/nzcp.js file for usage examples.

nzcp-circom's People

Contributors

noway avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

cyberflamego

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.