@aztec/stdlib 3.0.0-nightly.20251026 → 3.0.0-nightly.20251030-2

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.
Files changed (138) hide show
  1. package/dest/block/body.d.ts.map +1 -1
  2. package/dest/block/body.js +2 -6
  3. package/dest/block/l2_block.d.ts +11 -0
  4. package/dest/block/l2_block.d.ts.map +1 -1
  5. package/dest/block/l2_block.js +15 -1
  6. package/dest/block/l2_block_source.d.ts +5 -5
  7. package/dest/block/l2_block_source.d.ts.map +1 -1
  8. package/dest/checkpoint/checkpoint_body.d.ts +4 -0
  9. package/dest/checkpoint/checkpoint_body.d.ts.map +1 -0
  10. package/dest/checkpoint/checkpoint_body.js +9 -0
  11. package/dest/checkpoint/index.d.ts +2 -0
  12. package/dest/checkpoint/index.d.ts.map +1 -0
  13. package/dest/checkpoint/index.js +1 -0
  14. package/dest/interfaces/archiver.js +3 -3
  15. package/dest/interfaces/epoch-prover.d.ts +3 -3
  16. package/dest/interfaces/epoch-prover.d.ts.map +1 -1
  17. package/dest/interfaces/private_kernel_prover.d.ts +2 -2
  18. package/dest/interfaces/private_kernel_prover.d.ts.map +1 -1
  19. package/dest/interfaces/proving-job.d.ts +15 -15
  20. package/dest/interfaces/proving-job.d.ts.map +1 -1
  21. package/dest/interfaces/proving-job.js +8 -8
  22. package/dest/interfaces/server_circuit_prover.d.ts +3 -3
  23. package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
  24. package/dest/kernel/private_kernel_data.js +2 -2
  25. package/dest/kernel/private_kernel_prover_output.d.ts +4 -4
  26. package/dest/kernel/private_kernel_prover_output.d.ts.map +1 -1
  27. package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts +1 -0
  28. package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts.map +1 -1
  29. package/dest/kernel/private_kernel_tail_circuit_public_inputs.js +3 -0
  30. package/dest/keys/derivation.d.ts.map +1 -1
  31. package/dest/keys/derivation.js +2 -3
  32. package/dest/logs/directional_app_tagging_secret.d.ts.map +1 -1
  33. package/dest/logs/directional_app_tagging_secret.js +1 -2
  34. package/dest/logs/shared_secret_derivation.d.ts.map +1 -1
  35. package/dest/logs/shared_secret_derivation.js +2 -4
  36. package/dest/p2p/gossipable.d.ts +4 -12
  37. package/dest/p2p/gossipable.d.ts.map +1 -1
  38. package/dest/p2p/gossipable.js +4 -7
  39. package/dest/p2p/topic_type.d.ts +4 -8
  40. package/dest/p2p/topic_type.d.ts.map +1 -1
  41. package/dest/p2p/topic_type.js +14 -8
  42. package/dest/proofs/chonk_proof.d.ts +28 -0
  43. package/dest/proofs/chonk_proof.d.ts.map +1 -0
  44. package/dest/proofs/chonk_proof.js +101 -0
  45. package/dest/proofs/index.d.ts +1 -1
  46. package/dest/proofs/index.d.ts.map +1 -1
  47. package/dest/proofs/index.js +1 -1
  48. package/dest/proofs/proof_data.d.ts +2 -2
  49. package/dest/proofs/proof_data.d.ts.map +1 -1
  50. package/dest/proofs/proving_request_type.d.ts +1 -1
  51. package/dest/proofs/proving_request_type.d.ts.map +1 -1
  52. package/dest/proofs/proving_request_type.js +1 -1
  53. package/dest/rollup/checkpoint_rollup_public_inputs.d.ts +1 -1
  54. package/dest/rollup/checkpoint_rollup_public_inputs.d.ts.map +1 -1
  55. package/dest/rollup/checkpoint_rollup_public_inputs.js +1 -1
  56. package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts +1 -1
  57. package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts.map +1 -1
  58. package/dest/rollup/checkpoint_root_rollup_private_inputs.js +1 -1
  59. package/dest/rollup/index.d.ts +2 -2
  60. package/dest/rollup/index.d.ts.map +1 -1
  61. package/dest/rollup/index.js +2 -2
  62. package/dest/rollup/private_tx_base_rollup_private_inputs.d.ts +4 -4
  63. package/dest/rollup/private_tx_base_rollup_private_inputs.d.ts.map +1 -1
  64. package/dest/rollup/public_chonk_verifier_private_inputs.d.ts +21 -0
  65. package/dest/rollup/public_chonk_verifier_private_inputs.d.ts.map +1 -0
  66. package/dest/rollup/{public_tube_private_inputs.js → public_chonk_verifier_private_inputs.js} +7 -6
  67. package/dest/rollup/{public_tube_public_inputs.d.ts → public_chonk_verifier_public_inputs.d.ts} +7 -7
  68. package/dest/rollup/public_chonk_verifier_public_inputs.d.ts.map +1 -0
  69. package/dest/rollup/{public_tube_public_inputs.js → public_chonk_verifier_public_inputs.js} +7 -6
  70. package/dest/rollup/public_tx_base_rollup_private_inputs.d.ts +4 -4
  71. package/dest/rollup/public_tx_base_rollup_private_inputs.d.ts.map +1 -1
  72. package/dest/rollup/public_tx_base_rollup_private_inputs.js +6 -6
  73. package/dest/rollup/root_rollup_public_inputs.d.ts +1 -1
  74. package/dest/rollup/root_rollup_public_inputs.d.ts.map +1 -1
  75. package/dest/rollup/root_rollup_public_inputs.js +1 -1
  76. package/dest/stats/stats.d.ts +3 -3
  77. package/dest/stats/stats.d.ts.map +1 -1
  78. package/dest/tests/factories.d.ts +3 -3
  79. package/dest/tests/factories.d.ts.map +1 -1
  80. package/dest/tests/factories.js +15 -15
  81. package/dest/tests/mocks.d.ts +3 -3
  82. package/dest/tests/mocks.d.ts.map +1 -1
  83. package/dest/tests/mocks.js +3 -3
  84. package/dest/tx/processed_tx.d.ts +2 -3
  85. package/dest/tx/processed_tx.d.ts.map +1 -1
  86. package/dest/tx/processed_tx.js +2 -7
  87. package/dest/tx/proven_tx.d.ts +7 -7
  88. package/dest/tx/proven_tx.d.ts.map +1 -1
  89. package/dest/tx/proven_tx.js +8 -8
  90. package/dest/tx/simulated_tx.js +2 -2
  91. package/dest/tx/tx.d.ts +3 -3
  92. package/dest/tx/tx.d.ts.map +1 -1
  93. package/dest/tx/tx.js +13 -13
  94. package/package.json +9 -8
  95. package/src/block/body.ts +3 -12
  96. package/src/block/l2_block.ts +15 -0
  97. package/src/block/l2_block_source.ts +5 -5
  98. package/src/checkpoint/checkpoint_body.ts +10 -0
  99. package/src/checkpoint/index.ts +1 -0
  100. package/src/interfaces/archiver.ts +3 -3
  101. package/src/interfaces/epoch-prover.ts +3 -3
  102. package/src/interfaces/private_kernel_prover.ts +2 -2
  103. package/src/interfaces/proving-job.ts +13 -10
  104. package/src/interfaces/server_circuit_prover.ts +7 -5
  105. package/src/kernel/private_kernel_data.ts +2 -2
  106. package/src/kernel/private_kernel_prover_output.ts +4 -4
  107. package/src/kernel/private_kernel_tail_circuit_public_inputs.ts +6 -0
  108. package/src/keys/derivation.ts +2 -3
  109. package/src/logs/directional_app_tagging_secret.ts +1 -2
  110. package/src/logs/shared_secret_derivation.ts +2 -4
  111. package/src/p2p/gossipable.ts +4 -12
  112. package/src/p2p/topic_type.ts +15 -8
  113. package/src/proofs/chonk_proof.ts +118 -0
  114. package/src/proofs/index.ts +1 -1
  115. package/src/proofs/proof_data.ts +2 -2
  116. package/src/proofs/proving_request_type.ts +1 -1
  117. package/src/rollup/checkpoint_rollup_public_inputs.ts +1 -1
  118. package/src/rollup/checkpoint_root_rollup_private_inputs.ts +1 -1
  119. package/src/rollup/index.ts +2 -2
  120. package/src/rollup/private_tx_base_rollup_private_inputs.ts +2 -2
  121. package/src/rollup/{public_tube_private_inputs.ts → public_chonk_verifier_private_inputs.ts} +11 -10
  122. package/src/rollup/{public_tube_public_inputs.ts → public_chonk_verifier_public_inputs.ts} +9 -8
  123. package/src/rollup/public_tx_base_rollup_private_inputs.ts +4 -4
  124. package/src/rollup/root_rollup_public_inputs.ts +1 -1
  125. package/src/stats/stats.ts +3 -3
  126. package/src/tests/factories.ts +21 -21
  127. package/src/tests/mocks.ts +4 -4
  128. package/src/tx/processed_tx.ts +4 -10
  129. package/src/tx/proven_tx.ts +6 -6
  130. package/src/tx/simulated_tx.ts +2 -2
  131. package/src/tx/tx.ts +11 -11
  132. package/dest/proofs/client_ivc_proof.d.ts +0 -15
  133. package/dest/proofs/client_ivc_proof.d.ts.map +0 -1
  134. package/dest/proofs/client_ivc_proof.js +0 -48
  135. package/dest/rollup/public_tube_private_inputs.d.ts +0 -21
  136. package/dest/rollup/public_tube_private_inputs.d.ts.map +0 -1
  137. package/dest/rollup/public_tube_public_inputs.d.ts.map +0 -1
  138. package/src/proofs/client_ivc_proof.ts +0 -57
