Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/ci-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
node-version: '20.x'

- name: Use npm 11.6.2
run: npm i -g npm@11.6.2

- name: Install dependencies
run: npm ci
Expand Down
14 changes: 13 additions & 1 deletion DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,22 @@ session.verify().ultraplonk({
session.verify().sp1().execute({...})
```

### EZKL

```typescript
session.verify().ezkl().execute({...})
```

### UltraHonk

Supports variants: `Plain`, `ZK`

**Note for v1.3.0+**: The `variant` option is required for runtime version 1.3.0 or later.

```typescript
session.verify().ultrahonk().execute({...})
session.verify().ultrahonk({
variant: UltrahonkVariant.Plain
}).execute({...})
```

### Runtime Versions and Network Compatibility
Expand Down
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,20 @@ session.verify().ultraplonk({
session.verify().sp1().execute({...})
```

### EZKL
```typescript
session.verify().ezkl().execute({...})
```

### UltraHonk
Supports variants: `Plain`, `ZK`

**Note for v1.3.0+**: The `variant` option is required for runtime version 1.3.0 or later.

```typescript
session.verify().ultrahonk().execute({...})
session.verify().ultrahonk({
variant: UltrahonkVariant.Plain
}).execute({...})
```

## Runtime Versions and Network Compatibility
Expand Down
69 changes: 20 additions & 49 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zkverifyjs",
"version": "1.3.0",
"version": "2.0.0",
"description": "Submit proofs to zkVerify and query proof state with ease using our npm package.",
"author": "zkVerify <web3-platform@zkverify.io>",
"license": "GPL-3.0",
Expand Down Expand Up @@ -67,6 +67,7 @@
"blockchain",
"crypto",
"cryptography",
"ezkl",
"fflonk",
"groth16",
"javascript",
Expand Down
32 changes: 31 additions & 1 deletion src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import {
Library,
Plonky2HashFunction,
Risc0Version,
UltrahonkVariant,
} from '../enums';
import {
EZKLProcessor,
FflonkProcessor,
Groth16Processor,
Plonky2Processor,
Expand Down Expand Up @@ -48,6 +50,7 @@ export const SupportedNetworkConfig: Record<SupportedNetwork, NetworkConfig> = {
};

export enum ProofType {
ezkl = 'ezkl',
fflonk = 'fflonk',
groth16 = 'groth16',
plonky2 = 'plonky2',
Expand All @@ -64,6 +67,10 @@ export interface ProofConfig {
}

export const proofConfigurations: Record<ProofType, ProofConfig> = {
[ProofType.ezkl]: {
pallet: 'settlementEzklPallet',
processor: EZKLProcessor,
},
[ProofType.fflonk]: {
pallet: 'settlementFFlonkPallet',
processor: FflonkProcessor,
Expand Down Expand Up @@ -97,7 +104,12 @@ export const proofConfigurations: Record<ProofType, ProofConfig> = {

export interface ProofOptions {
proofType: ProofType;
config?: Groth16Config | Plonky2Config | Risc0Config | UltraplonkConfig; // ADD_NEW_PROOF_TYPE
config?:
| Groth16Config
| Plonky2Config
| Risc0Config
| UltraplonkConfig
| UltrahonkConfig; // ADD_NEW_PROOF_TYPE
}

export interface Groth16Config {
Expand All @@ -117,11 +129,16 @@ export interface UltraplonkConfig {
numberOfPublicInputs: number;
}

export interface UltrahonkConfig {
variant: UltrahonkVariant;
}

export type AllProofConfigs =
| Groth16Config
| Plonky2Config
| Risc0Config
| UltraplonkConfig
| UltrahonkConfig
| undefined;
// ADD_NEW_PROOF_TYPE - options if needed.

Expand Down Expand Up @@ -151,6 +168,9 @@ export const zkvTypes = {
config: 'Plonky2Config',
bytes: 'Bytes',
},
EzklVk: {
vkBytes: 'Bytes',
},
};

export const zkvRpc = {
Expand Down Expand Up @@ -249,6 +269,16 @@ export const zkvRpc = {
],
type: 'H256',
},
ezkl: {
description: 'Get the hash of an Ezkl verification key artifact',
params: [
{
name: 'vk',
type: 'EzklVK',
},
],
type: 'H256',
},
// ADD_NEW_PROOF_TYPE
},
};
Loading