@aztec/pxe 5.0.0-rc.2 → 5.0.0

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 (188) hide show
  1. package/dest/block_synchronizer/block_synchronizer.d.ts +5 -3
  2. package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
  3. package/dest/block_synchronizer/block_synchronizer.js +7 -1
  4. package/dest/contract/contract_class_service.d.ts +31 -0
  5. package/dest/contract/contract_class_service.d.ts.map +1 -0
  6. package/dest/contract/contract_class_service.js +68 -0
  7. package/dest/{contract_sync → contract}/contract_sync_service.d.ts +7 -6
  8. package/dest/contract/contract_sync_service.d.ts.map +1 -0
  9. package/dest/{contract_sync → contract}/contract_sync_service.js +10 -30
  10. package/dest/contract/helpers.d.ts +7 -0
  11. package/dest/contract/helpers.d.ts.map +1 -0
  12. package/dest/contract/helpers.js +20 -0
  13. package/dest/contract_function_simulator/anchored_contract_data.d.ts +36 -0
  14. package/dest/contract_function_simulator/anchored_contract_data.d.ts.map +1 -0
  15. package/dest/contract_function_simulator/anchored_contract_data.js +54 -0
  16. package/dest/contract_function_simulator/aztec_node_read_cache.d.ts +39 -0
  17. package/dest/contract_function_simulator/aztec_node_read_cache.d.ts.map +1 -0
  18. package/dest/contract_function_simulator/aztec_node_read_cache.js +60 -0
  19. package/dest/contract_function_simulator/contract_function_simulator.d.ts +9 -3
  20. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
  21. package/dest/contract_function_simulator/contract_function_simulator.js +31 -14
  22. package/dest/contract_function_simulator/execution_note_cache.d.ts +3 -9
  23. package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
  24. package/dest/contract_function_simulator/execution_note_cache.js +8 -28
  25. package/dest/contract_function_simulator/index.d.ts +4 -2
  26. package/dest/contract_function_simulator/index.d.ts.map +1 -1
  27. package/dest/contract_function_simulator/index.js +2 -1
  28. package/dest/contract_function_simulator/noir-structs/fact.d.ts +5 -5
  29. package/dest/contract_function_simulator/noir-structs/fact.d.ts.map +1 -1
  30. package/dest/contract_function_simulator/noir-structs/fact.js +2 -2
  31. package/dest/contract_function_simulator/noir-structs/fact_collection.d.ts +3 -3
  32. package/dest/contract_function_simulator/noir-structs/fact_collection.d.ts.map +1 -1
  33. package/dest/contract_function_simulator/noir-structs/fact_collection.js +3 -1
  34. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +7 -1
  35. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts.map +1 -1
  36. package/dest/contract_function_simulator/noir-structs/pending_tagged_log.d.ts +11 -0
  37. package/dest/contract_function_simulator/noir-structs/pending_tagged_log.d.ts.map +1 -0
  38. package/dest/contract_function_simulator/noir-structs/pending_tagged_log.js +4 -0
  39. package/dest/contract_function_simulator/noir-structs/provided_secret.d.ts +2 -2
  40. package/dest/contract_function_simulator/noir-structs/provided_secret.d.ts.map +1 -1
  41. package/dest/contract_function_simulator/noir-structs/provided_secret.js +1 -1
  42. package/dest/contract_function_simulator/noir-structs/resolved_tagging_strategy.d.ts +8 -1
  43. package/dest/contract_function_simulator/noir-structs/resolved_tagging_strategy.d.ts.map +1 -1
  44. package/dest/contract_function_simulator/noir-structs/resolved_tagging_strategy.js +17 -0
  45. package/dest/contract_function_simulator/oracle/acir_callback.d.ts +7 -2
  46. package/dest/contract_function_simulator/oracle/acir_callback.d.ts.map +1 -1
  47. package/dest/contract_function_simulator/oracle/acir_callback.js +55 -11
  48. package/dest/contract_function_simulator/oracle/legacy_oracle_registry.d.ts +39 -0
  49. package/dest/contract_function_simulator/oracle/legacy_oracle_registry.d.ts.map +1 -0
  50. package/dest/contract_function_simulator/oracle/legacy_oracle_registry.js +107 -0
  51. package/dest/contract_function_simulator/oracle/oracle_registry.d.ts +10 -7
  52. package/dest/contract_function_simulator/oracle/oracle_registry.d.ts.map +1 -1
  53. package/dest/contract_function_simulator/oracle/oracle_registry.js +41 -10
  54. package/dest/contract_function_simulator/oracle/oracle_type_mappings.d.ts +48 -9
  55. package/dest/contract_function_simulator/oracle/oracle_type_mappings.d.ts.map +1 -1
  56. package/dest/contract_function_simulator/oracle/oracle_type_mappings.js +51 -30
  57. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +10 -2
  58. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
  59. package/dest/contract_function_simulator/oracle/private_execution_oracle.js +73 -32
  60. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +20 -16
  61. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
  62. package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +68 -47
  63. package/dest/debug/pxe_debug_utils.d.ts +2 -2
  64. package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
  65. package/dest/entrypoints/client/bundle/utils.js +2 -2
  66. package/dest/entrypoints/client/lazy/utils.js +2 -2
  67. package/dest/entrypoints/server/index.d.ts +5 -2
  68. package/dest/entrypoints/server/index.d.ts.map +1 -1
  69. package/dest/entrypoints/server/index.js +3 -1
  70. package/dest/error_enriching.d.ts +5 -3
  71. package/dest/error_enriching.d.ts.map +1 -1
  72. package/dest/error_enriching.js +12 -10
  73. package/dest/hooks/execution_hooks.d.ts +15 -4
  74. package/dest/hooks/execution_hooks.d.ts.map +1 -1
  75. package/dest/hooks/index.d.ts +3 -2
  76. package/dest/hooks/index.d.ts.map +1 -1
  77. package/dest/hooks/index.js +1 -0
  78. package/dest/hooks/resolve_custom_request.d.ts +23 -0
  79. package/dest/hooks/resolve_custom_request.d.ts.map +1 -0
  80. package/dest/hooks/resolve_custom_request.js +3 -0
  81. package/dest/hooks/resolve_tagging_secret_strategy.d.ts +10 -1
  82. package/dest/hooks/resolve_tagging_secret_strategy.d.ts.map +1 -1
  83. package/dest/hooks/resolve_tagging_secret_strategy.js +3 -3
  84. package/dest/logs/log_service.d.ts +3 -2
  85. package/dest/logs/log_service.d.ts.map +1 -1
  86. package/dest/logs/log_service.js +33 -16
  87. package/dest/oracle_version.d.ts +2 -2
  88. package/dest/oracle_version.js +2 -2
  89. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts +1 -1
  90. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts.map +1 -1
  91. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.js +6 -2
  92. package/dest/private_kernel/private_kernel_execution_prover.d.ts +1 -1
  93. package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
  94. package/dest/private_kernel/private_kernel_execution_prover.js +17 -36
  95. package/dest/private_kernel/private_kernel_oracle.d.ts +4 -2
  96. package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
  97. package/dest/private_kernel/private_kernel_oracle.js +17 -5
  98. package/dest/pxe.d.ts +81 -46
  99. package/dest/pxe.d.ts.map +1 -1
  100. package/dest/pxe.js +135 -104
  101. package/dest/storage/backwards_compatibility_tests/schema_tests.d.ts +1 -1
  102. package/dest/storage/backwards_compatibility_tests/schema_tests.d.ts.map +1 -1
  103. package/dest/storage/backwards_compatibility_tests/schema_tests.js +31 -7
  104. package/dest/storage/contract_store/contract_store.d.ts +27 -24
  105. package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
  106. package/dest/storage/contract_store/contract_store.js +63 -74
  107. package/dest/storage/fact_store/fact_service.d.ts +6 -4
  108. package/dest/storage/fact_store/fact_service.d.ts.map +1 -1
  109. package/dest/storage/fact_store/fact_service.js +19 -4
  110. package/dest/storage/fact_store/fact_store.d.ts +1 -1
  111. package/dest/storage/fact_store/fact_store.js +1 -1
  112. package/dest/storage/fact_store/index.d.ts +2 -1
  113. package/dest/storage/fact_store/index.d.ts.map +1 -1
  114. package/dest/storage/fact_store/index.js +1 -0
  115. package/dest/storage/fact_store/origin_state.d.ts +57 -0
  116. package/dest/storage/fact_store/origin_state.d.ts.map +1 -0
  117. package/dest/storage/fact_store/origin_state.js +53 -0
  118. package/dest/storage/metadata.d.ts +2 -2
  119. package/dest/storage/metadata.d.ts.map +1 -1
  120. package/dest/storage/metadata.js +1 -1
  121. package/dest/storage/tagging_store/tagging_secret_sources_store.d.ts +17 -6
  122. package/dest/storage/tagging_store/tagging_secret_sources_store.d.ts.map +1 -1
  123. package/dest/storage/tagging_store/tagging_secret_sources_store.js +24 -11
  124. package/dest/tagging/constants.d.ts +2 -2
  125. package/dest/tagging/constants.d.ts.map +1 -1
  126. package/dest/tagging/constants.js +18 -9
  127. package/package.json +17 -17
  128. package/src/block_synchronizer/block_synchronizer.ts +9 -1
  129. package/src/contract/contract_class_service.ts +83 -0
  130. package/src/{contract_sync → contract}/contract_sync_service.ts +18 -37
  131. package/src/contract/helpers.ts +35 -0
  132. package/src/contract_function_simulator/anchored_contract_data.ts +74 -0
  133. package/src/contract_function_simulator/aztec_node_read_cache.ts +89 -0
  134. package/src/contract_function_simulator/contract_function_simulator.ts +56 -14
  135. package/src/contract_function_simulator/execution_note_cache.ts +7 -28
  136. package/src/contract_function_simulator/index.ts +7 -1
  137. package/src/contract_function_simulator/noir-structs/fact.ts +4 -4
  138. package/src/contract_function_simulator/noir-structs/fact_collection.ts +9 -4
  139. package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +6 -0
  140. package/src/contract_function_simulator/noir-structs/pending_tagged_log.ts +12 -0
  141. package/src/contract_function_simulator/noir-structs/provided_secret.ts +1 -1
  142. package/src/contract_function_simulator/noir-structs/resolved_tagging_strategy.ts +21 -0
  143. package/src/contract_function_simulator/oracle/acir_callback.ts +58 -12
  144. package/src/contract_function_simulator/oracle/legacy_oracle_registry.ts +147 -0
  145. package/src/contract_function_simulator/oracle/oracle_registry.ts +32 -7
  146. package/src/contract_function_simulator/oracle/oracle_type_mappings.ts +49 -32
  147. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +92 -41
  148. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +104 -59
  149. package/src/debug/pxe_debug_utils.ts +1 -1
  150. package/src/entrypoints/client/bundle/utils.ts +2 -2
  151. package/src/entrypoints/client/lazy/utils.ts +2 -2
  152. package/src/entrypoints/server/index.ts +5 -1
  153. package/src/error_enriching.ts +26 -10
  154. package/src/hooks/execution_hooks.ts +14 -3
  155. package/src/hooks/index.ts +2 -0
  156. package/src/hooks/resolve_custom_request.ts +24 -0
  157. package/src/hooks/resolve_tagging_secret_strategy.ts +14 -0
  158. package/src/logs/log_service.ts +31 -11
  159. package/src/oracle_version.ts +2 -2
  160. package/src/private_kernel/hints/private_kernel_reset_private_inputs_builder.ts +11 -1
  161. package/src/private_kernel/private_kernel_execution_prover.ts +22 -52
  162. package/src/private_kernel/private_kernel_oracle.ts +23 -4
  163. package/src/pxe.ts +209 -143
  164. package/src/storage/backwards_compatibility_tests/__snapshots__/AddressStore.json +6 -6
  165. package/src/storage/backwards_compatibility_tests/__snapshots__/ContractStore.json +1 -1
  166. package/src/storage/backwards_compatibility_tests/__snapshots__/KeyStore.json +12 -12
  167. package/src/storage/backwards_compatibility_tests/__snapshots__/RecipientTaggingStore.json +11 -3
  168. package/src/storage/backwards_compatibility_tests/__snapshots__/SenderTaggingStore.json +12 -4
  169. package/src/storage/backwards_compatibility_tests/__snapshots__/TaggingSecretSourcesStore.json +3 -3
  170. package/src/storage/backwards_compatibility_tests/__snapshots__/opened_stores.json +1 -1
  171. package/src/storage/backwards_compatibility_tests/schema_tests.ts +38 -4
  172. package/src/storage/contract_store/contract_store.ts +85 -92
  173. package/src/storage/fact_store/fact_service.ts +29 -5
  174. package/src/storage/fact_store/fact_store.ts +1 -1
  175. package/src/storage/fact_store/index.ts +10 -0
  176. package/src/storage/fact_store/origin_state.ts +75 -0
  177. package/src/storage/metadata.ts +1 -1
  178. package/src/storage/tagging_store/tagging_secret_sources_store.ts +36 -15
  179. package/src/tagging/constants.ts +19 -9
  180. package/dest/contract_function_simulator/proxied_contract_data_source.d.ts +0 -6
  181. package/dest/contract_function_simulator/proxied_contract_data_source.d.ts.map +0 -1
  182. package/dest/contract_function_simulator/proxied_contract_data_source.js +0 -51
  183. package/dest/contract_sync/contract_sync_service.d.ts.map +0 -1
  184. package/dest/contract_sync/helpers.d.ts +0 -28
  185. package/dest/contract_sync/helpers.d.ts.map +0 -1
  186. package/dest/contract_sync/helpers.js +0 -48
  187. package/src/contract_function_simulator/proxied_contract_data_source.ts +0 -60
  188. package/src/contract_sync/helpers.ts +0 -79
