Skip to content

Commit 2d8e0b5

Browse files
AztecBotAztecBot
and
AztecBot
authored
chore(master): release 0.86.0 (#13579)
🤖 I have created a new Aztec Packages release --- ## [0.86.0](v0.85.0...v0.86.0) (2025-04-24) ### ⚠ BREAKING CHANGES * Use combined p2p and http prover coordination ([#13760](#13760)) * use single extended viem client ([#13715](#13715)) * remove slice read from CALL ([#13729](#13729)) ### Features * `#[allow(dead_code)]` (noir-lang/noir#8066) ([366d980](366d980)) * add aztec-up amm test w/ proving & sponsoredfpc ([#13209](#13209)) ([f54c8a1](f54c8a1)) * Add Rollup to registry and produce blocks ([#13556](#13556)) ([9ed10d3](9ed10d3)) * adding devnet tests ([#12808](#12808)) ([7687a1f](7687a1f)) * audit tracking tooling ([#13639](#13639)) ([e50d8e0](e50d8e0)) * **avm:** fast entity indexing without macros ([#13737](#13737)) ([5c8a993](5c8a993)) * **avm:** quick n dirty memory trace ([#13659](#13659)) ([062c6a9](062c6a9)) * **avm:** support col arrays and add keccak cols ([#13711](#13711)) ([9c4345a](9c4345a)) * **avm:** tagged value type in C++ ([#13540](#13540)) ([b30b5b3](b30b5b3)) * avoid unnecessary zero check in brillig overflow check (noir-lang/noir#8109) ([366d980](366d980)) * **contracts:** static + snapshotted validator set ([#13046](#13046)) ([90033f2](90033f2)) * enable mempool limiter on devnet ([#13722](#13722)) ([36fb0a1](36fb0a1)) * exec opcode spec table ([#13594](#13594)) ([d4d503a](d4d503a)) * **experimental:** Implement separate `-Zownership` analysis for ownership pass (noir-lang/noir#7861) ([366d980](366d980)) * expose mempool limit through helm chart ([#13616](#13616)) ([822e8d9](822e8d9)) * Garaga UltraStarknet[Zk]Honk flavours ([#11489](#11489)) ([6bc34a1](6bc34a1)) * IPA claim as public component ([#13429](#13429)) ([1ce3c43](1ce3c43)) * no longer recompute vk's in CIVC proofs ([#13590](#13590)) ([66a61ba](66a61ba)) * **p2p:** add private peers ([#12585](#12585)) ([4264c8c](4264c8c)) * **p2p:** optional P2P_BROADCAST_PORT ([#13525](#13525)) ([f709fab](f709fab)) * Port callstack resolution from aztec to noirjs (noir-lang/noir#7642) ([366d980](366d980)) * Refactor IPA claim handling in acir format to support them for AVM ([#13547](#13547)) ([df73c05](df73c05)) * remove slice read from CALL ([#13729](#13729)) ([7e7eb85](7e7eb85)) * replace field divisions by constants with multiplication by inv… (noir-lang/noir#8053) ([366d980](366d980)) * report world state size on disk ([#13706](#13706)) ([0dd8a7e](0dd8a7e)) * skip inverting field elements with values +-1 in ACVM (noir-lang/noir#8049) ([44c1347](44c1347)) * SMT Verificaiton Module: Data Structures ([#13658](#13658)) ([2de3bc5](2de3bc5)) * SMT verification module updates ([#13551](#13551)) ([f02123d](f02123d)) * ssa fuzzer (noir-lang/noir#7641) ([366d980](366d980)) * Tighter timing on ACVM ([#13743](#13743)) ([45cd39b](45cd39b)) * track rewards and slots ([#13546](#13546)) ([489c6cf](489c6cf)) * Use combined p2p and http prover coordination ([#13760](#13760)) ([4d04e62](4d04e62)) * VK generation test for HonkRecursionConstraint ([#13637](#13637)) ([71e81ce](71e81ce)) ### Bug Fixes * **acir:** Check whether opcodes were laid down for non-equality check before fetching payload locations (noir-lang/noir#8133) ([366d980](366d980)) * add proper handling for `u128` in comptime interpreter (noir-lang/noir#8079) ([366d980](366d980)) * Add version to gossipsub protocol ([#13567](#13567)) ([8ce4829](8ce4829)) * allow keywords in function names in SSA parser (noir-lang/noir#8063) ([44c1347](44c1347)) * Allow more slack in AST calibration for CI (noir-lang/noir#8076) ([366d980](366d980)) * amm bot ([#13553](#13553)) ([6b93832](6b93832)), closes [#13544](#13544) * **avm:** cpp addressing ([#13652](#13652)) ([9d941b6](9d941b6)) * blob sink waits for reg address when needed ([#13628](#13628)) ([486a42a](486a42a)) * **brillig:** SliceRefCount reads from the appropriate pointer (noir-lang/noir#8148) ([366d980](366d980)) * Check against multiple aws profiles in build instance credentails ([#13421](#13421)) ([71a408a](71a408a)) * dependency cycles in public simulator - part 0 (sim -&gt; context) ([#13678](#13678)) ([e00089f](e00089f)) * dependency cycles in public simulator - part 1 (errors/revertReason) ([#13679](#13679)) ([c75e365](c75e365)) * dependency cycles in public simulator part 2 (serializable bytecode) ([#13680](#13680)) ([5d3e24c](5d3e24c)) * discv5 test failure ([#13653](#13653)) ([58c143b](58c143b)) * **docs:** Make viewing (outdated) protocol specs work locally ([#13534](#13534)) ([694537d](694537d)) * Increase timeout for p2p integration test ([#13720](#13720)) ([c244b2e](c244b2e)) * mac bb --version ([#13690](#13690)) ([9f8b64f](9f8b64f)) * make translator use ultra rather than eccvm ops ([#13489](#13489)) ([53c070d](53c070d)) * more worker fixes ([#13759](#13759)) ([080485a](080485a)) * move helm lint to build ([#13532](#13532)) ([7768ff8](7768ff8)) * native ivc benches not publishing ([#13665](#13665)) ([7ab712d](7ab712d)) * no exports of simulator should depend on jest-mock-extended ([#13694](#13694)) ([65a9f33](65a9f33)) * only clear trailing zeros on logs ([#13727](#13727)) ([e392d7c](e392d7c)) * **p2p:** better batch connection sampling ([#13674](#13674)) ([9c1d9f1](9c1d9f1)) * **p2p:** reqresp types + batch request tx pool filtering ([#13666](#13666)) ([8e2a3c9](8e2a3c9)) * **parser:** error on missing let semicolon in trait (and others) (noir-lang/noir#8101) ([366d980](366d980)) * pass along coinbase ([#13560](#13560)) ([593f810](593f810)), closes [#13643](#13643) * prover-node start ([#13627](#13627)) ([5d87f7a](5d87f7a)) * quote numbers ([#13654](#13654)) ([f0d1ec1](f0d1ec1)) * remove all txs from a failed epoch ([#13771](#13771)) ([abc4623](abc4623)) * remove insecure dummy round derivation from sumcheck and shplemini ([#13488](#13488)) ([9a3bb46](9a3bb46)) * replace values in data_bus too (noir-lang/noir#8086) ([366d980](366d980)) * retry deploy npm ([#13691](#13691)) ([76cab3f](76cab3f)) * run yarn ([#13713](#13713)) ([0e51259](0e51259)) * squash nightly foundry warning ([#13640](#13640)) ([e21f9fd](e21f9fd)) * SSA pass print filter to include the count (noir-lang/noir#8074) ([366d980](366d980)) * **ssa:** Do not inline simple recursive functions (noir-lang/noir#8127) ([366d980](366d980)) * **ssa:** Do not unroll loop with break (noir-lang/noir#8090) ([366d980](366d980)) * **ssa:** Do not use inner else condition when collapsing IfElse based upon the then condition (noir-lang/noir#8040) ([44c1347](44c1347)) * **ssa:** fix possibility to `Field % Field` operaions in Brillig from SSA (noir-lang/noir#8105) ([366d980](366d980)) * **ssa:** Loop range with u1 (noir-lang/noir#8131) ([366d980](366d980)) * update metric name to avoid conflicts ([#13629](#13629)) ([70c58ab](70c58ab)), closes [#13626](#13626) * wasm memory benchmark ([#13573](#13573)) ([9a73c4a](9a73c4a)) * wrapping mul support for u128 (noir-lang/noir#7941) ([366d980](366d980)) ### Miscellaneous * Accept optional test path for emitting integration tests (noir-lang/noir#8062) ([366d980](366d980)) * Add `GITHUB_TOKEN` to more workflow steps (noir-lang/noir#8046) ([44c1347](44c1347)) * add a benchmark for opcodes which need a batchable inversion (noir-lang/noir#8110) ([366d980](366d980)) * add hacky faster bootstrap for bb-centric e2e flow ([#13587](#13587)) ([498d433](498d433)) * address some visibility warnings ([#13728](#13728)) ([35dec90](35dec90)) * **avm:** less codegen for lookups ([#13741](#13741)) ([ec468d9](ec468d9)) * **avm:** move interaction jobs to trace builders ([#13621](#13621)) ([caac1c9](caac1c9)) * bb.js non-inlined web workers ([#13736](#13736)) ([0e604a1](0e604a1)) * **bb:** debugging helpers ([#13584](#13584)) ([0ebb29e](0ebb29e)) * **bb:** Make goblin a proper source module ([#13580](#13580)) ([3048a14](3048a14)) * bespoke export for client native prover / PXE server store lazy load ([#13783](#13783)) ([640dd08](640dd08)) * Blob and archiver syncing improvements ([#13542](#13542)) ([629aa2a](629aa2a)), closes [#13530](#13530) * blob archive client factory code ([#13648](#13648)) ([7b16791](7b16791)) * bug list ([#13773](#13773)) ([c6d4fb8](c6d4fb8)) * bump axois ([#13453](#13453)) ([1c20920](1c20920)) * bump bb to 0.84.0 (noir-lang/noir#8047) ([44c1347](44c1347)) * bump bignum timeout (noir-lang/noir#8080) ([366d980](366d980)) * bump external pinned commits (noir-lang/noir#8045) ([44c1347](44c1347)) * **ci:** run non dependent bootstrap build steps in parallel ([#13454](#13454)) ([b17e18d](b17e18d)) * cleanup aztec up amm test ([#13754](#13754)) ([3d92afe](3d92afe)) * Cleanup scripts in package jsons in yarn-project ([#13527](#13527)) ([a296945](a296945)) * **contracts:** core/staking -&gt; core/slashing ([#13748](#13748)) ([5d93a0e](5d93a0e)) * create module for array handling in acirgen (noir-lang/noir#8119) ([366d980](366d980)) * dashboards use ${data_source} variable ([#13613](#13613)) ([45533d9](45533d9)) * delete honk_recursion for building ACIR ([#13664](#13664)) ([ac95729](ac95729)) * delete Ultra Vanilla CIVC ([#13669](#13669)) ([ae578a2](ae578a2)) * delete zeromorph ([#13667](#13667)) ([c8acae0](c8acae0)) * Disable blobscan by default ([#13742](#13742)) ([c55088e](c55088e)) * **docs:** `aztec` and `aztec-wallet` cli reference updates ([#13692](#13692)) ([d11d154](d11d154)) * **docs:** add 0.85.0 docs ([#13578](#13578)) ([cf07358](cf07358)) * **docs:** add AND/XOR bug to bug list ([#13784](#13784)) ([797ae6d](797ae6d)) * **docs:** Add architecture docs (noir-lang/noir#7992) ([366d980](366d980)) * **docs:** adding redirects for node guide ([#13768](#13768)) ([e96e5bf](e96e5bf)) * **docs:** bugfix + deploy on master ([#13717](#13717)) ([010975a](010975a)) * **docs:** Fix some stuff on fees, rm confusing storage example ([#13501](#13501)) ([c00b20b](c00b20b)) * **docs:** Sequencer and Prover Guide ([#13433](#13433)) ([55b9a2b](55b9a2b)) * **docs:** update bb commands to match 0.84.0 (noir-lang/noir#8050) ([366d980](366d980)) * **docs:** Update docs bootrap to to include release ([#13615](#13615)) ([2154d5e](2154d5e)) * don't use `set_from_value_id` in `remove_if_else` (noir-lang/noir#8070) ([366d980](366d980)) * don't use `set_value_from_id` in `as_slice_length` (noir-lang/noir#8039) ([44c1347](44c1347)) * don't use `set_value_from_id` in `constant_folding` (noir-lang/noir#8091) ([366d980](366d980)) * don't use `set_value_from_id` in `loop_invariant` (noir-lang/noir#8085) ([366d980](366d980)) * don't use `set_value_from_id` in `remove_bit_shifts` (noir-lang/noir#8071) ([366d980](366d980)) * don't use `set_value_from_id` in `simplify_cfg` (noir-lang/noir#8072) ([366d980](366d980)) * **experimental:** Function::simple_optimization for SSA optimizations (noir-lang/noir#8102) ([366d980](366d980)) * Fetch rollup address using version as index ([#13620](#13620)) ([60e73f9](60e73f9)) * Fix license files ([#13695](#13695)) ([9931fb8](9931fb8)) * mempool limit ([#13735](#13735)) ([def1287](def1287)) * mint block rewards for 200K blocks at deployment ([#13537](#13537)) ([1a3a326](1a3a326)) * move check_circuit functionality from `TranslatorCircuitBuilder` into a `TranslatorCircuitChecker` ([#13761](#13761)) ([e4e7fca](e4e7fca)) * noir test flake addition ([#13663](#13663)) ([c302fdd](c302fdd)) * **noir-contracts:** update readme ([#13563](#13563)) ([42dfbbf](42dfbbf)) * **optimization:** Enable experimental ownership clone scheme by default (noir-lang/noir#8097) ([366d980](366d980)) * parse nop in SSA parser (noir-lang/noir#8141) ([366d980](366d980)) * ping luke instead of cody on bb benchmark regressions ([#13718](#13718)) ([2802f5a](2802f5a)) * playground improvements ([#13588](#13588)) ([4c3453b](4c3453b)) * **playground:** bump vite ([#13750](#13750)) ([7e72420](7e72420)) * Print `unsafe { ... }` around calls to Brillig from ACIR in AST (noir-lang/noir#8077) ([366d980](366d980)) * **public/avm:** from hints to the end of the world ([#13459](#13459)) ([a89de5d](a89de5d)) * redo typo PR by dizer-ti ([#13757](#13757)) ([075d3a8](075d3a8)) * release playground on s3. ([#13582](#13582)) ([2f9458a](2f9458a)) * **release:** give aztec release image sensible default entrypoint ([#13517](#13517)) ([a864c06](a864c06)) * remove circuit simulator ([#13689](#13689)) ([a00566c](a00566c)) * Remove code of the fake AVM recursive verifier ([#13614](#13614)) ([048dfed](048dfed)) * remove msm sorter ([#13668](#13668)) ([ff29d86](ff29d86)) * remove old terraform configs ([#13716](#13716)) ([49ac1db](49ac1db)), closes [#13651](#13651) * remove omit param from serialize derivation ([#13703](#13703)) ([6af5943](6af5943)) * remove pcs vk from vk ([#13638](#13638)) ([0e941ef](0e941ef)) * remove try_merge_only_changed_indices (noir-lang/noir#8142) ([366d980](366d980)) * replace relative paths to noir-protocol-circuits ([78c87b5](78c87b5)) * replace relative paths to noir-protocol-circuits ([4e53cd1](4e53cd1)) * replace relative paths to noir-protocol-circuits ([3a33c47](3a33c47)) * replace relative paths to noir-protocol-circuits ([eaaa85b](eaaa85b)) * replace relative paths to noir-protocol-circuits ([648a4fe](648a4fe)) * replace relative paths to noir-protocol-circuits ([b3f4745](b3f4745)) * replace relative paths to noir-protocol-circuits ([269b316](269b316)) * replace relative paths to noir-protocol-circuits ([1330efe](1330efe)) * replace relative paths to noir-protocol-circuits ([a739284](a739284)) * Sanity check block number from archiver before returning it ([#13631](#13631)) ([e459b2a](e459b2a)) * simpler `make_mutable` in `array_set` optimization (noir-lang/noir#8106) ([366d980](366d980)) * **spartan:** bump default kind resources ([#13747](#13747)) ([8ca828f](8ca828f)) * **ssa:** Additional unrolling and mem2reg passes (noir-lang/noir#8017) ([44c1347](44c1347)) * **ssa:** Remove IfElse pass basic SSA tests (noir-lang/noir#8058) ([44c1347](44c1347)) * **ssa:** Test terminator value constant folding and resolve cache for data bus (noir-lang/noir#8132) ([366d980](366d980)) * starknet feature flag ([#13681](#13681)) ([2b6c627](2b6c627)) * stop prover node swallowing start prover job errors ([#13676](#13676)) ([90c2b7b](90c2b7b)) * **test:** AST generation calibration test (noir-lang/noir#8054) ([44c1347](44c1347)) * update ACVM doc (noir-lang/noir#8004) ([366d980](366d980)) * Update docs snippet ([#13739](#13739)) ([7fb333a](7fb333a)) * update staking asset handler address ([#13566](#13566)) ([daa09f2](daa09f2)) * Updated contract addresses for alpha-testnet ([#13585](#13585)) ([9f0ff4a](9f0ff4a)) * Use chain monitor to sync system time in p2p tests ([#13632](#13632)) ([abbad4c](abbad4c)) * use public component key for pairing inputs ([#13705](#13705)) ([467166f](467166f)) * use PublicComponentKeys ([#13686](#13686)) ([68e4b6f](68e4b6f)) * use single extended viem client ([#13715](#13715)) ([cf637dc](cf637dc)) * validate block header hash in circuits ([#13094](#13094)) ([f19c182](f19c182)) * wasm proof verifying with native bb ([#13499](#13499)) ([1ad9249](1ad9249)) ### Documentation * fees tutorial ([#13357](#13357)) ([c580657](c580657)) * move snippets all versions ([#13650](#13650)) ([a2f5553](a2f5553)) * Update glossary & snippets ([#13661](#13661)) ([d55816d](d55816d)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: AztecBot <tech@aztecprotocol.com>
1 parent c580657 commit 2d8e0b5

File tree

446 files changed

+57338
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

446 files changed

+57338
-2
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.85.0"
2+
".": "0.86.0"
33
}

