Skip to content

Commit 68d9c2b

Browse files
committed
feat: nuke UltraPlonk
1 parent fc0854b commit 68d9c2b

File tree

5 files changed

+3
-57
lines changed

5 files changed

+3
-57
lines changed

README.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -152,19 +152,6 @@ export default {
152152
};
153153
```
154154

155-
Change the proof flavor. It will generate different Solidity verifiers. If you switch to `ultra_plonk`, use `noir.getCircuit(name, UltraPlonkBackend)` to get ultra plonk backend.
156-
157-
```js
158-
export default {
159-
noir: {
160-
// default is "ultra_keccak_honk"
161-
flavor: "ultra_plonk",
162-
// you can also specify multiple flavors
163-
// flavor: ["ultra_keccak_honk", "ultra_plonk"],
164-
},
165-
};
166-
```
167-
168155
The default folder where Noir is located is `noir`. You can change it in `hardhat.config.js`:
169156

170157
```js

src/Noir.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class NoirExtension {
3434
* Call this only once per circuit as it creates a new backend each time.
3535
*
3636
* @param name name of the circuit
37-
* @param backendClass Backend class. Depends on the `noir.flavor` type you have set in Hardhat config. Either {@link UltraHonkBackend} or {@link UltraPlonkBackend}
37+
* @param backendClass Backend class. Currently, only {@link UltraHonkBackend}-like backends are supported.
3838
*/
3939
async getCircuit<T = UltraHonkBackend>(
4040
name: string,
@@ -65,5 +65,4 @@ export async function getTarget(noirDir: string | HardhatConfig) {
6565
export type ProofFlavor = keyof typeof ProofFlavor;
6666
export const ProofFlavor = {
6767
ultra_keccak_honk: "ultra_keccak_honk",
68-
ultra_plonk: "ultra_plonk",
6968
} as const;

src/tasks.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,11 @@ async function generateSolidityVerifier(
109109
) {
110110
const path = await import("path");
111111
const fs = await import("fs");
112-
const { UltraHonkBackend, UltraPlonkBackend } = await import("@aztec/bb.js");
112+
const { UltraHonkBackend } = await import("@aztec/bb.js");
113113

114114
let verifier: string;
115115
const program = JSON.parse(fs.readFileSync(file, "utf-8"));
116116
switch (flavor) {
117-
case "ultra_plonk": {
118-
const backend = new UltraPlonkBackend(program.bytecode);
119-
verifier = await backend.getSolidityVerifier();
120-
break;
121-
}
122117
case "ultra_keccak_honk": {
123118
const backend = new UltraHonkBackend(program.bytecode);
124119
const vk = await backend.getVerificationKey({ keccak: true });

test/fixture-projects/hardhat-project/hardhat.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const config: HardhatUserConfig = {
2121
},
2222
noir: {
2323
version: TEST_NOIR_VERSION,
24-
flavor: ["ultra_keccak_honk", "ultra_plonk"],
24+
flavor: ["ultra_keccak_honk"],
2525
},
2626
};
2727

test/noir.test.ts

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// tslint:disable-next-line no-implicit-dependencies
2-
import { UltraPlonkBackend } from "@aztec/bb.js";
32
import { assert, expect } from "chai";
43
import fs from "fs";
54
import { TASK_CLEAN, TASK_COMPILE } from "hardhat/builtin-tasks/task-names";
@@ -78,40 +77,6 @@ describe("Integration tests examples", function () {
7877
);
7978
expect(resultJs).to.eq(true);
8079
});
81-
82-
it("proves and verifies on-chain ultra_plonk", async function () {
83-
await this.hre.run("compile");
84-
85-
// Deploy a verifier contract
86-
const contractFactory =
87-
await this.hre.ethers.getContractFactory("UltraVerifier");
88-
const contract = await contractFactory.deploy();
89-
await contract.waitForDeployment();
90-
91-
// Generate a proof
92-
const { noir, backend } = await this.hre.noir.getCircuit(
93-
"my_circuit",
94-
UltraPlonkBackend,
95-
);
96-
const input = { x: 1, y: 2 };
97-
const { witness } = await noir.execute(input);
98-
const { proof, publicInputs } = await backend.generateProof(witness);
99-
// it matches because we marked y as `pub` in `main.nr`
100-
expect(BigInt(publicInputs[0])).to.eq(BigInt(input.y));
101-
102-
// Verify the proof on-chain
103-
const result = await contract.verify(proof, [
104-
this.hre.ethers.toBeHex(input.y, 32),
105-
]);
106-
expect(result).to.eq(true);
107-
108-
// You can also verify in JavaScript.
109-
const resultJs = await backend.verifyProof({
110-
proof,
111-
publicInputs: [String(input.y)],
112-
});
113-
expect(resultJs).to.eq(true);
114-
});
11580
});
11681

11782
describe("HardhatConfig extension", function () {

0 commit comments

Comments
 (0)