Skip to content

Commit

Permalink
Merge pull request #1292 from rpanic/feature/zkprogram-add-vk-hash
Browse files Browse the repository at this point in the history
Add verification key hash to the return type of ZkProgram compile
  • Loading branch information
mitschabaude committed Dec 5, 2023
2 parents d901dea + f36ac3d commit 03bb11f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/1292 [@rpanic](https://github.com/rpanic)

### Added

- **Foreign field arithmetic** exposed through the `createForeignField()` class factory https://github.com/o1-labs/snarkyjs/pull/985
Expand Down
9 changes: 4 additions & 5 deletions src/lib/proof_system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,9 @@ function ZkProgram<
}
): {
name: string;
compile: (options?: {
cache?: Cache;
forceRecompile?: boolean;
}) => Promise<{ verificationKey: string }>;
compile: (options?: { cache?: Cache; forceRecompile?: boolean }) => Promise<{
verificationKey: { data: string; hash: Field }
}>;
verify: (
proof: Proof<
InferProvableOrUndefined<Get<StatementType, 'publicInput'>>,
Expand Down Expand Up @@ -361,7 +360,7 @@ function ZkProgram<
overrideWrapDomain: config.overrideWrapDomain,
});
compileOutput = { provers, verify };
return { verificationKey: verificationKey.data };
return { verificationKey };
}

function toProver<K extends keyof Types & string>(
Expand Down

0 comments on commit 03bb11f

Please sign in to comment.