From e8918f05c667710c15973044a2de5ce22c3dfe5d Mon Sep 17 00:00:00 2001 From: Raphael Panic Date: Mon, 4 Dec 2023 20:35:55 +0100 Subject: [PATCH 1/3] Add vk hash to the return type of compile --- src/lib/proof_system.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/proof_system.ts b/src/lib/proof_system.ts index 08adef5f68..c7948f22af 100644 --- a/src/lib/proof_system.ts +++ b/src/lib/proof_system.ts @@ -263,7 +263,7 @@ function ZkProgram< compile: (options?: { cache?: Cache; forceRecompile?: boolean; - }) => Promise<{ verificationKey: string }>; + }) => Promise<{ verificationKey: { data: string, hash: Field } }>; verify: ( proof: Proof< InferProvableOrUndefined>, @@ -361,7 +361,7 @@ function ZkProgram< overrideWrapDomain: config.overrideWrapDomain, }); compileOutput = { provers, verify }; - return { verificationKey: verificationKey.data }; + return { verificationKey }; } function toProver( From f9aa51e1bbeb0f96b78df63cb6a13678e0a20d91 Mon Sep 17 00:00:00 2001 From: Raphael Panic Date: Mon, 4 Dec 2023 20:59:39 +0100 Subject: [PATCH 2/3] Added changelog --- CHANGELOG.md | 4 ++++ src/lib/proof_system.ts | 7 +++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f1b8d4af3..67e2bcd567 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## [Unreleased](https://github.com/o1-labs/o1js/compare/1ad7333e9e...HEAD) +### Breaking changes + +- `ZkProgram.compile()` now returns the verification key and its hash, to be consistent with `SmartContract.compile()` https://github.com/o1-labs/o1js/pull/1240 + ### Added - **Foreign field arithmetic** exposed through the `createForeignField()` class factory https://github.com/o1-labs/snarkyjs/pull/985 diff --git a/src/lib/proof_system.ts b/src/lib/proof_system.ts index c7948f22af..9d0a5fdcec 100644 --- a/src/lib/proof_system.ts +++ b/src/lib/proof_system.ts @@ -260,10 +260,9 @@ function ZkProgram< } ): { name: string; - compile: (options?: { - cache?: Cache; - forceRecompile?: boolean; - }) => Promise<{ verificationKey: { data: string, hash: Field } }>; + compile: (options?: { cache?: Cache; forceRecompile?: boolean }) => Promise<{ + verificationKey: { data: string; hash: Field } + }>; verify: ( proof: Proof< InferProvableOrUndefined>, From f36ac3d73b4a6d7103c3a60002a662011f15c50f Mon Sep 17 00:00:00 2001 From: Gregor Mitscha-Baude Date: Tue, 5 Dec 2023 10:19:53 +0100 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67e2bcd567..7ac14ae655 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ### Breaking changes -- `ZkProgram.compile()` now returns the verification key and its hash, to be consistent with `SmartContract.compile()` https://github.com/o1-labs/o1js/pull/1240 +- `ZkProgram.compile()` now returns the verification key and its hash, to be consistent with `SmartContract.compile()` https://github.com/o1-labs/o1js/pull/1292 [@rpanic](https://github.com/rpanic) ### Added