@@ -1,18 +1,25 @@
1
1
  import { P2PClientType } from './client_type.js';
2
2
 
3
- /** Create Topic String
4
- *
5
- * The topic channel identifier
6
- * @param topicType
7
- * @returns
3
+ /**
4
+ * Creates the topic channel identifier string from a given topic type
8
5
  */
9
6
  export function createTopicString(topicType: TopicType, protocolVersion: string) {
10
7
  return `/aztec/${TopicType[topicType]}/${protocolVersion}`;
11
8
  }
12
9
 
13
- /**
14
- *
15
- */
10
+ /** Extracts the topic type from a topic string */
11
+ export function getTopicFromString(topicStr: string): TopicType | undefined {
12
+ const parts = topicStr.split('/');
13
+ if (parts.length < 4 || parts[1] !== 'aztec') {
14
+ return undefined;
15
+ }
16
+ const topic = parts[2];
17
+ if (Object.values(TopicType).includes(topic as TopicType)) {
18
+ return topic as TopicType;
19
+ }
20
+ return undefined;
21
+ }
22
+
16
23
  export enum TopicType {
17
24
  tx = 'tx',
18
25
  block_proposal = 'block_proposal',
@@ -0,0 +1,118 @@
1
+ import { CHONK_PROOF_LENGTH } from '@aztec/constants';
2
+ import { randomBytes } from '@aztec/foundation/crypto';
3
+ import { Fr } from '@aztec/foundation/fields';
4
+ import { bufferSchemaFor } from '@aztec/foundation/schemas';
5
+ import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
6
+
7
+ // CHONK: "Client Honk" - An UltraHonk variant with incremental folding and delayed non-native arithmetic.
8
+ export class ChonkProof {
9
+ constructor(
10
+ // The proof fields.
11
+ // For native verification, attach public inputs via `attachPublicInputs(publicInputs)`.
12
+ // Not using Tuple here due to the length being too high.
13
+ public fields: Fr[],
14
+ ) {
15
+ if (fields.length !== CHONK_PROOF_LENGTH) {
16
+ throw new Error(`Invalid ChonkProof length: ${fields.length}`);
17
+ }
18
+ }
19
+
20
+ public attachPublicInputs(publicInputs: Fr[]) {
21
+ return new ChonkProofWithPublicInputs([...publicInputs, ...this.fields]);
22
+ }
23
+
24
+ public isEmpty() {
25
+ return this.fields.every(field => field.isZero());
26
+ }
27
+
28
+ static empty() {
29
+ return new ChonkProof(new Array(CHONK_PROOF_LENGTH).fill(Fr.ZERO));
30
+ }
31
+
32
+ static random() {
33
+ // NB: Not using Fr.random here because it slows down some tests that require a large number of txs significantly.
34
+ const reducedFrSize = Fr.SIZE_IN_BYTES - 1;
35
+ const randomFields = randomBytes(CHONK_PROOF_LENGTH * reducedFrSize);
36
+ const proof = Array.from(
37
+ { length: CHONK_PROOF_LENGTH },
38
+ (_, i) => new Fr(randomFields.subarray(i * reducedFrSize, (i + 1) * reducedFrSize)),
39
+ );
40
+ return new ChonkProof(proof);
41
+ }
42
+
43
+ static get schema() {
44
+ return bufferSchemaFor(ChonkProof);
45
+ }
46
+
47
+ // We use this in tandem with the bufferSchemaFor to serialize to base64 strings.
48
+ toJSON() {
49
+ return this.toBuffer();
50
+ }
51
+
52
+ static fromBuffer(buffer: Buffer | BufferReader): ChonkProof {
53
+ const reader = BufferReader.asReader(buffer);
54
+ const proofLength = reader.readNumber();
55
+ const proof = reader.readArray(proofLength, Fr);
56
+ return new ChonkProof(proof);
57
+ }
58
+
59
+ public toBuffer() {
60
+ return serializeToBuffer(this.fields.length, this.fields);
61
+ }
62
+ }
63
+
64
+ export class ChonkProofWithPublicInputs {
65
+ constructor(
66
+ // The proof fields with public inputs.
67
+ // For recursive verification, use without public inputs via `removePublicInputs()`.
68
+ public fieldsWithPublicInputs: Fr[],
69
+ ) {
70
+ if (fieldsWithPublicInputs.length < CHONK_PROOF_LENGTH) {
71
+ throw new Error(`Invalid ChonkProofWithPublicInputs length: ${fieldsWithPublicInputs.length}`);
72
+ }
73
+ }
74
+
75
+ public getPublicInputs() {
76
+ const numPublicInputs = this.fieldsWithPublicInputs.length - CHONK_PROOF_LENGTH;
77
+ return this.fieldsWithPublicInputs.slice(0, numPublicInputs);
78
+ }
79
+
80
+ public removePublicInputs() {
81
+ const numPublicInputs = this.fieldsWithPublicInputs.length - CHONK_PROOF_LENGTH;
82
+ return new ChonkProof(this.fieldsWithPublicInputs.slice(numPublicInputs));
83
+ }
84
+
85
+ public isEmpty() {
86
+ return this.fieldsWithPublicInputs.every(field => field.isZero());
87
+ }
88
+
89
+ static empty() {
90
+ return ChonkProof.empty().attachPublicInputs([]);
91
+ }
92
+
93
+ static get schema() {
94
+ return bufferSchemaFor(ChonkProofWithPublicInputs);
95
+ }
96
+
97
+ // We use this in tandem with the bufferSchemaFor to serialize to base64 strings.
98
+ toJSON() {
99
+ return this.toBuffer();
100
+ }
101
+
102
+ static fromBuffer(buffer: Buffer | BufferReader): ChonkProofWithPublicInputs {
103
+ const reader = BufferReader.asReader(buffer);
104
+ const proofLength = reader.readNumber();
105
+ const proof = reader.readArray(proofLength, Fr);
106
+ return new ChonkProofWithPublicInputs(proof);
107
+ }
108
+
109
+ public toBuffer() {
110
+ return serializeToBuffer(this.fieldsWithPublicInputs.length, this.fieldsWithPublicInputs);
111
+ }
112
+
113
+ // Called when constructing from bb proving results.
114
+ static fromBufferArray(fields: Uint8Array[]): ChonkProofWithPublicInputs {
115
+ const proof = fields.map(field => Fr.fromBuffer(Buffer.from(field)));
116
+ return new ChonkProofWithPublicInputs(proof);
117
+ }
118
+ }
@@ -1,5 +1,5 @@
1
1
  export * from './recursive_proof.js';
2
- export * from './client_ivc_proof.js';
2
+ export * from './chonk_proof.js';
3
3
  export * from './proof.js';
4
4
  export * from './proof_data.js';
5
5
  export * from './proving_request_type.js';
@@ -1,4 +1,4 @@
1
- import type { CIVC_PROOF_LENGTH, RECURSIVE_PROOF_LENGTH, RECURSIVE_ROLLUP_HONK_PROOF_LENGTH } from '@aztec/constants';
1
+ import type { CHONK_PROOF_LENGTH, RECURSIVE_PROOF_LENGTH, RECURSIVE_ROLLUP_HONK_PROOF_LENGTH } from '@aztec/constants';
2
2
  import { BufferReader, type Bufferable, serializeToBuffer } from '@aztec/foundation/serialize';
3
3
 
4
4
  import { RecursiveProof } from '../proofs/recursive_proof.js';
@@ -29,7 +29,7 @@ export class ProofData<T extends Bufferable, PROOF_LENGTH extends number> {
29
29
  }
30
30
  }
