bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 75쪽 중 57쪽
(producing the proof, nullifiers, and note commitments included with the transaction); what runs in this phase is the public call stack. It starts with the public calls that private execution enqueued, and grows as those public calls themselves enqueue further public calls. If any public call in this phase reverts, all state changes from the phase are discarded, but fees committed during setup are still paid.
### Teardown phase (optional)[](#teardown-phase-optional "Direct link to Teardown phase (optional)")
Transactions can optionally include a teardown phase after app execution. During teardown, the final transaction fee is available to public functions, which is useful for FPCs that want to refund unused gas to the user. Not every FPC uses teardown; some charge a fixed quoted amount with no refund, retaining any surplus in the FPC's Fee Juice balance.
## Next Steps[](#next-steps "Direct link to Next Steps")
* Learn about [accounts](/developers/testnet/docs/foundational-topics/accounts.md) and how they authorize transactions
* Understand [state management](/developers/testnet/docs/foundational-topics/state_management.md) and how transaction effects are stored
* Explore the [PXE](/developers/testnet/docs/foundational-topics/pxe.md) in more detail
* Understand the [performance impact of kernel circuits](/developers/testnet/docs/foundational-topics/advanced/circuits/private_kernel.md#performance-impact) on proving time
---
# Wallets
This page covers the main responsibilities of a wallet in the Aztec network.
Wallets are the applications through which users manage their accounts. Users rely on wallets to browse through their accounts, monitor their balances, and create new accounts. Wallets also store seed phrases and private keys, or interact with external keystores such as hardware wallets.
Wallets also provide an interface for dapps. Dapps may request access to see the user accounts, in order to show the state of those accounts in the context of the application, and request to send transactions from those accounts as the user interacts with the dapp.
In addition to these usual responsibilities, wallets in Aztec also need to track private state. This implies keeping a local database of all private notes encrypted for any of the user's accounts, so dapps and contracts can query the user's private state. Aztec wallets are also responsible for producing local proofs of execution for private functions.
## Account setup[](#account-setup "Direct link to Account setup")
The first step for any wallet is to let the user set up their [accounts](/developers/testnet/docs/foundational-topics/accounts.md). An account in Aztec is represented onchain by its corresponding account contract that the user must deploy to begin interacting with the network. This account contract dictates how transactions are authenticated and executed.
A wallet must support at least one specific account contract implementation, which means being able to deploy such a contract, as well as interacting with it when sending transactions. Code-wise, this requires [implementing the `AccountContract` interface](https://github.com/aztec-labs-eng/aztec-node/blob/v6.0.0-rc.1/yarn-project/aztec.js/src/account/account_contract.ts).
Note that users must be able to receive funds in Aztec before deploying their account. A wallet should let a user generate a [deterministic complete address](/developers/testnet/docs/foundational-topics/accounts/keys.md#address-derivation) without having to interact with the network, so they can share it with others to receive funds. This requires that the wallet pins a specific contract implementation, its initialization arguments, a deployment salt, and the user's keys. These values yield a deterministic address, so when the account contract is actually deployed, it is available at the precalculated address. Once the account contract is deployed, the user can start sending transactions using it as the transaction origin.
## Transaction lifecycle[](#transaction-lifecycle "Direct link to Transaction lifecycle")
Every transaction in Aztec is broadcast to the network as a zero-knowledge proof of correct execution, in order to preserve privacy. This means that transaction proofs are generated on the wallet and not on a remote node. This is one of the biggest differences with regard to EVM chain wallets.
A wallet is responsible for **creating** an *execution request* out of one or more *function calls* requested by a dapp. For example, a dapp may request a wallet to "invoke the `transfer` function on the contract at `0x1234` with the following arguments", in response to a user action. The wallet turns that into an execution request with the signed instructions to execute that function call from the user's account contract. In an [ECDSA-based account](https://github.com/aztec-labs-eng/aztec-node/blob/v6.0.0-rc.1/noir-projects/noir-contracts/contracts/account/ecdsa_k_account_contract/src/main.nr), for instance, this is an execution request that encodes the function call in the *entrypoint payload*, and includes its ECDSA signature with the account's signing private key.
Once the *execution request* is created, the wallet is responsible for **simulating** and **proving** the execution of its private functions. The simulation yields an execution trace, which can be used to provide the user with a list of side effects of the private execution of the transaction. During this simulation, the wallet is responsible for providing data to the virtual machine, such as private notes, encryption keys, or nullifier secrets. This execution trace is fed into the prover, which returns a zero-knowledge proof that guarantees correct execution and hides all private information. The output of this process is a *transaction object*.
info
Private functions use a UTXO model, so their execution trace is determined entirely by the input notes. Since notes are immutable, simulation results match mined results exactly. However, a transaction may be dropped if it tries to consume a note that was nullified by another transaction first.
Public functions use an account model (like Ethereum), so their execution trace depends on chain state at inclusion time, which may differ from simulation.
Before sending, the wallet may run a **simulation**, a lightweight execution using a stub account contract that avoids expensive kernel circuit execution. This simulation estimates gas limits for the transaction and captures any required private authorization data (see [Authorizing actions](#authorizing-actions) below). The `EmbeddedWallet` runs this step automatically on every send. For details on what the PXE skips in this mode and how to wire it up in your own wallet, see [Kernelless simulations](/developers/testnet/docs/foundational-topics/pxe/kernelless_simulations.md).
Finally, the wallet **sends** the resulting *transaction* object, which includes the proof of execution, to an Aztec Node. The transaction is then broadcasted through the peer-to-peer network, to be eventually picked up by a sequencer and included in a block.
## Authorizing actions[](#authorizing-actions "Direct link to Authorizing actions")
Account contracts in Aztec expose an interface for other contracts to validate [whether an action is authorized by the account or not](/developers/testnet/docs/foundational-topics/accounts.md#authentication-witnesses-authwit). For example, an application contract may want to transfer tokens on behalf of a user, in which case the token contract will check with the account contract whether the application is authorized to do so. These actions may be carried out in private or in public functions, and in transactions originated by the user or by someone else.
Wallets should manage these authorizations, prompting the user when they are requested by an application. Authorizations in private executions come in the form of *auth witnesses*, which are usually signatures over an identifier for an action. Applications can request the wallet to produce an auth witness via the `createAuthWit` call. In public functions, authorizations are pre-stored in the account contract storage, which is handled by a call to an internal function in the account contract implementation.
Wallets can automate private authorization by capturing authorization requests during simulation. The `EmbeddedWallet`, for example, detects which private authwits a transaction needs and generates them automatically, so dapps don't need to explicitly create or manage private authorizations. Public authorizations still require explicit setup, as they involve onchain state changes that must occur before the authorized action.
## Key management[](#key-management "Direct link to Key management")
As in EVM-based chains, wallets are expected to manage user keys, or provide an interface to hardware wallets or alternative key stores. Keep in mind that in Aztec each account requires [multiple key pairs](/developers/testnet/docs/foundational-topics/accounts/keys.md): protocol keys (nullifier and incoming viewing keys) are mandated by the protocol and used for spending notes and decryption, whereas signing keys are dependent on the account contract implementation rolled out by the wallet. Should the account contract support it, wallets must provide the user with the means to rotate or recover their signing keys.
info
Due to limitations in the current architecture, protocol keys need to be available in the wallet software itself and cannot be delegated to an external keystore. This restriction may be lifted in a future release.
## Recipient address management[](#recipient-address-management "Direct link to Recipient address management")
Wallets are also expected to manage the public encryption keys of any recipients of local transactions. When creating an encrypted note for a recipient given their address, the wallet needs to provide their [complete address](/developers/testnet/docs/foundational-topics/accounts/keys.md#address-derivation). Recipients broadcast their complete addresses when deploying their account contracts, and wallets collect this information and save it in a local registry for easy access when needed.
Note that, in order to interact with a recipient who has not yet deployed their account contract (and thus not broadcasted their complete address), it must also be possible to manually add an entry to a wallet's local registry of complete addresses.
## Private state[](#private-state "Direct link to Private state")
Wallets also store the user's private state. Aztec uses a [note tagging system](/developers/testnet/docs/foundational-topics/advanced/storage/note_discovery.md) that allows users to efficiently discover notes that belong to them. When a note is created, the sender tags it with a value derived from a shared secret, allowing the recipient's wallet to query for relevant notes without attempting to decrypt every note on the network. Once discovered, notes are decrypted and added to the corresponding account's private state.
To discover notes from a sender, the wallet must first register that sender's address with the PXE. This allows the wallet to compute the shared secrets needed for note tagging. Wallets typically register senders when users add contacts or interact with new counterparties. Wallets must also scan for private state in blocks prior to the deployment of a user's account contract, since users may have received notes before deployment.
Private state can be encrypted and broadcast through the network, then committed to L1. While tags allow wallets to query the network for relevant notes, the tags themselves don't reveal the recipient - only the sender and recipient can compute and recognize them. This means wallets need to maintain a local database of their accounts' private state to answer queries efficiently.
Dapps may require access to the user's private state, in order to show information relevant to the current application. For instance, a dapp for a token may require access to the user's private notes in the token contract in order to display the user's balance. It is the responsibility of the wallet to require authorization from the user before disclosing private state to a dapp.
## Account interface[](#account-interface "Direct link to Account interface")
The account interface is used for creating an *execution request* out of one or more *function calls* requested by a dapp, as well as creating an *auth witness* for a given message hash. Account contracts are expected to handle multiple function calls per transaction, since dapps may choose to batch multiple actions into a single request to the wallet.
account-interface
```
/**
* Minimal interface for transaction execution and authorization.
*/
export type Account = EntrypointInterface &
AuthorizationProvider & {
/** Returns the complete address for this account. */
getCompleteAddress(): CompleteAddress;
/** Returns the address for this account. */
getAddress(): AztecAddress;
};
```
> [Source code: yarn-project/aztec.js/src/account/account.ts#L23-L34](https://github.com/aztec-labs-eng/aztec-node/blob/v6.0.0-rc.1/yarn-project/aztec.js/src/account/account.ts#L23-L34)
---
# Community Calls
**Build with us, live.**
Every week you can join office hours and ecosystem calls to get unblocked, learn from maintainers, and connect with other builders. Pick the call that fits your needs, add it to your calendar, and show up with questions.
***
## Ecosystem Call[](#ecosystem-call "Direct link to Ecosystem Call")
* **When:** Biweekly · Wednesdays · 16:00 - 16:45 UTC
* **Where:** [Google Meet](https://meet.google.com/tnk-phse-bmz)
* **For:** The Ecosystem Call is the place to be if you're building on Aztec. Get updates on libraries and devnet, watch demo apps, peek at what's coming next, and connect with the community. Building an app? Don't miss it.
***
## Aztec & Noir Developer Office Hours[](#aztec--noir-developer-office-hours "Direct link to Aztec & Noir Developer Office Hours")
* **When:** Thursdays · 14:00 - 15:00 UTC
* **Where:** [Google Meet](https://meet.google.com/vev-waao-mab)
* **For:** Developers building with Aztec.nr smart contracts or writing and debugging Noir. Bring your questions about syntax, tooling, patterns, or protocol-level topics. Share a project you're working on, or just hang out with the Aztec Labs Dev Rel team and other devs.
***
## Community[](#community "Direct link to Community")
* Follow discussions in the [Forum](https://forum.aztec.network)
* Ask daily questions in [Discord](https://discord.gg/aztec)
***
## One calendar, all calls[](#one-calendar-all-calls "Direct link to One calendar, all calls")
Save time, add everything with one click:
[Subscribe to the Aztec Builder Calendar](https://calendar.google.com/calendar/u/0?cid=Y19kMTdhMTEzNmU3NDEwNDNiNDJkMTZlYWU2ZDUzODg4YjlhYTVhNzA5NzNkNjVkNDU3YTA1ZTc3NWNhMGEwNWY5QGdyb3VwLmNhbGVuZGFyLmdvb2dsZS5jb20)
---
# Limitations
The Aztec stack is a work in progress. Packages have been released early to gather feedback on the capabilities of the protocol and user experiences.
## What to expect[](#what-to-expect "Direct link to What to expect")
* Regular breaking changes
* Missing features
* Bugs
* An "unpolished" UX
* Missing information
## Why participate[](#why-participate "Direct link to Why participate")
Front-run the future!
Help shape and define:
* Previously-impossible smart contracts and applications
* Network tooling
* Network standards
* Smart contract syntax
* Educational content
* Core protocol improvements
## Limitations developers need to know about[](#limitations-developers-need-to-know-about "Direct link to Limitations developers need to know about")
* The Aztec stack is unaudited and under active development. See the [Alpha Network](/participate/alpha.md) page for details on what this means.
* `msg_sender` is leaked by default when making private -> public calls.
<!-- -->
* `self.enqueue(...)` sets `msg_sender` to the private caller's address, which is publicly visible.
* Use `self.enqueue_incognito(...)` to hide the sender. The called public function must use `maybe_msg_sender()` instead of `msg_sender()` to handle the null sender.
* The initial `msg_sender` is `-1`, which can be problematic for some contracts.
* Some side-effect counts are still visible in a transaction. Note hashes, nullifiers, and private logs are padded to hide their true counts, but the number of public function calls and L2->L1 messages remains visible. Privacy sets to further reduce leakage are still under development.
* A transaction can only emit a limited number of side-effects (notes, nullifiers, logs, L2->L1 messages). See [circuit limitations](#circuit-limitations).
<!-- -->
* We have not settled on the final constants, since we are still in a testing phase. You could find that certain compositions of nested private function calls (for example, call stacks that are dynamic in size, based on runtime data) could accumulate so many side-effects as to exceed transaction limits. Such transactions would then be unprovable. Please open an issue if you encounter this, as it will help us decide on adequate sizes for our constants.
* Not all Noir cryptographic primitives work in public (AVM) functions. Signature verification (ECDSA secp256k1/r1), AES-128, Blake2s, and Blake3 are not supported. See [AVM Cryptographic Compatibility](/developers/testnet/docs/foundational-topics/advanced/circuits/avm_compatibility.md) for details and workarounds.
* There are many features that we still want to implement. Check out GitHub and the forum for details. If you would like a feature, please open an issue on GitHub.
## WARNING[](#warning "Direct link to WARNING")
Do not use real, meaningful secrets on Aztec networks. Some privacy features are still in development, including ensuring a secure "zk" property. Since the Aztec stack is still being developed, there are no guarantees that real secrets will remain secret.
## Limitations[](#limitations "Direct link to Limitations")
There are plans to resolve all of the below.
### It is not audited[](#it-is-not-audited "Direct link to It is not audited")
None of the Aztec stack is audited. It is being iterated on every day. It will not be audited for quite some time.
### Under-constrained[](#under-constrained "Direct link to Under-constrained")
Some of our more complex circuits are still in development, so they are still under-constrained.
#### What are the consequences?[](#what-are-the-consequences "Direct link to What are the consequences?")
Sound proofs are really only needed as a protection against malicious behavior, which we are not testing for at this stage.
### Keys and addresses may change in future rollup versions[](#keys-and-addresses-may-change-in-future-rollup-versions "Direct link to Keys and addresses may change in future rollup versions")
The key derivation scheme is documented and stable within the current rollup version, but it may change in future rollup upgrades. Applications should not hardcode assumptions about the specific derivation algorithm.
Please open new discussions on [Discourse](https://discourse.aztec.network) or open issues on [GitHub](https://github.com/AztecProtocol/aztec-packages) if you have requirements that are not being met by the current key derivation scheme.
### No privacy-preserving queries to nodes[](#no-privacy-preserving-queries-to-nodes "Direct link to No privacy-preserving queries to nodes")
Ethereum has a notion of a "full node" which keeps up with the blockchain and stores the full chain state. Many users do not wish to run full nodes, so they rely on third-party "full-node-as-a-service" infrastructure providers who service blockchain queries from their users.
This pattern is likely to develop in Aztec as well, except there is a problem: privacy. If a privacy-seeking user makes a qu프로젝트로 돌아가기