@clearproof/contracts 0.7.1 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,7 +22,38 @@ contract PilotGroth16Verifier {
22
22
  uint256[2][PILOT_SIGNAL_COUNT + 1] ic;
23
23
  }
24
24
 
25
- VerificationKey private _key;
25
+ uint256 private immutable _alphaX;
26
+ uint256 private immutable _alphaY;
27
+ uint256 private immutable _betaX0;
28
+ uint256 private immutable _betaX1;
29
+ uint256 private immutable _betaY0;
30
+ uint256 private immutable _betaY1;
31
+ uint256 private immutable _gammaX0;
32
+ uint256 private immutable _gammaX1;
33
+ uint256 private immutable _gammaY0;
34
+ uint256 private immutable _gammaY1;
35
+ uint256 private immutable _deltaX0;
36
+ uint256 private immutable _deltaX1;
37
+ uint256 private immutable _deltaY0;
38
+ uint256 private immutable _deltaY1;
39
+ uint256 private immutable _ic0X;
40
+ uint256 private immutable _ic0Y;
41
+ uint256 private immutable _ic1X;
42
+ uint256 private immutable _ic1Y;
43
+ uint256 private immutable _ic2X;
44
+ uint256 private immutable _ic2Y;
45
+ uint256 private immutable _ic3X;
46
+ uint256 private immutable _ic3Y;
47
+ uint256 private immutable _ic4X;
48
+ uint256 private immutable _ic4Y;
49
+ uint256 private immutable _ic5X;
50
+ uint256 private immutable _ic5Y;
51
+ uint256 private immutable _ic6X;
52
+ uint256 private immutable _ic6Y;
53
+ uint256 private immutable _ic7X;
54
+ uint256 private immutable _ic7Y;
55
+ uint256 private immutable _ic8X;
56
+ uint256 private immutable _ic8Y;
26
57
  bytes32 public immutable verificationKeyCommitment;
27
58
  bytes32 public immutable artifactManifestDigest;
28
59
  string public constant proofProfile = P.PROFILE;
@@ -39,7 +70,38 @@ contract PilotGroth16Verifier {
39
70
  _validateG2(key.beta);
40
71
  _validateG2(key.gamma);
41
72
  _validateG2(key.delta);
42
- _key = key;
73
+ _alphaX = key.alpha[0];
74
+ _alphaY = key.alpha[1];
75
+ _betaX0 = key.beta[0][0];
76
+ _betaX1 = key.beta[0][1];
77
+ _betaY0 = key.beta[1][0];
78
+ _betaY1 = key.beta[1][1];
79
+ _gammaX0 = key.gamma[0][0];
80
+ _gammaX1 = key.gamma[0][1];
81
+ _gammaY0 = key.gamma[1][0];
82
+ _gammaY1 = key.gamma[1][1];
83
+ _deltaX0 = key.delta[0][0];
84
+ _deltaX1 = key.delta[0][1];
85
+ _deltaY0 = key.delta[1][0];
86
+ _deltaY1 = key.delta[1][1];
87
+ _ic0X = key.ic[0][0];
88
+ _ic0Y = key.ic[0][1];
89
+ _ic1X = key.ic[1][0];
90
+ _ic1Y = key.ic[1][1];
91
+ _ic2X = key.ic[2][0];
92
+ _ic2Y = key.ic[2][1];
93
+ _ic3X = key.ic[3][0];
94
+ _ic3Y = key.ic[3][1];
95
+ _ic4X = key.ic[4][0];
96
+ _ic4Y = key.ic[4][1];
97
+ _ic5X = key.ic[5][0];
98
+ _ic5Y = key.ic[5][1];
99
+ _ic6X = key.ic[6][0];
100
+ _ic6Y = key.ic[6][1];
101
+ _ic7X = key.ic[7][0];
102
+ _ic7Y = key.ic[7][1];
103
+ _ic8X = key.ic[8][0];
104
+ _ic8Y = key.ic[8][1];
43
105
  verificationKeyCommitment = keccak256(abi.encode(key));
44
106
  artifactManifestDigest = manifestDigest;
45
107
  }
@@ -72,6 +134,16 @@ contract PilotGroth16Verifier {
72
134
  if (!Pairing.pairing(left, right)) revert InvalidKey();
73
135
  }
74
136
 
137
+ function _acc(
138
+ Pairing.G1Point memory accumulator,
139
+ uint256 x,
140
+ uint256 y,
141
+ uint256 signal
142
+ ) private view returns (Pairing.G1Point memory) {
143
+ if (signal >= R) revert NoncanonicalSignal();
144
+ return Pairing.add(accumulator, Pairing.scalar_mul(Pairing.G1Point(x, y), signal));
145
+ }
146
+
75
147
  /// @dev G2 coordinates use EVM precompile order, the reverse of snarkjs JSON pairs.
76
148
  /// Invalid encodings may revert; false means a well-encoded failed pairing.