31
31
 
32
- export type CivcProofData<T extends Bufferable> = ProofData<T, typeof CIVC_PROOF_LENGTH>;
32
+ export type ChonkProofData<T extends Bufferable> = ProofData<T, typeof CHONK_PROOF_LENGTH>;
33
33
 
34
34
  export type UltraHonkProofData<T extends Bufferable> = ProofData<T, typeof RECURSIVE_PROOF_LENGTH>;
35
35
 
@@ -1,6 +1,6 @@
1
1
  export enum ProvingRequestType {
2
2
  PUBLIC_VM,
3
- PUBLIC_TUBE,
3
+ PUBLIC_CHONK_VERIFIER,
4
4
 
5
5
  PRIVATE_TX_BASE_ROLLUP,
6
6
  PUBLIC_TX_BASE_ROLLUP,
@@ -1,4 +1,4 @@
1
- import { BlobAccumulator, FinalBlobBatchingChallenges } from '@aztec/blob-lib';
1
+ import { BlobAccumulator, FinalBlobBatchingChallenges } from '@aztec/blob-lib/types';
2
2
  import { AZTEC_MAX_EPOCH_DURATION } from '@aztec/constants';
3
3
  import { EthAddress } from '@aztec/foundation/eth-address';
4
4
  import { Fr } from '@aztec/foundation/fields';
@@ -1,4 +1,4 @@
1
- import { BlobAccumulator, FinalBlobBatchingChallenges } from '@aztec/blob-lib';
1
+ import { BlobAccumulator, FinalBlobBatchingChallenges } from '@aztec/blob-lib/types';
2
2
  import { ARCHIVE_HEIGHT, BLOBS_PER_BLOCK, FIELDS_PER_BLOB } from '@aztec/constants';
3
3
  import { BLS12Point, Fr } from '@aztec/foundation/fields';
4
4
  import { bufferSchemaFor } from '@aztec/foundation/schemas';
@@ -12,8 +12,8 @@ export * from './checkpoint_root_rollup_private_inputs.js';
12
12
  export * from './epoch_constant_data.js';
13
13
  export * from './private_tx_base_rollup_private_inputs.js';
14
14
  export * from './public_tx_base_rollup_private_inputs.js';
15
- export * from './public_tube_private_inputs.js';
16
- export * from './public_tube_public_inputs.js';
15
+ export * from './public_chonk_verifier_private_inputs.js';
16
+ export * from './public_chonk_verifier_public_inputs.js';
17
17
  export * from './root_rollup_private_inputs.js';
18
18
  export * from './root_rollup_public_inputs.js';
19
19
  export * from './tree_snapshot_diff_hints.js';
@@ -4,12 +4,12 @@ import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
4
4
  import type { FieldsOf } from '@aztec/foundation/types';
5
5
 
6
6
  import { PrivateToRollupKernelCircuitPublicInputs } from '../kernel/private_to_rollup_kernel_circuit_public_inputs.js';
7
- import { type CivcProofData, ProofData } from '../proofs/proof_data.js';
7
+ import { type ChonkProofData, ProofData } from '../proofs/proof_data.js';
8
8
  import { PrivateBaseRollupHints } from './base_rollup_hints.js';
9
9
 
10
10
  export class PrivateTxBaseRollupPrivateInputs {
11
11
  constructor(
12
- public hidingKernelProofData: CivcProofData<PrivateToRollupKernelCircuitPublicInputs>,
12
+ public hidingKernelProofData: ChonkProofData<PrivateToRollupKernelCircuitPublicInputs>,
13
13
  public hints: PrivateBaseRollupHints,
14
14
  ) {}
15
15
 
@@ -5,36 +5,37 @@ import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
5
5
  import type { FieldsOf } from '@aztec/foundation/types';
6
6
 
7
7
  import { PrivateToPublicKernelCircuitPublicInputs } from '../kernel/private_to_public_kernel_circuit_public_inputs.js';
8
- import { type CivcProofData, ProofData } from '../proofs/proof_data.js';
8
+ import { type ChonkProofData, ProofData } from '../proofs/proof_data.js';
9
9
 
10
- export class PublicTubePrivateInputs {
10
+ // CHONK_VERIFIER: Recursively verifies Chonk (Client Honk) proofs in circuits
11
+ export class PublicChonkVerifierPrivateInputs {
11
12
  constructor(
12
- public hidingKernelProofData: CivcProofData<PrivateToPublicKernelCircuitPublicInputs>,
13
+ public hidingKernelProofData: ChonkProofData<PrivateToPublicKernelCircuitPublicInputs>,
13
14
  public proverId: Fr,
14
15
  ) {}
15
16
 
16
- static from(fields: FieldsOf<PublicTubePrivateInputs>) {
17
- return new PublicTubePrivateInputs(...PublicTubePrivateInputs.getFields(fields));
17
+ static from(fields: FieldsOf<PublicChonkVerifierPrivateInputs>) {
18
+ return new PublicChonkVerifierPrivateInputs(...PublicChonkVerifierPrivateInputs.getFields(fields));
18
19
  }
19
20
 
20
- static getFields(fields: FieldsOf<PublicTubePrivateInputs>) {
21
+ static getFields(fields: FieldsOf<PublicChonkVerifierPrivateInputs>) {
21
22
  return [fields.hidingKernelProofData, fields.proverId] as const;
22
23
  }
23
24
 
24
25
  static fromBuffer(buffer: Buffer | BufferReader) {
25
26
  const reader = BufferReader.asReader(buffer);
26
- return new PublicTubePrivateInputs(
27
+ return new PublicChonkVerifierPrivateInputs(
27
28
  ProofData.fromBuffer(reader, PrivateToPublicKernelCircuitPublicInputs),
28
29
  Fr.fromBuffer(reader),
29
30
  );
30
31
  }
31
32
 
32
33
  toBuffer() {
33
- return serializeToBuffer(...PublicTubePrivateInputs.getFields(this));
34
+ return serializeToBuffer(...PublicChonkVerifierPrivateInputs.getFields(this));
34
35
  }
35
36
 
36
37
  static fromString(str: string) {
37
- return PublicTubePrivateInputs.fromBuffer(hexToBuffer(str));
38
+ return PublicChonkVerifierPrivateInputs.fromBuffer(hexToBuffer(str));
38
39
  }
39
40
 
40
41
  toString() {
@@ -48,6 +49,6 @@ export class PublicTubePrivateInputs {
48
49
 
49
50
  /** Creates an instance from a string. */
50
51
  static get schema() {
51
- return bufferSchemaFor(PublicTubePrivateInputs);
52
+ return bufferSchemaFor(PublicChonkVerifierPrivateInputs);
52
53
  }
53
54
  }
@@ -6,34 +6,35 @@ import type { FieldsOf } from '@aztec/foundation/types';
6
6
 
7
7
  import { PrivateToPublicKernelCircuitPublicInputs } from '../kernel/private_to_public_kernel_circuit_public_inputs.js';
8
8
 
9
- export class PublicTubePublicInputs {
9
+ // CHONK_VERIFIER: Recursively verifies Chonk (Client Honk) proofs in circuits
10
+ export class PublicChonkVerifierPublicInputs {
10
11
  constructor(
11
12
  public privateTail: PrivateToPublicKernelCircuitPublicInputs,
12
13
  public proverId: Fr,
13
14
  ) {}
14
15
 
15
- static from(fields: FieldsOf<PublicTubePublicInputs>) {
16
- return new PublicTubePublicInputs(...PublicTubePublicInputs.getFields(fields));
16
+ static from(fields: FieldsOf<PublicChonkVerifierPublicInputs>) {
17
+ return new PublicChonkVerifierPublicInputs(...PublicChonkVerifierPublicInputs.getFields(fields));
17
18
  }
18
19
 
19
- static getFields(fields: FieldsOf<PublicTubePublicInputs>) {
20
+ static getFields(fields: FieldsOf<PublicChonkVerifierPublicInputs>) {
20
21
  return [fields.privateTail, fields.proverId] as const;
21
22
  }
22
23
 
23
24
  static fromBuffer(buffer: Buffer | BufferReader) {
24
25
  const reader = BufferReader.asReader(buffer);
25
- return new PublicTubePublicInputs(
26
+ return new PublicChonkVerifierPublicInputs(
26
27
  reader.readObject(PrivateToPublicKernelCircuitPublicInputs),
27
28
  reader.readObject(Fr),
28
29
  );
29
30
  }
30
31
 
31
32
  toBuffer() {
32
- return serializeToBuffer(...PublicTubePublicInputs.getFields(this));
33
+ return serializeToBuffer(...PublicChonkVerifierPublicInputs.getFields(this));
33
34
  }
34
35
 
35
36
  static fromString(str: string) {
36
- return PublicTubePublicInputs.fromBuffer(hexToBuffer(str));
37
+ return PublicChonkVerifierPublicInputs.fromBuffer(hexToBuffer(str));
37
38
  }
38
39
 
39
40
  toString() {
@@ -47,6 +48,6 @@ export class PublicTubePublicInputs {
47
48
 
48
49
  /** Creates an instance from a string. */
49
50
  static get schema() {
50
- return bufferSchemaFor(PublicTubePublicInputs);
51
+ return bufferSchemaFor(PublicChonkVerifierPublicInputs);
51
52
  }
52
53
  }
@@ -7,11 +7,11 @@ import { AvmCircuitPublicInputs } from '../avm/avm_circuit_public_inputs.js';
7
7
  import { ProofData, type RollupHonkProofData } from '../proofs/proof_data.js';
8
8
  import type { AvmProofData } from './avm_proof_data.js';
9
9
  import { PublicBaseRollupHints } from './base_rollup_hints.js';
10
- import { PublicTubePublicInputs } from './public_tube_public_inputs.js';
10
+ import { PublicChonkVerifierPublicInputs } from './public_chonk_verifier_public_inputs.js';
11
11
 
12
12
  export class PublicTxBaseRollupPrivateInputs {
13
13
  constructor(
14
- public publicTubeProofData: RollupHonkProofData<PublicTubePublicInputs>,
14
+ public publicChonkVerifierProofData: RollupHonkProofData<PublicChonkVerifierPublicInputs>,
15
15
  public avmProofData: AvmProofData,
16
16
  public hints: PublicBaseRollupHints,
17
17
  ) {}
@@ -21,13 +21,13 @@ export class PublicTxBaseRollupPrivateInputs {
21
21
  }
22
22
 
23
23
  static getFields(fields: FieldsOf<PublicTxBaseRollupPrivateInputs>) {
24
- return [fields.publicTubeProofData, fields.avmProofData, fields.hints] as const;
24
+ return [fields.publicChonkVerifierProofData, fields.avmProofData, fields.hints] as const;
25
25
  }
26
26
 
27
27
  static fromBuffer(buffer: Buffer | BufferReader): PublicTxBaseRollupPrivateInputs {
28
28
  const reader = BufferReader.asReader(buffer);
29
29
  return new PublicTxBaseRollupPrivateInputs(
30
- ProofData.fromBuffer(reader, PublicTubePublicInputs),
30
+ ProofData.fromBuffer(reader, PublicChonkVerifierPublicInputs),
31
31
  ProofData.fromBuffer(reader, AvmCircuitPublicInputs),
32
32
  reader.readObject(PublicBaseRollupHints),
33
33
  );
@@ -1,4 +1,4 @@
1
- import { FinalBlobAccumulator } from '@aztec/blob-lib';
1
+ import { FinalBlobAccumulator } from '@aztec/blob-lib/types';
2
2
  import { AZTEC_MAX_EPOCH_DURATION } from '@aztec/constants';
3
3
  import { makeTuple } from '@aztec/foundation/array';
4
4
  import { Fr } from '@aztec/foundation/fields';
@@ -88,7 +88,7 @@ export type ClientCircuitName =
88
88
  export type ServerCircuitName =
89
89
  | 'parity-base'
90
90
  | 'parity-root'
91
- | 'tube-public'
91
+ | 'chonk-verifier-public'
92
92
  | 'rollup-tx-base-private'
93
93
  | 'rollup-tx-base-public'
94
94
  | 'rollup-tx-merge'
@@ -181,8 +181,8 @@ export type CircuitVerificationStats = {
181
181
  eventName: 'circuit-verification';
182
182
  /** Name of the circuit. */
183
183
  circuitName: CircuitName;
184
- /** Type of proof (client-ivc, honk, etc) */
185
- proofType: 'client-ivc' | 'ultra-honk';
184
+ /** Type of proof (chonk, honk, etc) */
185
+ proofType: 'chonk' | 'ultra-honk';
186
186
  /** Duration in ms. */
187
187
  duration: number;
188
188
  };
@@ -1,10 +1,9 @@
1
- import { BlobAccumulator, FinalBlobAccumulator } from '@aztec/blob-lib';
2
1
  import { makeBatchedBlobAccumulator, makeSpongeBlob } from '@aztec/blob-lib/testing';
3
2
  import {
4
3
  ARCHIVE_HEIGHT,
5
4
  AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED,
6
5
  AZTEC_MAX_EPOCH_DURATION,
7
- CIVC_PROOF_LENGTH,
6
+ CHONK_PROOF_LENGTH,
8
7
  CONTRACT_CLASS_LOG_SIZE_IN_FIELDS,
9
8
  FIXED_DA_GAS,
10
9
  FIXED_L2_GAS,
@@ -42,9 +41,9 @@ import {
42
41
  } from '@aztec/constants';
43
42
  import { type FieldsOf, makeHalfFullTuple, makeTuple } from '@aztec/foundation/array';
44
43
  import { compact, padArrayEnd } from '@aztec/foundation/collection';
45
- import { SchnorrSignature, poseidon2HashWithSeparator, sha256 } from '@aztec/foundation/crypto';
44
+ import { Grumpkin, SchnorrSignature, poseidon2HashWithSeparator, sha256 } from '@aztec/foundation/crypto';
46
45
  import { EthAddress } from '@aztec/foundation/eth-address';
47
- import { Fr, GrumpkinScalar, Point } from '@aztec/foundation/fields';
46
+ import { Fq, Fr, GrumpkinScalar, Point } from '@aztec/foundation/fields';
48
47
  import type { Bufferable, Serializable, Tuple } from '@aztec/foundation/serialize';
49
48
  import { MembershipWitness } from '@aztec/foundation/trees';
50
49
 
@@ -143,7 +142,7 @@ import { CheckpointHeader } from '../rollup/checkpoint_header.js';
143
142
  import { CheckpointRollupPublicInputs, FeeRecipient } from '../rollup/checkpoint_rollup_public_inputs.js';
144
143
  import { EpochConstantData } from '../rollup/epoch_constant_data.js';
145
144
  import { PrivateTxBaseRollupPrivateInputs } from '../rollup/private_tx_base_rollup_private_inputs.js';
146
- import { PublicTubePublicInputs } from '../rollup/public_tube_public_inputs.js';
145
+ import { PublicChonkVerifierPublicInputs } from '../rollup/public_chonk_verifier_public_inputs.js';
147
146
  import { PublicTxBaseRollupPrivateInputs } from '../rollup/public_tx_base_rollup_private_inputs.js';
148
147
  import { RootRollupPublicInputs } from '../rollup/root_rollup_public_inputs.js';
149
148
  import { TreeSnapshotDiffHints } from '../rollup/tree_snapshot_diff_hints.js';
@@ -417,8 +416,8 @@ export function makePrivateToPublicKernelCircuitPublicInputs(seed = 1) {
417
416
  );
418
417
  }
419
418
 
420
- export function makePublicTubePublicInputs(seed = 1) {
421
- return new PublicTubePublicInputs(makePrivateToPublicKernelCircuitPublicInputs(seed), fr(seed + 0x1000));
419
+ export function makePublicChonkVerifierPublicInputs(seed = 1) {
420
+ return new PublicChonkVerifierPublicInputs(makePrivateToPublicKernelCircuitPublicInputs(seed), fr(seed + 0x1000));
422
421
  }
423
422
 
424
423
  export function makeProtocolContracts(seed = 1) {
@@ -758,8 +757,8 @@ export function makeCheckpointRollupPublicInputs(seed = 0) {
758
757
  makeAppendOnlyTreeSnapshot(seed + 0x200),
759
758
  makeTuple(AZTEC_MAX_EPOCH_DURATION, () => fr(seed), 0x300),
760
759
  makeTuple(AZTEC_MAX_EPOCH_DURATION, () => makeFeeRecipient(seed), 0x700),
761
- BlobAccumulator.fromBatchedBlobAccumulator(startBlobAccumulator),
762
- BlobAccumulator.fromBatchedBlobAccumulator(makeBatchedBlobAccumulator(seed + 1)),
760
+ startBlobAccumulator.toBlobAccumulator(),
761
+ makeBatchedBlobAccumulator(seed + 1).toBlobAccumulator(),
763
762
  startBlobAccumulator.finalBlobChallenges,
764
763
  );
765
764
  }
@@ -795,7 +794,7 @@ export function makeRootRollupPublicInputs(seed = 0): RootRollupPublicInputs {
795
794
  makeTuple(AZTEC_MAX_EPOCH_DURATION, () => fr(seed), 0x300),
796
795
  makeTuple(AZTEC_MAX_EPOCH_DURATION, () => makeFeeRecipient(seed), 0x500),
797
796
  makeEpochConstantData(seed + 0x600),
798
- FinalBlobAccumulator.fromBatchedBlobAccumulator(makeBatchedBlobAccumulator(seed)),
797
+ makeBatchedBlobAccumulator(seed).toFinalBlobAccumulator(),
799
798
  );
800
799
  }
801
800
 
@@ -1084,18 +1083,22 @@ function makePublicBaseRollupHints(seed = 1) {
1084
1083
 
1085
1084
  export function makePrivateTxBaseRollupPrivateInputs(seed = 0) {
1086
1085
  return PrivateTxBaseRollupPrivateInputs.from({
1087
- hidingKernelProofData: makeProofData(seed, makePrivateToRollupKernelCircuitPublicInputs, CIVC_PROOF_LENGTH),
1086
+ hidingKernelProofData: makeProofData(seed, makePrivateToRollupKernelCircuitPublicInputs, CHONK_PROOF_LENGTH),
1088
1087
  hints: makePrivateBaseRollupHints(seed + 0x100),
1089
1088
  });
1090
1089
  }
1091
1090
 
1092
1091
  export function makePublicTxBaseRollupPrivateInputs(seed = 0) {
1093
- const publicTubeProofData = makeProofData(seed, makePublicTubePublicInputs, RECURSIVE_ROLLUP_HONK_PROOF_LENGTH);
1092
+ const publicChonkVerifierProofData = makeProofData(
1093
+ seed,
1094
+ makePublicChonkVerifierPublicInputs,
1095
+ RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
1096
+ );
1094
1097
  const avmProofData = makeProofData(seed + 0x100, makeAvmCircuitPublicInputs, AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED);
1095
1098
  const hints = makePublicBaseRollupHints(seed + 0x200);
1096
1099
 
1097
1100
  return PublicTxBaseRollupPrivateInputs.from({
1098
- publicTubeProofData,
1101
+ publicChonkVerifierProofData,
1099
1102
  avmProofData,
1100
1103
  hints,
1101
1104
  });
@@ -1183,13 +1186,10 @@ export async function makeMapAsync<T>(size: number, fn: (i: number) => Promise<[
1183
1186
  return new Map(await makeArrayAsync(size, i => fn(i + offset)));
1184
1187
  }
1185
1188
 
1186
- export function makePublicKeys(seed = 0): PublicKeys {
1187
- return new PublicKeys(
1188
- new Point(new Fr(seed + 0), new Fr(seed + 1), false),
1189
- new Point(new Fr(seed + 2), new Fr(seed + 3), false),
1190
- new Point(new Fr(seed + 4), new Fr(seed + 5), false),
1191
- new Point(new Fr(seed + 6), new Fr(seed + 7), false),
1192
- );
1189
+ export async function makePublicKeys(seed = 0): Promise<PublicKeys> {
1190
+ const f = (offset: number) => Grumpkin.mul(Grumpkin.generator, new Fq(seed + offset));
1191
+
1192
+ return new PublicKeys(await f(0), await f(1), await f(2), await f(3));
1193
1193
  }
1194
1194
 
1195
1195
  export async function makeContractInstanceFromClassId(
@@ -1205,7 +1205,7 @@ export async function makeContractInstanceFromClassId(
1205
1205
  const salt = new Fr(seed);
1206
1206
  const initializationHash = overrides?.initializationHash ?? new Fr(seed + 1);
1207
1207
  const deployer = overrides?.deployer ?? new AztecAddress(new Fr(seed + 2));
1208
- const publicKeys = overrides?.publicKeys ?? makePublicKeys(seed + 3);
1208
+ const publicKeys = overrides?.publicKeys ?? (await makePublicKeys(seed + 3));
1209
1209
 
1210
1210
  const saltedInitializationHash = await poseidon2HashWithSeparator(
1211
1211
  [salt, initializationHash, deployer],
@@ -30,7 +30,7 @@ import { BlockAttestation } from '../p2p/block_attestation.js';
30
30
  import { BlockProposal } from '../p2p/block_proposal.js';
31
31
  import { ConsensusPayload } from '../p2p/consensus_payload.js';
32
32
  import { SignatureDomainSeparator, getHashedSignaturePayloadEthSignedMessage } from '../p2p/signature_utils.js';
33
- import { ClientIvcProof } from '../proofs/client_ivc_proof.js';
33
+ import { ChonkProof } from '../proofs/chonk_proof.js';
34
34
  import { HashedValues, PrivateCallExecutionResult, PrivateExecutionResult, StateReference, Tx } from '../tx/index.js';
35
35
  import { PublicSimulationOutput } from '../tx/public_simulation_output.js';
36
36
  import { TxSimulationResult, accumulatePrivateReturnValues } from '../tx/simulated_tx.js';
@@ -67,7 +67,7 @@ export const mockTx = async (
67
67
  hasPublicTeardownCallRequest = false,
68
68
  publicCalldataSize = 2,
69
69
  feePayer,
70
- clientIvcProof = ClientIvcProof.random(),
70
+ chonkProof = ChonkProof.random(),
71
71
  maxPriorityFeesPerGas,
72
72
  gasUsed = Gas.empty(),
73
73
  chainId = Fr.ZERO,
@@ -81,7 +81,7 @@ export const mockTx = async (
81
81
  hasPublicTeardownCallRequest?: boolean;
82
82
  publicCalldataSize?: number;
83
83
  feePayer?: AztecAddress;
84
- clientIvcProof?: ClientIvcProof;
84
+ chonkProof?: ChonkProof;
85
85
  maxPriorityFeesPerGas?: GasFees;
86
86
  gasUsed?: Gas;
87
87
  chainId?: Fr;
@@ -150,7 +150,7 @@ export const mockTx = async (
150
150
 
151
151
  return await Tx.create({
152
152
  data,
153
- clientIvcProof,
153
+ chonkProof,
154
154
  contractClassLogFields: [],
155
155
  publicFunctionCalldata,
156
156
  });
@@ -8,7 +8,7 @@ import { Gas } from '../gas/gas.js';
8
8
  import type { GasUsed } from '../gas/gas_used.js';
9
9
  import { computeL2ToL1MessageHash } from '../hash/hash.js';
10
10
  import type { PrivateKernelTailCircuitPublicInputs } from '../kernel/private_kernel_tail_circuit_public_inputs.js';
11
- import type { ClientIvcProof } from '../proofs/client_ivc_proof.js';
11
+ import type { ChonkProof } from '../proofs/chonk_proof.js';
12
12
  import type { GlobalVariables } from './global_variables.js';
13
13
  import type { Tx } from './tx.js';
14
14
  import { TxEffect } from './tx_effect.js';
@@ -36,7 +36,7 @@ export type ProcessedTx = {
36
36
  /**
37
37
  * Proof for the private execution.
38
38
  */
39
- clientIvcProof: ClientIvcProof;
39
+ chonkProof: ChonkProof;
40
40
  /**
41
41
  * The request for AVM proving.
42
42
  */
@@ -118,7 +118,7 @@ export function makeProcessedTxFromPrivateOnlyTx(
118
118
  return {
119
119
  hash: txEffect.txHash,
120
120
  data: tx.data,
121
- clientIvcProof: tx.clientIvcProof,
121
+ chonkProof: tx.chonkProof,
122
122
  avmProvingRequest: undefined,
123
123
  globalVariables,
124
124
  txEffect,
@@ -128,12 +128,6 @@ export function makeProcessedTxFromPrivateOnlyTx(
128
128
  };
129
129
  }
130
130
 
131
- export function toNumBlobFields(txs: ProcessedTx[]): number {
132
- return txs.reduce((acc, tx) => {
133
- return acc + tx.txEffect.toBlobFields().length;
134
- }, 0);
135
- }
136
-
137
131
  export function makeProcessedTxFromTxWithPublicCalls(
138
132
  tx: Tx,
139
133
  avmProvingRequest: AvmProvingRequest,
@@ -182,7 +176,7 @@ export function makeProcessedTxFromTxWithPublicCalls(
182
176
  return {
183
177
  hash: txEffect.txHash,
184
178
  data: tx.data,
185
- clientIvcProof: tx.clientIvcProof,
179
+ chonkProof: tx.chonkProof,
186
180
  avmProvingRequest,
187
181
  globalVariables,
188
182
  txEffect,
@@ -4,7 +4,7 @@ import type { FieldsOf } from '@aztec/foundation/types';
4
4
  import { z } from 'zod';
5
5
 
6
6
  import { PrivateKernelTailCircuitPublicInputs } from '../kernel/private_kernel_tail_circuit_public_inputs.js';
7
- import { ClientIvcProof } from '../proofs/client_ivc_proof.js';
7
+ import { ChonkProof } from '../proofs/chonk_proof.js';
8
8
  import type { OffchainEffect } from './offchain_effect.js';
9
9
  import {
10
10
  PrivateExecutionResult,
@@ -18,7 +18,7 @@ export class TxProvingResult {
18
18
  constructor(
19
19
  public privateExecutionResult: PrivateExecutionResult,
20
20
  public publicInputs: PrivateKernelTailCircuitPublicInputs,
21
- public clientIvcProof: ClientIvcProof,
21
+ public chonkProof: ChonkProof,
22
22
  public stats?: ProvingStats,
23
23
  ) {}
24
24
 
@@ -27,7 +27,7 @@ export class TxProvingResult {
27
27
 
28
28
  return await Tx.create({
29
29
  data: this.publicInputs,
30
- clientIvcProof: this.clientIvcProof,
30
+ chonkProof: this.chonkProof,
31
31
  contractClassLogFields: contractClassLogs,
32
32
  publicFunctionCalldata: this.privateExecutionResult.publicFunctionCalldata,
33
33
  });
@@ -42,21 +42,21 @@ export class TxProvingResult {
42
42
  .object({
43
43
  privateExecutionResult: PrivateExecutionResult.schema,
44
44
  publicInputs: PrivateKernelTailCircuitPublicInputs.schema,
45
- clientIvcProof: ClientIvcProof.schema,
45
+ chonkProof: ChonkProof.schema,
46
46
  timings: optional(ProvingTimingsSchema),
47
47
  })
48
48
  .transform(TxProvingResult.from);
49
49
  }
50
50
 
51
51
  static from(fields: FieldsOf<TxProvingResult>) {
52
- return new TxProvingResult(fields.privateExecutionResult, fields.publicInputs, fields.clientIvcProof);
52
+ return new TxProvingResult(fields.privateExecutionResult, fields.publicInputs, fields.chonkProof);
53
53
  }
54
54
 
55
55
  static async random() {
56
56
  return new TxProvingResult(
57
57
  await PrivateExecutionResult.random(),
58
58
  PrivateKernelTailCircuitPublicInputs.empty(),
59
- ClientIvcProof.empty(),
59
+ ChonkProof.empty(),
60
60
  );
61
61
  }
62
62
  }