Read the website for more info.
Based on NZCP.circom
The circuit takes in the following private inputs:
toBeSigned
- theToBeSigned
value of NZ COVID Pass as per https://datatracker.ietf.org/doc/html/rfc8152#section-4.4toBeSignedLen
- the length oftoBeSigned
data
- 20 bytes of pass-through data
The circuit outputs the following public inputs:
nullifierHashPart
- the blinded sha512 hash of the credential subject of the NZ COVID Pass. That is your given name, family name and date of birth delimited by comma. The blinding is done by taking 256 bits of the 512 bit hash, therefore one blinded hash can represent 2256 identities.toBeSignedSha256
- the SHA256 hash of thetoBeSigned
value.exp
- the expiry date of the NZ COVID Pass.data
- 20 bytes of pass-through data that is used for the receiving address (MEV protection)
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.
The signature is verified in the solidity contract.
For live passes:
- The length of the
ToBeSigned
value is limited to 351 bytes. - The length of the credential subject string (defined as
${familyName},${givenName},${dob}
) is limited to 64 bytes.
- 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.
- Use
- Run
make test
powersOfTau28_hez_final_21.ptau
from https://github.com/iden3/snarkjs#7-prepare-phase-2 was used to generate the Plonk proving key. Blake2b hash is9aef0573cef4ded9c4a75f148709056bf989f80dad96876aadeb6f1c6d062391f07a394a9e756d16f7eb233198d5b69407cca44594c763ab4a5b67ae73254678
nzcp_example_final.zkey
b2sum is0a1979ca92cc7bcd608b0a5eb7d5252959ab17ffa69758dab8f17a44a83e842d61aa5709bde426215beca4296d7f1ddb86aadd66708717f484ce7295c8f8250c
nzcp_live_final.zkey
b2sum isedab1c7534d26b495ac0ac779b4fa9f2c75bc89fe9c38ed0a2767b0c390d7bd53594e27a3e106696c6186e82c27e6683f87fbe58d38f1190990971fea37d173f
The key was generated using the plonk_example
and plonk_live
tasks in Makefile.
MIT License