Skip to content

Commit f21fd6d

Browse files
authored
Web3 1940 ezkl and plain/zk ultrahonk variants (#68)
* feat: ultrahonk variant plain and zk options * feat: ezkl support
1 parent cc71f83 commit f21fd6d

25 files changed

Lines changed: 288 additions & 78 deletions

File tree

.github/workflows/ci-build-and-test.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ jobs:
3939
- name: Setup Node.js
4040
uses: actions/setup-node@v3
4141
with:
42-
node-version: '18.x'
42+
node-version: '20.x'
43+
44+
- name: Use npm 11.6.2
45+
run: npm i -g npm@11.6.2
4346

4447
- name: Install dependencies
4548
run: npm ci

DOCS.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,22 @@ session.verify().ultraplonk({
7272
session.verify().sp1().execute({...})
7373
```
7474

75+
### EZKL
76+
77+
```typescript
78+
session.verify().ezkl().execute({...})
79+
```
80+
7581
### UltraHonk
7682

83+
Supports variants: `Plain`, `ZK`
84+
85+
**Note for v1.3.0+**: The `variant` option is required for runtime version 1.3.0 or later.
86+
7787
```typescript
78-
session.verify().ultrahonk().execute({...})
88+
session.verify().ultrahonk({
89+
variant: UltrahonkVariant.Plain
90+
}).execute({...})
7991
```
8092

8193
### Runtime Versions and Network Compatibility

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,20 @@ session.verify().ultraplonk({
6363
session.verify().sp1().execute({...})
6464
```
6565

66+
### EZKL
67+
```typescript
68+
session.verify().ezkl().execute({...})
69+
```
70+
6671
### UltraHonk
72+
Supports variants: `Plain`, `ZK`
73+
74+
**Note for v1.3.0+**: The `variant` option is required for runtime version 1.3.0 or later.
75+
6776
```typescript
68-
session.verify().ultrahonk().execute({...})
77+
session.verify().ultrahonk({
78+
variant: UltrahonkVariant.Plain
79+
}).execute({...})
6980
```
7081

7182
## Runtime Versions and Network Compatibility

package-lock.json

Lines changed: 20 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "zkverifyjs",
3-
"version": "1.3.0",
3+
"version": "2.0.0",
44
"description": "Submit proofs to zkVerify and query proof state with ease using our npm package.",
55
"author": "zkVerify <web3-platform@zkverify.io>",
66
"license": "GPL-3.0",
@@ -67,6 +67,7 @@
6767
"blockchain",
6868
"crypto",
6969
"cryptography",
70+
"ezkl",
7071
"fflonk",
7172
"groth16",
7273
"javascript",

src/config/index.ts

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ import {
33
Library,
44
Plonky2HashFunction,
55
Risc0Version,
6+
UltrahonkVariant,
67
} from '../enums';
78
import {
9+
EZKLProcessor,
810
FflonkProcessor,
911
Groth16Processor,
1012
Plonky2Processor,
@@ -48,6 +50,7 @@ export const SupportedNetworkConfig: Record<SupportedNetwork, NetworkConfig> = {
4850
};
4951

5052
export enum ProofType {
53+
ezkl = 'ezkl',
5154
fflonk = 'fflonk',
5255
groth16 = 'groth16',
5356
plonky2 = 'plonky2',
@@ -64,6 +67,10 @@ export interface ProofConfig {
6467
}
6568

6669
export const proofConfigurations: Record<ProofType, ProofConfig> = {
70+
[ProofType.ezkl]: {
71+
pallet: 'settlementEzklPallet',
72+
processor: EZKLProcessor,
73+
},
6774
[ProofType.fflonk]: {
6875
pallet: 'settlementFFlonkPallet',
6976
processor: FflonkProcessor,
@@ -97,7 +104,12 @@ export const proofConfigurations: Record<ProofType, ProofConfig> = {
97104

98105
export interface ProofOptions {
99106
proofType: ProofType;
100-
config?: Groth16Config | Plonky2Config | Risc0Config | UltraplonkConfig; // ADD_NEW_PROOF_TYPE
107+
config?:
108+
| Groth16Config
109+
| Plonky2Config
110+
| Risc0Config
111+
| UltraplonkConfig
112+
| UltrahonkConfig; // ADD_NEW_PROOF_TYPE
101113
}
102114

103115
export interface Groth16Config {
@@ -117,11 +129,16 @@ export interface UltraplonkConfig {
117129
numberOfPublicInputs: number;
118130
}
119131

132+
export interface UltrahonkConfig {
133+
variant: UltrahonkVariant;
134+
}
135+
120136
export type AllProofConfigs =
121137
| Groth16Config
122138
| Plonky2Config
123139
| Risc0Config
124140
| UltraplonkConfig
141+
| UltrahonkConfig
125142
| undefined;
126143
// ADD_NEW_PROOF_TYPE - options if needed.
127144

@@ -151,6 +168,9 @@ export const zkvTypes = {
151168
config: 'Plonky2Config',
152169
bytes: 'Bytes',
153170
},
171+
EzklVk: {
172+
vkBytes: 'Bytes',
173+
},
154174
};
155175

156176
export const zkvRpc = {
@@ -249,6 +269,16 @@ export const zkvRpc = {
249269
],
250270
type: 'H256',
251271
},
272+
ezkl: {
273+
description: 'Get the hash of an Ezkl verification key artifact',
274+
params: [
275+
{
276+
name: 'vk',
277+
type: 'EzklVK',
278+
},
279+
],
280+
type: 'H256',
281+
},
252282
// ADD_NEW_PROOF_TYPE
253283
},
254284
};

0 commit comments

Comments
 (0)