-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add groth16 verification for zkid transaction signatures #11772
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments, LGTM overall. Should probably be reviewed by someone more involved with the JWK consensus work
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #11772 +/- ##
=========================================
- Coverage 71.3% 71.2% -0.1%
=========================================
Files 792 794 +2
Lines 182415 182760 +345
=========================================
+ Hits 130076 130212 +136
- Misses 52339 52548 +209 ☔ View full report in Codecov by Sentry. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
Description
This adds the ability to verify groth16 proofs as an option to authenticate transactions. This builds on #11681 and implements the privacy-preserving path based on Groth16 ZKPs.
SignedGroth16Zkp
Signature size
Groth16Zkp.a
-> 32 bytesGroth16Zkp.b
-> 64 bytesGroth16Zkp.c
-> 32 bytesGroth16Zkp = ~ 128 bytes
SignedGroth16Zkp.proof
-> 128 bytesSignedGroth16Zkp.non_malleability_signature
-> 66 bytes (when Ed25519 is used, schemes in the future could differ)SignedGroth16Zkp = ~ 194 bytes
ZkIdSignature.sig
-> 1 bytes (enum) + ~ 194 bytesZkIdSignature.jwt_header
-> ~ 100 bytesZkIdSignature.exp_timestamp_secs
-> 8 bytes (u64)ZkIdSignature.ephemeral_pubkey
-> 34 bytes (when Ed25519 is used but up to 93 bytes)ZkIdSignature.ephemeral_signature
-> 66 bytes (when Ed25519 is used, schemes in the future could differ)ZkIdSignature= ~ 403 bytes
ZkIdPublicKey.iss
-> ~27 bytes (google)ZkIdPublicKey.idc
-> ~32 byteZkIdPublicKey= ~ 59 bytes
Total Size Estimate
Total for ZkId Groth16 Authenticator = ~462
Signature verification
To verify an SignedGroth16Zkp with a ZkIdSignature, the following checks must pass
ZkIdSignature.exp_timestamp_secs
<now
(the current time on-chain at validation time)ZkIdSignature.jwt_header
and construct the public_inputs_hash from the JWK, ZkIdSignature, and ZkIdPublicKey. Verify that SignedGroth16Zkp.proof is a valid proof with the public_inputs_hash and corresponding verification key.Todos after circuit finalization
Test Plan
Smoke tested and unit tested