@aztec/stdlib 5.0.0-rc.2 → 5.0.1

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 (197) hide show
  1. package/dest/block/attestation_info.d.ts +1 -1
  2. package/dest/block/attestation_info.d.ts.map +1 -1
  3. package/dest/block/attestation_info.js +7 -4
  4. package/dest/block/l2_block_source.d.ts +34 -3
  5. package/dest/block/l2_block_source.d.ts.map +1 -1
  6. package/dest/block/l2_block_source.js +15 -0
  7. package/dest/block/l2_block_stream/event_driven_l2_block_stream.d.ts +39 -0
  8. package/dest/block/l2_block_stream/event_driven_l2_block_stream.d.ts.map +1 -0
  9. package/dest/block/l2_block_stream/event_driven_l2_block_stream.js +165 -0
  10. package/dest/block/l2_block_stream/index.d.ts +2 -1
  11. package/dest/block/l2_block_stream/index.d.ts.map +1 -1
  12. package/dest/block/l2_block_stream/index.js +1 -0
  13. package/dest/block/l2_block_stream/interfaces.d.ts +16 -2
  14. package/dest/block/l2_block_stream/interfaces.d.ts.map +1 -1
  15. package/dest/block/l2_block_stream/interfaces.js +25 -1
  16. package/dest/block/l2_block_stream/l2_block_stream.d.ts +21 -35
  17. package/dest/block/l2_block_stream/l2_block_stream.d.ts.map +1 -1
  18. package/dest/block/l2_block_stream/l2_block_stream.js +5 -30
  19. package/dest/block/proposal/attestations_and_signers.d.ts +19 -1
  20. package/dest/block/proposal/attestations_and_signers.d.ts.map +1 -1
  21. package/dest/block/proposal/attestations_and_signers.js +47 -7
  22. package/dest/block/validate_block_result.d.ts +16 -1
  23. package/dest/block/validate_block_result.d.ts.map +1 -1
  24. package/dest/block/validate_block_result.js +18 -3
  25. package/dest/config/network-consensus-config.d.ts +1 -1
  26. package/dest/config/network-consensus-config.d.ts.map +1 -1
  27. package/dest/config/network-consensus-config.js +2 -10
  28. package/dest/contract/contract_address.d.ts +5 -4
  29. package/dest/contract/contract_address.d.ts.map +1 -1
  30. package/dest/contract/contract_instance.d.ts +16 -2
  31. package/dest/contract/contract_instance.d.ts.map +1 -1
  32. package/dest/contract/contract_instance.js +45 -0
  33. package/dest/contract/interfaces/contract_instance.d.ts +71 -10
  34. package/dest/contract/interfaces/contract_instance.d.ts.map +1 -1
  35. package/dest/contract/interfaces/contract_instance.js +7 -2
  36. package/dest/contract/partial_address.d.ts +9 -3
  37. package/dest/contract/partial_address.d.ts.map +1 -1
  38. package/dest/contract/partial_address.js +8 -2
  39. package/dest/database-version/version_manager.d.ts +18 -4
  40. package/dest/database-version/version_manager.d.ts.map +1 -1
  41. package/dest/database-version/version_manager.js +76 -6
  42. package/dest/ha-signing/config.d.ts +19 -5
  43. package/dest/ha-signing/config.d.ts.map +1 -1
  44. package/dest/ha-signing/config.js +9 -3
  45. package/dest/ha-signing/local_config.d.ts +10 -2
  46. package/dest/ha-signing/local_config.d.ts.map +1 -1
  47. package/dest/ha-signing/local_config.js +8 -2
  48. package/dest/hash/hash.d.ts +1 -2
  49. package/dest/hash/hash.d.ts.map +1 -1
  50. package/dest/hash/hash.js +0 -7
  51. package/dest/interfaces/archiver.d.ts +8 -1
  52. package/dest/interfaces/archiver.d.ts.map +1 -1
  53. package/dest/interfaces/archiver.js +2 -1
  54. package/dest/interfaces/aztec-node-admin.d.ts +5 -2
  55. package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
  56. package/dest/interfaces/configs.d.ts +4 -1
  57. package/dest/interfaces/configs.d.ts.map +1 -1
  58. package/dest/interfaces/configs.js +1 -0
  59. package/dest/interfaces/private_kernel_prover.d.ts +9 -11
  60. package/dest/interfaces/private_kernel_prover.d.ts.map +1 -1
  61. package/dest/interfaces/proving-job.d.ts +87 -74
  62. package/dest/interfaces/proving-job.d.ts.map +1 -1
  63. package/dest/interfaces/proving-job.js +13 -4
  64. package/dest/interfaces/server_circuit_prover.d.ts +3 -3
  65. package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
  66. package/dest/interfaces/validator.d.ts +7 -3
  67. package/dest/interfaces/validator.d.ts.map +1 -1
  68. package/dest/interfaces/world_state.d.ts +14 -1
  69. package/dest/interfaces/world_state.d.ts.map +1 -1
  70. package/dest/kernel/hints/find_private_kernel_reset_dimensions.d.ts +8 -2
  71. package/dest/kernel/hints/find_private_kernel_reset_dimensions.d.ts.map +1 -1
  72. package/dest/kernel/hints/find_private_kernel_reset_dimensions.js +12 -74
  73. package/dest/kernel/index.d.ts +2 -2
  74. package/dest/kernel/index.d.ts.map +1 -1
  75. package/dest/kernel/index.js +1 -1
  76. package/dest/kernel/private_circuit_public_inputs.d.ts +13 -3
  77. package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
  78. package/dest/kernel/private_circuit_public_inputs.js +14 -7
  79. package/dest/kernel/private_context_inputs.d.ts +4 -3
  80. package/dest/kernel/private_context_inputs.d.ts.map +1 -1
  81. package/dest/kernel/private_context_inputs.js +7 -3
  82. package/dest/kernel/private_kernel_circuit_public_inputs.d.ts +7 -1
  83. package/dest/kernel/private_kernel_circuit_public_inputs.d.ts.map +1 -1
  84. package/dest/kernel/private_kernel_circuit_public_inputs.js +7 -0
  85. package/dest/kernel/private_kernel_init_2_circuit_private_inputs.d.ts +2 -3
  86. package/dest/kernel/private_kernel_init_2_circuit_private_inputs.d.ts.map +1 -1
  87. package/dest/kernel/private_kernel_init_2_circuit_private_inputs.js +3 -5
  88. package/dest/kernel/private_kernel_init_3_circuit_private_inputs.d.ts +2 -3
  89. package/dest/kernel/private_kernel_init_3_circuit_private_inputs.d.ts.map +1 -1
  90. package/dest/kernel/private_kernel_init_3_circuit_private_inputs.js +3 -5
  91. package/dest/kernel/private_kernel_init_circuit_private_inputs.d.ts +1 -9
  92. package/dest/kernel/private_kernel_init_circuit_private_inputs.d.ts.map +1 -1
  93. package/dest/kernel/private_kernel_init_circuit_private_inputs.js +2 -6
  94. package/dest/kernel/private_kernel_reset_dimensions.d.ts +7 -8
  95. package/dest/kernel/private_kernel_reset_dimensions.d.ts.map +1 -1
  96. package/dest/kernel/private_kernel_reset_tail_circuit_private_inputs.d.ts +29 -0
  97. package/dest/kernel/private_kernel_reset_tail_circuit_private_inputs.d.ts.map +1 -0
  98. package/dest/kernel/private_kernel_reset_tail_circuit_private_inputs.js +36 -0
  99. package/dest/keys/derivation.d.ts +41 -6
  100. package/dest/keys/derivation.d.ts.map +1 -1
  101. package/dest/keys/derivation.js +49 -26
  102. package/dest/logs/app_tagging_secret.d.ts +16 -8
  103. package/dest/logs/app_tagging_secret.d.ts.map +1 -1
  104. package/dest/logs/app_tagging_secret.js +24 -27
  105. package/dest/logs/index.d.ts +1 -3
  106. package/dest/logs/index.d.ts.map +1 -1
  107. package/dest/logs/index.js +0 -2
  108. package/dest/logs/shared_secret_derivation.d.ts +29 -6
  109. package/dest/logs/shared_secret_derivation.d.ts.map +1 -1
  110. package/dest/logs/shared_secret_derivation.js +44 -11
  111. package/dest/messaging/l1_to_l2_message.d.ts +23 -2
  112. package/dest/messaging/l1_to_l2_message.d.ts.map +1 -1
  113. package/dest/messaging/l1_to_l2_message.js +36 -11
  114. package/dest/p2p/attestation_utils.d.ts +1 -1
  115. package/dest/p2p/attestation_utils.d.ts.map +1 -1
  116. package/dest/p2p/attestation_utils.js +8 -1
  117. package/dest/p2p/checkpoint_attestation.d.ts +9 -1
  118. package/dest/p2p/checkpoint_attestation.d.ts.map +1 -1
  119. package/dest/p2p/checkpoint_attestation.js +10 -0
  120. package/dest/p2p/signature_utils.d.ts +10 -1
  121. package/dest/p2p/signature_utils.d.ts.map +1 -1
  122. package/dest/p2p/signature_utils.js +9 -1
  123. package/dest/rollup/avm_proof_data.d.ts +3 -3
  124. package/dest/rollup/avm_proof_data.d.ts.map +1 -1
  125. package/dest/stats/stats.d.ts +2 -2
  126. package/dest/stats/stats.d.ts.map +1 -1
  127. package/dest/tests/factories.d.ts +1 -1
  128. package/dest/tests/factories.d.ts.map +1 -1
  129. package/dest/tests/factories.js +4 -3
  130. package/dest/tx/private_tx_constant_data.d.ts +18 -2
  131. package/dest/tx/private_tx_constant_data.d.ts.map +1 -1
  132. package/dest/tx/private_tx_constant_data.js +13 -4
  133. package/dest/tx/simulated_tx.d.ts +10 -6
  134. package/dest/tx/simulated_tx.d.ts.map +1 -1
  135. package/dest/world-state/genesis_data.d.ts +9 -1
  136. package/dest/world-state/genesis_data.d.ts.map +1 -1
  137. package/dest/world-state/genesis_data.js +1 -0
  138. package/package.json +8 -8
  139. package/src/block/attestation_info.ts +7 -2
  140. package/src/block/l2_block_source.ts +54 -2
  141. package/src/block/l2_block_stream/event_driven_l2_block_stream.ts +207 -0
  142. package/src/block/l2_block_stream/index.ts +1 -0
  143. package/src/block/l2_block_stream/interfaces.ts +35 -1
  144. package/src/block/l2_block_stream/l2_block_stream.ts +35 -62
  145. package/src/block/proposal/attestations_and_signers.ts +53 -7
  146. package/src/block/validate_block_result.ts +48 -2
  147. package/src/config/network-consensus-config.ts +2 -13
  148. package/src/contract/contract_address.ts +4 -3
  149. package/src/contract/contract_instance.ts +62 -1
  150. package/src/contract/interfaces/contract_instance.ts +26 -8
  151. package/src/contract/partial_address.ts +8 -2
  152. package/src/database-version/version_manager.ts +96 -6
  153. package/src/gas/README.md +108 -36
  154. package/src/ha-signing/config.ts +23 -5
  155. package/src/ha-signing/local_config.ts +20 -1
  156. package/src/hash/hash.ts +0 -8
  157. package/src/interfaces/archiver.ts +8 -0
  158. package/src/interfaces/configs.ts +3 -0
  159. package/src/interfaces/private_kernel_prover.ts +10 -12
  160. package/src/interfaces/proving-job.ts +15 -3
  161. package/src/interfaces/server_circuit_prover.ts +2 -2
  162. package/src/interfaces/world_state.ts +14 -0
  163. package/src/kernel/hints/find_private_kernel_reset_dimensions.ts +22 -112
  164. package/src/kernel/index.ts +1 -1
  165. package/src/kernel/private_circuit_public_inputs.ts +12 -1
  166. package/src/kernel/private_context_inputs.ts +10 -3
  167. package/src/kernel/private_kernel_circuit_public_inputs.ts +9 -0
  168. package/src/kernel/private_kernel_init_2_circuit_private_inputs.ts +0 -3
  169. package/src/kernel/private_kernel_init_3_circuit_private_inputs.ts +0 -3
  170. package/src/kernel/private_kernel_init_circuit_private_inputs.ts +0 -6
  171. package/src/kernel/private_kernel_reset_dimensions.ts +15 -5
  172. package/src/kernel/private_kernel_reset_tail_circuit_private_inputs.ts +69 -0
  173. package/src/keys/derivation.ts +69 -24
  174. package/src/logs/app_tagging_secret.ts +34 -27
  175. package/src/logs/index.ts +0 -2
  176. package/src/logs/shared_secret_derivation.ts +47 -14
  177. package/src/messaging/l1_to_l2_message.ts +51 -13
  178. package/src/p2p/attestation_utils.ts +8 -1
  179. package/src/p2p/checkpoint_attestation.ts +12 -0
  180. package/src/p2p/signature_utils.ts +9 -0
  181. package/src/rollup/avm_proof_data.ts +2 -2
  182. package/src/stats/stats.ts +2 -2
  183. package/src/tests/factories.ts +3 -6
  184. package/src/tx/private_tx_constant_data.ts +25 -2
  185. package/src/world-state/genesis_data.ts +10 -0
  186. package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts +0 -47
  187. package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts.map +0 -1
  188. package/dest/kernel/private_kernel_tail_circuit_private_inputs.js +0 -38
  189. package/dest/logs/message_context.d.ts +0 -17
  190. package/dest/logs/message_context.d.ts.map +0 -1
  191. package/dest/logs/message_context.js +0 -9
  192. package/dest/logs/pending_tagged_log.d.ts +0 -11
  193. package/dest/logs/pending_tagged_log.d.ts.map +0 -1
  194. package/dest/logs/pending_tagged_log.js +0 -4
  195. package/src/kernel/private_kernel_tail_circuit_private_inputs.ts +0 -58
  196. package/src/logs/message_context.ts +0 -18
  197. package/src/logs/pending_tagged_log.ts +0 -12