77
149
  function verifyProof(
@@ -82,16 +154,24 @@ contract PilotGroth16Verifier {
82
154
  Pairing.G1Point memory pointA = _g1(a);
83
155
  Pairing.G2Point memory pointB = _g2(b);
84
156
  Pairing.G1Point memory pointC = _g1(c);
85
- Pairing.G1Point memory accumulator = _g1(_key.ic[0]);
86
- for (uint256 i; i < P.PILOT_PUBLIC_SIGNAL_COUNT; ++i) {
87
- if (signals[i] >= R) revert NoncanonicalSignal();
88
- accumulator = Pairing.add(accumulator, Pairing.scalar_mul(_g1(_key.ic[i + 1]), signals[i]));
89
- }
157
+ // Constructor validation guarantees all immutable VK coordinates are < Q and on-curve.
158
+ Pairing.G1Point memory accumulator = Pairing.G1Point(_ic0X, _ic0Y);
159
+ accumulator = _acc(accumulator, _ic1X, _ic1Y, signals[0]);
160
+ accumulator = _acc(accumulator, _ic2X, _ic2Y, signals[1]);
161
+ accumulator = _acc(accumulator, _ic3X, _ic3Y, signals[2]);
162
+ accumulator = _acc(accumulator, _ic4X, _ic4Y, signals[3]);
163
+ accumulator = _acc(accumulator, _ic5X, _ic5Y, signals[4]);
164
+ accumulator = _acc(accumulator, _ic6X, _ic6Y, signals[5]);
165
+ accumulator = _acc(accumulator, _ic7X, _ic7Y, signals[6]);
166
+ accumulator = _acc(accumulator, _ic8X, _ic8Y, signals[7]);
90
167
  return Pairing.pairingProd4(
91
168
  Pairing.negate(pointA), pointB,
92
- _g1(_key.alpha), _g2(_key.beta),
93
- accumulator, _g2(_key.gamma),
94
- pointC, _g2(_key.delta)
169
+ Pairing.G1Point(_alphaX, _alphaY),
170
+ Pairing.G2Point([_betaX0, _betaX1], [_betaY0, _betaY1]),
171
+ accumulator,
172
+ Pairing.G2Point([_gammaX0, _gammaX1], [_gammaY0, _gammaY1]),
173
+ pointC,
174
+ Pairing.G2Point([_deltaX0, _deltaX1], [_deltaY0, _deltaY1])
95
175
  );
96
176
  }
97
177
  }
