From a206acb2c1e1a38a795132a6758819dbd53ae898 Mon Sep 17 00:00:00 2001 From: Oleksandr Brezhniev Date: Thu, 25 Jul 2024 10:35:21 +0100 Subject: [PATCH] Circuits with different tree sizes for the trusted setup ceremony --- circuits/authV3-16-32.circom | 16 +++++++++++ circuits/authV3-8-16.circom | 16 +++++++++++ circuits/authV3-8-32.circom | 16 +++++++++++ circuits/authV3.circom | 2 +- .../credentialAtomicQueryV3-16-16-64.circom | 27 +++++++++++++++++++ circuits/credentialAtomicQueryV3.circom | 2 +- ...AtomicQueryV3OnChain-16-16-64-16-16.circom | 21 +++++++++++++++ ...AtomicQueryV3OnChain-16-16-64-16-32.circom | 21 +++++++++++++++ .../credentialAtomicQueryV3OnChain.circom | 2 +- circuits/linkedMultiQuery10-16-64.circom | 5 ++++ circuits/linkedMultiQuery10.circom | 2 +- circuits/linkedMultiQuery3-16-64.circom | 5 ++++ circuits/linkedMultiQuery3.circom | 5 ++++ 13 files changed, 136 insertions(+), 4 deletions(-) create mode 100644 circuits/authV3-16-32.circom create mode 100644 circuits/authV3-8-16.circom create mode 100644 circuits/authV3-8-32.circom create mode 100644 circuits/credentialAtomicQueryV3-16-16-64.circom create mode 100644 circuits/credentialAtomicQueryV3OnChain-16-16-64-16-16.circom create mode 100644 circuits/credentialAtomicQueryV3OnChain-16-16-64-16-32.circom create mode 100644 circuits/linkedMultiQuery10-16-64.circom create mode 100644 circuits/linkedMultiQuery3-16-64.circom create mode 100644 circuits/linkedMultiQuery3.circom diff --git a/circuits/authV3-16-32.circom b/circuits/authV3-16-32.circom new file mode 100644 index 00000000..7037d473 --- /dev/null +++ b/circuits/authV3-16-32.circom @@ -0,0 +1,16 @@ +pragma circom 2.1.1; + +include "auth/authV3.circom"; + +/* +* The identity authorization circuit. +* User ownership of the identity verified by signed challenge. +* Auth claim should be in the user state and not revoked. +* User state should be genesis or added to the global state tree (available in the smart contract). +* The state is verified out of circuits by a verifier. +* public signals: + - userID + - challenge + - gistRoot +*/ +component main {public [challenge, gistRoot]} = AuthV3(16, 32); // IdOwnershipLevels, onChainLevels diff --git a/circuits/authV3-8-16.circom b/circuits/authV3-8-16.circom new file mode 100644 index 00000000..83839af6 --- /dev/null +++ b/circuits/authV3-8-16.circom @@ -0,0 +1,16 @@ +pragma circom 2.1.1; + +include "auth/authV3.circom"; + +/* +* The identity authorization circuit. +* User ownership of the identity verified by signed challenge. +* Auth claim should be in the user state and not revoked. +* User state should be genesis or added to the global state tree (available in the smart contract). +* The state is verified out of circuits by a verifier. +* public signals: + - userID + - challenge + - gistRoot +*/ +component main {public [challenge, gistRoot]} = AuthV3(8, 16); // IdOwnershipLevels, onChainLevels diff --git a/circuits/authV3-8-32.circom b/circuits/authV3-8-32.circom new file mode 100644 index 00000000..c8e46482 --- /dev/null +++ b/circuits/authV3-8-32.circom @@ -0,0 +1,16 @@ +pragma circom 2.1.1; + +include "auth/authV3.circom"; + +/* +* The identity authorization circuit. +* User ownership of the identity verified by signed challenge. +* Auth claim should be in the user state and not revoked. +* User state should be genesis or added to the global state tree (available in the smart contract). +* The state is verified out of circuits by a verifier. +* public signals: + - userID + - challenge + - gistRoot +*/ +component main {public [challenge, gistRoot]} = AuthV3(8, 32); // IdOwnershipLevels, onChainLevels diff --git a/circuits/authV3.circom b/circuits/authV3.circom index 7306d271..db8c04fb 100644 --- a/circuits/authV3.circom +++ b/circuits/authV3.circom @@ -13,4 +13,4 @@ include "auth/authV3.circom"; - challenge - gistRoot */ -component main {public [challenge, gistRoot]} = AuthV3(40, 64); +component main {public [challenge, gistRoot]} = AuthV3(40, 64); // IdOwnershipLevels, onChainLevels diff --git a/circuits/credentialAtomicQueryV3-16-16-64.circom b/circuits/credentialAtomicQueryV3-16-16-64.circom new file mode 100644 index 00000000..6e993739 --- /dev/null +++ b/circuits/credentialAtomicQueryV3-16-16-64.circom @@ -0,0 +1,27 @@ +pragma circom 2.1.1; + +include "offchain/credentialAtomicQueryV3OffChain.circom"; + +/* + public output signals: + userID - user profile id + merklized - `1` if claim is merklized + issuerState - equals to issuerAuthState for sig, and to issuerClaimIdenState for mtp + nullifier - sybil resistant user identifier for session id + linkID - linked proof identifier +*/ +component main{public [requestID, + issuerID, + issuerClaimNonRevState, + claimSchema, + slotIndex, + claimPathKey, + operator, + value, + valueArraySize, + timestamp, + isRevocationChecked, + proofType, + verifierID, + nullifierSessionID + ]} = credentialAtomicQueryV3OffChain(16, 16, 64); // issuerLevels, claimLevels, maxValueArraySize diff --git a/circuits/credentialAtomicQueryV3.circom b/circuits/credentialAtomicQueryV3.circom index 4436e315..c4e2c3d2 100644 --- a/circuits/credentialAtomicQueryV3.circom +++ b/circuits/credentialAtomicQueryV3.circom @@ -24,4 +24,4 @@ component main{public [requestID, proofType, verifierID, nullifierSessionID - ]} = credentialAtomicQueryV3OffChain(40, 32, 64); + ]} = credentialAtomicQueryV3OffChain(40, 32, 64); // issuerLevels, claimLevels, maxValueArraySize diff --git a/circuits/credentialAtomicQueryV3OnChain-16-16-64-16-16.circom b/circuits/credentialAtomicQueryV3OnChain-16-16-64-16-16.circom new file mode 100644 index 00000000..9bcc78b0 --- /dev/null +++ b/circuits/credentialAtomicQueryV3OnChain-16-16-64-16-16.circom @@ -0,0 +1,21 @@ +pragma circom 2.1.1; + +include "./onchain/credentialAtomicQueryV3OnChain.circom"; + +/* + public output signals: + userID - user profile id + merklized - `1` if claim is merklized + issuerState - equals to issuerAuthState for sig, and to issuerClaimIdenState for mtp + nullifier - sybil resistant user identifier for session id + linkID - linked proof identifier +*/ +component main{public [requestID, + issuerID, + issuerClaimNonRevState, + timestamp, + challenge, + gistRoot, + proofType, + isBJJAuthEnabled + ]} = credentialAtomicQueryV3OnChain(16, 16, 64, 16, 16); // issuerLevels, claimLevels, maxValueArraySize, idOwnershipLevels, onChainLevels diff --git a/circuits/credentialAtomicQueryV3OnChain-16-16-64-16-32.circom b/circuits/credentialAtomicQueryV3OnChain-16-16-64-16-32.circom new file mode 100644 index 00000000..fda8fcae --- /dev/null +++ b/circuits/credentialAtomicQueryV3OnChain-16-16-64-16-32.circom @@ -0,0 +1,21 @@ +pragma circom 2.1.1; + +include "./onchain/credentialAtomicQueryV3OnChain.circom"; + +/* + public output signals: + userID - user profile id + merklized - `1` if claim is merklized + issuerState - equals to issuerAuthState for sig, and to issuerClaimIdenState for mtp + nullifier - sybil resistant user identifier for session id + linkID - linked proof identifier +*/ +component main{public [requestID, + issuerID, + issuerClaimNonRevState, + timestamp, + challenge, + gistRoot, + proofType, + isBJJAuthEnabled + ]} = credentialAtomicQueryV3OnChain(16, 16, 64, 16, 32); // issuerLevels, claimLevels, maxValueArraySize, idOwnershipLevels, onChainLevels diff --git a/circuits/credentialAtomicQueryV3OnChain.circom b/circuits/credentialAtomicQueryV3OnChain.circom index 9e56936d..e01ca4ef 100644 --- a/circuits/credentialAtomicQueryV3OnChain.circom +++ b/circuits/credentialAtomicQueryV3OnChain.circom @@ -18,4 +18,4 @@ component main{public [requestID, gistRoot, proofType, isBJJAuthEnabled - ]} = credentialAtomicQueryV3OnChain(40, 32, 64, 40, 64); + ]} = credentialAtomicQueryV3OnChain(40, 32, 64, 40, 64); // issuerLevels, claimLevels, maxValueArraySize, idOwnershipLevels, onChainLevels diff --git a/circuits/linkedMultiQuery10-16-64.circom b/circuits/linkedMultiQuery10-16-64.circom new file mode 100644 index 00000000..65911917 --- /dev/null +++ b/circuits/linkedMultiQuery10-16-64.circom @@ -0,0 +1,5 @@ +pragma circom 2.1.1; + +include "linked/multiQuery.circom"; + +component main = LinkedMultiQuery(10, 16, 64); // N, claimLevels, maxValueArraySize diff --git a/circuits/linkedMultiQuery10.circom b/circuits/linkedMultiQuery10.circom index 8b3d4c3a..e5aa0119 100644 --- a/circuits/linkedMultiQuery10.circom +++ b/circuits/linkedMultiQuery10.circom @@ -2,4 +2,4 @@ pragma circom 2.1.1; include "linked/multiQuery.circom"; -component main = LinkedMultiQuery(10, 32, 64); // 175331 constraints +component main = LinkedMultiQuery(10, 32, 64); // N, claimLevels, maxValueArraySize diff --git a/circuits/linkedMultiQuery3-16-64.circom b/circuits/linkedMultiQuery3-16-64.circom new file mode 100644 index 00000000..c1665dc2 --- /dev/null +++ b/circuits/linkedMultiQuery3-16-64.circom @@ -0,0 +1,5 @@ +pragma circom 2.1.1; + +include "linked/multiQuery.circom"; + +component main = LinkedMultiQuery(3, 16, 64); // N, claimLevels, maxValueArraySize diff --git a/circuits/linkedMultiQuery3.circom b/circuits/linkedMultiQuery3.circom new file mode 100644 index 00000000..d5eef3fd --- /dev/null +++ b/circuits/linkedMultiQuery3.circom @@ -0,0 +1,5 @@ +pragma circom 2.1.1; + +include "linked/multiQuery.circom"; + +component main = LinkedMultiQuery(3, 32, 64); // N, claimLevels, maxValueArraySize