Skip to content

Commit

Permalink
Circuits with different tree sizes for the trusted setup ceremony
Browse files Browse the repository at this point in the history
  • Loading branch information
OBrezhniev committed Jul 25, 2024
1 parent f97118a commit a206acb
Show file tree
Hide file tree
Showing 13 changed files with 136 additions and 4 deletions.
16 changes: 16 additions & 0 deletions circuits/authV3-16-32.circom
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions circuits/authV3-8-16.circom
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions circuits/authV3-8-32.circom
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion circuits/authV3.circom
Original file line number Diff line number Diff line change
Expand Up @@ -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
27 changes: 27 additions & 0 deletions circuits/credentialAtomicQueryV3-16-16-64.circom
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion circuits/credentialAtomicQueryV3.circom
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ component main{public [requestID,
proofType,
verifierID,
nullifierSessionID
]} = credentialAtomicQueryV3OffChain(40, 32, 64);
]} = credentialAtomicQueryV3OffChain(40, 32, 64); // issuerLevels, claimLevels, maxValueArraySize
21 changes: 21 additions & 0 deletions circuits/credentialAtomicQueryV3OnChain-16-16-64-16-16.circom
Original file line number Diff line number Diff line change
@@ -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
21 changes: 21 additions & 0 deletions circuits/credentialAtomicQueryV3OnChain-16-16-64-16-32.circom
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion circuits/credentialAtomicQueryV3OnChain.circom
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions circuits/linkedMultiQuery10-16-64.circom
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pragma circom 2.1.1;

include "linked/multiQuery.circom";

component main = LinkedMultiQuery(10, 16, 64); // N, claimLevels, maxValueArraySize
2 changes: 1 addition & 1 deletion circuits/linkedMultiQuery10.circom
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions circuits/linkedMultiQuery3-16-64.circom
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pragma circom 2.1.1;

include "linked/multiQuery.circom";

component main = LinkedMultiQuery(3, 16, 64); // N, claimLevels, maxValueArraySize
5 changes: 5 additions & 0 deletions circuits/linkedMultiQuery3.circom
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pragma circom 2.1.1;

include "linked/multiQuery.circom";

component main = LinkedMultiQuery(3, 32, 64); // N, claimLevels, maxValueArraySize

0 comments on commit a206acb

Please sign in to comment.