@@ -0,0 +1,69 @@
1
+ import type {
2
+ MAX_KEY_VALIDATION_REQUESTS_PER_TX,
3
+ MAX_NOTE_HASH_READ_REQUESTS_PER_TX,
4
+ MAX_NULLIFIERS_PER_TX,
5
+ MAX_NULLIFIER_READ_REQUESTS_PER_TX,
6
+ } from '@aztec/constants';
7
+ import { bigintToUInt64BE, serializeToBuffer } from '@aztec/foundation/serialize';
8
+
9
+ import type { UInt64 } from '../types/shared.js';
10
+ import type { PrivateKernelResetHints } from './hints/private_kernel_reset_hints.js';
11
+ import type { PaddedSideEffectAmounts, PaddedSideEffects } from './padded_side_effects.js';
12
+ import { kernelStateIsForPublic } from './private_kernel_circuit_public_inputs.js';
13
+ import type { PrivateKernelData } from './private_kernel_data.js';
14
+ import { PrivateKernelResetCircuitPrivateInputsVariants } from './private_kernel_reset_circuit_private_inputs.js';
15
+ import type { PrivateKernelResetDimensions } from './private_kernel_reset_dimensions.js';
16
+
17
+ /**
18
+ * Input to a terminal reset+tail circuit. `isForPublic()` selects the rollup-bound (`reset_tail`)
19
+ * or public-bound (`reset_tail_to_public`) family.
20
+ */
21
+ export class PrivateKernelResetTailCircuitPrivateInputs {
22
+ constructor(
23
+ public previousKernel: PrivateKernelData,
24
+ public paddedSideEffects: PaddedSideEffects,
25
+ public hints: PrivateKernelResetHints<
26
+ typeof MAX_NOTE_HASH_READ_REQUESTS_PER_TX,
27
+ typeof MAX_NOTE_HASH_READ_REQUESTS_PER_TX,
28
+ typeof MAX_NULLIFIER_READ_REQUESTS_PER_TX,
29
+ typeof MAX_NULLIFIER_READ_REQUESTS_PER_TX,
30
+ typeof MAX_KEY_VALIDATION_REQUESTS_PER_TX,
31
+ typeof MAX_NULLIFIERS_PER_TX
32
+ >,
33
+ public dimensions: PrivateKernelResetDimensions,
34
+ public paddedSideEffectAmounts: PaddedSideEffectAmounts,
35
+ public expirationTimestampUpperBound: UInt64,
36
+ ) {}
37
+
38
+ isForPublic() {
39
+ return kernelStateIsForPublic(this.previousKernel.publicInputs);
40
+ }
41
+
42
+ /**
43
+ * Returns a dimension-trimmed view of the reset portion of these inputs (without the tail
44
+ * fields). The prover uses this to feed witness generation of the variant matching the chosen
45
+ * dimensions.
46
+ */
47
+ trimResetToSizes() {
48
+ const hints = this.hints.trimToSizes(
49
+ this.dimensions.NOTE_HASH_PENDING_READ,
50
+ this.dimensions.NOTE_HASH_SETTLED_READ,
51
+ this.dimensions.NULLIFIER_PENDING_READ,
52
+ this.dimensions.NULLIFIER_SETTLED_READ,
53
+ this.dimensions.KEY_VALIDATION,
54
+ this.dimensions.TRANSIENT_DATA_SQUASHING,
55
+ );
56
+ return new PrivateKernelResetCircuitPrivateInputsVariants(this.previousKernel, this.paddedSideEffects, hints);
57
+ }
58
+
59
+ toBuffer() {
60
+ return serializeToBuffer(
61
+ this.previousKernel,
62
+ this.paddedSideEffects,
63
+ this.hints,
64
+ this.dimensions,
65
+ this.paddedSideEffectAmounts,
66
+ bigintToUInt64BE(this.expirationTimestampUpperBound),
67
+ );
68
+ }
69
+ }
@@ -1,4 +1,4 @@
1
- import { DEFAULT_FBPK_M_HASH, DEFAULT_MSPK_M_HASH, DomainSeparator } from '@aztec/constants';
1
+ import { DomainSeparator } from '@aztec/constants';
2
2
  import { Grumpkin } from '@aztec/foundation/crypto/grumpkin';