package/src/pxe.ts CHANGED
@@ -6,6 +6,7 @@ import { type Logger, type LoggerBindings, createLogger } from '@aztec/foundatio
6
6
  import { SerialQueue } from '@aztec/foundation/queue';
7
7
  import { Timer } from '@aztec/foundation/timer';
8
8
  import { KeyStore } from '@aztec/key-store';
9
+ import type { AccountPrivacyKeys, AccountPrivacySecretKeys } from '@aztec/key-store';
9
10
  import type { AztecAsyncKVStore } from '@aztec/kv-store';
10
11
  import { type ProtocolContractsProvider, protocolContractNames } from '@aztec/protocol-contracts';
11
12
  import type { CircuitSimulator } from '@aztec/simulator/client';
@@ -13,6 +14,7 @@ import {
13
14
  type ContractArtifact,
14
15
  EventSelector,
15
16
  FunctionCall,
17
+ type FunctionSelector,
16
18
  FunctionType,
17
19
  decodeFunctionSignature,
18
20
  } from '@aztec/stdlib/abi';
@@ -21,10 +23,11 @@ import type { AztecAddress } from '@aztec/stdlib/aztec-address';
21
23
  import { GENESIS_BLOCK_HEADER_HASH, type L2TipsProvider } from '@aztec/stdlib/block';