CHANGELOG.md

Lines changed: 201 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"label": "Concepts",
3+
"position": 1,
4+
"collapsible": true,
5+
"collapsed": true
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"label": "Accounts",
3+
"position": 5,
4+
"collapsible": true,
5+
"collapsed": true
6+
}
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
---
2+
title: Accounts
3+
sidebar_position: 1
4+
tags: [accounts]
5+
---
6+
7+
Aztec has native account abstraction. Every account in Aztec is a smart contract.
8+
9+
In this section, you'll learn about Aztec's account abstraction, Aztec accounts and address derivation, how wallets relate to accounts, and how the entrypoints are defined.
10+
11+
## Account Abstraction (AA)
12+
13+
With account abstraction, the identity of a user is usually represented by a smart contract. That makes user's on-chain identity more flexible than simply using private/public keys. For example, Bitcoin has rigid accounts that must be a private key, whereas a user might want their on-chain identity to be controlled by a physical passport.
14+
15+
Among the account parts to be abstracted are authentication (“Who I am”), authorization (“What I am allowed to do”), replay protection, fee payment, and execution.
16+
17+
Some account features unlocked by account abstraction are account recovery, gas sponsorship, and support of signatures other than ECDSA, such as more efficient signatures (e.g. Schnorr, BLS), or more user-friendly ones (e.g. smartphone secure enclave).
18+
19+
### Protocol vs application level
20+
21+
AA can be implemented at the protocol level is called native Account Abstraction. In this case, all the accounts on the network are smart contracts. AA can also be implemented at the smart-contract level, then we call it non-native Account Abstraction. In this case, there might be both EOAs and accounts controlled by smart contracts.
22+
23+
In the case of Aztec, we have native Account Abstraction.
24+
25+
## Aztec Account Abstraction
26+
27+
### Authorization abstraction and DoS attacks
28+
29+
While we talk about “arbitrary verification logic” describing the intuition behind AA, the logic is usually not really arbitrary. The verification logic (i.e. what is checked as an authorization) is limited to make the verification time fast and bounded. If it is not bounded, an attacker can flood the mempool with expensive invalid transactions, clogging the network. That is the case for all chains where transaction validity is checked by the sequencer.
30+
31+
On Aztec, there is no limitation on the complexity of verification logic (what does it mean for the transaction to be valid). Whatever conditions it checks, the proof (that the sequencer needs to verify) is independent of its complexity.
32+
33+
This unlocks a whole universe of new use cases and optimization of existing ones. Whenever the dapp can benefit from moving expensive computations off-chain, Aztec will provide a unique chance for an optimization. That is to say, on traditional chains users pay for each executed opcode, hence more complex operations (e.g. alternative signature verification) are quite expensive. In the case of Aztec, it can be moved off-chain so that it becomes almost free. The user pays for the operations in terms of client-side prover time. However, this refers to Aztec's client-side proving feature and not directly AA.
34+
35+
Couple of examples:
36+
37+
- Multisig contract with an arbitrary number of parties that can verify any number of signatures for free.
38+
- Oracle contract with an arbitrary number of data providers that can verify any number of data entries for free.
39+
40+
## Aztec account
41+
42+
Smart contracts on Aztec are represented by an "address", which is a hexadecimal number that uniquely represents an entity on the Aztec network. An address is derived by hashing information specific to the entity represented by the address. This information includes contract bytecode and the public keys used in private execution for encryption and nullification. This means addresses are deterministic.
43+
44+
Aztec has no concept of EOAs (Externally Owned Accounts). Every account is implemented as a contract.
45+
46+
### Entrypoints
47+
48+
Account contracts usually have a specific function called `entrypoint`. It serves as the interface for interaction with the smart contract and can be called by external users or other smart contracts.
49+
50+
An `entrypoint` function receives the actions to be carried out and an authentication payload. In pseudocode:
51+
52+
```
53+
publicKey: PublicKey;
54+
55+
def entryPoint(payload):
56+
let { privateCalls, publicCalls, nonce, signature } = payload;
57+
let payloadHash = hash(privateCalls, publicCalls, nonce);
58+
validateSignature(this.publicKey, signature, payloadHash);
59+
60+
foreach privateCall in privateCalls:
61+
let { to, data, value } = privateCall;
62+
call(to, data, value);
63+
64+
foreach publicCall in publicCalls:
65+
let { to, data, value, gasLimit } = publicCall;
66+
enqueueCall(to, data, value, gasLimit);
67+
```
68+
69+
A request for executing an action requires:
70+
71+
- The `origin` contract to execute as the first step.
72+
- The initial function to call (usually `entrypoint`).
73+
- The arguments (which encode the private and public calls to run as well as any signatures).
74+
75+
Read more about how to write an account contract [here](../../../developers/tutorials/codealong/contract_tutorials/write_accounts_contract.md).
76+
77+
### Non-standard entrypoints
78+
79+
Since the `entrypoint` interface is not enshrined, there is nothing that differentiates an account contract from an application contract. This allows implementing functions that can be called by any user and are just intended to advance the state of a contract.
80+
81+
For example, a lottery contract, where at some point a prize needs to be paid out to its winners. This `pay` action does not require authentication and does not need to be executed by any user in particular, so anyone could submit a transaction that defines the lottery contract itself as `origin` and `pay` as `entrypoint` function. However, it's on the contract to define how fees for the prize claim will be paid as they won't be paid by the account contract.
82+
83+
For an example of this behavior see our [e2e_crowdfunding_and_claim test](https://github.com/AztecProtocol/aztec-packages/blob/88b5878dd4b95d691b855cd84153ba884adf25f8/yarn-project/end-to-end/src/e2e_crowdfunding_and_claim.test.ts#L322) and the [SignerLess wallet](https://github.com/AztecProtocol/aztec-packages/blob/master/yarn-project/aztec.js/src/wallet/signerless_wallet.ts) implementation. Notice that the Signerless wallet doesn't invoke an `entrypoint` function of an account contract but instead invokes the target contract function directly.
84+
85+
:::info
86+
87+
Entrypoints for the following cases:
88+
89+
- If no contract `entrypoint` is used `msg_sender` is set to `Field.max`.
90+
- In a private to public `entrypoint`, `msg_sender` is the contract making the private to public call.
91+
- When calling the `entrypoint` on an account contract, `msg_sender` is set to the account contract address.
92+
93+
:::
94+
95+
### Account contracts and wallets
96+
97+
Account contracts are tightly coupled to the wallet software that users use to interact with the protocol. Dapps submit to the wallet software one or more function calls to be executed (e.g. "call swap in X contract"), and the wallet encodes and signs the request as a valid payload for the user's account contract. The account contract then validates the request encoded and signed by the wallet, and executes the function calls requested by the dapp.
98+
99+
### Account Initialization
100+
101+
When a user wants to interact with the network's **public** state, they need to deploy their account contract. A contract instance is considered to be publicly deployed when it has been broadcasted to the network via the canonical `ContractInstanceDeployer` contract, which also emits a deployment nullifier associated to the deployed instance.
102+
103+
However, to send fully **private** transactions, it's enough to initialize the account contract (public deployment is not needed). The default state for any given address is to be uninitialized, meaning a function with the [initializer annotation](../../../developers/tutorials/codealong/contract_tutorials/nft_contract.md#initializer) has not been called. The contract is initialized when one of the functions marked with the `#[initializer]` annotation has been invoked. Multiple functions in the contract can be marked as initializers. Contracts may have functions that skip the initialization check (marked with `#[noinitcheck]`).
104+
105+
Account deployment and initialization are not required to receive notes. The user address is deterministically derived from the encryption public key and the account contract they intend to deploy, so that funds can be sent to an account that hasn't been deployed yet.
106+
107+
Users will need to pay transaction fees in order to deploy their account contract. This can be done by sending fee juice to their account contract address (which can be derived deterministically, as mentioned above), so that the account has funds to pay for its own deployment. Alternatively, the fee can be paid for by another account, using [fee abstraction](#fee-abstraction).
108+
109+
## What is an account address
110+
111+
Address is derived from the [address keys](keys.md#address-keys). While the AddressPublicKey is an elliptic curve point of the form (x,y) on the [Grumpkin elliptic curve](https://github.com/AztecProtocol/aztec-connect/blob/9374aae687ec5ea01adeb651e7b9ab0d69a1b33b/markdown/specs/aztec-connect/src/primitives.md), the address is its x coordinate. The corresponding y coordinate can be derived if needed. For x to be a legitimate address, address there should exist a corresponding y that satisfies the curve equation. Any field element cannot work as an address.
112+
113+
### Complete address
114+
115+
Because of the contract address derivation scheme, you can check that a given set of public [keys](keys.md) corresponds to a given address by trying to recompute it.
116+
117+
If Alice wants Bob to send her a note, it's enough to share with him her address (x coordinate of the AddressPublicKey).
118+
119+
However, if Alice wants to spend her notes (i.e. to prove that the nullifier key inside her address is correct) she needs her complete address. It is represented by:
120+
121+
- all the user's public keys,
122+
- [partial address](keys.md#address-keys),
123+
- contract address.
124+
125+
## Authorizing actions
126+
127+
Account contracts are also expected, though not required by the protocol, to implement a set of methods for authorizing actions on behalf of the user. During a transaction, a contract may call into the account contract and request the user authorization for a given action, identified by a hash. This pattern is used, for instance, for transferring tokens from an account that is not the caller.
128+
129+
When executing a private function, this authorization is checked by requesting an authentication witness from the execution oracle, which is usually a signed message. Authentication Witness is a scheme for authenticating actions on Aztec, so users can allow third-parties (e.g. contracts) to execute an action on their behalf.
130+
131+
The user's [Private eXecution Environment (PXE)](../pxe/index.md) is responsible for storing these auth witnesses and returning them to the requesting account contract. Auth witnesses can belong to the current user executing the local transaction, or to another user who shared it out-of-band.
132+
133+
However, during a public function execution, it is not possible to retrieve a value from the local [oracle](../../smart_contracts/oracles/index.md). To support authorizations in public functions, account contracts should save in a public authwit registry what actions have been pre-authorized by their owner.
134+
135+
These two patterns combined allow an account contract to answer whether an action `is_valid_impl` for a given user both in private and public contexts.
136+
137+
You can read more about authorizing actions with authorization witnesses on [this page](../advanced/authwit.md).
138+
139+
:::info
140+
141+
Transaction simulations in the PXE are not currently simulated, this is future work described [here](https://github.com/AztecProtocol/aztec-packages/issues/9133). This means that any transaction simulations that call into a function requiring an authwit will require the user to provide an authwit. Without simulating simulations, the PXE can't anticipate what authwits a transaction may need, so developers will need to manually request these authwits from users. In the future, transactions requiring authwits will be smart enough to ask the user for the correct authwits automatically.
142+
143+
:::
144+
145+
## Nonce and fee abstraction
146+
147+
Beyond the authentication logic abstraction, there are nonce abstraction and fee abstraction.
148+
149+
### Nonce abstraction
150+
151+
Nonce is a unique number and it is utilized for replay protection (i.e. preventing users from executing a transaction more than once and unauthorized reordering).
152+
153+
In particular, nonce management defines what it means for a transaction to be canceled, the rules of transaction ordering, and replay protection. In Ethereum, nonce is enshrined into the protocol. On the Aztec network, nonce is abstracted i.e. if a developer wants to customize it, they get to decide how they handle replay protection, transaction cancellation, as well as ordering.
154+
155+
Take as an example the transaction cancellation logic. It can be done through managing nullifiers. Even though we usually refer to a nullifier as a creature utilized to consume a note, in essence, a nullifier is an emitted value whose uniqueness is guaranteed by the protocol. If we want to cancel a transaction before it was mined, we can send another transaction with higher gas price that emits the same nullifier (i.e. nullifier with the same value, for example, 5). The second transaction will invalidate the original one, since nullifiers cannot be repeated.
156+
157+
Nonce abstraction is mostly relevant to those building wallets. For example, a developer can design a wallet that allows sending big transactions with very low priority fees because the transactions are not time sensitive (i.e. the preference is that a transaction is cheap and doesn't matter if it is slow). If one tries to apply this logic today on Ethereum (under sequential nonces), when they send a large, slow transaction they can't send any other transactions until that first large, slow transaction is processed.
158+
159+
### Fee abstraction
160+
161+
It doesn't have to be the transaction sender who pays the transaction fees. Wallets or dapp developers can choose any payment logic they want using a paymaster. To learn more about fees on Aztec – check [this page](../fees.md).
162+
163+
Paymaster is a contract that can pay for transactions on behalf of users. It is invoked during the private execution stage and set as the fee payer.
164+
165+
- It can be managed by a dapp itself (e.g. a DEX can have its own paymaster) or operate as a third party service available for everyone.
166+
- Fees can be paid publicly or privately.
167+
- Fees can be paid in any token that a paymaster accepts.
168+
169+
Fee abstraction unlocks use cases like:
170+
171+
- Sponsored transactions (e.g. the dapp's business model might assume revenue from other streams besides transaction fees or the dapp might utilize sponsored transaction mechanics for marketing purposes). For example, sponsoring the first ten transactions for every user.
172+
- Flexibility in the currency used in transaction payments (e.g. users can pay for transactions in ERC-20 token).

0 commit comments

Comments
 (0)