3
3
  import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto/poseidon';
4
4
  import { sha512ToGrumpkinScalar } from '@aztec/foundation/crypto/sha512';
@@ -11,8 +11,11 @@ import { PublicKey, hashPublicKey } from './public_key.js';
11
11
  import { PublicKeys } from './public_keys.js';
12
12
  import { getKeyGenerator } from './utils.js';
13
13
 
14
- export function computeAppNullifierHidingKey(masterNullifierHidingKey: GrumpkinScalar, app: AztecAddress): Promise<Fr> {
15
- return computeAppSecretKey(masterNullifierHidingKey, app, 'n'); // 'n' is the key prefix for nullifier hiding key
14
+ export function computeAppNullifierHidingKey(
15
+ masterNullifierHidingSecretKey: GrumpkinScalar,
16
+ app: AztecAddress,
17
+ ): Promise<Fr> {
18
+ return computeAppSecretKey(masterNullifierHidingSecretKey, app, 'n'); // 'n' is the key prefix for nullifier hiding key
16
19
  }
17
20
 
18
21
  export function computeAppSecretKey(skM: GrumpkinScalar, app: AztecAddress, keyPrefix: KeyPrefix): Promise<Fr> {
@@ -27,7 +30,7 @@ export async function computeOvskApp(ovsk: GrumpkinScalar, app: AztecAddress): P
27
30
  return GrumpkinScalar.fromBuffer(ovskAppFr.toBuffer());
28
31
  }
29
32
 
30
- export function deriveMasterNullifierHidingKey(secretKey: Fr): GrumpkinScalar {
33
+ export function deriveMasterNullifierHidingSecretKey(secretKey: Fr): GrumpkinScalar {
31
34
  return sha512ToGrumpkinScalar([secretKey, DomainSeparator.NHK_M]);
32
35
  }
33
36
 
@@ -39,9 +42,12 @@ export function deriveMasterOutgoingViewingSecretKey(secretKey: Fr): GrumpkinSca
39
42
  return sha512ToGrumpkinScalar([secretKey, DomainSeparator.OVSK_M]);
40
43
  }
41
44
 
42
- export function deriveSigningKey(secretKey: Fr): GrumpkinScalar {
43
- // TODO(#5837): come up with a standard signing key derivation scheme instead of using ivsk_m as signing keys here
44
- return sha512ToGrumpkinScalar([secretKey, DomainSeparator.IVSK_M]);
45
+ export function deriveMasterMessageSigningSecretKey(secretKey: Fr): GrumpkinScalar {
46
+ return sha512ToGrumpkinScalar([secretKey, DomainSeparator.MSSK_M]);
47
+ }
48
+
49
+ export function deriveMasterFallbackSecretKey(secretKey: Fr): GrumpkinScalar {
50
+ return sha512ToGrumpkinScalar([secretKey, DomainSeparator.FBSK_M]);
45
51
  }
46
52
 
47
53
  export function computePreaddress(publicKeysHash: Fr, partialAddress: Fr) {
@@ -85,52 +91,91 @@ export async function computeAddressSecret(preaddress: Fr, ivsk: Fq) {
85
91
  }
86
92
 
87
93
  export function derivePublicKeyFromSecretKey(secretKey: Fq): Promise<PublicKey> {
94
+ // 0 * G is the point at infinity. The WASM encodes infinity with an out-of-field x coordinate that Point cannot
95
+ // deserialize, so return the point directly instead of calling into it.
96
+ if (secretKey.isZero()) {
97
+ return Promise.resolve(PublicKey.INFINITY);
98
+ }
88
99
  return Grumpkin.mul(Grumpkin.generator, secretKey);
89
100
  }
90
101
 
102
+ /**
103
+ * The six master secret keys that fully define an account's privacy keys.
104
+ */
105
+ export type MasterSecretKeys = {
106
+ masterNullifierHidingSecretKey: GrumpkinScalar;
107
+ masterIncomingViewingSecretKey: GrumpkinScalar;
108
+ masterOutgoingViewingSecretKey: GrumpkinScalar;
109
+ masterTaggingSecretKey: GrumpkinScalar;
110
+ masterMessageSigningSecretKey: GrumpkinScalar;
111
+ masterFallbackSecretKey: GrumpkinScalar;
112
+ };
113
+
91
114
  /**
92
115
  * Computes secret and public keys and public keys hash from a secret key.
93
116
  * @param secretKey - The secret key to derive keys from.
94
117
  * @returns The derived keys.
95
118
  */
96
- export async function deriveKeys(secretKey: Fr) {
119
+ export function deriveKeys(secretKey: Fr) {
97
120
  // First we derive master secret/hiding keys - we use sha512 here because this derivation will never take place
98
121
  // in a circuit
99
- const masterNullifierHidingKey = deriveMasterNullifierHidingKey(secretKey);
100
- const masterIncomingViewingSecretKey = deriveMasterIncomingViewingSecretKey(secretKey);
101
- const masterOutgoingViewingSecretKey = deriveMasterOutgoingViewingSecretKey(secretKey);
102
- const masterTaggingSecretKey = sha512ToGrumpkinScalar([secretKey, DomainSeparator.TSK_M]);
122
+ return deriveKeysFromMasterSecretKeys({
123
+ masterNullifierHidingSecretKey: deriveMasterNullifierHidingSecretKey(secretKey),
124
+ masterIncomingViewingSecretKey: deriveMasterIncomingViewingSecretKey(secretKey),
125
+ masterOutgoingViewingSecretKey: deriveMasterOutgoingViewingSecretKey(secretKey),
126
+ masterTaggingSecretKey: sha512ToGrumpkinScalar([secretKey, DomainSeparator.TSK_M]),
127
+ masterMessageSigningSecretKey: deriveMasterMessageSigningSecretKey(secretKey),
128
+ masterFallbackSecretKey: deriveMasterFallbackSecretKey(secretKey),
129
+ });
130
+ }
103
131
 
104
- // Then we derive master public keys
105
- const masterNullifierPublicKey = await derivePublicKeyFromSecretKey(masterNullifierHidingKey);
132
+ /**
133
+ * Derives the master public keys and the {@link PublicKeys} struct from a set of master secret keys.
134
+ * @param secretKeys - The master secret keys to derive public keys from.
135
+ * @returns The provided secret keys alongside the derived public keys.
136
+ */
137
+ export async function deriveKeysFromMasterSecretKeys(secretKeys: MasterSecretKeys) {
138
+ const {
139
+ masterNullifierHidingSecretKey,
140
+ masterIncomingViewingSecretKey,
141
+ masterOutgoingViewingSecretKey,
142
+ masterTaggingSecretKey,
143
+ masterMessageSigningSecretKey,
144
+ masterFallbackSecretKey,
145
+ } = secretKeys;
146
+
147
+ const masterNullifierHidingPublicKey = await derivePublicKeyFromSecretKey(masterNullifierHidingSecretKey);
106
148
  const masterIncomingViewingPublicKey = await derivePublicKeyFromSecretKey(masterIncomingViewingSecretKey);
107
149
  const masterOutgoingViewingPublicKey = await derivePublicKeyFromSecretKey(masterOutgoingViewingSecretKey);
108
150
  const masterTaggingPublicKey = await derivePublicKeyFromSecretKey(masterTaggingSecretKey);
151
+ const masterMessageSigningPublicKey = await derivePublicKeyFromSecretKey(masterMessageSigningSecretKey);
152
+ const masterFallbackPublicKey = await derivePublicKeyFromSecretKey(masterFallbackSecretKey);
109
153
 
110
154
  // The non-owner-visible PublicKeys carries hashes for npk/ovpk/tpk/mspk/fbpk and the raw
111
- // point only for ivpk_m. The npk/ovpk/tpk raw points are also returned alongside so the key
112
- // store can persist them under `${account}-{n|ov|t}pk_m` (only their hashes live in publicKeys).
155
+ // point only for ivpk_m. The npk/ovpk/tpk/mspk/fbpk raw points are also returned alongside so the key
156
+ // store can persist them under `${account}-{n|ov|t|ms|fb}pk_m` (only their hashes live in publicKeys).
113
157
  // The ivpk_m point isn't returned separately because it already lives in publicKeys.ivpkM.
114
- //
115
- // TODO: There isn't a derivation path for the message signing(msk) and fallback(fbk) keys yet. So we just use the the
116
- // default values for now.
117
158
  const publicKeys = new PublicKeys(
118
- await hashPublicKey(masterNullifierPublicKey),
159
+ await hashPublicKey(masterNullifierHidingPublicKey),
119
160
  masterIncomingViewingPublicKey,
120
161
  await hashPublicKey(masterOutgoingViewingPublicKey),
121
162
  await hashPublicKey(masterTaggingPublicKey),
122
- new Fr(DEFAULT_MSPK_M_HASH),
123
- new Fr(DEFAULT_FBPK_M_HASH),
163
+ await hashPublicKey(masterMessageSigningPublicKey),
164
+ await hashPublicKey(masterFallbackPublicKey),
124
165
  );
125
166
 
126
167
  return {
127
- masterNullifierHidingKey,
168
+ masterNullifierHidingSecretKey,
128
169
  masterIncomingViewingSecretKey,
129
170
  masterOutgoingViewingSecretKey,
130
171
  masterTaggingSecretKey,
131
- masterNullifierPublicKey,
172
+ masterMessageSigningSecretKey,
173
+ masterFallbackSecretKey,
174
+ masterNullifierHidingPublicKey,
132
175
  masterOutgoingViewingPublicKey,
133
176
  masterTaggingPublicKey,
177
+ masterMessageSigningPublicKey,
178
+ masterFallbackPublicKey,
134
179
  publicKeys,
135
180
  };
136
181
  }
@@ -9,6 +9,7 @@ import { AztecAddress } from '../aztec-address/index.js';
9
9
  import type { CompleteAddress } from '../contract/complete_address.js';
10
10
  import { computeAddressSecret, computePreaddress } from '../keys/derivation.js';
11
11
  import { AppTaggingSecretKind } from './app_tagging_secret_kind.js';
12
+ import { appSiloEcdhSharedSecretPoint } from './shared_secret_derivation.js';
12
13
 
13
14
  const AppTaggingSecretKindSchema = z.union([
14
15
  z.literal(AppTaggingSecretKind.UNCONSTRAINED),
@@ -32,32 +33,47 @@ export class AppTaggingSecret {
32
33
  /**
33
34
  * Derives an app-siloed, recipient-directional tagging secret from a shared tagging secret point.
34
35
  *
36
+ * App-silos the point via {@link appSiloEcdhSharedSecretPoint}, then directs the result to `recipient`:
37
+ * `h([s_app, recipient])`. The directional step stops a symmetric shared secret (ECDH against an address, or an
38
+ * arbitrary registered point) from colliding bidirectionally, so two parties never share a tag sequence.
39
+ *
35
40
  * The point is obtained either via {@link computeSharedTaggingSecret} (an ECDH key exchange against a sender) or
36
- * registered directly as a pre-shared secret. Each secret point yields a distinct tagging secret per (app, recipient)
37
- * pair.
41
+ * registered directly as a pre-shared secret.
38
42
  *
39
43
  * @param taggingSecretPoint - The shared tagging secret point (ECDH output, or a directly registered pre-shared secret)
40
44
  * @param app - Contract address to silo the secret to
41
45
  * @param recipient - Recipient of the log. Defines the "direction of the secret".
42
46
  * @returns The secret that can be used along with an index to compute a tag to be included in a log.
43
47
  */
44
- static async compute(
48
+ static async computeDirectional(
45
49
  taggingSecretPoint: Point,
46
50
  app: AztecAddress,
47
51
  recipient: AztecAddress,
48
52
  ): Promise<AppTaggingSecret> {
49
- const appTaggingSecret = await poseidon2Hash([taggingSecretPoint.x, taggingSecretPoint.y, app]);
50
- const directionalAppTaggingSecret = await poseidon2Hash([appTaggingSecret, recipient]);
53
+ const appSiloedSecret = await appSiloEcdhSharedSecretPoint(taggingSecretPoint, app);
54
+ const directionalAppTaggingSecret = await poseidon2Hash([appSiloedSecret, recipient]);
51
55
 
52
56
  return new AppTaggingSecret(directionalAppTaggingSecret, app);
53
57
  }
54
58
 
55
59
  /**
56
- * Derives the unconstrained tagging secret for `(externalAddress, recipient, app)` by performing the ECDH key
57
- * exchange against `externalAddress` and then siloing and directing the result. Returns undefined if
58
- * `externalAddress` is not a valid address.
60
+ * Derives the bare app-siloed tagging secret from a shared secret point via {@link appSiloEcdhSharedSecretPoint},
61
+ * under the given delivery-mode kind.
62
+ */
63
+ static async computeAppSiloed(
64
+ taggingSecretPoint: Point,
65
+ app: AztecAddress,
66
+ kind: AppTaggingSecretKind,
67
+ ): Promise<AppTaggingSecret> {
68
+ return new AppTaggingSecret(await appSiloEcdhSharedSecretPoint(taggingSecretPoint, app), app, kind);
69
+ }
70
+
71
+ /**
72
+ * Derives the tagging secret for `(externalAddress, recipient, app)` by performing an ECDH key exchange against
73
+ * `externalAddress` to obtain the shared point, then siloing and directing it via {@link computeDirectional}.
74
+ * Returns undefined if `externalAddress` is not a valid address.
59
75
  */
60
- static async computeUnconstrained(
76
+ static async computeViaEcdh(
61
77
  localAddress: CompleteAddress,
62
78
  localIvsk: Fq,
63
79
  externalAddress: AztecAddress,
@@ -69,33 +85,24 @@ export class AppTaggingSecret {
69
85
  return undefined;
70
86
  }
71
87
 
72
- return AppTaggingSecret.compute(taggingSecretPoint, app, recipient);
88
+ return AppTaggingSecret.computeDirectional(taggingSecretPoint, app, recipient);
73
89
  }
74
90
 
75
91
  toString(): string {
76
- // TODO(F-680): Migrate stored tagging keys and remove the legacy unconstrained format.
77
- if (this.kind === AppTaggingSecretKind.UNCONSTRAINED) {
78
- return `${this.secret.toString()}:${this.app.toString()}`;
79
- }
80
92
  return `${this.kind}:${this.secret.toString()}:${this.app.toString()}`;
81
93
  }
82
94
 
83
95
  static fromString(str: string): AppTaggingSecret {
84
96
  const parts = str.split(':');
85
- if (parts.length === 2) {
86
- // TODO(F-680): Remove legacy two-part parsing after stored tagging keys are migrated.
87
- const [secretStr, appStr] = parts;
88
- return new AppTaggingSecret(Fr.fromString(secretStr), AztecAddress.fromStringUnsafe(appStr));
89
- }
90
- if (parts.length === 3) {
91
- const [kindStr, secretStr, appStr] = parts;
92
- return new AppTaggingSecret(
93
- Fr.fromString(secretStr),
94
- AztecAddress.fromStringUnsafe(appStr),
95
- appTaggingSecretKindFromString(kindStr),
96
- );
97
+ if (parts.length !== 3) {
98
+ throw new Error(`Invalid AppTaggingSecret string: ${str}`);
97
99
  }
98
- throw new Error(`Invalid AppTaggingSecret string: ${str}`);
100
+ const [kindStr, secretStr, appStr] = parts;
101
+ return new AppTaggingSecret(
102
+ Fr.fromString(secretStr),
103
+ AztecAddress.fromStringUnsafe(appStr),
104
+ appTaggingSecretKindFromString(kindStr),
105
+ );
99
106
  }
100
107
  }
101
108
 
package/src/logs/index.ts CHANGED
@@ -5,13 +5,11 @@ export * from './tagging_index_range.js';
5
5
  export * from './contract_class_log.js';
6
6
  export * from './public_log.js';
7
7
  export * from './private_log.js';
8
- export * from './pending_tagged_log.js';
9
8
  export * from './log_result.js';
10
9
  export * from './log_cursor.js';
11
10
  export * from './logs_query.js';
12
11
  export * from './query_all_logs_by_tags.js';
13
12
  export * from './shared_secret_derivation.js';
14
- export * from './message_context.js';
15
13
  export * from './debug_log.js';
16
14
  export * from './debug_log_store.js';
17
15
  export * from './tag.js';
@@ -2,16 +2,28 @@ import { DomainSeparator } from '@aztec/constants';
2
2
  import { Grumpkin } from '@aztec/foundation/crypto/grumpkin';
3
3
  import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto/poseidon';
4
4
  import type { Fr } from '@aztec/foundation/curves/bn254';
5
- import type { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
5
+ import { GrumpkinScalar, type Point } from '@aztec/foundation/curves/grumpkin';
6
6
 
7
7
  import type { AztecAddress } from '../aztec-address/index.js';
8
8
  import type { PublicKey } from '../keys/public_key.js';
9
9
 
10
10
  /**
11
- * Derives an app-siloed ECDH shared secret.
11
+ * Derives the raw ECDH shared secret point `S = secretKey * publicKey`.
12
12
  *
13
- * Computes the raw ECDH shared secret `S = secretKey * publicKey`, then app-silos it:
14
- * `s_app = h(DOM_SEP__APP_SILOED_ECDH_SHARED_SECRET, S.x, S.y, contractAddress)`
13
+ * @throws If the publicKey is zero.
14
+ */
15
+ export function deriveEcdhSharedSecretPoint(secretKey: GrumpkinScalar, publicKey: PublicKey): Promise<Point> {
16
+ if (publicKey.isZero()) {
17
+ throw new Error(
18
+ `Attempting to derive a shared secret with a zero public key. You have probably passed a zero public key in your Noir code somewhere thinking that the note won't be broadcast... but it was.`,
19
+ );
20
+ }
21
+ return Grumpkin.mul(publicKey, secretKey);
22
+ }
23
+
24
+ /**
25
+ * Derives an app-siloed ECDH shared secret from keys: ECDHs `S = secretKey * publicKey` via
26
+ * {@link deriveEcdhSharedSecretPoint}, then app-silos it via {@link appSiloEcdhSharedSecretPoint}.
15
27
  *
16
28
  * @param secretKey - The secret key used to derive shared secret.
17
29
  * @param publicKey - The public key used to derive shared secret.
@@ -19,19 +31,40 @@ import type { PublicKey } from '../keys/public_key.js';
19
31
  * @returns The app-siloed shared secret as a Field.
20
32
  * @throws If the publicKey is zero.
21
33
  */
22
- export async function deriveAppSiloedSharedSecret(
34
+ export async function appSiloEcdhSharedSecret(
23
35
  secretKey: GrumpkinScalar,
24
36
  publicKey: PublicKey,
25
37
  contractAddress: AztecAddress,
26
38
  ): Promise<Fr> {
27
- if (publicKey.isZero()) {
28
- throw new Error(
29
- `Attempting to derive a shared secret with a zero public key. You have probably passed a zero public key in your Noir code somewhere thinking that the note won't be broadcast... but it was.`,
30
- );
31
- }
32
- const rawSharedSecret = await Grumpkin.mul(publicKey, secretKey);
33
- return poseidon2HashWithSeparator(
34
- [rawSharedSecret.x, rawSharedSecret.y, contractAddress],
35
- DomainSeparator.APP_SILOED_ECDH_SHARED_SECRET,
39
+ const rawSharedSecret = await deriveEcdhSharedSecretPoint(secretKey, publicKey);
40
+ return appSiloEcdhSharedSecretPoint(rawSharedSecret, contractAddress);
41
+ }
42
+
43
+ /**
44
+ * App-silos a shared secret point: `s_app = h(DOM_SEP__APP_SILOED_ECDH_SHARED_SECRET, S.x, S.y, app)`.
45
+ *
46
+ * Mirrors `compute_app_siloed_shared_secret` in aztec-nr.
47
+ *
48
+ * @param point - The raw shared secret point `S`.
49
+ * @param app - The contract address to silo to.
50
+ */
51
+ export function appSiloEcdhSharedSecretPoint(point: Point, app: AztecAddress): Promise<Fr> {
52
+ return poseidon2HashWithSeparator([point.x, point.y, app], DomainSeparator.APP_SILOED_ECDH_SHARED_SECRET);
53
+ }
54
+
55
+ /**
56
+ * Protects a handshake's shared secret from being forged by the recipient: `S' = hash(ephPk, recipientPoint) * S`.
57
+ *
58
+ * Mirrors aztec-nr's `protect_from_forgery` and must stay byte-compatible with it.
59
+ *
60
+ * @param secret - The raw shared secret `S` to protect.
61
+ * @param ephPk - The handshake's ephemeral public key.
62
+ * @param recipientPoint - The recipient's address point.
63
+ */
64
+ export async function protectFromForgery(secret: Point, ephPk: Point, recipientPoint: Point): Promise<Point> {
65
+ const scalar = await poseidon2HashWithSeparator(
66
+ [ephPk.x, ephPk.y, recipientPoint.x, recipientPoint.y],
67
+ DomainSeparator.HANDSHAKE_FORGERY_PROTECTION,
36
68
  );
69
+ return Grumpkin.mul(secret, new GrumpkinScalar(scalar.toBigInt()));
37
70
  }
@@ -1,4 +1,5 @@
1
- import type { L1_TO_L2_MSG_TREE_HEIGHT } from '@aztec/constants';
1
+ import { DomainSeparator, type L1_TO_L2_MSG_TREE_HEIGHT } from '@aztec/constants';
2
+ import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto/poseidon';
2
3
  import { sha256ToField } from '@aztec/foundation/crypto/sha256';
3
4
  import { Fr } from '@aztec/foundation/curves/bn254';
4
5
  import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
@@ -7,7 +8,7 @@ import { SiblingPath } from '@aztec/foundation/trees';
7
8
 
8
9
  import type { AztecAddress } from '../aztec-address/index.js';
9
10
  import type { BlockParameter } from '../block/block_parameter.js';
10
- import { computeL1ToL2MessageNullifier } from '../hash/hash.js';
11
+ import { siloNullifier } from '../hash/hash.js';
11
12
  import type { AztecNode } from '../interfaces/aztec-node.js';
12
13
  import { MerkleTreeId } from '../trees/merkle_tree_id.js';
13
14
  import { L1Actor } from './l1_actor.js';
@@ -74,28 +75,65 @@ export class L1ToL2Message {
74
75
  }
75
76
  }
76
77
 
77
- // This functionality is not on the node because we do not want to pass the node the secret, and give the node the ability to derive a valid nullifer for an L1 to L2 message.
78
- export async function getNonNullifiedL1ToL2MessageWitness(
78
+ /**
79
+ * The unsiloed nullifier a message consumer derives, together with the contract address needed to silo it.
80
+ */
81
+ export interface UnsiloedMessageNullifier {
82
+ contractAddress: AztecAddress;
83
+ nullifier: Fr;
84
+ }
85
+
86
+ /**
87
+ * Computes the unsiloed nullifier that the fee juice contract (and any consumer following the same scheme) derives when
88
+ * consuming an L1 to L2 message.
89
+ *
90
+ * This is not a general-purpose utility: other contracts may derive the secret hash and hence the nullifier
91
+ * differently. The result is unsiloed — callers silo it (with the consuming contract's address) before looking it up
92
+ * in the nullifier tree.
93
+ */
94
+ export function computeFeeJuiceMessageNullifier(messageHash: Fr, secret: Fr): Promise<Fr> {
95
+ return poseidon2HashWithSeparator([messageHash, secret], DomainSeparator.MESSAGE_NULLIFIER);
96
+ }
97
+
98
+ /**
99
+ * Fetches the membership witness of an L1 to L2 message. When `unsiloedNullifier` is provided, the message is
100
+ * additionally required to be un-nullified.
101
+ */
102
+ export async function getL1ToL2MessageWitness(
79
103
  node: AztecNode,
80
- contractAddress: AztecAddress,
81
104
  messageHash: Fr,
82
- secret: Fr,
105
+ unsiloedNullifier?: UnsiloedMessageNullifier,
83
106
  referenceBlock: BlockParameter = 'latest',
84
107
  ): Promise<[bigint, SiblingPath<typeof L1_TO_L2_MSG_TREE_HEIGHT>]> {
85
- const messageNullifier = await computeL1ToL2MessageNullifier(contractAddress, messageHash, secret);
86
-
87
- const [l1ToL2Response, nullifierResponse] = await Promise.all([
88
- node.getL1ToL2MessageMembershipWitness(referenceBlock, messageHash),
89
- node.findLeavesIndexes(referenceBlock, MerkleTreeId.NULLIFIER_TREE, [messageNullifier]),
90
- ]);
108
+ // Both requests are dispatched before awaiting so they run concurrently.
109
+ const l1ToL2ResponsePromise = node.getL1ToL2MessageMembershipWitness(referenceBlock, messageHash);
110
+ const nullifierResponsePromise = unsiloedNullifier
111
+ ? siloNullifier(unsiloedNullifier.contractAddress, unsiloedNullifier.nullifier).then(siloed =>
112
+ node.findLeavesIndexes(referenceBlock, MerkleTreeId.NULLIFIER_TREE, [siloed]),
113
+ )
114
+ : undefined;
91
115
 
116
+ const l1ToL2Response = await l1ToL2ResponsePromise;
92
117
  if (!l1ToL2Response) {
93
118
  throw new Error(`No L1 to L2 message found for message hash ${messageHash.toString()}`);
94
119
  }
95
120
 
96
- if (nullifierResponse[0] !== undefined) {
121
+ const nullifierResponse = await nullifierResponsePromise;
122
+ if (nullifierResponse?.[0] !== undefined) {
97
123
  throw new Error(`No non-nullified L1 to L2 message found for message hash ${messageHash.toString()}`);
98
124
  }
99
125
 
100
126
  return l1ToL2Response;
101
127
  }
128
+
129
+ // This functionality is not on the node because we do not want to pass the node the secret, and give the node the ability to derive a valid nullifer for an L1 to L2 message.
130
+ export async function getNonNullifiedL1ToL2MessageWitness(
131
+ node: AztecNode,
132
+ contractAddress: AztecAddress,
133
+ messageHash: Fr,
134
+ secret: Fr,
135
+ referenceBlock: BlockParameter = 'latest',
136
+ ): Promise<[bigint, SiblingPath<typeof L1_TO_L2_MSG_TREE_HEIGHT>]> {
137
+ const nullifier = await computeFeeJuiceMessageNullifier(messageHash, secret);
138
+ return getL1ToL2MessageWitness(node, messageHash, { contractAddress, nullifier }, referenceBlock);
139
+ }
@@ -1,3 +1,4 @@
1
+ import { normalizeSignature } from '@aztec/foundation/crypto/secp256k1-signer';
1
2
  import type { EthAddress } from '@aztec/foundation/eth-address';
2
3
 
3
4
  import { CommitteeAttestation } from '../block/index.js';
@@ -18,9 +19,15 @@ export function orderAttestations(
18
19
  for (const attestation of attestations) {
19
20
  const sender = attestation.getSender();
20
21
  if (sender) {
22
+ // Canonicalize the recovery byte to v ∈ {27, 28} before it reaches the L1 bundle. A committee
23
+ // member (or a peer mutating the byte in flight) can emit an equivalent signature in yParity form
24
+ // (v = 0/1); left as-is it makes `packAttestations` (empty iff v === 0) and `getSigners` (empty iff
25
+ // r,s,v all zero) disagree, reverting `propose()` with SignersSizeMismatch, and a v = 1 byte would
26
+ // later revert epoch proving in ECDSA.recover. `sender` recovered, so the signature is non-empty
27
+ // and low-s, and normalizeSignature preserves the recovered address.
21
28
  attestationMap.set(
22
29
  sender.toString(),
23
- CommitteeAttestation.fromAddressAndSignature(sender, attestation.signature),
30
+ CommitteeAttestation.fromAddressAndSignature(sender, normalizeSignature(attestation.signature)),
24
31
  );
25
32
  }
26
33
  }
@@ -1,5 +1,6 @@
1
1
  import { CheckpointProposalHash, type SlotNumber } from '@aztec/foundation/branded-types';
2
2
  import { type BaseBuffer32, Buffer32 } from '@aztec/foundation/buffer';
3
+ import { normalizeSignature } from '@aztec/foundation/crypto/secp256k1-signer';
3
4
  import type { Fr } from '@aztec/foundation/curves/bn254';
4
5
  import type { EthAddress } from '@aztec/foundation/eth-address';
5
6
  import { Signature } from '@aztec/foundation/eth-signature';
@@ -97,6 +98,17 @@ export class CheckpointAttestation extends Gossipable {
97
98
  return this.cachedProposer ?? undefined;
98
99
  }
99
100
 
101
+ /**
102
+ * Returns a copy with the attester signature canonicalized to v ∈ {27, 28}. Callers store attestations
103
+ * received from gossip verbatim; normalizing on ingress keeps a signature emitted in yParity form
104
+ * (v = 0/1) — whether by a malicious committee member or a peer mutating the byte in flight — from
105
+ * reaching the L1 bundle in a non-canonical form. Must only be called once the signature has recovered
106
+ * a sender (so it is non-empty and low-s); `normalizeSignature` throws on an all-zero signature.
107
+ */
108
+ withNormalizedSignature(): CheckpointAttestation {
109
+ return new CheckpointAttestation(this.payload, normalizeSignature(this.signature), this.proposerSignature);
110
+ }
111
+
100
112
  getPayload(): Buffer {
101
113
  return this.payload.getPayloadToSign();
102
114
  }
@@ -112,6 +112,15 @@ export function getHashedSignaturePayloadTypedData(signable: Signable): Buffer32
112
112
  return Buffer32.fromString(hashTypedData(getCoordinationSignatureTypedData(signable)));
113
113
  }
114
114
 
115
+ /**
116
+ * Recovers the sender of a gossiped coordination message. Deliberately lenient (allowYParityAsV): a
117
+ * signature whose recovery byte is in yParity form (v ∈ {0, 1}) still resolves to its sender, so the P2P
118
+ * layer can attribute and accept it and then canonicalize on ingress (CheckpointAttestation.
119
+ * withNormalizedSignature, A-1351) before it reaches the L1 bundle. This is intentionally looser than
120
+ * on-chain checkpoint validation (getAttestationInfoFromPayload), which recovers strictly to mirror L1's
121
+ * ECDSA.recover — do not unify the two. These proposal/attestation signatures are P2P-only and never reach
122
+ * L1 verbatim, so leniency here cannot leak a non-canonical byte onto L1.
123
+ */
115
124
  export function recoverCoordinationSigner(signable: Signable, signature: Signature): EthAddress | undefined {
116
125
  const digest = getHashedSignaturePayloadTypedData(signable);
117
126
  return tryRecoverAddress(digest, signature, { allowYParityAsV: true });
@@ -1,6 +1,6 @@
1
- import { AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED } from '@aztec/constants';
1
+ import { AVM_V2_PROOF_LENGTH_IN_FIELDS } from '@aztec/constants';
2
2
 
3
3
  import { AvmCircuitPublicInputs } from '../avm/avm_circuit_public_inputs.js';
4
4
  import type { ProofDataForFixedVk } from '../proofs/proof_data.js';
5
5
 
6
- export type AvmProofData = ProofDataForFixedVk<AvmCircuitPublicInputs, typeof AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED>;
6
+ export type AvmProofData = ProofDataForFixedVk<AvmCircuitPublicInputs, typeof AVM_V2_PROOF_LENGTH_IN_FIELDS>;
@@ -90,8 +90,8 @@ export type ClientCircuitName =
90
90
  | 'private-kernel-inner-2'
91
91
  | 'private-kernel-inner-3'
92
92
  | 'private-kernel-reset'
93
- | 'private-kernel-tail'
94
- | 'private-kernel-tail-to-public'
93
+ | 'private-kernel-reset-tail'
94
+ | 'private-kernel-reset-tail-to-public'
95
95
  | 'hiding-kernel-to-rollup'
96
96
  | 'hiding-kernel-to-public'
97
97
  | 'app-circuit';
@@ -6,7 +6,7 @@ import {
6
6
  } from '@aztec/blob-lib/testing';
7
7
  import {
8
8
  ARCHIVE_HEIGHT,
9
- AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED,
9
+ AVM_V2_PROOF_LENGTH_IN_FIELDS,
10
10
  CHONK_PROOF_LENGTH,
11
11
  CONTRACT_CLASS_LOG_SIZE_IN_FIELDS,
12
12
  L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH,
@@ -692,6 +692,7 @@ export function makePrivateCircuitPublicInputs(seed = 0): PrivateCircuitPublicIn
692
692
  anchorBlockHeader: makeBlockHeader(seed + 0xd00),
693
693
  txContext: makeTxContext(seed + 0x1400),
694
694
  isFeePayer: false,
695
+ txRequestSalt: fr(seed + 0x1500),
695
696
  });
696
697
  }
697
698
 
@@ -1162,11 +1163,7 @@ export function makePublicTxBaseRollupPrivateInputs(seed = 0) {
1162
1163
  makePublicChonkVerifierPublicInputs,
1163
1164
  RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
1164
1165
  );
1165
- const avmProofData = makeProofDataForFixedVk(
1166
- seed + 0x100,
1167
- makeAvmCircuitPublicInputs,
1168
- AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED,
1169
- );
1166
+ const avmProofData = makeProofDataForFixedVk(seed + 0x100, makeAvmCircuitPublicInputs, AVM_V2_PROOF_LENGTH_IN_FIELDS);
1170
1167
  const hints = makePublicBaseRollupHints(seed + 0x200);
1171
1168
 
1172
1169
  return PublicTxBaseRollupPrivateInputs.from({