22
24
  import {
23
25
  CompleteAddress,
26
+ type ContractInstancePreimage,
27
+ type ContractInstancePreimageWithAddress,
24
28
  type ContractInstanceWithAddress,
25
29
  type PartialAddress,
26
30
  computeContractAddressFromInstance,
27
- getContractClassFromArtifact,
28
31
  } from '@aztec/stdlib/contract';
29
32
  import { SimulationError } from '@aztec/stdlib/errors';
30
33
  import type { AztecNode, AztecNodeDebug, PrivateKernelProver } from '@aztec/stdlib/interfaces/client';
@@ -33,6 +36,8 @@ import type {
33
36
  PrivateKernelExecutionProofOutput,
34
37
  PrivateKernelTailCircuitPublicInputs,
35
38
  } from '@aztec/stdlib/kernel';
39
+ import { computeAddressSecret } from '@aztec/stdlib/keys';
40
+ import { deriveEcdhSharedSecretPoint } from '@aztec/stdlib/logs';
36
41
  import {
37
42
  BlockHeader,
38
43
  type ContractOverrides,
@@ -55,15 +60,14 @@ import { inspect } from 'util';
55
60
 
56
61
  import { BlockSynchronizer } from './block_synchronizer/index.js';
57
62
  import type { PXEConfig } from './config/index.js';
63
+ import { ContractClassService } from './contract/contract_class_service.js';
64
+ import { ContractSyncService } from './contract/contract_sync_service.js';
58
65
  import { BenchmarkedNodeFactory } from './contract_function_simulator/benchmarked_node.js';
59
66
  import {
60
67
  ContractFunctionSimulator,
61
68
  generateSimulatedProvingResult,
62
69
  } from './contract_function_simulator/contract_function_simulator.js';
63
- import { ProxiedContractStoreFactory } from './contract_function_simulator/proxied_contract_data_source.js';
64
70
  import { displayDebugLogs } from './contract_logging.js';
65
- import { ContractSyncService } from './contract_sync/contract_sync_service.js';
66
- import { readCurrentClassId } from './contract_sync/helpers.js';
67
71
  import { PXEDebugUtils } from './debug/pxe_debug_utils.js';
68
72
  import { enrichPublicSimulationError, enrichSimulationError } from './error_enriching.js';
69
73
  import { PrivateEventFilterValidator } from './events/private_event_filter_validator.js';
@@ -85,7 +89,10 @@ import { openPxeStores } from './storage/open_pxe_stores.js';
85
89
  import { PrivateEventStore } from './storage/private_event_store/private_event_store.js';
86
90
  import { RecipientTaggingStore } from './storage/tagging_store/recipient_tagging_store.js';
87
91
  import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store.js';
88
- import { TaggingSecretSourcesStore } from './storage/tagging_store/tagging_secret_sources_store.js';
92
+ import {
93
+ type SharedSecretKind,
94
+ TaggingSecretSourcesStore,
95
+ } from './storage/tagging_store/tagging_secret_sources_store.js';
89
96
  import { persistSenderTaggingIndexRangesForTx } from './tagging/index.js';
90
97
 
91
98
  export type PackedPrivateEvent = InTx & {
@@ -189,18 +196,33 @@ export type PXECreateArgs = {
189
196
  hooks?: ExecutionHooks;
190
197
  };
191
198
 
192
- /**
193
- * A source from which PXE derives the tagging secrets it scans for to discover incoming private logs.
194
- *
195
- * - `address-derived`: derives a shared secret via ECDH from an external `sender` address against every account
196
- * registered in this PXE (present and future), so registering one sender applies it to all of them. The address is
197
- * not secret, so unlike `arbitrary-secret` it can be reused freely across recipients.
198
- * - `arbitrary-secret`: a shared secret point provided directly, scoped to a single recipient. It bypasses ECDH, so it
199
- * must not be reused across recipients (each would then be able to find the others' tags).
200
- */
199
+ /** A source from which PXE derives the tagging secrets it scans for to discover incoming private logs. */
201
200
  export type TaggingSecretSource =
201
+ /**
202
+ * Derives a shared secret via ECDH from an external `sender` address against every account registered in this PXE
203
+ * (present and future), so registering one sender applies it to all of them. The address is not secret, so unlike
204
+ * `arbitrary-secret` it can be reused freely across recipients.
205
+ */
202
206
  | { kind: 'address-derived'; sender: AztecAddress }
203
- | { kind: 'arbitrary-secret'; recipient: AztecAddress; secret: Point };
207
+ /**
208
+ * A shared secret point provided directly, scoped to a single recipient. It bypasses ECDH, so it must not be
209
+ * reused across recipients (each would then be able to find the others' tags).
210
+ */
211
+ | { kind: 'arbitrary-secret'; recipient: AztecAddress; secret: Point }
212
+ /**
213
+ * A handshake known by the x-coordinate of its ephemeral public key (the value a recipient learns while authorizing
214
+ * an interactive handshake, which emits no discoverable announcement). The ephemeral key's y-coordinate is always
215
+ * positive by protocol construction, so the x-coordinate alone identifies it.
216
+ */
217
+ | { kind: 'handshake'; recipient: AztecAddress; ephPk: Fr };
218
+
219
+ /**
220
+ * The registered form of a {@link TaggingSecretSource}.
221
+ */
222
+ export type RegisteredTaggingSecretSource =
223
+ | Exclude<TaggingSecretSource, { kind: 'handshake' }>
224
+ /** A handshake's resolved shared secret, derived at registration from the handshake's ephemeral key. */
225
+ | { kind: 'handshake'; recipient: AztecAddress; secret: Point };
204
226
 
205
227
  /**
206
228
  * Private eXecution Environment (PXE) is a library used by wallets to simulate private phase of transactions and to
@@ -224,6 +246,7 @@ export class PXE {
224
246
  private addressStore: AddressStore,
225
247
  private privateEventStore: PrivateEventStore,
226
248
  private contractSyncService: ContractSyncService,
249
+ private contractClassService: ContractClassService,
227
250
  private txResolver: TxResolverService,
228
251
  private l2TipsStore: L2TipsProvider,
229
252
  private simulator: CircuitSimulator,
@@ -292,9 +315,11 @@ export class PXE {
292
315
  l2TipsStore,
293
316
  factStore,
294
317
  } = openPxeStores(store, initialBlockHash);
318
+ const contractClassService = new ContractClassService(node, contractStore);
295
319
  const contractSyncService = new ContractSyncService(
296
320
  node,
297
321
  contractStore,
322
+ contractClassService,
298
323
  noteStore,
299
324
  createLogger('pxe:contract_sync', bindings),
300
325
  );
@@ -309,6 +334,7 @@ export class PXE {
309
334
  factStore,
310
335
  l2TipsStore,
311
336
  contractSyncService,
337
+ contractClassService,
312
338
  config,
313
339
  bindings,
314
340
  );
@@ -345,6 +371,7 @@ export class PXE {
345
371
  addressStore,
346
372
  privateEventStore,
347
373
  contractSyncService,
374
+ contractClassService,
348
375
  txResolver,
349
376
  l2TipsStore,
350
377
  simulator,
@@ -376,10 +403,10 @@ export class PXE {
376
403
  // Internal methods
377
404
 
378
405
  #getSimulatorForTx(overrides?: { contracts?: ContractOverrides }) {
379
- const proxyContractStore = ProxiedContractStoreFactory.create(this.contractStore, overrides?.contracts);
380
-
381
406
  return new ContractFunctionSimulator({
382
- contractStore: proxyContractStore,
407
+ contractStore: this.contractStore,
408
+ contractClassService: this.contractClassService,
409
+ overrides: overrides?.contracts,
383
410
  noteStore: this.noteStore,
384
411
  keyStore: this.keyStore,
385
412
  addressStore: this.addressStore,
@@ -398,6 +425,30 @@ export class PXE {
398
425
  });
399
426
  }
400
427
 
428
+ /** Best-effort debug function name for the class `address` runs at `anchorBlockHeader`. Used for log display only. */
429
+ async #getDebugFunctionName(
430
+ address: AztecAddress,
431
+ selector: FunctionSelector,
432
+ anchorBlockHeader: BlockHeader,
433
+ ): Promise<string> {
434
+ try {
435
+ const classId = await this.contractClassService.getCurrentClassId(address, anchorBlockHeader);
436
+ return classId ? await this.contractStore.getDebugFunctionName(classId, selector) : `${address}:${selector}`;
437
+ } catch {
438
+ return `${address}:${selector}`;
439
+ }
440
+ }
441
+
442
+ /** Best-effort debug contract name for the class `address` runs at `anchorBlockHeader`. Used for log display only. */
443
+ async #getDebugContractName(address: AztecAddress, anchorBlockHeader: BlockHeader): Promise<string | undefined> {
444
+ try {
445
+ const classId = await this.contractClassService.getCurrentClassId(address, anchorBlockHeader);
446
+ return classId ? await this.contractStore.getDebugContractName(classId) : undefined;
447
+ } catch {
448
+ return undefined;
449
+ }
450
+ }
451
+
401
452
  #contextualizeError(err: Error, ...context: string[]): Error {
