Skip to content

Commit

Permalink
Merge branch 'master' into feature/plonk
Browse files Browse the repository at this point in the history
  • Loading branch information
Hrom131 committed Sep 25, 2024
2 parents 2f13a27 + 799178c commit e8e6a3e
Show file tree
Hide file tree
Showing 13 changed files with 1,119 additions and 508 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
**A zero knowledge kit that helps you interact with Circom circuits.**

- Generate and verify ZK proofs with a single line of code.
- Render optimized Solidity verifiers.
- Render optimized Solidity | Vyper verifiers.
- Build and work with ZK witnesses.

## Installation
Expand All @@ -33,31 +33,31 @@ CircuitZKitConfig = {
circuitName: string;
circuitArtifactsPath: string;
verifierDirPath: string;
templateType?: VerifierTemplateType;
provingSystem?: VerifierProvingSystem;
};
```

This config contains all the information required to work with the circuit, namely:

- `circuitName` - Name of the circuit file without extension
- `circuitArtifactsPath` - Full path to compilation artifacts for the desired circuit
- `verifierDirPath` - Full path to the directory where Solidity verifier file will be generated
- `templateType` - The type of template that will be used to generate the Solidity verifier contract. Right now only `groth16` is supported
- `verifierDirPath` - Full path to the directory where Solidity | Vyper verifier file will be generated
- `provingSystem` - The proving system that will be used to generate the verifier contract. Right now only `groth16` is supported

#### getTemplate()

Static `CircuitZKit` function that returns the contents of a template file by the passed type.

```typescript
const templateContent = CircuitZKit.getTemplate("groth16");
const templateContent = CircuitZKit.getTemplate("groth16", "sol");
```

#### createVerifier()

Creates a Solidity verifier contract on `verifierDirPath` path, which was specified in the config.
Creates a Solidity | Vyper verifier contract on `verifierDirPath` path, which was specified in the config.

```typescript
await multiplier.createVerifier();
await multiplier.createVerifier("sol");
```

#### calculateWitness()
Expand Down Expand Up @@ -89,7 +89,7 @@ const isValidProof = await multiplier.verifyProof(proof);

#### generateCalldata()

Generates calldata by proof for the Solidity verifier's `verifyProof()` method.
Generates calldata by proof for the Solidity | Vyper verifier's `verifyProof()` method.

```typescript
/// You can use this calldata to call the verifier contract
Expand Down
Loading

0 comments on commit e8e6a3e

Please sign in to comment.