Skip to content

Commit 1811266

Browse files
committed
dump data for rust
1 parent 6cd7de9 commit 1811266

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/examples/zkfunction/root.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { writeFileSync } from 'fs';
12
import { Experimental, Field, Gadgets } from 'o1js';
23
const { ZkFunction } = Experimental;
34

@@ -39,6 +40,14 @@ ok = await proof.verify(verificationKeyRoundTrip(verificationKey));
3940

4041
console.log('verification key round trip ok?', ok);
4142

43+
console.log('writing proof to file...');
44+
writeFileSync('zkfunction-proof.json', JSON.stringify(proofRoundTrip(proof).toJSON(), null, 2));
45+
46+
console.log('writing verification key to file...');
47+
writeFileSync(
48+
'zkfunction-verification-key.data',
49+
verificationKeyRoundTrip(verificationKey).toString()
50+
);
4251
function proofRoundTrip(proof: Experimental.KimchiProof): Experimental.KimchiProof {
4352
let json = proof.toJSON();
4453
console.log('proof json:', {

0 commit comments

Comments
 (0)