File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 1+ import { writeFileSync } from 'fs' ;
12import { Experimental , Field , Gadgets } from 'o1js' ;
23const { ZkFunction } = Experimental ;
34
@@ -39,6 +40,14 @@ ok = await proof.verify(verificationKeyRoundTrip(verificationKey));
3940
4041console . 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+ ) ;
4251function proofRoundTrip ( proof : Experimental . KimchiProof ) : Experimental . KimchiProof {
4352 let json = proof . toJSON ( ) ;
4453 console . log ( 'proof json:' , {
You can’t perform that action at this time.
0 commit comments