@aztec/stdlib 0.85.0-nightly.20250417 → 0.85.0-nightly.20250418
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/kernel/private_kernel_data.d.ts +3 -3
- package/dest/kernel/private_kernel_data.d.ts.map +1 -1
- package/dest/kernel/private_kernel_data.js +8 -8
- package/dest/kernel/private_kernel_prover_output.d.ts +6 -2
- package/dest/kernel/private_kernel_prover_output.d.ts.map +1 -1
- package/dest/kernel/private_kernel_prover_output.js +17 -1
- package/dest/kernel/private_kernel_simulated_output.d.ts +3 -3
- package/dest/kernel/private_kernel_simulated_output.d.ts.map +1 -1
- package/dest/tx/profiled_tx.d.ts.map +1 -1
- package/dest/tx/profiled_tx.js +2 -1
- package/package.json +7 -6
- package/src/kernel/private_kernel_data.ts +6 -6
- package/src/kernel/private_kernel_prover_output.ts +18 -2
- package/src/kernel/private_kernel_simulated_output.ts +3 -3
- package/src/tx/profiled_tx.ts +1 -0
|
@@ -4,7 +4,7 @@ import { VK_TREE_HEIGHT } from '@aztec/constants';
|
|
|
4
4
|
import { Fr } from '@aztec/foundation/fields';
|
|
5
5
|
import { BufferReader, type Tuple } from '@aztec/foundation/serialize';
|
|
6
6
|
import type { UInt32 } from '../types/shared.js';
|
|
7
|
-
import {
|
|
7
|
+
import { VerificationKeyData } from '../vks/verification_key.js';
|
|
8
8
|
import { PrivateKernelCircuitPublicInputs } from './private_kernel_circuit_public_inputs.js';
|
|
9
9
|
/**
|
|
10
10
|
* Data of the previous kernel iteration in the chain of kernels.
|
|
@@ -17,7 +17,7 @@ export declare class PrivateKernelData {
|
|
|
17
17
|
/**
|
|
18
18
|
* Verification key of the previous kernel.
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
verificationKey: VerificationKeyData;
|
|
21
21
|
/**
|
|
22
22
|
* Index of the previous kernel's vk in a tree of vks.
|
|
23
23
|
*/
|
|
@@ -34,7 +34,7 @@ export declare class PrivateKernelData {
|
|
|
34
34
|
/**
|
|
35
35
|
* Verification key of the previous kernel.
|
|
36
36
|
*/
|
|
37
|
-
|
|
37
|
+
verificationKey: VerificationKeyData,
|
|
38
38
|
/**
|
|
39
39
|
* Index of the previous kernel's vk in a tree of vks.
|
|
40
40
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private_kernel_data.d.ts","sourceRoot":"","sources":["../../src/kernel/private_kernel_data.ts"],"names":[],"mappings":";;AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"private_kernel_data.d.ts","sourceRoot":"","sources":["../../src/kernel/private_kernel_data.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,KAAK,KAAK,EAAqB,MAAM,6BAA6B,CAAC;AAE1F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAC;AAE7F;;GAEG;AACH,qBAAa,iBAAiB;IAI1B;;OAEG;IACI,YAAY,EAAE,gCAAgC;IACrD;;OAEG;IACI,eAAe,EAAE,mBAAmB;IAC3C;;OAEG;IACI,OAAO,EAAE,MAAM;IACtB;;OAEG;IACI,MAAM,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,cAAc,CAAC;;IAf/C;;OAEG;IACI,YAAY,EAAE,gCAAgC;IACrD;;OAEG;IACI,eAAe,EAAE,mBAAmB;IAC3C;;OAEG;IACI,OAAO,EAAE,MAAM;IACtB;;OAEG;IACI,MAAM,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,cAAc,CAAC;IAGjD;;;OAGG;IACH,QAAQ;IAIR,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,iBAAiB;IAUnE,MAAM,CAAC,KAAK,IAAI,iBAAiB;CAQlC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { VK_TREE_HEIGHT } from '@aztec/constants';
|
|
2
2
|
import { makeTuple } from '@aztec/foundation/array';
|
|
3
3
|
import { Fr } from '@aztec/foundation/fields';
|
|
4
4
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
5
|
-
import {
|
|
5
|
+
import { VerificationKeyData } from '../vks/verification_key.js';
|
|
6
6
|
import { PrivateKernelCircuitPublicInputs } from './private_kernel_circuit_public_inputs.js';
|
|
7
7
|
/**
|
|
8
8
|
* Data of the previous kernel iteration in the chain of kernels.
|
|
9
9
|
*/ export class PrivateKernelData {
|
|
10
10
|
publicInputs;
|
|
11
|
-
|
|
11
|
+
verificationKey;
|
|
12
12
|
vkIndex;
|
|
13
13
|
vkPath;
|
|
14
14
|
// NOTE: as of move to honk and client IVC, previous private kernels no longer come with their proof
|
|
@@ -17,13 +17,13 @@ import { PrivateKernelCircuitPublicInputs } from './private_kernel_circuit_publi
|
|
|
17
17
|
* Public inputs of the previous kernel.
|
|
18
18
|
*/ publicInputs, /**
|
|
19
19
|
* Verification key of the previous kernel.
|
|
20
|
-
*/
|
|
20
|
+
*/ verificationKey, /**
|
|
21
21
|
* Index of the previous kernel's vk in a tree of vks.
|
|
22
22
|
*/ vkIndex, /**
|
|
23
23
|
* Sibling path of the previous kernel's vk in a tree of vks.
|
|
24
24
|
*/ vkPath){
|
|
25
25
|
this.publicInputs = publicInputs;
|
|
26
|
-
this.
|
|
26
|
+
this.verificationKey = verificationKey;
|
|
27
27
|
this.vkIndex = vkIndex;
|
|
28
28
|
this.vkPath = vkPath;
|
|
29
29
|
}
|
|
@@ -31,13 +31,13 @@ import { PrivateKernelCircuitPublicInputs } from './private_kernel_circuit_publi
|
|
|
31
31
|
* Serialize this as a buffer.
|
|
32
32
|
* @returns The buffer.
|
|
33
33
|
*/ toBuffer() {
|
|
34
|
-
return serializeToBuffer(this.publicInputs, this.
|
|
34
|
+
return serializeToBuffer(this.publicInputs, this.verificationKey, this.vkIndex, this.vkPath);
|
|
35
35
|
}
|
|
36
36
|
static fromBuffer(buffer) {
|
|
37
37
|
const reader = BufferReader.asReader(buffer);
|
|
38
|
-
return new this(reader.readObject(PrivateKernelCircuitPublicInputs), reader.readObject(
|
|
38
|
+
return new this(reader.readObject(PrivateKernelCircuitPublicInputs), reader.readObject(VerificationKeyData), reader.readNumber(), reader.readArray(VK_TREE_HEIGHT, Fr));
|
|
39
39
|
}
|
|
40
40
|
static empty() {
|
|
41
|
-
return new PrivateKernelData(PrivateKernelCircuitPublicInputs.empty(),
|
|
41
|
+
return new PrivateKernelData(PrivateKernelCircuitPublicInputs.empty(), VerificationKeyData.empty(), 0, makeTuple(VK_TREE_HEIGHT, Fr.zero));
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import type { WitnessMap } from '@aztec/noir-acvm_js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import type { ClientIvcProof } from '../proofs/client_ivc_proof.js';
|
|
6
|
-
import type { VerificationKeyAsFields } from '../vks/verification_key.js';
|
|
7
6
|
import type { PrivateKernelCircuitPublicInputs } from './private_kernel_circuit_public_inputs.js';
|
|
8
7
|
import type { PrivateKernelTailCircuitPublicInputs } from './private_kernel_tail_circuit_public_inputs.js';
|
|
9
8
|
export declare const PrivateExecutionStepSchema: z.ZodObject<{
|
|
@@ -11,13 +10,16 @@ export declare const PrivateExecutionStepSchema: z.ZodObject<{
|
|
|
11
10
|
gateCount: z.ZodOptional<z.ZodNumber>;
|
|
12
11
|
bytecode: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Buffer, string>;
|
|
13
12
|
witness: import("@aztec/foundation/schemas").ZodFor<Map<number, string>>;
|
|
13
|
+
vk: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Buffer, string>;
|
|
14
14
|
}, "strip", z.ZodTypeAny, {
|
|
15
15
|
bytecode: Buffer;
|
|
16
|
+
vk: Buffer;
|
|
16
17
|
functionName: string;
|
|
17
18
|
witness: Map<number, string>;
|
|
18
19
|
gateCount?: number | undefined;
|
|
19
20
|
}, {
|
|
20
21
|
bytecode: string;
|
|
22
|
+
vk: string;
|
|
21
23
|
functionName: string;
|
|
22
24
|
gateCount?: number | undefined;
|
|
23
25
|
witness?: any;
|
|
@@ -30,6 +32,7 @@ export interface PrivateExecutionStep {
|
|
|
30
32
|
gateCount?: number;
|
|
31
33
|
bytecode: Buffer;
|
|
32
34
|
witness: WitnessMap;
|
|
35
|
+
vk: Buffer;
|
|
33
36
|
}
|
|
34
37
|
/** Represents the output of proven PrivateKernelSimulateOutput.*/
|
|
35
38
|
export interface PrivateKernelExecutionProofOutput<PublicInputsType extends PrivateKernelCircuitPublicInputs | PrivateKernelTailCircuitPublicInputs> {
|
|
@@ -38,7 +41,7 @@ export interface PrivateKernelExecutionProofOutput<PublicInputsType extends Priv
|
|
|
38
41
|
/** The private IVC proof optimized for user devices. It will be consumed by an Aztec prover,
|
|
39
42
|
* which recursively verifies it through the "tube" circuit.*/
|
|
40
43
|
clientIvcProof: ClientIvcProof;
|
|
41
|
-
|
|
44
|
+
vk: Buffer;
|
|
42
45
|
/**
|
|
43
46
|
* The trace the clientIvcProof corresponds to.
|
|
44
47
|
* A trace of app circuits interleaved with private kernel circuits.
|
|
@@ -46,4 +49,5 @@ export interface PrivateKernelExecutionProofOutput<PublicInputsType extends Priv
|
|
|
46
49
|
*/
|
|
47
50
|
executionSteps: PrivateExecutionStep[];
|
|
48
51
|
}
|
|
52
|
+
export declare function serializePrivateExecutionSteps(steps: PrivateExecutionStep[]): Buffer;
|
|
49
53
|
//# sourceMappingURL=private_kernel_prover_output.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private_kernel_prover_output.d.ts","sourceRoot":"","sources":["../../src/kernel/private_kernel_prover_output.ts"],"names":[],"mappings":";;AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"private_kernel_prover_output.d.ts","sourceRoot":"","sources":["../../src/kernel/private_kernel_prover_output.ts"],"names":[],"mappings":";;AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAItD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,gDAAgD,CAAC;AAE3G,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;EAMrC,CAAC;AAEH;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,UAAU,CAAC;IAEpB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,kEAAkE;AAClE,MAAM,WAAW,iCAAiC,CAChD,gBAAgB,SAAS,gCAAgC,GAAG,oCAAoC;IAEhG,8DAA8D;IAC9D,YAAY,EAAE,gBAAgB,CAAC;IAC/B;kEAC8D;IAC9D,cAAc,EAAE,cAAc,CAAC;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX;;;;OAIG;IACH,cAAc,EAAE,oBAAoB,EAAE,CAAC;CACxC;AAED,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,oBAAoB,EAAE,UAU3E"}
|
|
@@ -1,8 +1,24 @@
|
|
|
1
1
|
import { bufferSchema, mapSchema } from '@aztec/foundation/schemas';
|
|
2
|
+
import { serializeWitness } from '@aztec/noir-noirc_abi';
|
|
3
|
+
import { Encoder } from 'msgpackr';
|
|
2
4
|
import { z } from 'zod';
|
|
3
5
|
export const PrivateExecutionStepSchema = z.object({
|
|
4
6
|
functionName: z.string(),
|
|
5
7
|
gateCount: z.number().optional(),
|
|
6
8
|
bytecode: bufferSchema,
|
|
7
|
-
witness: mapSchema(z.number(), z.string())
|
|
9
|
+
witness: mapSchema(z.number(), z.string()),
|
|
10
|
+
vk: bufferSchema
|
|
8
11
|
});
|
|
12
|
+
export function serializePrivateExecutionSteps(steps) {
|
|
13
|
+
const stepToStruct = (step)=>{
|
|
14
|
+
return {
|
|
15
|
+
bytecode: step.bytecode,
|
|
16
|
+
witness: serializeWitness(step.witness),
|
|
17
|
+
vk: step.vk,
|
|
18
|
+
functionName: step.functionName
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
return new Encoder({
|
|
22
|
+
useRecords: false
|
|
23
|
+
}).pack(steps.map(stepToStruct));
|
|
24
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
/// <reference types="node" resolution-mode="require"/>
|
|
3
3
|
import type { WitnessMap } from '@aztec/noir-acvm_js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { VerificationKeyData } from '../vks/verification_key.js';
|
|
5
5
|
import type { PrivateKernelCircuitPublicInputs } from './private_kernel_circuit_public_inputs.js';
|
|
6
6
|
import type { PrivateKernelTailCircuitPublicInputs } from './private_kernel_tail_circuit_public_inputs.js';
|
|
7
7
|
/**
|
|
@@ -12,13 +12,13 @@ export interface PrivateKernelSimulateOutput<PublicInputsType extends PrivateKer
|
|
|
12
12
|
/** The public inputs required for the proof generation process. */
|
|
13
13
|
publicInputs: PublicInputsType;
|
|
14
14
|
outputWitness: WitnessMap;
|
|
15
|
-
verificationKey:
|
|
15
|
+
verificationKey: VerificationKeyData;
|
|
16
16
|
bytecode: Buffer;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* Represents the output of the circuit simulation process for init and inner private kernel circuit.
|
|
20
20
|
*/
|
|
21
21
|
export type AppCircuitSimulateOutput = {
|
|
22
|
-
verificationKey:
|
|
22
|
+
verificationKey: VerificationKeyData;
|
|
23
23
|
};
|
|
24
24
|
//# sourceMappingURL=private_kernel_simulated_output.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private_kernel_simulated_output.d.ts","sourceRoot":"","sources":["../../src/kernel/private_kernel_simulated_output.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"private_kernel_simulated_output.d.ts","sourceRoot":"","sources":["../../src/kernel/private_kernel_simulated_output.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,gDAAgD,CAAC;AAE3G;;;GAGG;AACH,MAAM,WAAW,2BAA2B,CAC1C,gBAAgB,SAAS,gCAAgC,GAAG,oCAAoC;IAEhG,mEAAmE;IACnE,YAAY,EAAE,gBAAgB,CAAC;IAC/B,aAAa,EAAE,UAAU,CAAC;IAC1B,eAAe,EAAE,mBAAmB,CAAC;IACrC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,eAAe,EAAE,mBAAmB,CAAC;CACtC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiled_tx.d.ts","sourceRoot":"","sources":["../../src/tx/profiled_tx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAIxD,OAAO,EAAE,KAAK,oBAAoB,EAA8B,MAAM,2CAA2C,CAAC;AAElH,qBAAa,eAAe;IACP,cAAc,EAAE,oBAAoB,EAAE;gBAAtC,cAAc,EAAE,oBAAoB,EAAE;IAEzD,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,eAAe,CAAC,CAM3C;IAED,MAAM,CAAC,MAAM,IAAI,eAAe;
|
|
1
|
+
{"version":3,"file":"profiled_tx.d.ts","sourceRoot":"","sources":["../../src/tx/profiled_tx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAIxD,OAAO,EAAE,KAAK,oBAAoB,EAA8B,MAAM,2CAA2C,CAAC;AAElH,qBAAa,eAAe;IACP,cAAc,EAAE,oBAAoB,EAAE;gBAAtC,cAAc,EAAE,oBAAoB,EAAE;IAEzD,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,eAAe,CAAC,CAM3C;IAED,MAAM,CAAC,MAAM,IAAI,eAAe;CAUjC"}
|
package/dest/tx/profiled_tx.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/stdlib",
|
|
3
|
-
"version": "0.85.0-nightly.
|
|
3
|
+
"version": "0.85.0-nightly.20250418",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"inherits": [
|
|
6
6
|
"../package.common.json",
|
|
@@ -66,11 +66,12 @@
|
|
|
66
66
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@aztec/bb.js": "0.85.0-nightly.
|
|
70
|
-
"@aztec/blob-lib": "0.85.0-nightly.
|
|
71
|
-
"@aztec/constants": "0.85.0-nightly.
|
|
72
|
-
"@aztec/ethereum": "0.85.0-nightly.
|
|
73
|
-
"@aztec/foundation": "0.85.0-nightly.
|
|
69
|
+
"@aztec/bb.js": "0.85.0-nightly.20250418",
|
|
70
|
+
"@aztec/blob-lib": "0.85.0-nightly.20250418",
|
|
71
|
+
"@aztec/constants": "0.85.0-nightly.20250418",
|
|
72
|
+
"@aztec/ethereum": "0.85.0-nightly.20250418",
|
|
73
|
+
"@aztec/foundation": "0.85.0-nightly.20250418",
|
|
74
|
+
"@aztec/noir-noirc_abi": "0.85.0-nightly.20250418",
|
|
74
75
|
"@google-cloud/storage": "^7.15.0",
|
|
75
76
|
"lodash.chunk": "^4.2.0",
|
|
76
77
|
"lodash.isequal": "^4.5.0",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { VK_TREE_HEIGHT } from '@aztec/constants';
|
|
2
2
|
import { makeTuple } from '@aztec/foundation/array';
|
|
3
3
|
import { Fr } from '@aztec/foundation/fields';
|
|
4
4
|
import { BufferReader, type Tuple, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
5
5
|
|
|
6
6
|
import type { UInt32 } from '../types/shared.js';
|
|
7
|
-
import {
|
|
7
|
+
import { VerificationKeyData } from '../vks/verification_key.js';
|
|
8
8
|
import { PrivateKernelCircuitPublicInputs } from './private_kernel_circuit_public_inputs.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -21,7 +21,7 @@ export class PrivateKernelData {
|
|
|
21
21
|
/**
|
|
22
22
|
* Verification key of the previous kernel.
|
|
23
23
|
*/
|
|
24
|
-
public
|
|
24
|
+
public verificationKey: VerificationKeyData,
|
|
25
25
|
/**
|
|
26
26
|
* Index of the previous kernel's vk in a tree of vks.
|
|
27
27
|
*/
|
|
@@ -37,14 +37,14 @@ export class PrivateKernelData {
|
|
|
37
37
|
* @returns The buffer.
|
|
38
38
|
*/
|
|
39
39
|
toBuffer() {
|
|
40
|
-
return serializeToBuffer(this.publicInputs, this.
|
|
40
|
+
return serializeToBuffer(this.publicInputs, this.verificationKey, this.vkIndex, this.vkPath);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
static fromBuffer(buffer: Buffer | BufferReader): PrivateKernelData {
|
|
44
44
|
const reader = BufferReader.asReader(buffer);
|
|
45
45
|
return new this(
|
|
46
46
|
reader.readObject(PrivateKernelCircuitPublicInputs),
|
|
47
|
-
reader.readObject(
|
|
47
|
+
reader.readObject(VerificationKeyData),
|
|
48
48
|
reader.readNumber(),
|
|
49
49
|
reader.readArray(VK_TREE_HEIGHT, Fr),
|
|
50
50
|
);
|
|
@@ -53,7 +53,7 @@ export class PrivateKernelData {
|
|
|
53
53
|
static empty(): PrivateKernelData {
|
|
54
54
|
return new PrivateKernelData(
|
|
55
55
|
PrivateKernelCircuitPublicInputs.empty(),
|
|
56
|
-
|
|
56
|
+
VerificationKeyData.empty(),
|
|
57
57
|
0,
|
|
58
58
|
makeTuple(VK_TREE_HEIGHT, Fr.zero),
|
|
59
59
|
);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { bufferSchema, mapSchema } from '@aztec/foundation/schemas';
|
|
2
2
|
import type { WitnessMap } from '@aztec/noir-acvm_js';
|
|
3
|
+
import { serializeWitness } from '@aztec/noir-noirc_abi';
|
|
3
4
|
|
|
5
|
+
import { Encoder } from 'msgpackr';
|
|
4
6
|
import { z } from 'zod';
|
|
5
7
|
|
|
6
8
|
import type { ClientIvcProof } from '../proofs/client_ivc_proof.js';
|
|
7
|
-
import type { VerificationKeyAsFields } from '../vks/verification_key.js';
|
|
8
9
|
import type { PrivateKernelCircuitPublicInputs } from './private_kernel_circuit_public_inputs.js';
|
|
9
10
|
import type { PrivateKernelTailCircuitPublicInputs } from './private_kernel_tail_circuit_public_inputs.js';
|
|
10
11
|
|
|
@@ -13,6 +14,7 @@ export const PrivateExecutionStepSchema = z.object({
|
|
|
13
14
|
gateCount: z.number().optional(),
|
|
14
15
|
bytecode: bufferSchema,
|
|
15
16
|
witness: mapSchema(z.number(), z.string()),
|
|
17
|
+
vk: bufferSchema,
|
|
16
18
|
});
|
|
17
19
|
|
|
18
20
|
/**
|
|
@@ -23,6 +25,8 @@ export interface PrivateExecutionStep {
|
|
|
23
25
|
gateCount?: number;
|
|
24
26
|
bytecode: Buffer;
|
|
25
27
|
witness: WitnessMap;
|
|
28
|
+
/* TODO(https://github.com/AztecProtocol/barretenberg/issues/1328) this should get its own proper class. */
|
|
29
|
+
vk: Buffer;
|
|
26
30
|
}
|
|
27
31
|
|
|
28
32
|
/** Represents the output of proven PrivateKernelSimulateOutput.*/
|
|
@@ -34,7 +38,7 @@ export interface PrivateKernelExecutionProofOutput<
|
|
|
34
38
|
/** The private IVC proof optimized for user devices. It will be consumed by an Aztec prover,
|
|
35
39
|
* which recursively verifies it through the "tube" circuit.*/
|
|
36
40
|
clientIvcProof: ClientIvcProof;
|
|
37
|
-
|
|
41
|
+
vk: Buffer;
|
|
38
42
|
/**
|
|
39
43
|
* The trace the clientIvcProof corresponds to.
|
|
40
44
|
* A trace of app circuits interleaved with private kernel circuits.
|
|
@@ -42,3 +46,15 @@ export interface PrivateKernelExecutionProofOutput<
|
|
|
42
46
|
*/
|
|
43
47
|
executionSteps: PrivateExecutionStep[];
|
|
44
48
|
}
|
|
49
|
+
|
|
50
|
+
export function serializePrivateExecutionSteps(steps: PrivateExecutionStep[]) {
|
|
51
|
+
const stepToStruct = (step: PrivateExecutionStep) => {
|
|
52
|
+
return {
|
|
53
|
+
bytecode: step.bytecode,
|
|
54
|
+
witness: serializeWitness(step.witness),
|
|
55
|
+
vk: step.vk,
|
|
56
|
+
functionName: step.functionName,
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
return new Encoder({ useRecords: false }).pack(steps.map(stepToStruct));
|
|
60
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { WitnessMap } from '@aztec/noir-acvm_js';
|
|
2
2
|
|
|
3
|
-
import type {
|
|
3
|
+
import type { VerificationKeyData } from '../vks/verification_key.js';
|
|
4
4
|
import type { PrivateKernelCircuitPublicInputs } from './private_kernel_circuit_public_inputs.js';
|
|
5
5
|
import type { PrivateKernelTailCircuitPublicInputs } from './private_kernel_tail_circuit_public_inputs.js';
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@ export interface PrivateKernelSimulateOutput<
|
|
|
14
14
|
/** The public inputs required for the proof generation process. */
|
|
15
15
|
publicInputs: PublicInputsType;
|
|
16
16
|
outputWitness: WitnessMap;
|
|
17
|
-
verificationKey:
|
|
17
|
+
verificationKey: VerificationKeyData;
|
|
18
18
|
bytecode: Buffer;
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -22,5 +22,5 @@ export interface PrivateKernelSimulateOutput<
|
|
|
22
22
|
* Represents the output of the circuit simulation process for init and inner private kernel circuit.
|
|
23
23
|
*/
|
|
24
24
|
export type AppCircuitSimulateOutput = {
|
|
25
|
-
verificationKey:
|
|
25
|
+
verificationKey: VerificationKeyData;
|
|
26
26
|
};
|