bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 75쪽 중 62쪽
r.getAccount();
- const secretKey = account.getSecretKey();
+ const secretKey = accountManager.getSecretKey();
```
To do what `AccountWithSecretKey` was meant for (exporting an account into a separate PXE or wallet), account registration accepts a full set of master secret keys instead of only a single seed. `wallet.registerContract(instance, artifact?, secretKeyOrKeys?)` takes either an `Fr` seed (as before) or a `MasterSecretKeys` object (exported from `@aztec/aztec.js/keys`), for an account whose privacy keys were generated independently rather than from one seed.
The PXE never receives the seed nor the message-signing and fallback secret keys: it is not trusted to hold them. The wallet derives the account's privacy keys and passes the PXE only the four privacy secret keys (nullifier-hiding, incoming-viewing, outgoing-viewing, tagging) plus the message-signing and fallback *public* keys. Accordingly, `pxe.getAccountSecretKeys(address)` returns only those four privacy secret keys.
**Impact**: Importing `AccountWithSecretKey`, or calling `getSecretKey()`/`getEncryptionSecret()` on the result of `getAccount()`, no longer compiles. The signer `getAccount()` returns is otherwise unchanged, and passing a single `Fr` or a `MasterSecretKeys` to `wallet.registerContract` keeps working.
### \[CLI] `aztec-wallet` `--secret-key` is renamed to `--signing-key`[](#cli-aztec-wallet---secret-key-is-renamed-to---signing-key "Direct link to cli-aztec-wallet---secret-key-is-renamed-to---signing-key")
`aztec-wallet` accounts are now rooted on their signing key rather than on a privacy secret. The `--secret-key` option (on `create-account` and `simulate`) is renamed to `--signing-key`, and the `SECRET_KEY` environment variable to `SIGNING_KEY`. When creating an account, a random signing key is generated by default and the privacy secret is derived from it.
**Migration:**
```
- aztec-wallet create-account --secret-key 0x...
+ aztec-wallet create-account --signing-key 0x...
```
**Impact**: The value you save and restore for an account is now its signing key, and account addresses change, so existing wallet databases and funded addresses are not carried over.
### \[Bot] `senderPrivateKey` is now the account signing key[](#bot-senderprivatekey-is-now-the-account-signing-key "Direct link to bot-senderprivatekey-is-now-the-account-signing-key")
The transaction bot previously derived its account's signing key from the configured `senderPrivateKey`. That value is now used directly as the signing key, with the privacy secret derived from it.
**Impact**: The bot's account address changes for a given `senderPrivateKey`, so the account must be re-funded at its new address.
### \[PXE] Unconstrained delivery defaults to a non-interactive handshake for external recipients[](#pxe-unconstrained-delivery-defaults-to-a-non-interactive-handshake-for-external-recipients "Direct link to \[PXE] Unconstrained delivery defaults to a non-interactive handshake for external recipients")
When no `resolveTaggingSecretStrategy` hook is configured, onchain unconstrained delivery now defaults to a non-interactive handshake when the recipient is external (an account whose keys the wallet does not hold), instead of an address-derived shared secret. A self-send (the recipient is one of the wallet's own accounts) still uses an address-derived secret, which needs no handshake and leaves no onchain trace.
**Impact**: An external recipient can now discover unconstrained-delivered messages without having registered the sender in advance, but establishing the handshake publishes an onchain marker derived from the recipient's address (anyone who knows that address can tell a handshake was created for them, though not by whom nor the contents). Wallets that want the previous behavior can configure a `resolveTaggingSecretStrategy` hook that returns an `address-derived` strategy.
### \[Aztec.nr] `PrivateContext` data fields are no longer public[](#aztecnr-privatecontext-data-fields-are-no-longer-public "Direct link to aztecnr-privatecontext-data-fields-are-no-longer-public")
`PrivateContext`'s data fields are now private (or crate-internal): its public API is now exclusively its methods. Contracts that read these fields directly must switch to the corresponding getter. A new `get_side_effect_counter()` getter exposes the side-effect counter, and a new `is_static_call()` getter replaces reaching into `inputs.call_context`. The `get_anchor_block_header()` getter already existed.
**Migration:**
```
- let header = context.anchor_block_header;
+ let header = context.get_anchor_block_header();
- let counter = context.side_effect_counter;
+ let counter = context.get_side_effect_counter();
- let is_static = context.inputs.call_context.is_static_call;
+ let is_static = context.is_static_call();
```
**Impact**: Direct field access on `PrivateContext` (e.g. `context.anchor_block_header`, `context.side_effect_counter`, `context.inputs`) no longer compiles. Contract state should be read through the context's methods.
### \[PXE] Browser KV-store default is now SQLite-OPFS; the IndexedDB entrypoint moved and will be deprecated[](#pxe-browser-kv-store-default-is-now-sqlite-opfs-the-indexeddb-entrypoint-moved-and-will-be-deprecated "Direct link to \[PXE] Browser KV-store default is now SQLite-OPFS; the IndexedDB entrypoint moved and will be deprecated")
The browser PXE data store and the embedded wallet (`@aztec/wallets`) now persist to SQLite-OPFS instead of IndexedDB by default. The recommended way to obtain the browser backend is `@aztec/kv-store/sqlite-opfs`.
**Migration:**
```
- import { createStore } from '@aztec/kv-store/indexeddb';
+ import { createStore } from '@aztec/kv-store/sqlite-opfs';
```
If you must stay on IndexedDB for now, import from the deprecated entrypoint instead:
```
- import { createStore } from '@aztec/kv-store/indexeddb';
+ import { createStore } from '@aztec/kv-store/deprecated/indexeddb';
```
**Impact**: Existing IndexedDB-backed data is not migrated, so browser PXE and wallet state starts fresh on SQLite-OPFS (the v5 protocol upgrade wipes local state regardless). SQLite-OPFS also holds an exclusive, origin-wide lock on its store directory, so a second browser tab opening the same store will fail. Consequently, we recommend to explicitly manage this case in your app if it uses `EmbeddedWallet`.
### \[Aztec.js] `getPublicEvents` is now cursor-paginated[](#aztecjs-getpublicevents-is-now-cursor-paginated "Direct link to aztecjs-getpublicevents-is-now-cursor-paginated")
`getPublicEvents` returns a single page of events (at most `MAX_LOGS_PER_TAG`, the node's per-tag page size) and pages instead of the `maxLogsHit` flag, which didn't provide any way to fetch the next page of events:
* The result's `maxLogsHit` boolean is replaced by `nextCursor`. When `nextCursor` is present, more events might exist; pass it as the next query's `afterEvent` to fetch the following page. When it is absent, the range is exhausted.
* The filter's `afterLog` cursor is renamed to `afterEvent`.
* Both cursors are the new `EventCursor` type (exported from `@aztec/aztec.js/events`), not the node-layer `LogCursor`.
**Migration:**
```
- const { events, maxLogsHit } = await getPublicEvents(node, MyContract.events.MyEvent, { contractAddress });
+ // One page:
+ const { events, nextCursor } = await getPublicEvents(node, MyContract.events.MyEvent, { contractAddress });
+
+ // All events:
+ const all = [];
+ let afterEvent;
+ do {
+ const page = await getPublicEvents(node, MyContract.events.MyEvent, { contractAddress, afterEvent });
+ all.push(...page.events);
+ afterEvent = page.nextCursor;
+ } while (afterEvent);
```
**Impact**: Reading `maxLogsHit` or passing `afterLog` no longer compiles. Previously a single call was silently capped at `MAX_LOGS_PER_TAG` events with no usable way to continue, so the old API was unusable anyway. You can now page through the full set with `afterEvent`/`nextCursor`.
### \[PXE] Sender and shared-secret registration unified into `TaggingSecretSource`[](#pxe-sender-and-shared-secret-registration-unified-into-taggingsecretsource "Direct link to pxe-sender-and-shared-secret-registration-unified-into-taggingsecretsource")
The PXE methods for registering tagging-secret sources have been replaced by a single set that takes a `TaggingSecretSource` discriminated union. `registerSender`/`getSenders`/`removeSender` and `registerSharedSecret`/`removeSharedSecret` are gone; use `registerTaggingSecretSource`/`removeTaggingSecretSource`/`getTaggingSecretSources` instead. The `Wallet` interface (`wallet.registerSender`, `getAddressBook`) is unchanged, so this only affects code that talks to a `PXE` instance directly.
| Before | After |
| --------------------------------------------- | ---------------------------------------------------------------------------------- |
| `pxe.registerSender(address)` | `pxe.registerTaggingSecretSource({ kind: 'address-derived', sender: address })` |
| `pxe.removeSender(address)` | `pxe.removeTaggingSecretSource({ kind: 'address-derived', sender: address })` |
| `pxe.getSenders()` | `pxe.getTaggingSecretSources({ kind: 'address-derived' })` |
| `pxe.registerSharedSecret(recipient, secret)` | `pxe.registerTaggingSecretSource({ kind: 'arbitrary-secret', recipient, secret })` |
| `pxe.removeSharedSecret(recipient, secret)` | `pxe.removeTaggingSecretSource({ kind: 'arbitrary-secret', recipient, secret })` |
### \[Aztec.js] Unchecked `AztecAddress` constructors renamed with an `Unsafe` suffix[](#aztecjs-unchecked-aztecaddress-constructors-renamed-with-an-unsafe-suffix "Direct link to aztecjs-unchecked-aztecaddress-constructors-renamed-with-an-unsafe-suffix")
The synchronous `AztecAddress` constructors that build an address from a raw value do not verify that the value is a valid address (the x-coordinate of a point on the Grumpkin curve, which is what allows it to be encrypted to). An invalid value is accepted silently and only fails later, when a transaction is sent. To make this obvious at the call site, they now carry an `Unsafe` suffix:
| Before | After |
| ------------------------- | ------------------------------- |
| `AztecAddress.fromField` | `AztecAddress.fromFieldUnsafe` |
| `AztecAddress.fromBigInt` | `AztecAddress.fromBigIntUnsafe` |
| `AztecAddress.fromNumber` | `AztecAddress.fromNumberUnsafe` |
| `AztecAddress.fromString` | `AztecAddress.fromStringUnsafe` |
**Migration:**
```
- const address = AztecAddress.fromBigInt(123n);
+ const address = AztecAddress.fromBigIntUnsafe(123n);
```
For a random, genuinely valid address in tests use `AztecAddress.random()`, and to check an untrusted value use `address.isValid()`. The serialization constructors `fromBuffer` and `fromFields` keep their names (they are part of the (de)serialization interface and read addresses from already-validated data), but their docs now note that they perform no validation either.
### Cross-contract utility calls now have a `msg_sender`[](#cross-contract-utility-calls-now-have-a-msg_sender "Direct link to cross-contract-utility-calls-now-have-a-msg_sender")
A utility function called by another contract (utility to utility, or private to utility) can read the calling contract's address via `self.msg_sender()`, mirroring private and public functions. A top-level utility call (e.g. invoked directly by a wallet or dapp) has no caller: `self.msg_sender()` panics, and `self.context.maybe_msg_sender()` returns `Option::none()`.
`msg_sender` is only set for cross-contract calls, where it is taken from the call graph and so cannot be forged. A directly-invoked utility (from a wallet or dapp) has no verifiable caller, so it exposes none rather than trusting a value the caller could pick freely.
#### \[Aztec.nr] `ExecuteUtilityOptions` gains `with_from` to simulate a cross-contract caller in tests[](#aztecnr-executeutilityoptions-gains-with_from-to-simulate-a-cross-contract-caller-in-tests "Direct link to aztecnr-executeutilityoptions-gains-with_from-to-simulate-a-cross-contract-caller-in-tests")
In `TestEnvironment`, use `execute_utility_opts` with the new `ExecuteUtilityOptions::with_from` builder method to set the `msg_sender` a utility observes, simulating a cross-contract caller without routing through an actual nested call (by default it observes no caller):
```
let secret = env.execute_utility_opts(
ExecuteUtilityOptions::new().with_from(caller),
Registry::at(registry_address).get_app_siloed_secret(sender, recipient),
).map(|secrets| secrets.shared);
```
### \[Prover Node JSON-RPC] Prover API moved to the admin endpoint; `getL2Tips`/`getWorldStateSyncStatus` removed[](#prover-node-json-rpc-prover-api-moved-to-the-admin-endpoint-getl2tipsgetworldstatesyncstatus-removed "Direct link to prover-node-json-rpc-prover-api-moved-to-the-admin-endpoint-getl2tipsgetworldstatesyncstatus-removed")
The prover node's JSON-RPC methods (`prover_*`) have moved off the public node RPC server and onto the admin RPC server. They now require the admin API key and are served on the admin port (8880) instead of the public port (8080).
In addition, `prover_getL2Tips` and `prover_getWorldStateSyncStatus` have been removed from the prover API. They duplicated data already served by the node: use `aztec_getChainTips` (same shape as the old `getL2Tips`) and `aztec_getWorldStateSyncStatus` instead.
If you call the prover RPC directly (e.g. via `curl`), point at the admin endpoint with the API key and use the remaining methods:
* `prover_startProof` — schedule proving for an epoch
* `prover_getJobs` — list proving jobs
A client factory `createProverNodeAdminClient(url, versions?, fetch?, apiKey?)` is now exported from `@aztec/stdlib/interfaces/server`, and the CLI exposes `aztec prover start-proof --epoch <n> --admin-url <url> --api-key <key>` and `aztec prover get-jobs` (the API key defaults to `AZTEC_ADMIN_API_KEY`).
### \[Aztec.nr] `ContractInstance.contract_class_id` renamed to `original_contract_class_id`[](#aztecnr-contractinstancecontract_class_id-renamed-to-original_contract_class_id "Direct link to aztecnr-contractinstancecontract_class_id-renamed-to-original_contract_class_id")
The `contract_class_id` field of the `ContractInstance` struct (returned by `get_contract_instance`) has been renamed to `original_contract_class_id`. The struct is the contract's *address preimage*, so this field is the class id the contract was deployed with: for contracts whose class was later updated via the `ContractInstanceRegistry`, it is NOT the class currently executing. The rename makes that explicit.
**Migration:**
```
let instance = get_contract_instance(address);
- let class_id = instance.contract_class_id;
+ let class_id = instance.original_contract_class_id;
```
Note that this value is not available during public execution, which only has access to the *current* contract class.
### \[Aztec.nr] `get_contract_instance_class_id_avm` renamed to `get_contract_instance_current_class_id_avm`[](#aztecnr-get_contract_instance_class_id_avm-renamed-to-get_contract_instance_current_class_id_avm "Direct link to aztecnr-get_contract_instance_class_id_avm-renamed-to-get_contract_instance_current_class_id_avm")
The AVM contract-instance class id getter has been renamed to make explicit that it returns the *current* class id, i.e. it reflects updates performed via the `ContractInstanceRegistry`.
**Migration:**
```
- use aztec::oracle::get_contract_instance::get_contract_instance_class_id_avm;
+ use aztec::oracle::get_contract_instance::get_contract_instance_current_class_id_avm;
- let class_id = get_contract_instance_class_id_avm(address);
+ let class_id = get_contract_instance_current_class_id_avm(address);
```
### \[Aztec.nr] `for_each` visits elements in order; removing during iteration no longer supported[](#aztecnr-for_each-visits-elements-in-order-removing-during-iteration-no-longer-supported "Direct link to aztecnr-for_each-visits-elements-in-order-removing-during-iteration-no-longer-supported")
`CapsuleArray::for_each` and `EphemeralArray::for_each` previously iterated backwards (from the last element to the first) so that the callback could safely remove the current element. They now visit elements in order, from first to last, as is usually expected in other languages. Structurally mutating the array (e.g. via `push` or `remove`) from inside the callback is no longer supported.
For `EphemeralArray`, replace remove-during-iteration with `filter`:
```
- array.for_each(|index, value| {
- if should_remove(value) {
- array.remove(index);
- }
- });
+ let kept = array.filter(|value| !should_remove(value));
```
`filter` collects the kept elements into a fresh array at a new slot. If the original slot matters (e.g. a `TransientArray` slot shared with other call frames), rebuild it from the filtered result:
```
let kept = array.filter(|value| !should_remove(value));
let _ = array.clear();
kept.for_each(|_index, value| array.push(value));
```
`EphemeralArray`'s are cheap and by nature not persistent though, so in most cases you probably can just work with the new copy instead of going through this hassle.
`CapsuleArray` has no `filter`, so iterate manually, backwards. Removing the current element is safe in a backward loop because it only shifts elements at higher indices:
```
let mut i = array.len();
while i > 0 {
i -= 1;
if should_remove(array.get(i)) {
array.remove(i);
}
}
```
### \[Protocol] `PrivateCircuitPublicInputs` and `PrivateContextInputs` gain a `tx_request_salt` field[](#protocol-privatecircuitpublicinputs-and-privatecontextinputs-gain-a-tx_request_salt-field "Direct link to protocol-privatecircuitpublicinputs-and-privatecontextinputs-gain-a-tx_request_salt-field")
The init kernel now always injects the protocol nullifier (`H(tx_request)`) as the transaction's first nullifier and binds the entry-point proof to the tx request's salt. To support this, `PrivateCircuitPublicInputs` and `PrivateContextInputs` each carry a new `tx_request_salt` field (set by the framework), and the `first_nullifier_hint` input to the init kernel is removed. This is handled automatically by the framework and PXE; contracts using the standard entrypoint need no changes beyond recompiling against the new protocol circuits.
The salt serves two purposes. It keeps `H(tx_request)` (the protocol nullifier) unpredictable, preventing a dictionary attack that guesses the tx-request preimage to recompute the nullifier. It also lets the init kernel bind the proof to a specific tx request: the kernel asserts `tx_request_salt` equals `tx_request.salt`, so a third party holding the proof cannot rebind it to a different request (and thus a different protocol nullifier).
Because `tx_request_salt` is now part of the private function's public inputs, an app or account contract can read it. Together with the other public inputs (the call context, `args_hash`, `tx_context`, and the function selector), an entrypoint can reconstruct the full `tx_request` and verify a signature over `tx_request.hash()`, instead of over a separate payload. This lets an account authorize the complete, kernel-checked transaction request rather than just the calls it contains. Building on that, the protocol nullifier can be made to provide a transaction's replay protection and cancellation directly, reducing the number of nullifiers an account needs to emit. This is not done by the standard entrypoint today; see issues #461 (the protocol/design direction) and #462 (the Aztec.nr account-layer work) for the full picture.
### \[Aztec.js] Prefunded local network test accounts are now initializerless[](#aztecjs-prefunded-local-network-test-accounts-are-now-initializerless "Direct link to \[Aztec.js] Prefunded local network test accounts are now initializerless")
The genesis-funded test accounts in the local network (sandbox), returned by `getInitial프로젝트로 돌아가기