402
453
  let contextStr = '';
403
454
  if (context.length > 0) {
@@ -461,7 +512,14 @@ export class PXE {
461
512
 
462
513
  async #registerPreloadedContracts() {
463
514
  const contracts = await this.preloadedContractsProvider.getPreloadedContracts();
464
- await Promise.all(contracts.map(({ instance, artifact }) => this.registerContract({ instance, artifact })));
515
+ await Promise.all(
516
+ contracts.map(async ({ instance, artifact }) => {
517
+ if (artifact) {
518
+ await this.registerContractClass(artifact);
519
+ }
520
+ await this.registerContract(instance);
521
+ }),
522
+ );
465
523
  this.log.verbose(`Registered preloaded contracts in pxe`, {
466
524
  contracts: contracts.map(({ instance }) => instance.address.toString()),
467
525
  });
@@ -507,7 +565,7 @@ export class PXE {
507
565
  return result;
508
566
  } catch (err) {
509
567
  if (err instanceof SimulationError) {
510
- await enrichSimulationError(err, this.contractStore, this.log);
568
+ await enrichSimulationError(err, this.contractStore, this.contractClassService, anchorBlockHeader, this.log);
511
569
  }
512
570
  throw err;
513
571
  }
@@ -542,7 +600,8 @@ export class PXE {
542
600
  return { result, offchainEffects };
543
601
  } catch (err) {
544
602
  if (err instanceof SimulationError) {
545
- await enrichSimulationError(err, this.contractStore, this.log);
603
+ const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
604
+ await enrichSimulationError(err, this.contractStore, this.contractClassService, anchorBlockHeader, this.log);
546
605
  }
547
606
  throw err;
548
607
  }
@@ -566,7 +625,14 @@ export class PXE {
566
625
  } catch (err) {
567
626
  if (err instanceof SimulationError) {
568
627
  try {
569
- await enrichPublicSimulationError(err, this.contractStore, this.log);
628
+ const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
629
+ await enrichPublicSimulationError(
630
+ err,
631
+ this.contractStore,
632
+ this.contractClassService,
633
+ anchorBlockHeader,
634
+ this.log,
635
+ );
570
636
  } catch (enrichErr) {
571
637
  this.log.error(`Failed to enrich public simulation error: ${enrichErr}`);
572
638
  }
@@ -593,7 +659,13 @@ export class PXE {
593
659
  anchorBlockHeader: BlockHeader,
594
660
  config: PrivateKernelExecutionProverConfig,
595
661
  ): Promise<PrivateKernelExecutionProofOutput<PrivateKernelTailCircuitPublicInputs>> {
596
- const kernelOracle = new PrivateKernelOracle(this.contractStore, this.keyStore, this.node, anchorBlockHeader);
662
+ const kernelOracle = new PrivateKernelOracle(
663
+ this.contractStore,
664
+ this.contractClassService,
665
+ this.keyStore,
666
+ this.node,
667
+ anchorBlockHeader,
668
+ );
597
669
  const kernelTraceProver = new PrivateKernelExecutionProver(
598
670
  kernelOracle,
599
671
  proofCreator,
@@ -637,11 +709,11 @@ export class PXE {
637
709
  }
638
710
 
639
711
  /**
640
- * Returns the contract instance for a given address, if it's registered in the PXE.
712
+ * Returns the address preimage of the contract instance at a given address, if it's registered in the PXE.
641
713
  * @param address - The contract address.
642
- * @returns The contract instance if found, undefined otherwise.
714
+ * @returns The contract instance address preimage if found, undefined otherwise.
643
715
  */
644
- public getContractInstance(address: AztecAddress): Promise<ContractInstanceWithAddress | undefined> {
716
+ public getContractInstance(address: AztecAddress): Promise<ContractInstancePreimageWithAddress | undefined> {
645
717
  return this.contractStore.getContractInstance(address);
646
718
  }
647
719
 
@@ -655,18 +727,22 @@ export class PXE {
655
727
  }
656
728
 
657
729
  /**
658
- * Registers a user account in PXE given its master encryption private key.
659
- * Once a new account is registered, the PXE will trial-decrypt all published notes on
660
- * the chain and store those that correspond to the registered account. Will do nothing if the
661
- * account is already registered.
730
+ * Registers a user account in PXE.
731
+ *
732
+ * PXE holds the account's four privacy secret keys but only the *public* message-signing and fallback keys: their
733
+ * secret keys are withheld, since PXE is not trusted to hold them.
662
734
  *
663
- * @param secretKey - Secret key of the corresponding user master public key.
735
+ * Does nothing if the account is already registered.
736
+ *
737
+ * The four privacy secret keys can be retrieved later with {@link getAccountSecretKeys}.
738
+ *
739
+ * @param keys - The account's privacy keys: four secret keys plus the message-signing and fallback public keys.
664
740
  * @param partialAddress - The partial address of the account contract corresponding to the account being registered.
665
741
  * @returns The complete address of the account.
666
742
  */
667
- public async registerAccount(secretKey: Fr, partialAddress: PartialAddress): Promise<CompleteAddress> {
743
+ public async registerAccount(keys: AccountPrivacyKeys, partialAddress: PartialAddress): Promise<CompleteAddress> {
668
744
  const accounts = await this.keyStore.getAccounts();
669
- const accountCompleteAddress = await this.keyStore.addAccount(secretKey, partialAddress);
745
+ const accountCompleteAddress = await this.keyStore.addAccount(keys, partialAddress);
670
746
  if (accounts.some(a => a.equals(accountCompleteAddress.address))) {
671
747
  this.log.info(`Account:\n "${accountCompleteAddress.address.toString()}"\n already registered.`);
672
748
  return accountCompleteAddress;
@@ -679,6 +755,24 @@ export class PXE {
679
755
  return accountCompleteAddress;
680
756
  }
681
757
 
758
+ /**
759
+ * Retrieves the four privacy secret keys PXE holds for a registered account (nullifier-hiding, incoming-viewing,
760
+ * outgoing-viewing, tagging).
761
+ *
762
+ * These do NOT grant control over an account's assets, e.g. they are insufficient to impersonate the account or to
763
+ * spend notes, but they _do_ guard the account's privacy. Parties that have knowledge of these keys can decrypt all
764
+ * messages sent to the account, discover all of their on-chain activity, including notes, events, etc.
765
+ *
766
+ * Security is paramount when handling these keys, which should itself be a very rare occurrence. Other than exporting
767
+ * and then importing an account into a separate PXE/wallet, there is typically no need for a wallet to ever access
768
+ * these keys. Applications should NEVER be given access to them.
769
+ *
770
+ * @throws If the account is not registered.
771
+ */
772
+ public getAccountSecretKeys(account: AztecAddress): Promise<AccountPrivacySecretKeys> {
773
+ return this.keyStore.getAccountSecretKeys(account);
774
+ }
775
+
682
776
  /**
683
777
  * Registers a source from which this PXE derives the tagging secrets it scans for to discover incoming private logs.
684
778
  * See {@link TaggingSecretSource} for the meaning of each variant. Does nothing if the source is already registered.
@@ -695,7 +789,14 @@ export class PXE {
695
789
  wasAdded = await this.#registerSender(source.sender);
696
790
  break;
697
791
  case 'arbitrary-secret':
698
- wasAdded = await this.#registerArbitrarySecret(source.recipient, source.secret);
792
+ wasAdded = await this.#registerSharedSecret(source.recipient, 'arbitrary-secret', source.secret);
793
+ break;
794
+ case 'handshake':
795
+ wasAdded = await this.#registerSharedSecret(
796
+ source.recipient,
797
+ 'handshake',
798
+ await this.#deriveHandshakeSecret(source.recipient, source.ephPk),
799
+ );
699
800
  break;
700
801
  default: {
701
802
  const _: never = source;
@@ -710,9 +811,10 @@ export class PXE {
710
811
  }
711
812
 
712
813
  /**
713
- * Removes a previously registered tagging secret source. Does nothing if it was not registered.
814
+ * Removes a previously registered tagging secret source, identified by its registered form (see
815
+ * {@link getTaggingSecretSources}). Does nothing if it was not registered.
714
816
  */
715
- public async removeTaggingSecretSource(source: TaggingSecretSource): Promise<void> {
817
+ public async removeTaggingSecretSource(source: RegisteredTaggingSecretSource): Promise<void> {
716
818
  switch (source.kind) {
717
819
  case 'address-derived': {
718
820
  const { sender } = source;
@@ -724,13 +826,14 @@ export class PXE {
724
826
  );
725
827
  break;
726
828
  }
727
- case 'arbitrary-secret': {
728
- const { recipient, secret } = source;
729
- const wasRemoved = await this.taggingSecretSourcesStore.removeSharedSecret(recipient, secret);
829
+ case 'arbitrary-secret':
830
+ case 'handshake': {
831
+ const { kind, recipient, secret } = source;
832
+ const wasRemoved = await this.taggingSecretSourcesStore.removeSharedSecret(recipient, kind, secret);
730
833
  this.log.info(
731
834
  wasRemoved
732
- ? `Removed shared secret for recipient:\n ${recipient.toString()}`
733
- : `Shared secret not registered for recipient:\n ${recipient.toString()}`,
835
+ ? `Removed ${kind} shared secret for recipient:\n ${recipient.toString()}`
836
+ : `No ${kind} shared secret registered for recipient:\n ${recipient.toString()}`,
734
837
  );
735
838
  break;
736
839
  }
@@ -742,24 +845,24 @@ export class PXE {
742
845
  }
743
846
 
744
847
  /**
745
- * Retrieves the tagging secret sources registered in this PXE. Without a filter it returns every source; pass
746
- * `{ kind }` to narrow to a single variant. See {@link TaggingSecretSource}.
848
+ * Retrieves the tagging secret sources registered in this PXE, in their registered form. Without a filter it
849
+ * returns every source; pass `{ kind }` to narrow to a single variant. See {@link RegisteredTaggingSecretSource}.
747
850
  */
748
- public getTaggingSecretSources<K extends TaggingSecretSource['kind']>(filter: {
851
+ public getTaggingSecretSources<K extends RegisteredTaggingSecretSource['kind']>(filter: {
749
852
  kind: K;
750
- }): Promise<Extract<TaggingSecretSource, { kind: K }>[]>;
751
- public getTaggingSecretSources(): Promise<TaggingSecretSource[]>;
853
+ }): Promise<Extract<RegisteredTaggingSecretSource, { kind: K }>[]>;
854
+ public getTaggingSecretSources(): Promise<RegisteredTaggingSecretSource[]>;
752
855
  public async getTaggingSecretSources(filter?: {
753
- kind?: TaggingSecretSource['kind'];
754
- }): Promise<TaggingSecretSource[]> {
856
+ kind?: RegisteredTaggingSecretSource['kind'];
857
+ }): Promise<RegisteredTaggingSecretSource[]> {
755
858
  const [senders, secrets] = await Promise.all([
756
859
  this.taggingSecretSourcesStore.getSenders(),
757
860
  this.taggingSecretSourcesStore.getAllSharedSecrets(),
758
861
  ]);
759
862
 
760
- const sources: TaggingSecretSource[] = [
761
- ...senders.map((sender): TaggingSecretSource => ({ kind: 'address-derived', sender })),
762
- ...secrets.map(({ recipient, secret }): TaggingSecretSource => ({ kind: 'arbitrary-secret', recipient, secret })),
863
+ const sources: RegisteredTaggingSecretSource[] = [
864
+ ...senders.map((sender): RegisteredTaggingSecretSource => ({ kind: 'address-derived', sender })),
865
+ ...secrets.map(({ recipient, kind, secret }): RegisteredTaggingSecretSource => ({ kind, recipient, secret })),
763
866
  ];
764
867
 
765
868
  return filter?.kind ? sources.filter(source => source.kind === filter.kind) : sources;
@@ -786,8 +889,36 @@ export class PXE {
786
889
  return wasAdded;
787
890
  }
788
891
 
789
- /** Registers a directly-provided shared secret scoped to a recipient. Returns whether it was newly added. */
790
- async #registerArbitrarySecret(recipient: AztecAddress, secret: Point): Promise<boolean> {
892
+ /**
893
+ * Derives the shared secret of a handshake from its ephemeral public key: `S = addressSecret(recipient) * ephPk`,
894
+ * the same derivation the recipient-side scan uses for handshakes discovered onchain. The ephemeral key is
895
+ * reconstructed from its x-coordinate with a positive y, matching how the protocol generates it.
896
+ *
897
+ * @throws If `ephPk` is not the x-coordinate of a Grumpkin curve point, or if `recipient` is not an account of
898
+ * this PXE, since the derivation needs its keys.
899
+ */
900
+ async #deriveHandshakeSecret(recipient: AztecAddress, ephPk: Fr): Promise<Point> {
901
+ let ephPkPoint: Point;
902
+ try {
903
+ ephPkPoint = await Point.fromXAndSign(ephPk, true);
904
+ } catch {
905
+ throw new Error(`Ephemeral public key x-coordinate ${ephPk} does not correspond to a Grumpkin curve point.`);
906
+ }
907
+
908
+ const completeAddress = await this.addressStore.getCompleteAddress(recipient);
909
+ if (!completeAddress || !(await this.keyStore.hasAccount(recipient))) {
910
+ throw new Error(
911
+ `Recipient ${recipient} is not an account of this PXE. A handshake's shared secret can only be derived for an account whose keys are held.`,
912
+ );
913
+ }
914
+
915
+ const ivskM = await this.keyStore.getMasterIncomingViewingSecretKey(recipient);
916
+ const addressSecret = await computeAddressSecret(await completeAddress.getPreaddress(), ivskM);
917
+ return deriveEcdhSharedSecretPoint(addressSecret, ephPkPoint);
918
+ }
919
+
920
+ /** Registers a resolved shared secret scoped to a recipient. Returns whether it was newly added. */
921
+ async #registerSharedSecret(recipient: AztecAddress, kind: SharedSecretKind, secret: Point): Promise<boolean> {
791
922
  if (!(await recipient.isValid())) {
792
923
  throw new Error(
793
924
  `Recipient ${recipient} is not valid: it does not correspond to a point on the Grumpkin curve. Cannot register a shared secret for it.`,
@@ -798,11 +929,11 @@ export class PXE {
798
929
  throw new Error(`Shared secret ${secret} is not a valid non-zero point on the Grumpkin curve.`);
799
930
  }
800
931
 
801
- const wasAdded = await this.taggingSecretSourcesStore.addSharedSecret(recipient, secret);
932
+ const wasAdded = await this.taggingSecretSourcesStore.addSharedSecret(recipient, kind, secret);
802
933
  this.log.info(
803
934
  wasAdded
804
- ? `Added shared secret for recipient:\n ${recipient.toString()}`
805
- : `Shared secret already registered for recipient:\n ${recipient.toString()}`,
935
+ ? `Added ${kind} shared secret for recipient:\n ${recipient.toString()}`
936
+ : `${kind} shared secret already registered for recipient:\n ${recipient.toString()}`,
806
937
  );
807
938
  return wasAdded;
808
939
  }
@@ -828,98 +959,33 @@ export class PXE {
828
959
  */
829
960
  public async registerContractClass(artifact: ContractArtifact): Promise<void> {
830
961
  const contractClassId = await this.contractStore.addContractArtifact(artifact);
962
+ // Publishing the artifact's public function signatures to the node is part of "registering a class", so that
963
+ // node-side debugging works regardless of which entrypoint (registerContractClass or registerContract) was used.
964
+ const publicFunctionSignatures = artifact.functions
965
+ .filter(fn => fn.functionType === FunctionType.PUBLIC)
966
+ .map(fn => decodeFunctionSignature(fn.name, fn.parameters));
967
+ if (publicFunctionSignatures.length > 0) {
968
+ await this.nodeDebug?.registerContractFunctionSignatures(publicFunctionSignatures);
969
+ }
831
970
  this.log.info(`Added contract class ${artifact.name} with id ${contractClassId}`);
832
971
  }
833
972
 
834
973
  /**
835
- * Adds deployed contracts to the PXE. Deployed contract information is used to access the
836
- * contract code when simulating local transactions. This is automatically called by aztec.js when
837
- * deploying a contract. Dapps that wish to interact with contracts already deployed should register
838
- * these contracts in their users' PXE through this method.
974
+ * Registers a deployed contract instance so its private state can be synced and its functions simulated. The
975
+ * artifact for the class the instance runs must be registered separately via {@link registerContractClass}, before
976
+ * or after this call; registration performs no validation, so a missing or mismatched artifact only surfaces when
977
+ * the contract is later simulated. This is automatically called by aztec.js when deploying a contract.
839
978
  *
840
- * @param contract - A contract instance to register, with an optional artifact which can be omitted if the contract class has already been registered.
841
- */
842
- public async registerContract(contract: { instance: ContractInstanceWithAddress; artifact?: ContractArtifact }) {
843
- const { instance } = contract;
844
- let { artifact } = contract;
845
-
846
- if (artifact) {
847
- // If the user provides an artifact, validate it against the expected class id and register it
848
- const contractClass = await getContractClassFromArtifact(artifact);
849
- if (!contractClass.id.equals(instance.currentContractClassId)) {
850
- throw new Error(
851
- `Artifact does not match expected class id (computed ${contractClass.id} but instance refers to ${instance.currentContractClassId})`,
852
- );
853
- }
854
- const computedAddress = await computeContractAddressFromInstance(instance);
855
- if (!computedAddress.equals(instance.address)) {
856
- throw new Error('Added a contract in which the address does not match the contract instance.');
857
- }
858
-
859
- await this.contractStore.addContractArtifact(artifact, contractClass);
860
-
861
- const publicFunctionSignatures = artifact.functions
862
- .filter(fn => fn.functionType === FunctionType.PUBLIC)
863
- .map(fn => decodeFunctionSignature(fn.name, fn.parameters));
864
- if (publicFunctionSignatures.length > 0) {
865
- await this.nodeDebug?.registerContractFunctionSignatures(publicFunctionSignatures);
866
- }
867
- } else {
868
- // Otherwise, make sure there is an artifact already registered for that class id
869
- artifact = await this.contractStore.getContractArtifact(instance.currentContractClassId);
870
- if (!artifact) {
871
- throw new Error(
872
- `Artifact not found when registering an instance. Contract class: ${instance.currentContractClassId}.`,
873
- );
874
- }
875
- }
876
-
877
- await this.contractStore.addContractInstance(instance);
878
- this.log.info(
879
- `Added contract ${artifact.name} at ${instance.address.toString()} with class ${instance.currentContractClassId}`,
880
- );
881
- }
882
-
883
- /**
884
- * Updates a deployed contract in the PXE. This is used to update the contract artifact when
885
- * an update has happened, so the new code can be used in the simulation of local transactions.
886
- * This is called by aztec.js when instantiating a contract in a given address with a mismatching artifact.
887
- * @param contractAddress - The address of the contract to update.
888
- * @param artifact - The updated artifact for the contract.
889
- * @throws If the artifact's contract class is not found in the PXE or if the contract class is different from
890
- * the current one (current one from the point of view of the node to which the PXE is connected).
979
+ * @param instance - The address preimage of the contract instance to register. The address is derived from it.
980
+ * @returns The address of the registered instance.
891
981
  */
892
- public updateContract(contractAddress: AztecAddress, artifact: ContractArtifact): Promise<void> {
893
- // We disable concurrently updating contracts to avoid concurrently syncing with the node, or changing a contract's
894
- // class while we're simulating it.
982
+ public registerContract(instance: ContractInstancePreimage): Promise<AztecAddress> {
983
+ // Run inside the job queue so we can't race a concurrent simulation while writing the instance to the store.
895
984
  return this.#putInJobQueue(async () => {
896
- const currentInstance = await this.contractStore.getContractInstance(contractAddress);
897
- if (!currentInstance) {
898
- throw new Error(`Instance not found when updating a contract. Contract address: ${contractAddress}.`);
899
- }
900
- const contractClass = await getContractClassFromArtifact(artifact);
901
- await this.#maybeSync();
902
-
903
- const header = await this.anchorBlockStore.getBlockHeader();
904
-
905
- const currentClassId = await readCurrentClassId(contractAddress, currentInstance, this.node, header);
906
- if (!contractClass.id.equals(currentClassId)) {
907
- throw new Error('Could not update contract to a class different from the current one.');
908
- }
909
-
910
- const publicFunctionSignatures = artifact.functions
911
- .filter(fn => fn.functionType === FunctionType.PUBLIC)
912
- .map(fn => decodeFunctionSignature(fn.name, fn.parameters));
913
- if (publicFunctionSignatures.length > 0) {
914
- await this.nodeDebug?.registerContractFunctionSignatures(publicFunctionSignatures);
915
- }
916
-
917
- currentInstance.currentContractClassId = contractClass.id;
918
- await Promise.all([
919
- this.contractStore.addContractArtifact(artifact, contractClass),
920
- this.contractStore.addContractInstance(currentInstance),
921
- ]);
922
- this.log.info(`Updated contract ${artifact.name} at ${contractAddress.toString()} to class ${contractClass.id}`);
985
+ const address = await computeContractAddressFromInstance(instance);
986
+ await this.contractStore.addContractInstance({ ...instance, address });
987
+ this.log.info(`Added contract at ${address}`, { address });
988
+ return address;
923
989
  });
924
990
  }
925
991
 
@@ -1181,7 +1247,7 @@ export class PXE {
1181
1247
  if (skipKernels) {
1182
1248
  ({ publicInputs, executionSteps } = await generateSimulatedProvingResult(
1183
1249
  privateExecutionResult,
1184
- (addr, sel) => this.contractStore.getDebugFunctionName(addr, sel),
1250
+ (addr, sel) => this.#getDebugFunctionName(addr, sel, anchorBlockHeader),
1185
1251
  this.node,
1186
1252
  ));
1187
1253
  } else {
@@ -1208,7 +1274,7 @@ export class PXE {
1208
1274
  publicOutput = await this.#simulatePublicCalls(simulatedTx, skipFeeEnforcement, overrides);
1209
1275
  publicSimulationTime = publicSimulationTimer.ms();
1210
1276
  if (publicOutput?.debugLogs?.length) {
1211
- await displayDebugLogs(publicOutput.debugLogs, addr => this.contractStore.getDebugContractName(addr));
1277
+ await displayDebugLogs(publicOutput.debugLogs, addr => this.#getDebugContractName(addr, anchorBlockHeader));
1212
1278
  }
1213
1279
  }
1214
1280
 
@@ -2,21 +2,21 @@
2
2
  "complete_addresses": [
3
3
  {
4
4
  "index": 0,
5
- "value": "0b3683ee9df3ed6ed7027145bd6093f783b0bb4d8354501d906db7bb8cb58ea313ad6965d11a533a663d07507319f74ac3305325f6f72423c0b24aa1193268bb19e95c05f09cb86d1a6257572f9082ca15d4a02373c4d8c9cee23dc61a4c2a882f9017d51bca6616102d8a1d4dba89e4ce12881a2414576f01d2fec9492814a22a1b054e998835d166711839b515d434b1fbc207ad4fdb5b2b43d6ac6b400871019f5bb255e87523d43da83ebc9fa95169b653d4abef902e011e9eac620fc45b14a5d4bde495b8c3a9ba4aed0d4870526e46fdff22d341a2f689ac5a50d103560f124f07811eebfaaa6d31316a2cc5bf255fa118f720e8ff1f2fc0d4aa46d4960000000000000000000000000000000000000000000000000000000000000003"
5
+ "value": "2369ead09116908cedc1642d5e0c714ef288ecbc838e4d434f800a408914ce4413ad6965d11a533a663d07507319f74ac3305325f6f72423c0b24aa1193268bb19e95c05f09cb86d1a6257572f9082ca15d4a02373c4d8c9cee23dc61a4c2a882f9017d51bca6616102d8a1d4dba89e4ce12881a2414576f01d2fec9492814a22a1b054e998835d166711839b515d434b1fbc207ad4fdb5b2b43d6ac6b400871019f5bb255e87523d43da83ebc9fa95169b653d4abef902e011e9eac620fc45b1006a921250e1395ef3cfc24c0e57d8f6745e7660ff70a28150f569bf66b8d5b28f331bfc59268b3f8b708104b95ed3a8065805cac8a0bdb622ce038631584c00000000000000000000000000000000000000000000000000000000000000003"
6
6
  },
7
7
  {
8
8
  "index": 1,
9
- "value": "2cf4c6a79bcb041923c0cf1cfbb6c7407e082824e29588dbcf9cc6c1d6e8b01f17c2df1b7355bb4c4494aa4ec85d15ff8881cea1b34691f0cc558e8aef3f3f4c267e526a2e6e9adf6a026989be005bd50d1aea76d20816b9843bc95557696f9f16c3eb259ba3e3eb27b7fe3abc36e87923990bf5c265cb0d57790eda2a4432f105a5449624125d37f10cd4c68ffd57b0dc0cdaa916cb37840be1db9bf88e3c5f0e81754454e3b12035b13448a9fe3b980bf31a9808cb93e146628fb06fa1b46f14a5d4bde495b8c3a9ba4aed0d4870526e46fdff22d341a2f689ac5a50d103560f124f07811eebfaaa6d31316a2cc5bf255fa118f720e8ff1f2fc0d4aa46d4960000000000000000000000000000000000000000000000000000000000000007"
9
+ "value": "1fc97e4d0bb6609f25973d986a7b4787cdbad4fb98c8823591c67e7cd744ba6317c2df1b7355bb4c4494aa4ec85d15ff8881cea1b34691f0cc558e8aef3f3f4c267e526a2e6e9adf6a026989be005bd50d1aea76d20816b9843bc95557696f9f16c3eb259ba3e3eb27b7fe3abc36e87923990bf5c265cb0d57790eda2a4432f105a5449624125d37f10cd4c68ffd57b0dc0cdaa916cb37840be1db9bf88e3c5f0e81754454e3b12035b13448a9fe3b980bf31a9808cb93e146628fb06fa1b46f1694840b143402ffa76cba23e6a9be64b4db084fa804f61940e2d10cf41d273e2475eeff188767ebed988e7d9997d9ed9fe667ff68df9b7143bc663c242929260000000000000000000000000000000000000000000000000000000000000007"
10
10
  }
11
11
  ],
12
12
  "complete_address_index": [
13
13
  {
14
- "key": "utf8:0x0b3683ee9df3ed6ed7027145bd6093f783b0bb4d8354501d906db7bb8cb58ea3",
15
- "value": "num:0"
14
+ "key": "utf8:0x1fc97e4d0bb6609f25973d986a7b4787cdbad4fb98c8823591c67e7cd744ba63",
15
+ "value": "num:1"
16
16
  },
17
17
  {
18
- "key": "utf8:0x2cf4c6a79bcb041923c0cf1cfbb6c7407e082824e29588dbcf9cc6c1d6e8b01f",
19
- "value": "num:1"
18
+ "key": "utf8:0x2369ead09116908cedc1642d5e0c714ef288ecbc838e4d434f800a408914ce44",
19
+ "value": "num:0"
20
20
  }
21
21
  ]
22
22
  }
@@ -22,7 +22,7 @@
22
22
  "contracts_instances": [
23
23
  {
24
24
  "key": "utf8:0x0000000000000000000000000000000000000000000000000000000000000065",
25
- "value": "020000000000000000000000000000000000000000000000000000000000000049000000000000000000000000000000000000000000000000000000000000004f00000000000000000000000000000000000000000000000000000000000000530000000000000000000000000000000000000000000000000000000000000059000000000000000000000000000000000000000000000000000000000000006100000000000000000000000000000000000000000000000000000000000000670000000000000000000000000000000000000000000000000000000000000029000000000000000000000000000000000000000000000000000000000000002f0000000000000000000000000000000000000000000000000000000000000035000000000000000000000000000000000000000000000000000000000000003b000000000000000000000000000000000000000000000000000000000000004300000000000000000000000000000000000000000000000000000000000000470000000000000000000000000000000000000000000000000000000000000049"
25
+ "value": "020000000000000000000000000000000000000000000000000000000000000049000000000000000000000000000000000000000000000000000000000000004f0000000000000000000000000000000000000000000000000000000000000059000000000000000000000000000000000000000000000000000000000000006100000000000000000000000000000000000000000000000000000000000000670000000000000000000000000000000000000000000000000000000000000029000000000000000000000000000000000000000000000000000000000000002f0000000000000000000000000000000000000000000000000000000000000035000000000000000000000000000000000000000000000000000000000000003b000000000000000000000000000000000000000000000000000000000000004300000000000000000000000000000000000000000000000000000000000000470000000000000000000000000000000000000000000000000000000000000049"
26
26
  }
27
27
  ]
28
28
  }