diff --git a/package.json b/package.json index ab1a7ecd6..7d372804f 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,8 @@ "circom" ], "workspaces": [ - "packages/*" + "packages/*", + "packages/circuits/templates" ], "packageManager": "yarn@3.2.1", "devDependencies": { diff --git a/packages/circuits/LICENSE b/packages/circuits/LICENSE new file mode 120000 index 000000000..8e505bcde --- /dev/null +++ b/packages/circuits/LICENSE @@ -0,0 +1 @@ +templates/LICENSE \ No newline at end of file diff --git a/packages/circuits/README.md b/packages/circuits/README.md new file mode 120000 index 000000000..6cb99675b --- /dev/null +++ b/packages/circuits/README.md @@ -0,0 +1 @@ +templates/README.md \ No newline at end of file diff --git a/packages/circuits/binary-merkle-root.r1cs b/packages/circuits/binary-merkle-root.r1cs new file mode 100644 index 000000000..e241bbaf2 Binary files /dev/null and b/packages/circuits/binary-merkle-root.r1cs differ diff --git a/packages/circuits/components/binary-merkle-root.circom b/packages/circuits/components/binary-merkle-root.circom new file mode 100644 index 000000000..7f59cddd4 --- /dev/null +++ b/packages/circuits/components/binary-merkle-root.circom @@ -0,0 +1,5 @@ +pragma circom 2.1.5; + +include "../templates/binary-merkle-root.circom"; + +component main {public [depth]} = BinaryMerkleRoot(16); diff --git a/packages/circuits/components/poseidon-proof.circom b/packages/circuits/components/poseidon-proof.circom new file mode 100644 index 000000000..4b45a3c87 --- /dev/null +++ b/packages/circuits/components/poseidon-proof.circom @@ -0,0 +1,5 @@ +pragma circom 2.1.5; + +include "../templates/poseidon-proof.circom"; + +component main {public [scope]} = PoseidonProof(); diff --git a/packages/circuits/package.json b/packages/circuits/package.json new file mode 100644 index 000000000..1b913981c --- /dev/null +++ b/packages/circuits/package.json @@ -0,0 +1,9 @@ +{ + "name": "circuits", + "private": true, + "description": "A comprehensive library of general-purpose Circom circuits.", + "license": "MIT", + "scripts": { + "compile": "circom --r1cs -l ../../node_modules/circomlib/circuits" + } +} diff --git a/packages/circuits/poseidon-proof.r1cs b/packages/circuits/poseidon-proof.r1cs new file mode 100644 index 000000000..b8dd55104 Binary files /dev/null and b/packages/circuits/poseidon-proof.r1cs differ diff --git a/packages/circuits/templates/LICENSE b/packages/circuits/templates/LICENSE new file mode 100644 index 000000000..4377091ec --- /dev/null +++ b/packages/circuits/templates/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Ethereum Foundation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/circuits/templates/README.md b/packages/circuits/templates/README.md new file mode 100644 index 000000000..f8980fab3 --- /dev/null +++ b/packages/circuits/templates/README.md @@ -0,0 +1,50 @@ +
+
A comprehensive library of general-purpose Circom circuits.
+ + ++ + + + + + + + + + + + + + + +
+ +