Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: UltraHonk #5

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/contracts/contracts/ZkLogin.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity ^0.8.27;

import {UltraVerifier} from "../noir/target/jwt_account.sol";
import {HonkVerifier} from "../noir/target/jwt_account_honk.sol";
import {Strings} from "./Strings.sol";
import {PublicKeyRegistry} from "./PublicKeyRegistry.sol";

Expand All @@ -10,7 +10,7 @@ library ZkLogin {
bytes32 accountId;
bytes32 authProviderId;
PublicKeyRegistry publicKeyRegistry;
UltraVerifier proofVerifier;
HonkVerifier proofVerifier;
}

struct VerificationData {
Expand Down
6 changes: 6 additions & 0 deletions packages/contracts/deploy/00_deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ declare module "hardhat/types/runtime" {
PublicKeyRegistry: "PublicKeyRegistry";
SimpleAccountFactory: "SimpleAccountFactory";
UltraVerifier: "UltraVerifier";
HonkVerifier: "HonkVerifier";
}
}

Expand All @@ -24,6 +25,11 @@ const deploy: DeployFunction = async ({
log: true,
});

await typedDeployments.deploy("HonkVerifier", {
from: deployer,
log: true,
});

const entryPoint = "0x0000000071727De22E5E9d8BAf0edAc6f37da032"; // 0.7.0
await typedDeployments.deploy("SimpleAccountFactory", {
from: deployer,
Expand Down
3 changes: 2 additions & 1 deletion packages/contracts/deployments.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
"84532": {
"chainId": "84532",
"contracts": {
"HonkVerifier": "0x99E1E8F8122eAdc0a2fC1B9dFa147237Bd543cD3",
"PublicKeyRegistry": "0xd279B6E1a3322Bc43Ca23C464b2450E5672882d4",
"SimpleAccountFactory": "0x993559431A2d6d3526a11604b5b7B5DE75fEc267",
"SimpleAccountFactory": "0xa712976C582ACa81e2800eF27afcdf157252aAdf",
"UltraVerifier": "0xD37D6e4e41Be1F05AfDF653777848Ee4Fff8FBc9"
},
"name": "baseSepolia"
Expand Down
80 changes: 80 additions & 0 deletions packages/contracts/deployments/baseSepolia/HonkVerifier.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions packages/contracts/noir/target/jwt_account_honk.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions packages/contracts/typechain-types/hardhat.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions packages/contracts/typechain-types/index.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/contracts/typechain-types/noir/target/index.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/sdk/src/ZkLoginSdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class ZkLogin {
const publicKeyRegistry = deployments[checkedChainId].contracts
.PublicKeyRegistry as Hex.Hex;
const proofVerifier = deployments[checkedChainId].contracts
.UltraVerifier as Hex.Hex;
.HonkVerifier as Hex.Hex;

const publicKey = await this.publicKeyRegistry.getPublicKeyByKid(
decoded.header.kid,
Expand Down Expand Up @@ -145,12 +145,12 @@ export class ZkLogin {

const getNoir = utils.lazyValue(async () => {
const { Noir } = await import("@noir-lang/noir_js");
const { UltraPlonkBackend } = await import("@aztec/bb.js");
const { UltraHonkBackend } = await import("@aztec/bb.js");
const noir = new Noir(circuit as any);
const threads =
typeof navigator !== "undefined" ? navigator.hardwareConcurrency : 1;
console.log(`Using ${threads} threads`);
const backend = new UltraPlonkBackend(circuit.bytecode, { threads });
const backend = new UltraHonkBackend(circuit.bytecode, { threads });
return { noir, backend };
});

Expand Down