@@ -34,8 +34,15 @@ contract Groth16VerifierBLS {
34
34
  uint256 internal constant Q_HI = 34565483545414906068789196026815425751;
35
35
  uint256 internal constant Q_LO = 45442060874369865957053122457065728162598490762543039060009208264153100167851;
36
36
 
37
+ /// The order r of the scalar field. Public signals must be < r.
38
+ uint256 internal constant SNARK_SCALAR_FIELD = 52435875175126190479447740508185965837690552500527637822603658699938581184513;
39
+
37
40
  uint256 internal constant N_PUBLIC = 16;
38
41
 
42
+ error PublicSignalExceedsScalarField();
43
+ error ProofPointAtInfinity();
44
+ error ProofPointNotCanonical();
45
+
39
46
  // Verification key (EIP-2537 encodings)
40
47
  bytes constant ALPHA = hex"0000000000000000000000000000000007052ac25c8174d68c3ccf74a9a5aa45fcab0a85cbd744e92e49c74b309f6ba1dd514aa40c487d82e67f68312fd59baf000000000000000000000000000000000e47efdfb3aa439ddf7227dbefa230a24305cb3f1e6153363069e1ed0dd2c223ae78834227d6679a0d075304afbd667e";
41
48
  bytes constant BETA = hex"00000000000000000000000000000000176bc78390ab973aee8d3a4f1435ad04909d9329e8925700e23823afecc676f34faa0a9d03278390fcaf75203e5dd22500000000000000000000000000000000199a69c8578edb77cf1b8fdf4615122e9d7e3b8e71bbe06926066a6c3dd733d43ec894a7eef5b360ecc6d90f016b538f00000000000000000000000000000000081ea159928872494adafccaf79137c9d21b17cf95cd661b490b00149e49ac0668248bda8a909293eaeac14335a94c01000000000000000000000000000000000de272f24956ec3fae1e49bd09d379aa5974ebd66127eec1e29ed2a2e46dd04060495521560cb38d501fef7d8fd8999d";
@@ -60,7 +67,7 @@ contract Groth16VerifierBLS {
60
67
  bytes constant IC16 = hex"000000000000000000000000000000000e7d2f3424d49642a3aa383209d3ebf24fc08c9de6830557f8ec19e663f9db8f64205eb5ef79739a508e9991f9b56dd20000000000000000000000000000000008f89dfb735c2e849f234046630ba1f02f3634f39a3f661a9b93fd20782ae744bbbc9d705cd26929c4293fdb992bd548";
61
68
 
62
69
  /// @notice Verify a Groth16 proof over BLS12-381.
63
- /// @param _proof 576-byte proof: pA (G1, 128B) || pB (G2, 256B) || pC (G1, 128B)
70
+ /// @param _proof 512-byte proof: pA (G1, 128B) || pB (G2, 256B) || pC (G1, 128B)
64
71
  /// @param _pubSignals public signals (each < BLS12-381 scalar field r)
65
72
  function verifyProof(
66
73
  bytes calldata _proof,
@@ -68,12 +75,40 @@ contract Groth16VerifierBLS {
68
75
  ) external view returns (bool) {
69
76
  require(_proof.length == 512, "Proof must be 512 bytes (G1 || G2 || G1)");
70
77
  require(_pubSignals.length == N_PUBLIC, "Wrong public signal count");
78
+ for (uint256 i = 0; i < N_PUBLIC; i++) {
79
+ if (_pubSignals[i] >= SNARK_SCALAR_FIELD) revert PublicSignalExceedsScalarField();
80
+ }
81
+ // EIP-2537 encodes infinity as all-zero bytes and the pairing precompile
82
+ // accepts it, so reject it here (ADR 0002 defense in depth).
83
+ if (_isZero(_proof[0:128]) || _isZero(_proof[128:384]) || _isZero(_proof[384:512])) {
84
+ revert ProofPointAtInfinity();
85
+ }
86
+ // The precompiles never see A's original y, only q - y, so check it here.
87
+ if (!_isCanonicalFp(_proof[64:128])) revert ProofPointNotCanonical();
71
88
 
72
89
  bytes memory vkX = _computeVkX(_pubSignals);
73
90
  bytes memory negA = _negateG1(_proof[0:128]);
74
91
  return _pairingCheck(negA, _proof[128:384], vkX, _proof[384:512]);
75
92
  }
76
93
 
94
+ function _isZero(bytes calldata data) internal pure returns (bool zero) {
95
+ assembly {
96
+ let acc := 0
97
+ for { let i := 0 } lt(i, data.length) { i := add(i, 32) } {
98
+ acc := or(acc, calldataload(add(data.offset, i)))
99
+ }
100
+ zero := iszero(acc)
101
+ }
102
+ }
103
+
104
+ /// @dev True if a 64-byte EIP-2537 Fp limb encodes a value < q.
105
+ function _isCanonicalFp(bytes calldata limb) internal pure returns (bool) {
106
+ uint256 hi = uint256(bytes32(limb[0:32]));
107
+ uint256 lo = uint256(bytes32(limb[32:64]));
108
+ if (hi != Q_HI) return hi < Q_HI;
109
+ return lo < Q_LO;
110
+ }
111
+
77
112
  /// @dev vk_x = IC0 + sum(pubSignals[i] * IC[i+1]) via the G1MSM precompile.
78
113
  function _computeVkX(uint256[] calldata _pubSignals) internal view returns (bytes memory vkX) {
79
114
  bytes memory msmInput = bytes.concat(
package/package.json CHANGED
@@ -1,12 +1,18 @@
1
1
  {
2
2
  "name": "@clearproof/contracts",
3
- "version": "0.7.1",
4
- "description": "On-chain Groth16 verifier for clearproof compliance proofs",
3
+ "version": "0.8.0",
4
+ "description": "Solidity sources and ABIs for the Clearproof pilot-transfer-v3 contracts and the legacy 16-signal demo contracts. Unaudited; not a deployment",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
7
7
  "contracts/",
8
8
  "artifacts/contracts/**/*.json",
9
- "!artifacts/contracts/**/*.dbg.json"
9
+ "!artifacts/contracts/**/*.dbg.json",
10
+ "!contracts/MockVerifier.sol",
11
+ "!contracts/PairingHarness.sol",
12
+ "!contracts/test/",
13
+ "!artifacts/contracts/MockVerifier.sol/",
14
+ "!artifacts/contracts/PairingHarness.sol/",
15
+ "!artifacts/contracts/test/"
10
16
  ],
11
17
  "repository": {
12
18
  "type": "git",
@@ -29,6 +35,7 @@
29
35
  "test": "hardhat test",
30
36
  "deploy": "hardhat run scripts/deploy.ts",
31
37
  "deploy:multi": "hardhat run scripts/deploy-multichain.ts",
38
+ "deploy:pilot": "hardhat run scripts/deploy-pilot.ts",
32
39
  "update-sanctions": "hardhat run scripts/update-sanctions-root.ts",
33
40
  "relay-sanctions": "ts-node scripts/relay-sanctions-root.ts",
34
41
  "typecheck": "hardhat typechain && tsc --noEmit",
@@ -36,9 +43,9 @@
36
43
  "coverage:check": "istanbul check-coverage --statements 100 --branches 100 --functions 100 --lines 100 coverage/coverage-final.json"
37
44
  },
38
45
  "devDependencies": {
39
- "@nomicfoundation/hardhat-toolbox": "^5.0",
40
- "dotenv": "^18.0.5",
41
- "hardhat": "^2.22",
46
+ "@nomicfoundation/hardhat-toolbox": "^6.1",
47
+ "dotenv": "^18.0.10",
48
+ "hardhat": "^2.29",
42
49
  "ts-node": "^10.9.2",
43
50
  "typescript": "^5.9.3"
44
51
  },
@@ -1,45 +0,0 @@
1
- {
2
- "_format": "hh-sol-artifact-1",
3
- "contractName": "MockVerifier",
4
- "sourceName": "contracts/MockVerifier.sol",
5
- "abi": [
6
- {
7
- "inputs": [
8
- {
9
- "internalType": "uint256[2]",
10
- "name": "",
11
- "type": "uint256[2]"
12
- },
13
- {
14
- "internalType": "uint256[2][2]",
15
- "name": "",
16
- "type": "uint256[2][2]"
17
- },
18
- {
19
- "internalType": "uint256[2]",
20
- "name": "",
21
- "type": "uint256[2]"
22
- },
23
- {
24
- "internalType": "uint256[16]",
25
- "name": "",
26
- "type": "uint256[16]"
27
- }
28
- ],
29
- "name": "verifyProof",
30
- "outputs": [
31
- {
32
- "internalType": "bool",
33
- "name": "",
34
- "type": "bool"
35
- }
36
- ],
37
- "stateMutability": "pure",
38
- "type": "function"
39
- }
40
- ],
41
- "bytecode": "0x608060405234801561001057600080fd5b50610101806100206000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063c82febf514602d575b600080fd5b60426038366004606c565b6001949350505050565b604051901515815260200160405180910390f35b8060408101831015606657600080fd5b92915050565b600080600080610300808688031215608357600080fd5b608b87876056565b945060c0860187811115609d57600080fd5b60408701945060ab88826056565b93505086818701111560bc57600080fd5b5092959194509261010001915056fea2646970667358221220711ee8f4c939a0c55aaa3dc3595f4e90e87456c1cd4a492451dd28e143df7c2e64736f6c63430008180033",
42
- "deployedBytecode": "0x6080604052348015600f57600080fd5b506004361060285760003560e01c8063c82febf514602d575b600080fd5b60426038366004606c565b6001949350505050565b604051901515815260200160405180910390f35b8060408101831015606657600080fd5b92915050565b600080600080610300808688031215608357600080fd5b608b87876056565b945060c0860187811115609d57600080fd5b60408701945060ab88826056565b93505086818701111560bc57600080fd5b5092959194509261010001915056fea2646970667358221220711ee8f4c939a0c55aaa3dc3595f4e90e87456c1cd4a492451dd28e143df7c2e64736f6c63430008180033",
43
- "linkReferences": {},
44
- "deployedLinkReferences": {}
45
- }
@@ -1,252 +0,0 @@
1
- {
2
- "_format": "hh-sol-artifact-1",
3
- "contractName": "PairingHarness",
4
- "sourceName": "contracts/PairingHarness.sol",
5
- "abi": [
6
- {
7
- "inputs": [
8
- {
9
- "components": [
10
- {
11
- "internalType": "uint256",
12
- "name": "X",
13
- "type": "uint256"
14
- },
15
- {
16
- "internalType": "uint256",
17
- "name": "Y",
18
- "type": "uint256"
19
- }
20
- ],
21
- "internalType": "struct Pairing.G1Point",
22
- "name": "a",
23
- "type": "tuple"
24
- },
25
- {
26
- "components": [
27
- {
28
- "internalType": "uint256",
29
- "name": "X",
30
- "type": "uint256"
31
- },
32
- {
33
- "internalType": "uint256",
34
- "name": "Y",
35
- "type": "uint256"
36
- }
37
- ],
38
- "internalType": "struct Pairing.G1Point",
39
- "name": "b",
40
- "type": "tuple"
41
- }
42
- ],
43
- "name": "add",
44
- "outputs": [
45
- {
46
- "components": [
47
- {
48
- "internalType": "uint256",
49
- "name": "X",
50
- "type": "uint256"
51
- },
52
- {
53
- "internalType": "uint256",
54
- "name": "Y",
55
- "type": "uint256"
56
- }
57
- ],
58
- "internalType": "struct Pairing.G1Point",
59
- "name": "",
60
- "type": "tuple"
61
- }
62
- ],
63
- "stateMutability": "view",
64
- "type": "function"
65
- },
66
- {
67
- "inputs": [],
68
- "name": "generators",
69
- "outputs": [
70
- {
71
- "components": [
72
- {
73
- "internalType": "uint256",
74
- "name": "X",
75
- "type": "uint256"
76
- },
77
- {
78
- "internalType": "uint256",
79
- "name": "Y",
80
- "type": "uint256"
81
- }
82
- ],
83
- "internalType": "struct Pairing.G1Point",
84
- "name": "",
85
- "type": "tuple"
86
- },
87
- {
88
- "components": [
89
- {
90
- "internalType": "uint256[2]",
91
- "name": "X",
92
- "type": "uint256[2]"
93
- },
94
- {
95
- "internalType": "uint256[2]",
96
- "name": "Y",
97
- "type": "uint256[2]"
98
- }
99
- ],
100
- "internalType": "struct Pairing.G2Point",
101
- "name": "",
102
- "type": "tuple"
103
- }
104
- ],
105
- "stateMutability": "pure",
106
- "type": "function"
107
- },
108
- {
109
- "inputs": [
110
- {
111
- "components": [
112
- {
113
- "internalType": "uint256",
114
- "name": "X",
115
- "type": "uint256"
116
- },
117
- {
118
- "internalType": "uint256",
119
- "name": "Y",
120
- "type": "uint256"
121
- }
122
- ],
123
- "internalType": "struct Pairing.G1Point",
124
- "name": "p",
125
- "type": "tuple"
126
- },
127
- {
128
- "internalType": "uint256",
129
- "name": "scalar",
130
- "type": "uint256"
131
- }
132
- ],
133
- "name": "multiply",
134
- "outputs": [
135
- {
136
- "components": [
137
- {
138
- "internalType": "uint256",
139
- "name": "X",
140
- "type": "uint256"
141
- },
142
- {
143
- "internalType": "uint256",
144
- "name": "Y",
145
- "type": "uint256"
146
- }
147
- ],
148
- "internalType": "struct Pairing.G1Point",
149
- "name": "",
150
- "type": "tuple"
151
- }
152
- ],
153
- "stateMutability": "view",
154
- "type": "function"
155
- },
156
- {
157
- "inputs": [
158
- {
159
- "components": [
160
- {
161
- "internalType": "uint256",
162
- "name": "X",
163
- "type": "uint256"
164
- },
165
- {
166
- "internalType": "uint256",
167
- "name": "Y",
168
- "type": "uint256"
169
- }
170
- ],
171
- "internalType": "struct Pairing.G1Point",
172
- "name": "p",
173
- "type": "tuple"
174
- }
175
- ],
176
- "name": "negate",
177
- "outputs": [
178
- {
179
- "components": [
180
- {
181
- "internalType": "uint256",
182
- "name": "X",
183
- "type": "uint256"
184
- },
185
- {
186
- "internalType": "uint256",
187
- "name": "Y",
188
- "type": "uint256"
189
- }
190
- ],
191
- "internalType": "struct Pairing.G1Point",
192
- "name": "",
193
- "type": "tuple"
194
- }
195
- ],
196
- "stateMutability": "pure",
197
- "type": "function"
198
- },
199
- {
200
- "inputs": [
201
- {
202
- "components": [
203
- {
204
- "internalType": "uint256",
205
- "name": "X",
206
- "type": "uint256"
207
- },
208
- {
209
- "internalType": "uint256",
210
- "name": "Y",
211
- "type": "uint256"
212
- }
213
- ],
214
- "internalType": "struct Pairing.G1Point[]",
215
- "name": "a",
216
- "type": "tuple[]"
217
- },
218
- {
219
- "components": [
220
- {
221
- "internalType": "uint256[2]",
222
- "name": "X",
223
- "type": "uint256[2]"
224
- },
225
- {
226
- "internalType": "uint256[2]",
227
- "name": "Y",
228
- "type": "uint256[2]"
229
- }
230
- ],
231
- "internalType": "struct Pairing.G2Point[]",
232
- "name": "b",
233
- "type": "tuple[]"
234
- }
235
- ],
236
- "name": "pairing",
237
- "outputs": [
238
- {
239
- "internalType": "bool",
240
- "name": "",
241
- "type": "bool"
242
- }
243
- ],
244
- "stateMutability": "view",
245
- "type": "function"
246
- }
247
- ],
248
- "bytecode": "0x608060405234801561001057600080fd5b50610c51806100206000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80633b3bf3261461005c57806361eea09e1461008457806382d23b8a1461009a578063d42dadde146100ba578063fb6b9e9a146100cd575b600080fd5b61006f61006a3660046109cf565b6100e0565b60405190151581526020015b60405180910390f35b61008c6100f5565b60405161007b929190610ac3565b6100ad6100a8366004610afd565b610147565b60405161007b9190610b32565b6100ad6100c8366004610b49565b610165565b6100ad6100db366004610b74565b610183565b60006100ec83836101a0565b90505b92915050565b604080518082019091526000808252602082015261011161077a565b604080518082018252600080825260209182015281518083019092526001825260029082015261013f6104ff565b915091509091565b60408051808201909152600080825260208201526100ec83836105bf565b60408051808201909152600080825260208201526100ec8383610657565b60408051808201909152600080825260208201526100ef826106db565b600081518351146102025760405162461bcd60e51b815260206004820152602160248201527f50616972696e673a206d69736d61746368656420696e707574206c656e6774686044820152607360f81b60648201526084015b60405180910390fd5b82516000610211826006610ba6565b905060008167ffffffffffffffff81111561022e5761022e610817565b604051908082528060200260200182016040528015610257578160200160208202803683370190505b50905060005b838110156104885786818151811061027757610277610bbd565b602002602001015160000151828260066102919190610ba6565b61029c906000610bd3565b815181106102ac576102ac610bbd565b6020026020010181815250508681815181106102ca576102ca610bbd565b602002602001015160200151828260066102e49190610ba6565b6102ef906001610bd3565b815181106102ff576102ff610bbd565b60200260200101818152505085818151811061031d5761031d610bbd565b6020908102919091010151515182610336836006610ba6565b610341906002610bd3565b8151811061035157610351610bbd565b60200260200101818152505085818151811061036f5761036f610bbd565b6020908102919091018101515101518261038a836006610ba6565b610395906003610bd3565b815181106103a5576103a5610bbd565b6020026020010181815250508581815181106103c3576103c3610bbd565b6020026020010151602001516000600281106103e1576103e1610bbd565b6020020151826103f2836006610ba6565b6103fd906004610bd3565b8151811061040d5761040d610bbd565b60200260200101818152505085818151811061042b5761042b610bbd565b60200260200101516020015160016002811061044957610449610bbd565b60200201518261045a836006610ba6565b610465906005610bd3565b8151811061047557610475610bbd565b602090810291909101015260010161025d565b5061049161079f565b6000602082602086026020860160085afa9050806104f15760405162461bcd60e51b815260206004820152601960248201527f50616972696e673a20656370616972696e67206661696c65640000000000000060448201526064016101f9565b505115159695505050505050565b61050761077a565b50604080516080810182527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c28183019081527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6060830152815281518083019092527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b82527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa60208381019190915281019190915290565b60408051808201909152600080825260208201526105db6107bd565b835181526020808501518183015283516040808401919091529084015160608301526000908360808460065afa90508061064f5760405162461bcd60e51b815260206004820152601560248201527414185a5c9a5b99ce881958d859190819985a5b1959605a1b60448201526064016101f9565b505092915050565b60408051808201909152600080825260208201526106736107db565b835181526020808501519082015260408082018490526000908360608460075afa90508061064f5760405162461bcd60e51b815260206004820152601560248201527414185a5c9a5b99ce881958db5d5b0819985a5b1959605a1b60448201526064016101f9565b604080518082019091526000808252602082015281517f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd479015801561072257506020830151155b156107425750506040805180820190915260008082526020820152919050565b6040518060400160405280846000015181526020018285602001516107679190610be6565b6107719084610c08565b90529392505050565b604051806040016040528061078d6107f9565b815260200161079a6107f9565b905290565b60405180602001604052806001906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b60405180606001604052806003906020820280368337509192915050565b60405180604001604052806002906020820280368337509192915050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff8111828210171561085057610850610817565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561087f5761087f610817565b604052919050565b600067ffffffffffffffff8211156108a1576108a1610817565b5060051b60200190565b6000604082840312156108bd57600080fd5b6108c561082d565b9050813581526020820135602082015292915050565b600082601f8301126108ec57600080fd5b6108f461082d565b80604084018581111561090657600080fd5b845b81811015610920578035845260209384019301610908565b509095945050505050565b600082601f83011261093c57600080fd5b8135602061095161094c83610887565b610856565b8083825260208201915060208460071b87010193508684111561097357600080fd5b602086015b848110156109c457608081890312156109915760008081fd5b61099961082d565b6109a389836108db565b81526109b289604084016108db565b81860152835291830191608001610978565b509695505050505050565b60008060408084860312156109e357600080fd5b833567ffffffffffffffff808211156109fb57600080fd5b818601915086601f830112610a0f57600080fd5b81356020610a1f61094c83610887565b8083825260208201915060208460061b87010193508a841115610a4157600080fd5b6020860195505b83861015610a6957610a5a8b876108ab565b82529486019490820190610a48565b97505050506020860135925080831115610a8257600080fd5b5050610a908582860161092b565b9150509250929050565b8060005b6002811015610abd578151845260209384019390910190600101610a9e565b50505050565b825181526020808401519082015260c08101610ae3604083018451610a9a565b6020830151610af56080840182610a9a565b509392505050565b60008060808385031215610b1057600080fd5b610b1a84846108ab565b9150610b2984604085016108ab565b90509250929050565b8151815260208083015190820152604081016100ef565b60008060608385031215610b5c57600080fd5b610b6684846108ab565b946040939093013593505050565b600060408284031215610b8657600080fd5b6100ec83836108ab565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176100ef576100ef610b90565b634e487b7160e01b600052603260045260246000fd5b808201808211156100ef576100ef610b90565b600082610c0357634e487b7160e01b600052601260045260246000fd5b500690565b818103818111156100ef576100ef610b9056fea2646970667358221220a2ef214ef6881738e904a6450c087de4668c60b4ce71a4dd7d6c2338347f820764736f6c63430008180033",
249
- "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100575760003560e01c80633b3bf3261461005c57806361eea09e1461008457806382d23b8a1461009a578063d42dadde146100ba578063fb6b9e9a146100cd575b600080fd5b61006f61006a3660046109cf565b6100e0565b60405190151581526020015b60405180910390f35b61008c6100f5565b60405161007b929190610ac3565b6100ad6100a8366004610afd565b610147565b60405161007b9190610b32565b6100ad6100c8366004610b49565b610165565b6100ad6100db366004610b74565b610183565b60006100ec83836101a0565b90505b92915050565b604080518082019091526000808252602082015261011161077a565b604080518082018252600080825260209182015281518083019092526001825260029082015261013f6104ff565b915091509091565b60408051808201909152600080825260208201526100ec83836105bf565b60408051808201909152600080825260208201526100ec8383610657565b60408051808201909152600080825260208201526100ef826106db565b600081518351146102025760405162461bcd60e51b815260206004820152602160248201527f50616972696e673a206d69736d61746368656420696e707574206c656e6774686044820152607360f81b60648201526084015b60405180910390fd5b82516000610211826006610ba6565b905060008167ffffffffffffffff81111561022e5761022e610817565b604051908082528060200260200182016040528015610257578160200160208202803683370190505b50905060005b838110156104885786818151811061027757610277610bbd565b602002602001015160000151828260066102919190610ba6565b61029c906000610bd3565b815181106102ac576102ac610bbd565b6020026020010181815250508681815181106102ca576102ca610bbd565b602002602001015160200151828260066102e49190610ba6565b6102ef906001610bd3565b815181106102ff576102ff610bbd565b60200260200101818152505085818151811061031d5761031d610bbd565b6020908102919091010151515182610336836006610ba6565b610341906002610bd3565b8151811061035157610351610bbd565b60200260200101818152505085818151811061036f5761036f610bbd565b6020908102919091018101515101518261038a836006610ba6565b610395906003610bd3565b815181106103a5576103a5610bbd565b6020026020010181815250508581815181106103c3576103c3610bbd565b6020026020010151602001516000600281106103e1576103e1610bbd565b6020020151826103f2836006610ba6565b6103fd906004610bd3565b8151811061040d5761040d610bbd565b60200260200101818152505085818151811061042b5761042b610bbd565b60200260200101516020015160016002811061044957610449610bbd565b60200201518261045a836006610ba6565b610465906005610bd3565b8151811061047557610475610bbd565b602090810291909101015260010161025d565b5061049161079f565b6000602082602086026020860160085afa9050806104f15760405162461bcd60e51b815260206004820152601960248201527f50616972696e673a20656370616972696e67206661696c65640000000000000060448201526064016101f9565b505115159695505050505050565b61050761077a565b50604080516080810182527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c28183019081527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6060830152815281518083019092527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b82527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa60208381019190915281019190915290565b60408051808201909152600080825260208201526105db6107bd565b835181526020808501518183015283516040808401919091529084015160608301526000908360808460065afa90508061064f5760405162461bcd60e51b815260206004820152601560248201527414185a5c9a5b99ce881958d859190819985a5b1959605a1b60448201526064016101f9565b505092915050565b60408051808201909152600080825260208201526106736107db565b835181526020808501519082015260408082018490526000908360608460075afa90508061064f5760405162461bcd60e51b815260206004820152601560248201527414185a5c9a5b99ce881958db5d5b0819985a5b1959605a1b60448201526064016101f9565b604080518082019091526000808252602082015281517f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd479015801561072257506020830151155b156107425750506040805180820190915260008082526020820152919050565b6040518060400160405280846000015181526020018285602001516107679190610be6565b6107719084610c08565b90529392505050565b604051806040016040528061078d6107f9565b815260200161079a6107f9565b905290565b60405180602001604052806001906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b60405180606001604052806003906020820280368337509192915050565b60405180604001604052806002906020820280368337509192915050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff8111828210171561085057610850610817565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561087f5761087f610817565b604052919050565b600067ffffffffffffffff8211156108a1576108a1610817565b5060051b60200190565b6000604082840312156108bd57600080fd5b6108c561082d565b9050813581526020820135602082015292915050565b600082601f8301126108ec57600080fd5b6108f461082d565b80604084018581111561090657600080fd5b845b81811015610920578035845260209384019301610908565b509095945050505050565b600082601f83011261093c57600080fd5b8135602061095161094c83610887565b610856565b8083825260208201915060208460071b87010193508684111561097357600080fd5b602086015b848110156109c457608081890312156109915760008081fd5b61099961082d565b6109a389836108db565b81526109b289604084016108db565b81860152835291830191608001610978565b509695505050505050565b60008060408084860312156109e357600080fd5b833567ffffffffffffffff808211156109fb57600080fd5b818601915086601f830112610a0f57600080fd5b81356020610a1f61094c83610887565b8083825260208201915060208460061b87010193508a841115610a4157600080fd5b6020860195505b83861015610a6957610a5a8b876108ab565b82529486019490820190610a48565b97505050506020860135925080831115610a8257600080fd5b5050610a908582860161092b565b9150509250929050565b8060005b6002811015610abd578151845260209384019390910190600101610a9e565b50505050565b825181526020808401519082015260c08101610ae3604083018451610a9a565b6020830151610af56080840182610a9a565b509392505050565b60008060808385031215610b1057600080fd5b610b1a84846108ab565b9150610b2984604085016108ab565b90509250929050565b8151815260208083015190820152604081016100ef565b60008060608385031215610b5c57600080fd5b610b6684846108ab565b946040939093013593505050565b600060408284031215610b8657600080fd5b6100ec83836108ab565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176100ef576100ef610b90565b634e487b7160e01b600052603260045260246000fd5b808201808211156100ef576100ef610b90565b600082610c0357634e487b7160e01b600052601260045260246000fd5b500690565b818103818111156100ef576100ef610b9056fea2646970667358221220a2ef214ef6881738e904a6450c087de4668c60b4ce71a4dd7d6c2338347f820764736f6c63430008180033",
250
- "linkReferences": {},
251
- "deployedLinkReferences": {}
252
- }
@@ -1,95 +0,0 @@
1
- {
2
- "_format": "hh-sol-artifact-1",
3
- "contractName": "MockPilotVerifier",
4
- "sourceName": "contracts/test/MockPilotVerifier.sol",
5
- "abi": [
6
- {
7
- "inputs": [
8
- {
9
- "internalType": "bytes32",
10
- "name": "manifestDigest",
11
- "type": "bytes32"
12
- }
13
- ],
14
- "stateMutability": "nonpayable",
15
- "type": "constructor"
16
- },
17
- {
18
- "inputs": [],
19
- "name": "artifactManifestDigest",
20
- "outputs": [
21
- {
22
- "internalType": "bytes32",
23
- "name": "",
24
- "type": "bytes32"
25
- }
26
- ],
27
- "stateMutability": "view",
28
- "type": "function"
29
- },
30
- {
31
- "inputs": [],
32
- "name": "result",
33
- "outputs": [
34
- {
35
- "internalType": "bool",
36
- "name": "",
37
- "type": "bool"
38
- }
39
- ],
40
- "stateMutability": "view",
41
- "type": "function"
42
- },
43
- {
44
- "inputs": [
45
- {
46
- "internalType": "bool",
47
- "name": "value",
48
- "type": "bool"
49
- }
50
- ],
51
- "name": "setResult",
52
- "outputs": [],
53
- "stateMutability": "nonpayable",
54
- "type": "function"
55
- },
56
- {
57
- "inputs": [
58
- {
59
- "internalType": "uint256[2]",
60
- "name": "",
61
- "type": "uint256[2]"
62
- },
63
- {
64
- "internalType": "uint256[2][2]",
65
- "name": "",
66
- "type": "uint256[2][2]"
67
- },
68
- {
69
- "internalType": "uint256[2]",
70
- "name": "",
71
- "type": "uint256[2]"
72
- },
73
- {
74
- "internalType": "uint256[8]",
75
- "name": "",
76
- "type": "uint256[8]"
77
- }
78
- ],
79
- "name": "verifyProof",
80
- "outputs": [
81
- {
82
- "internalType": "bool",
83
- "name": "",
84
- "type": "bool"
85
- }
86
- ],
87
- "stateMutability": "view",
88
- "type": "function"
89
- }
90
- ],
91
- "bytecode": "0x60a06040526000805460ff1916600117905534801561001d57600080fd5b5060405161023a38038061023a83398101604081905261003c91610044565b60805261005d565b60006020828403121561005657600080fd5b5051919050565b6080516101c36100776000396000607801526101c36000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80636537214714610051578063940a72ec14610073578063c9219a7a146100a8578063f4b4dc2e146100c4575b600080fd5b60005461005e9060ff1681565b60405190151581526020015b60405180910390f35b61009a7f000000000000000000000000000000000000000000000000000000000000000081565b60405190815260200161006a565b61005e6100b63660046100fe565b60005460ff16949350505050565b6100e56100d2366004610164565b6000805460ff1916911515919091179055565b005b80604081018310156100f857600080fd5b92915050565b60008060008061020080868803121561011657600080fd5b61012087876100e7565b945060c086018781111561013357600080fd5b60408701945061014388826100e7565b93505086818701111561015557600080fd5b50929591945092610100019150565b60006020828403121561017657600080fd5b8135801515811461018657600080fd5b939250505056fea26469706673582212200aaef75e0f4eabc71ff71d7151298a29c24b399ade598fbcc4c68ab62377293464736f6c63430008180033",
92
- "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80636537214714610051578063940a72ec14610073578063c9219a7a146100a8578063f4b4dc2e146100c4575b600080fd5b60005461005e9060ff1681565b60405190151581526020015b60405180910390f35b61009a7f000000000000000000000000000000000000000000000000000000000000000081565b60405190815260200161006a565b61005e6100b63660046100fe565b60005460ff16949350505050565b6100e56100d2366004610164565b6000805460ff1916911515919091179055565b005b80604081018310156100f857600080fd5b92915050565b60008060008061020080868803121561011657600080fd5b61012087876100e7565b945060c086018781111561013357600080fd5b60408701945061014388826100e7565b93505086818701111561015557600080fd5b50929591945092610100019150565b60006020828403121561017657600080fd5b8135801515811461018657600080fd5b939250505056fea26469706673582212200aaef75e0f4eabc71ff71d7151298a29c24b399ade598fbcc4c68ab62377293464736f6c63430008180033",
93
- "linkReferences": {},
94
- "deployedLinkReferences": {}
95
- }
@@ -1,18 +0,0 @@
1
- // SPDX-License-Identifier: Apache-2.0
2
- // LEGACY: 16-signal `compliance.circom` demo/parity path, not pilot-transfer-v3.
3
- // Never treat proofs, roots or records accepted here as current pilot authorization.
4
- // Kept at this path for the published @clearproof/contracts artifact layout; see
5
- // packages/contracts/AGENTS.md ("Legacy contracts") and docs/internal/CIRCUIT_SIGNALS.md.
6
- pragma solidity ^0.8.24;
7
-
8
- /// @dev Mock verifier that always returns true, for testing event emission.
9
- contract MockVerifier {
10
- function verifyProof(
11
- uint[2] calldata,
12
- uint[2][2] calldata,
13
- uint[2] calldata,
14
- uint[16] calldata
15
- ) external pure returns (bool) {
16
- return true;
17
- }
18
- }