diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d6f5405644d3..e28eff59b3bf 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.0.1" + ".": "3.0.2" } diff --git a/CHANGELOG.md b/CHANGELOG.md index c12aa342caea..6ec41fabcc51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [3.0.2](https://github.com/AztecProtocol/aztec-packages/compare/v3.0.1...v3.0.2) (2026-01-12) + + +### Bug Fixes + +* node request from `PXE` crossing `MAX_RPC_LIMIT` ([#19516](https://github.com/AztecProtocol/aztec-packages/issues/19516)) ([4a29a70](https://github.com/AztecProtocol/aztec-packages/commit/4a29a70d171df337fba51ab62567c853f84fca68)) + ## [3.0.1](https://github.com/AztecProtocol/aztec-packages/compare/v3.0.0...v3.0.1) (2026-01-08) diff --git a/barretenberg/docs/versioned_docs/version-v3.0.2/explainers/advanced/_category_.json b/barretenberg/docs/versioned_docs/version-v3.0.2/explainers/advanced/_category_.json new file mode 100644 index 000000000000..aad8ca643045 --- /dev/null +++ b/barretenberg/docs/versioned_docs/version-v3.0.2/explainers/advanced/_category_.json @@ -0,0 +1,6 @@ +{ + "label": "Advanced", + "position": 2, + "collapsible": true, + "collapsed": true +} diff --git a/barretenberg/docs/versioned_docs/version-v3.0.2/explainers/advanced/chonk.md b/barretenberg/docs/versioned_docs/version-v3.0.2/explainers/advanced/chonk.md new file mode 100644 index 000000000000..5f6d8c0020f2 --- /dev/null +++ b/barretenberg/docs/versioned_docs/version-v3.0.2/explainers/advanced/chonk.md @@ -0,0 +1,49 @@ +--- +title: CHONK - Client-side Highly Optimized ploNK +description: Learn about CHONK, Aztec's specialized proving system designed for client-side proving with low memory requirements and efficient recursion for private smart contract execution. +keywords: [chonk, plonk, proving system, recursive proofs, hypernova, goblin plonk, zero knowledge, aztec, client-side proving, hyperplonk, sumcheck] +image: https://hackmd.io/_uploads/BkpsblXEgg.jpg +sidebar_position: 1 +--- + +![CHONK Overview](https://hackmd.io/_uploads/BkpsblXEgg.jpg) + +Aztec's goal is to enable private verifiable execution of smart contracts. This motivates a proving system design where: + +- Proofs can be generated with relatively low memory, so that the prover can be run on a phone or browser. +- Proofs can efficiently incorporate many layers of recursion - as the claims being proven are of a recursive nature - one contract function calls another which calls another etc. + +The second goal indirectly supports the first - efficient recursion goes hand in hand with low memory proving, as statements can be decomposed via recursion into smaller statements that require less prover memory. + +We call the proving system **CHONK - Client-side Highly Optimized ploNK**. As the name suggests, its starting point is the [PlonK proving system](https://eprint.iacr.org/2019/953). + +As in the original PlonK system: + +- It is based on elliptic curves and pairings. +- Circuit constraints are expressed via selector polynomials and copy constraints. + +Its deviations from PlonK, detailed below, are motivated by the above goals. + +## Key Deviations from PlonK + +### 1. Proving statements about a sequence of circuits + +A statement about contract execution will translate to multiple circuits - representing the different contract functions called during the execution. Between each two of these circuits we need to run an Aztec constructed *Kernel circuit* to do "bookkeeping" - like making sure the correct arguments are passed from function to function. More details on this approach can be found in the [Aztec documentation](https://docs.aztec.network) and the [Stackproofs paper](https://eprint.iacr.org/2024/1281). + +### 2. Replacing univariate quotienting by sumcheck + +This eliminates FFT's and reduces prover time and memory at the expense of proof length. This approach is the main theme of the [hyperplonk paper](https://eprint.iacr.org/2022/1355). + +### 3. Using the Hypernova (HN) folding scheme + +Folding schemes enable cheaper recursion than standard recursive proofs. They work most smoothly with elliptic-curve based proofs systems like CHONK. We specifically work with [HyperNova](https://eprint.iacr.org/2023/573) which is convenient and efficient for folding non-uniform PlonK circuits (i.e. not a fixed repeating circuit). + +### 4. Enhancing HN with "Goblin plonk" + +Though HN (as do other folding schemes) already facilitates efficient recursion, it can still be a bit heavy client-side due to the non-native elliptic curve scalar multiplications performed by the folding verifier. For this reason, we use a "lazy" version of HN where the verifier doesn't perform these operations, but rather simply adds them to a queue of EC operations that need to be performed at the final proving stage. We call this deferral mechanism [*Goblin Plonk*](https://hackmd.io/@aztec-network/BkGNaHUJn/%2FdUsu57SOTBiQ4tS9KJMkMQ) (GP) (see also [this paper](https://eprint.iacr.org/2024/1651)). + +The advantage of GP is that at this final stage we transition to another elliptic curve called Grumpkin where these operations are more efficient. This curve-switch approach was initiated by [BCTV](https://eprint.iacr.org/2014/595.pdf), and a good example of it in the modern folding context is [CycleFold](https://eprint.iacr.org/2023/1192). GP is arguably simpler than CycleFold where we switch back and forth between the curves at every iteration of the IVC. The approaches are however incomparable, and for example, CycleFold has the advantage of the final IPA verifier size not growing with the number of iterations. (Although this verifier can be run server-side once for all client proofs using the [Halo](https://eprint.iacr.org/2019/1021)/[BCMS](https://eprint.iacr.org/2020/499) accumulation mechanism.) + +## Learn More + +*For a more colorful video presentation of the above check out [this talk](https://www.youtube.com/watch?v=j6wlamEPKlE).* diff --git a/barretenberg/docs/versioned_docs/version-v3.0.2/explainers/recursive_aggregation.md b/barretenberg/docs/versioned_docs/version-v3.0.2/explainers/recursive_aggregation.md new file mode 100644 index 000000000000..271d14ec120c --- /dev/null +++ b/barretenberg/docs/versioned_docs/version-v3.0.2/explainers/recursive_aggregation.md @@ -0,0 +1,173 @@ +--- +title: Recursive proofs +description: Explore the concept of recursive proofs in Zero-Knowledge programming. Understand how recursion works in Noir, a language for writing smart contracts on the EVM blockchain. Learn through practical examples like Alice and Bob's guessing game, Charlie's recursive merkle tree, and Daniel's reusable components. Discover how to use recursive proofs to optimize computational resources and improve efficiency. + +keywords: + [ + "Recursive Proofs", + "Zero-Knowledge Programming", + "Noir", + "EVM Blockchain", + "Smart Contracts", + "Recursion in Noir", + "Alice and Bob Guessing Game", + "Recursive Merkle Tree", + "Reusable Components", + "Optimizing Computational Resources", + "Improving Efficiency", + "Verification Key", + "Aggregation", + "Recursive zkSNARK schemes", + "PLONK", + "Proving and Verification Keys" + ] +--- + +In programming, we tend to think of recursion as something calling itself. A classic example would be the calculation of the factorial of a number: + +```js +function factorial(n) { + if (n === 0 || n === 1) { + return 1; + } else { + return n * factorial(n - 1); + } +} +``` + +In this case, while `n` is not `1`, this function will keep calling itself until it hits the base case, bubbling up the result on the call stack: + +```md + Is `n` 1? <--------- + /\ / + / \ n = n -1 + / \ / + Yes No -------- +``` + +In Zero-Knowledge, recursion has some similarities. + +It is not a Noir function calling itself, but a proof being used as an input to another circuit. In short, you verify one proof *inside* another proof, returning the proof that both proofs are valid. + +This means that, given enough computational resources, you can prove the correctness of any arbitrary number of proofs in a single proof. This could be useful to design state channels (for which a common example would be [Bitcoin's Lightning Network](https://en.wikipedia.org/wiki/Lightning_Network)), to save on gas costs by settling one proof onchain, or simply to make business logic less dependent on a consensus mechanism. + +## Examples + +Let us look at some of these examples + +### Alice and Bob - Guessing game + +Alice and Bob are friends, and they like guessing games. They want to play a guessing game online, but for that, they need a trusted third-party that knows both of their secrets and finishes the game once someone wins. + +So, they use zero-knowledge proofs. Alice tries to guess Bob's number, and Bob will generate a ZK proof stating whether she succeeded or failed. + +This ZK proof can go on a smart contract, revealing the winner and even giving prizes. However, this means every turn needs to be verified onchain. This incurs some cost and waiting time that may simply make the game too expensive or time-consuming to be worth it. + +As a solution, Alice proposes the following: "what if Bob generates his proof, and instead of sending it onchain, I verify it *within* my own proof before playing my own turn?". + +She can then generate a proof that she verified his proof, and so on. + +```md + Did you fail? <-------------------------- + / \ / + / \ n = n -1 + / \ / + Yes No / + | | / + | | / + | You win / + | / + | / +Generate proof of that / + + / + my own guess ---------------- +``` + +### Charlie - Recursive merkle tree + +Charlie is a concerned citizen, and wants to be sure his vote in an election is accounted for. He votes with a ZK proof, but he has no way of knowing that his ZK proof was included in the total vote count! + +If the vote collector puts all of the votes into a [Merkle tree](https://en.wikipedia.org/wiki/Merkle_tree), everyone can prove the verification of two proofs within one proof, as such: + +```md + abcd + __________|______________ + | | + ab cd + _____|_____ ______|______ + | | | | + alice bob charlie daniel +``` + +Doing this recursively allows us to arrive on a final proof `abcd` which if true, verifies the correctness of all the votes. + +### Daniel - Reusable components + +Daniel has a big circuit and a big headache. A part of his circuit is a setup phase that finishes with some assertions that need to be made. But that section alone takes most of the proving time, and is largely independent of the rest of the circuit. + +He might find it more efficient to generate a proof for that setup phase separately, and verify that proof recursively in the actual business logic section of his circuit. This will allow for parallelization of both proofs, which results in a considerable speedup. + +## What params do I need + +As you can see in the [recursion reference](https://noir-lang.org/docs/noir/standard_library/recursion), a simple recursive proof requires: + +- The proof to verify +- The Verification Key of the circuit that generated the proof +- The public inputs for the proof + +:::info + +Recursive zkSNARK schemes do not necessarily "verify a proof" in the sense that you expect a true or false to be spit out by the verifier. Rather an aggregation object is built over the public inputs. + +So, taking the example of Alice and Bob and their guessing game: + +- Alice makes her guess. Her proof is *not* recursive: it doesn't verify any proof within it! It's just a standard `assert(x != y)` circuit +- Bob verifies Alice's proof and makes his own guess. In this circuit, he doesn't exactly *prove* the verification of Alice's proof. Instead, he *aggregates* his proof to Alice's proof. The actual verification is done when the full proof is verified, for example when using `nargo verify` or through the verifier smart contract. + +We can imagine recursive proofs a [relay race](https://en.wikipedia.org/wiki/Relay_race). The first runner doesn't have to receive the baton from anyone else, as he/she already starts with it. But when his/her turn is over, the next runner needs to receive it, run a bit more, and pass it along. Even though every runner could theoretically verify the baton mid-run (why not? 🏃🔍), only at the end of the race does the referee verify that the whole race is valid. + +::: + +## Some architecture + +As with everything in computer science, there's no one-size-fits all. But there are some patterns that could help understanding and implementing them. To give three examples: + +### Adding some logic to a proof verification + +This would be an approach for something like our guessing game, where proofs are sent back and forth and are verified by each opponent. This circuit would be divided in two sections: + +- A `recursive verification` section, which would be just the call to `std::verify_proof`, and that would be skipped on the first move (since there's no proof to verify) +- A `guessing` section, which is basically the logic part where the actual guessing happens + +In such a situation, and assuming Alice is first, she would skip the first part and try to guess Bob's number. Bob would then verify her proof on the first section of his run, and try to guess Alice's number on the second part, and so on. + +### Aggregating proofs + +In some one-way interaction situations, recursion would allow for aggregation of simple proofs that don't need to be immediately verified onchain or elsewhere. + +To give a practical example, a barman wouldn't need to verify a "proof-of-age" onchain every time he serves alcohol to a customer. Instead, the architecture would comprise two circuits: + +- A `main`, non-recursive circuit with some logic +- A `recursive` circuit meant to verify two proofs in one proof + +The customer's proofs would be intermediate, and made on their phones, and the barman could just verify them locally. He would then aggregate them into a final proof sent onchain (or elsewhere) at the end of the day. + +### Recursively verifying different circuits + +Nothing prevents you from verifying different circuits in a recursive proof, for example: + +- A `circuit1` circuit +- A `circuit2` circuit +- A `recursive` circuit + +In this example, a regulator could verify that taxes were paid for a specific purchase by aggregating both a `payer` circuit (proving that a purchase was made and taxes were paid), and a `receipt` circuit (proving that the payment was received) + +## How fast is it + +At the time of writing, verifying recursive proofs is surprisingly fast. This is because most of the time is spent on generating the verification key that will be used to generate the next proof. So you are able to cache the verification key and reuse it later. + +Currently, Noir JS packages don't expose the functionality of loading proving and verification keys, but that feature exists in the underlying `bb.js` package. + +## How can I try it + +Learn more about using recursion in Nargo and NoirJS in the [how-to guide](../how_to_guides/recursive_aggregation.md) and see a full example in [noir-examples](https://github.com/noir-lang/noir-examples). diff --git a/barretenberg/docs/versioned_docs/version-v3.0.2/getting_started.md b/barretenberg/docs/versioned_docs/version-v3.0.2/getting_started.md new file mode 100644 index 000000000000..5c948b2d8a84 --- /dev/null +++ b/barretenberg/docs/versioned_docs/version-v3.0.2/getting_started.md @@ -0,0 +1,56 @@ +--- +title: Getting Started +hide_title: true +description: Barretenberg is a high-performance zero-knowledge proof system implementation written in C++. It serves as the cryptographic engine powering Aztec's privacy-focused blockchain solutions. The system includes efficient implementations of key cryptographic primitives, constraint system construction, and proof generation optimized for modern hardware. +keywords: + [zero-knowledge proofs, ZK proofs, cryptography, blockchain, privacy, Aztec, C++, PLONK, arithmetic circuits, constraint systems, elliptic curves, performance optimization, zkSNARKs, zero-knowledge] +sidebar_position: 1 +--- + +# Barretenberg + +Barretenberg (or `bb` for short) is an optimized elliptic curve library for the bn128 curve, and a PLONK SNARK prover. + +Although it is a standandalone prover, Barretenberg is designed to be used with [Noir](https://noir-lang.org). It is highly recommended to start by creating a Noir project with the [Noir guickstart guide](https://noir-lang.org/docs/getting_started/quick_start) before this guide! + +## Installation + +Inspired by `rustup`, `noirup` and similar tools, you can use the `bbup` installation script to quickly install and update Barretenberg's CLI tool: + +```bash +curl -L https://raw.githubusercontent.com/AztecProtocol/aztec-packages/refs/heads/next/barretenberg/bbup/install | bash +bbup +``` + +Following these prompts, you should be able to see `bb` binary in `$HOME/.bb/bb`. + +## Usage + +Assuming you have a Noir project, you can use `bb` straight-away to prove by giving it the compiled circuit and the witness (the outputs of `nargo execute`). Since we want to verify the proof later, we also want to write the verification key to a file. Let's do it: + +```bash +bb prove -b ./target/hello_world.json -w ./target/hello_world.gz --write_vk -o target +``` + +This will prove your program and write both a `proof` and a `vk` file to the `target` folder. To verify the proof, you don't need the witness (that would defeat the purpose, wouldn't it?), just the proof and the `vk`: + +```bash +bb verify -p ./target/proof -k ./target/vk +``` + +Congratulations! Using Noir and Barretenberg, your verifier could verify the correctness of a proof, without knowing the private inputs! + +:::info + +You may be asking yourself what happened to the **public inputs**? Barretenberg proofs usually append them to the beginning of the proof. This may or may not be useful, and the next guides will provide you with handy commands to split the proof and the public inputs whenever needed + +::: + +## Next steps + +As cool as it is, proving and verifying on the same machine is not incredibly useful. You may want to do things like: + +- Generating programs that verify proofs in immutable, decentralized ledgers like blockchains +- Verifying proofs within other proofs + +Check out those specific guides in the sidebar. diff --git a/barretenberg/docs/versioned_docs/version-v3.0.2/how_to_guides/_category_.json b/barretenberg/docs/versioned_docs/version-v3.0.2/how_to_guides/_category_.json new file mode 100644 index 000000000000..c24a6410a953 --- /dev/null +++ b/barretenberg/docs/versioned_docs/version-v3.0.2/how_to_guides/_category_.json @@ -0,0 +1,6 @@ +{ + "label": "How to Guides", + "position": 2, + "collapsible": true, + "collapsed": true +} diff --git a/barretenberg/docs/versioned_docs/version-v3.0.2/how_to_guides/how-to-solidity-verifier.md b/barretenberg/docs/versioned_docs/version-v3.0.2/how_to_guides/how-to-solidity-verifier.md new file mode 100644 index 000000000000..02d156f390af --- /dev/null +++ b/barretenberg/docs/versioned_docs/version-v3.0.2/how_to_guides/how-to-solidity-verifier.md @@ -0,0 +1,217 @@ +--- +title: Generate a Solidity Verifier +description: + Learn how to run the verifier as a smart contract on the blockchain. Compile a Solidity verifier + contract for your Noir program and deploy it on any EVM blockchain acting as a verifier smart + contract. Read more to find out +keywords: + [ + solidity verifier, + smart contract, + blockchain, + compiler, + plonk_vk.sol, + EVM blockchain, + verifying Noir programs, + proving backend, + Barretenberg, + ] +sidebar_position: 0 +--- + +This guide shows how to generate a Solidity Verifier with Barretenberg and deploy it on the [Remix IDE](https://remix.ethereum.org/). It is assumed that: + +- You are comfortable with the Solidity programming language and understand how contracts are deployed on the Ethereum network +- You have Noir installed and you have a Noir program. If you don't, [get started](https://noir-lang.org/docs/getting_started/quick_start) with Nargo, then follow through the [Barretenberg quick start](../index.md) +- You are comfortable navigating RemixIDE. If you aren't or you need a refresher, you can find some video tutorials [here](https://www.youtube.com/channel/UCjTUPyFEr2xDGN6Cg8nKDaA) that could help you. + +## Rundown + +Generating a Solidity Verifier with Barretenberg contract is actually a one-command process. However, compiling it and deploying it can have some caveats. Here's the rundown of this guide: + +1. How to generate a solidity smart contract +2. How to compile the smart contract in the RemixIDE +3. How to deploy it to a testnet + +## Step 1 - Generate a solidity contract + +```sh +# Generate the verification key. You need to pass the `--oracle_hash keccak` flag when generating vkey and proving +# to instruct bb to use keccak as the hash function, which is more optimal in Solidity +bb write_vk -b ./target/.json -o ./target --oracle_hash keccak + +# Generate the Solidity verifier from the vkey +bb write_solidity_verifier -k ./target/vk -o ./target/Verifier.sol +``` + +replacing `` with the name of your Noir project. A `Verifier.sol` contract is now in the target folder and can be deployed to any EVM blockchain acting as a verifier smart contract. + +## Step 2 - Compiling + +We will mostly skip the details of RemixIDE, as the UI can change from version to version. For now, we can just open Remix and create a blank workspace. + +![Create Workspace](@site/static/img/how-tos/solidity_verifier_1.png) + +We will create a new file to contain the contract Nargo generated, and copy-paste its content. + +:::warning + +You'll likely see a warning advising you to not trust pasted code. While it is an important warning, it is irrelevant in the context of this guide and can be ignored. We will not be deploying anywhere near a mainnet. + +::: + +To compile our the verifier, we can navigate to the compilation tab: + +![Compilation Tab](@site/static/img/how-tos/solidity_verifier_2.png) + +Remix should automatically match a suitable compiler version. However, hitting the "Compile" button will most likely tell you the contract is too big to deploy on mainnet, or complain about a stack too deep: + +![Contract code too big](@site/static/img/how-tos/solidity_verifier_6.png) +![Stack too deep](@site/static/img/how-tos/solidity_verifier_8.png) + +To avoid this, you can just use some optimization. Open the "Advanced Configurations" tab and enable optimization. The default 200 runs will suffice. + +![Compilation success](@site/static/img/how-tos/solidity_verifier_4.png) + +## Step 3 - Deploying + +At this point we should have a compiled contract ready to deploy. If we navigate to the deploy section in Remix, we will see many different environments we can deploy to. The steps to deploy on each environment would be out-of-scope for this guide, so we will just use the default Remix VM. + +Looking closely, we will notice that our "Solidity Verifier" is composed on multiple contracts working together. Remix will take care of the dependencies for us so we can simply deploy the Verifier contract by selecting it and hitting "deploy": + +![Deploying HonkVerifier](@site/static/img/how-tos/solidity_verifier_7.png) + +A contract will show up in the "Deployed Contracts" section. + +## Step 4 - Verifying + +To verify a proof using the Solidity verifier contract, we call the `verify` function: + +```solidity +function verify(bytes calldata _proof, bytes32[] calldata _publicInputs) external view returns (bool) +``` + +First generate a proof with `bb`. We need a `Prover.toml` file for our inputs. Run: + +```bash +nargo check +``` + +This will generate a `Prover.toml` you can fill with the values you want to prove. We can now execute the circuit with `nargo` and then use the proving backend to prove: + +```bash +nargo execute +bb prove -b ./target/.json -w ./target/ -o ./target --oracle_hash keccak +``` + +Binary Output Format + +Barretenberg outputs `proof` and `public_inputs` files in binary format. The binary format is fields-compatible, meaning it can be split into 32-byte chunks where each chunk represents a field element. + +A programmatic example of how the `verify` function is called can be seen in the example zk voting application [here](https://github.com/noir-lang/noir-examples/blob/33e598c257e2402ea3a6b68dd4c5ad492bce1b0a/foundry-voting/src/zkVote.sol#L35): + +```solidity +function castVote(bytes calldata proof, uint proposalId, uint vote, bytes32 nullifierHash) public returns (bool) { + // ... + bytes32[] memory publicInputs = new bytes32[](4); + publicInputs[0] = merkleRoot; + publicInputs[1] = bytes32(proposalId); + publicInputs[2] = bytes32(vote); + publicInputs[3] = nullifierHash; + require(verifier.verify(proof, publicInputs), "Invalid proof"); +``` + +:::info[Return Values] + +A circuit doesn't have the concept of a return value. Return values are just syntactic sugar in Noir. + +Under the hood, the return value is passed as an input to the circuit and is checked at the end of the circuit program. + +For example, if you have Noir program like this: + +```rust +fn main( + // Public inputs + pubkey_x: pub Field, + pubkey_y: pub Field, + // Private inputs + priv_key: Field, +) -> pub Field +``` + +the `verify` function will expect the public inputs array (second function parameter) to be of length 3, the two inputs and the return value. + +Passing only two inputs will result in an error such as `PUBLIC_INPUT_COUNT_INVALID(3, 2)`. + +In this case, the inputs parameter to `verify` would be an array ordered as `[pubkey_x, pubkey_y, return]`. + +::: + +:::tip[Structs] + +You can pass structs to the verifier contract. They will be flattened so that the array of inputs is 1-dimensional array. + +For example, consider the following program: + +```rust +struct Type1 { + val1: Field, + val2: Field, +} + +struct Nested { + t1: Type1, + is_true: bool, +} + +fn main(x: pub Field, nested: pub Nested, y: pub Field) { + //... +} +``` + +The order of these inputs would be flattened to: `[x, nested.t1.val1, nested.t1.val2, nested.is_true, y]` + +::: + +The other function you can call is our entrypoint `verify` function, as defined above. + +:::tip + +It's worth noticing that the `verify` function is actually a `view` function. A `view` function does not alter the blockchain state, so it doesn't need to be distributed (i.e. it will run only on the executing node), and therefore doesn't cost any gas. + +This can be particularly useful in some situations. If Alice generated a proof and wants Bob to verify its correctness, Bob doesn't need to run Nargo, NoirJS, or any Noir specific infrastructure. He can simply make a call to the blockchain with the proof and verify it is correct without paying any gas. + +It would be incorrect to say that a Noir proof verification costs any gas at all. However, most of the time the result of `verify` is used to modify state (for example, to update a balance, a game state, etc). In that case the whole network needs to execute it, which does incur gas costs (calldata and execution, but not storage). + +::: + +## Compatibility with different EVM chains + +Barretenberg proof verification requires the `ecMul`, `ecAdd`, `ecPairing`, and `modexp` EVM precompiles. You can deploy and use the verifier contract on all EVM chains that support the precompiles. + +EVM Diff provides a great table of which EVM chains support which precompiles: https://www.evmdiff.com/features?feature=precompiles + +Some EVM chains manually tested to work with the Barretenberg verifier include: + +- Optimism +- Arbitrum +- Polygon PoS +- Scroll +- Celo +- BSC +- Blast L2 +- Avalanche C-Chain +- Mode +- Linea +- Moonbeam + +Meanwhile, some EVM chains chains manually tested that failed to work with the Barretenberg verifier include: + +- zkSync ERA +- Polygon zkEVM + +Pull requests to update this section is welcome and appreciated if you have compatibility updates on existing / new chains to contribute: https://github.com/noir-lang/noir + +## What's next + +Now that you know how to call a Noir Solidity Verifier on a smart contract using Remix, you should be comfortable with using it with some programmatic frameworks. You can find other tools, examples, boilerplates and libraries in the [awesome-noir](https://github.com/noir-lang/awesome-noir) repository. diff --git a/barretenberg/docs/versioned_docs/version-v3.0.2/how_to_guides/on-the-browser.md b/barretenberg/docs/versioned_docs/version-v3.0.2/how_to_guides/on-the-browser.md new file mode 100644 index 000000000000..ce2eecec581e --- /dev/null +++ b/barretenberg/docs/versioned_docs/version-v3.0.2/how_to_guides/on-the-browser.md @@ -0,0 +1,210 @@ +--- +title: Barretenberg on the browser +description: Complete guide to using bb.js for zero-knowledge proof generation and verification on the browser or node.js +keywords: [bb.js, barretenberg, proving, verifying, zero-knowledge, TypeScript, JavaScript, browser, node, node.js] +--- + +bb.js is the TypeScript/JavaScript prover and verifier library for Barretenberg. It provides both a command-line interface and a programmatic API for generating and verifying zero-knowledge proofs in Node.js and browser environments. + +## Overview + +bb.js supports multiple proof systems: + +- **UltraHonk**: The current recommended proof system with various hash function options +- **MegaHonk**: Alternative Honk implementation +- **Chonk**: For Aztec-specific client-side proving + +## Installation + +### As a Library + +Install bb.js as a dependency in your project: + +```bash +npm install @aztec/bb.js +``` + +or with yarn: + +```bash +yarn add @aztec/bb.js +``` + +## Proving and Verifying with UltraHonk + +### Using the UltraHonkBackend Class + +The `UltraHonkBackend` class provides a high-level interface for proof generation and verification. You can import any specific backend (i.e. UltraHonk): + +```typescript +import { UltraHonkBackend } from '@aztec/bb.js'; +``` + + +Using a precompiled program and a witness from `nargo execute`, you can directly import it and initialize the backend: + +```typescript +// Load circuit bytecode (from Noir compiler output) +const circuitPath = path.join(__dirname, 'fixtures/main/target/program.json'); +const circuitJson = JSON.parse(readFileSync(circuitPath, 'utf8')); +const bytecode = circuitJson.bytecode; + +// Load witness data +const witnessPath = path.join(__dirname, 'fixtures/main/target/program.gz'); +const witnessBuffer = readFileSync(witnessPath); + +// Initialize backend +const backend = new UltraHonkBackend(bytecode); +``` + + +And just prove it using the witness: + +```typescript +// Generate proof for EVM verification (uses keccak hash, no ZK) +const proofData: ProofData = await backend.generateProof(witnessBuffer, { + verifierTarget: 'evm-no-zk', +}); + +const provingTime = Date.now() - startTime; +console.log(`Proof generated in ${provingTime}ms`); +console.log(`Proof size: ${proofData.proof.length} bytes`); +console.log(`Public inputs: ${proofData.publicInputs.length}`); +``` + + +Verification is similarly simple: + +```typescript +// Verify the proof +console.log('Verifying proof...'); +const isValid = await backend.verifyProof(proofData, { verifierTarget: 'evm-no-zk' }); +console.log(`Proof verification: ${isValid ? 'SUCCESS' : 'FAILED'}`); +``` + + +### Verifier Targets + +UltraHonk supports different verifier targets for different verification environments. The `verifierTarget` option configures the hash function and zero-knowledge settings automatically: + +- `evm` / `evm-no-zk`: For Ethereum/Solidity verification (uses keccak) +- `noir-recursive` / `noir-recursive-no-zk`: For recursive verification in Noir circuits (uses poseidon2) +- `noir-rollup` / `noir-rollup-no-zk`: For rollup circuits with IPA accumulation (uses poseidon2) +- `starknet` / `starknet-no-zk`: For Starknet verification via Garaga + +```typescript +// Default: recursive verification in Noir (poseidon2, ZK enabled) +const proof = await backend.generateProof(witnessBuffer); +expect(proof.proof.length).toBeGreaterThan(0); + +// EVM verification without ZK (keccak hash) +const proofEvm = await backend.generateProof(witnessBuffer, { verifierTarget: 'evm-no-zk' }); +expect(proofEvm.proof.length).toBeGreaterThan(0); + +// EVM verification with ZK (keccak hash) +const proofEvmZk = await backend.generateProof(witnessBuffer, { verifierTarget: 'evm' }); +expect(proofEvmZk.proof.length).toBeGreaterThan(0); + +// Recursive verification in Noir (explicit) +const proofRecursive = await backend.generateProof(witnessBuffer, { verifierTarget: 'noir-recursive' }); +expect(proofRecursive.proof.length).toBeGreaterThan(0); +``` + + +### Getting Verification Keys (VK) + +```typescript +// Get verification key for recursive verification (default) +const vk = await backend.getVerificationKey(); + +// For a solidity verifier (EVM target): +const vkEvm = await backend.getVerificationKey({ verifierTarget: 'evm-no-zk' }); +``` + + +### Getting Solidity Verifier + +The solidity verifier _is_ the VK, but with some logic that allows for non-interactive verification: + +```typescript +// Needs the EVM target VK (uses keccak hash) +const solidityContract = await backend.getSolidityVerifier(vkEvm, { verifierTarget: 'evm-no-zk' }); +``` + + +## Using the Low-Level API + +For more control, you can use the Barretenberg API directly: + +```typescript +const api = await Barretenberg.new({ threads: 1 }); + +// Blake2s hashing +const input = Buffer.from('hello world!'); +const hash = await api.blake2s(input); + +// Pedersen commitment +const left = Fr.random(); +const right = Fr.random(); +const commitment = await api.pedersenCommit([left, right], 0); + +await api.destroy(); +``` + + +## Browser Environment Considerations + +### Multithreading Support + +To enable multithreading in browsers using some frameworks (ex. Next.js), you may need to set COOP and COEP headers: + +```javascript +// Next.js example configuration +{ + async headers() { + return [ + { + source: '/:path*', + headers: [ + { key: 'Cross-Origin-Embedder-Policy', value: 'require-corp' }, + { key: 'Cross-Origin-Opener-Policy', value: 'same-origin' }, + ], + }, + ]; + }, +} +``` + +## Performance Optimization + +### Thread Configuration + +You can define specific thread counts in case you need the cores for other things in your app: + +```typescript +// Auto-detect optimal thread count (default) +const api = await Barretenberg.new(); + +// Manual thread configuration +const api = await Barretenberg.new({ + threads: Math.min(navigator.hardwareConcurrency || 1, 8) +}); + +// Single-threaded for compatibility +const api = await Barretenberg.new({ threads: 1 }); +``` + +### Memory Management + +It can be useful to manage memory manually, specially if targeting specific memory-constrained environments (ex. Safari): + +```typescript +// Configure initial and maximum memory +const api = await Barretenberg.new({ + threads: 4, + memory: { + initial: 128 * 1024 * 1024, // 128MB + maximum: 512 * 1024 * 1024 // 512MB + } +}); +``` diff --git a/barretenberg/docs/versioned_docs/version-v3.0.2/how_to_guides/recursive_aggregation.md b/barretenberg/docs/versioned_docs/version-v3.0.2/how_to_guides/recursive_aggregation.md new file mode 100644 index 000000000000..9984bf3dc543 --- /dev/null +++ b/barretenberg/docs/versioned_docs/version-v3.0.2/how_to_guides/recursive_aggregation.md @@ -0,0 +1,213 @@ +--- +title: Recursive Aggregation +description: Learn how to implement recursion with bb.js, a powerful tool for creating smart contracts on the EVM blockchain. This guide assumes familiarity with NoirJS, solidity verifiers, and the Barretenberg proving backend. Discover how to generate both final and intermediate proofs using `noir_js` and `bb.js`. +keywords: + [ + "NoirJS", + "EVM blockchain", + "smart contracts", + "recursion", + "solidity verifiers", + "Barretenberg backend", + "noir_js", + "intermediate proofs", + "final proofs", + "nargo compile", + "json import", + "recursive circuit", + "recursive app" + ] +--- + +This guide shows you how to prove recursive programs using `bb.js`. We will be using Noir as the frontend language. + +For the sake of clarity, it is assumed that: + +- You already have a NoirJS app. If you don't, please visit the [NoirJS tutorial](https://noir-lang.org/docs/tutorials/noirjs_app) and the [reference](https://noir-lang.org/docs/reference/NoirJS/noir_js). +- You are familiar with what are recursive proofs and you have read the [recursion explainer](../explainers/recursive_aggregation.md) +- You already built a recursive circuit following [the reference](https://noir-lang.org/docs/noir/standard_library/recursion), and understand how it works. + +It is also assumed that you're **not** using `noir_wasm` for compilation, and instead you've used [`nargo compile`](https://noir-lang.org/docs/reference/nargo_commands#nargo-compile) to generate the `json` you're now importing into your project. + +## Step 1: Setup + +In a standard recursive app, you're dealing with at least two circuits: + +- `main` or `inner`: a circuit of type `assert(x != y)`, which we want to embed in another circuit recursively. +- `recursive` or `outer`: a circuit that verifies `main`. + +First, let's import the necessary modules and set up our circuits: + +```typescript +import { UltraHonkBackend, ProofData, Barretenberg, RawBuffer, deflattenFields } from '@aztec/bb.js'; +import { Noir } from '@noir-lang/noir_js'; +``` + + +Then we need to load our circuit bytecode and set up the Noir instances: + +```typescript +// Load main circuit bytecode +const mainCircuitPath = path.join(__dirname, 'fixtures/main/target/program.json'); +const mainCircuitJson = JSON.parse(readFileSync(mainCircuitPath, 'utf8')); +const mainBytecode = mainCircuitJson.bytecode; + +// Load recursive circuit bytecode +const recursiveCircuitPath = path.join(__dirname, 'fixtures/recursive/target/recursive.json'); +const recursiveCircuitJson = JSON.parse(readFileSync(recursiveCircuitPath, 'utf8')); +const recursiveBytecode = recursiveCircuitJson.bytecode; + +// Create Noir instances +mainNoir = new Noir(mainCircuitJson); +recursiveNoir = new Noir(recursiveCircuitJson); +``` + + +The first program can be anything, so we should focus on the second one. The circuit could be something like so: + +```rust +global HONK_VK_SIZE: u32 = 112; +global HONK_PROOF_SIZE: u32 = 456; +global HONK_IDENTIFIER: u32 = 1; + +fn main( + verification_key: [Field; HONK_VK_SIZE], + proof: [Field; HONK_PROOF_SIZE], + public_inputs: pub [Field; 1], +) { + std::verify_proof_with_type( + verification_key, + proof, + public_inputs, + 0x0, + HONK_IDENTIFIER, + ); +} +``` + +A common scenario is one where you want to create a proof of multiple proof verifications, like a binary tree. Some projects and demos like [billion zk voters](https://github.com/jordan-public/billion-zk-voters) and [the 2023 progcrypto activation demo](https://github.com/signorecello/progcrypto23-act) are examples of 2-in-1 circuits. + +:::info Proof Types + +Different proof systems can have different proof and VK sizes and types. You need to plan this in advance depending on your proof. + +In this case we're using the default HONK proof. + +::: + +## Step 2: Witness generation + +As with every Noir program, you need to execute it and generate the witness. This is no different from a regular `noir.js` program, except you want to do it twice: + +```typescript +// Generate witness for main circuit +const { witness: mainWitness } = await mainNoir.execute({ x: 1, y: 2 }); + +// Note: recursiveWitness will be generated later after we have the proof inputs +// const { witness: recursiveWitness } = await recursiveNoir.execute(recursiveInputs); +``` + + +:::warning + +Noir will generate a witness which doesn't mean it is constrained or valid. The proving backend (in this case Barretenberg) is responsible for the generation of the proof. + +This is why you should refer this technique as "recursive aggregation" instead of "recursion". + +::: + +:::warning + +Always keep in mind what is actually happening on your development process, otherwise you'll quickly become confused about what circuit we are actually running and why! + +In this case, you can imagine that Alice (running the `main` circuit) is proving something to Bob (running the `recursive` circuit), and Bob is verifying her proof within his proof. + +With this in mind, it becomes clear that our intermediate proof is the one *meant to be verified within another circuit*, so it must be Alice's. Actually, the only final proof in this theoretical scenario would be the last one, sent onchain. + +::: + +## Step 3 - Proving Backend + +With the witness, we are now moving into actually proving. In this example, we will be using `bb.js` for generating the proof and the verification key of the inner circuit. + +Since we're using Honk proofs, let's instantiate the UltraHonkBackend just as in the [browser how-to-guide](./on-the-browser.md): + +```typescript +// Setup backend for main circuit (inner circuit) +mainBackend = new UltraHonkBackend(mainBytecode, { threads: 8 }, { recursive: true }); + +// Setup backend for recursive circuit (outer circuit) +recursiveBackend = new UltraHonkBackend(recursiveBytecode, { threads: 8 }, { recursive: false }); +``` + + +:::tip + +We're setting 8 threads here, but you can use the `os.cpus()` object in nodejs or `navigator.hardwareConcurrency` on the browser to make the most out of those cpu cores + +::: + +We can now generate the proof and the verification key (VK), for example: + +```typescript +// Generate proof for main circuit for EVM verification with ZK +const mainProofData = await mainBackend.generateProof(mainWitness, { + verifierTarget: 'evm', +}); + +// Generate verification key for main circuit +const mainVerificationKey = await mainBackend.getVerificationKey({ + verifierTarget: 'evm', +}); +``` + + +:::info + +One common mistake is to forget *who* generates the verification key. + +In a situation where Alice and Bob are playing a battleships game and Alice is proving to Bob that he shot an aircraft carrier, **Bob** should generate the verification key himself. If Bob just accepts the proof and the VK from Alice, this means Alice could prove any circuit (i.e. 1 != 2) instead of the actual "proof that Bob sinked my ship" + +::: + +We now need to prepare our inputs to be fed correctly into the recursive program. This means getting the VK and the proof as fields. We can use the default Barretenberg API for this: + +```typescript +// Convert proof and VK to fields for recursive circuit +const barretenbergAPI = await Barretenberg.new({ threads: 1 }); +const vkAsFields = (await barretenbergAPI.acirVkAsFieldsUltraHonk(new RawBuffer(mainVerificationKey))).map(field => + field.toString(), +); + +recursiveInputs = { + proof: deflattenFields(mainProofData.proof), + public_inputs: [2], + verification_key: vkAsFields, +}; + +await barretenbergAPI.destroy(); +``` + + +## Step 4 - Recursive proof generation + +Having the proof and the VK in the correct format, generating a recursive proof is no different from a normal proof. You simply use the `backend` (with the recursive circuit) to generate it: + +```typescript +// Generate witness for recursive circuit +const { witness: recursiveWitness } = await recursiveNoir.execute(recursiveInputs); + +// Generate recursive proof +const recursiveProofData = await recursiveBackend.generateProof(recursiveWitness); +``` + + +You can obviously chain this proof into another proof. In fact, if you're using recursive proofs, you're probably interested of using them this way! + +## Example + +You can find a non-exaustive example of recursive aggregation in the [noir-examples](https://github.com/noir-lang/noir-examples/tree/master/recursion) repository. + +Keep in mind that recursive proof aggregation is very much an experimental way of using Barretenberg, and you may need to tweak or downgrade versions. + +[Join the Noir discord](https://discord.gg/noirlang) for discussions, feedback and questions about anything regarding Noir and BB. diff --git a/barretenberg/docs/versioned_docs/version-v3.0.2/index.md b/barretenberg/docs/versioned_docs/version-v3.0.2/index.md new file mode 100644 index 000000000000..26c6eae6292a --- /dev/null +++ b/barretenberg/docs/versioned_docs/version-v3.0.2/index.md @@ -0,0 +1,121 @@ +# Barretenberg + +Barretenberg is a C++ library that implements various Zero-Knowledge Succinct Non-interactive Arguments of Knowledge (zk-SNARK) proof systems, cryptographic primitives, and supporting infrastructure. It's designed for efficiency, security, and flexibility, making it suitable for a wide range of applications requiring privacy-preserving computations. + +## Key Features + +- **Multiple Proof Systems**: Supports several zkSNARK implementations including: + - **UltraHonk**: A newer, more efficient PLONKish proving system + - **Chonk**: A proving scheme optimized for [Aztec](https://aztec.network) client-side smart contract execution + +- **Recursive Proof Verification**: Ability to verify proofs within proofs + +- **Cryptographic Primitives**: + - Elliptic curve operations (BN254, Grumpkin, Secp256k1) + - Hash functions (Blake2s, Blake3s, Keccak/SHA-3) + - Digital signatures (Schnorr, ECDSA) + - Pedersen commitments + +- **zkSNARK Infrastructure**: + - Polynomial commitment schemes (KZG, IPA) + - Sumcheck protocol with and without zero-knowledge + - Circuit building tools + - Execution trace management + +- **Advanced Features**: + - Memory operations (ROM/RAM) + - Lookup tables (Plookup) + - Efficient multi-scalar multiplication + +## Relationship with Noir + +Barretenberg serves as the cryptographic backend for [Noir](https://noir-lang.org), a domain-specific language for creating and verifying zero-knowledge proofs. The relationship works as follows: + +1. **Noir Compilation**: Noir programs are compiled into ACIR (Abstract Circuit Intermediate Representation) +2. **ACIR Processing**: Barretenberg takes the ACIR instructions and converts them into a circuit representation +3. **Witness Generation**: Based on actual input values, Barretenberg computes a witness for the circuit +4. **Proof Generation**: Barretenberg creates a zero-knowledge proof that the computation was performed correctly +5. **Verification**: The proof can be verified using Barretenberg's verification algorithms, including onchain via Solidity verifiers + +This integration allows Noir developers to focus on writing application logic while Barretenberg handles the complex cryptographic operations underneath. + +## Core Components + +### bbup + +A versioning tool allowing to install arbitrary versions of Barretenberg, as well as versions compatible with installed Nargo versions. + +### bb Command Line Interface + +The `bb` command line interface is the primary way to interact with Barretenberg directly. It provides commands for operations such as: + +- Proving and verifying circuits +- Generating verification keys +- Creating Solidity verifiers for onchain verification +- Executing and verifying recursive proofs + +### bb.js + +bb.js is a TypeScript library that wraps the Barretenberg C++ implementation via WebAssembly (WASM) bindings. It allows developers to use Barretenberg's functionality directly in JavaScript/TypeScript environments, including browsers and Node.js. + +### Proof Systems + +#### UltraHonk + +UltraHonk is an advanced proof system that offers improvements over the legacy UltraPlonk: + +- More efficient proving times +- Reduced memory usage +- Enhanced recursive proving capabilities + +### Blockchain Integration + +As the name implies, SNARKs are non-interactive, making them suitable to be verified in smart contracts. This enables applications where: + +1. Verification happens onchain (ensuring trustlessness) +2. Private data remains hidden while correctness is verified + +Barretenberg produces Solidity smart contracts meant to be used on several EVM networks, as long as they implement the `ecMul`, `ecAdd`, `ecPairing`, and `modexp` EVM precompiles. For example: + +- Ethereum +- Optimism +- Arbitrum +- Polygon PoS +- Scroll +- Celo +- BSC +- And many others + +Several teams have been writing Barretenberg verifier implementations for other frameworks, for example [Starknet's Garaga](https://garaga.gitbook.io/garaga/deploy-your-snark-verifier-on-starknet/noir). + +## Use Cases + +Barretenberg and Noir together enable a wide range of privacy-preserving applications: + +- Private transactions and token transfers +- Anonymous voting systems +- Zero-knowledge identity verification +- Private credentials and attestations +- Confidential smart contracts +- Secure multi-party computation +- Private order books and marketplaces + +## Technical Architecture + +Barretenberg is organized into several key modules: + +- **Core Cryptography**: Finite field arithmetic, elliptic curve operations +- **Constraint Systems**: Circuit representations and constraint management +- **Proving Systems**: Implementation of various proving schemes +- **Commitment Schemes**: Polynomial commitment methods +- **DSL (Domain Specific Language)**: Interfaces with ACIR from Noir +- **Execution**: Witness generation and computation +- **Verification**: Proof verification both native and onchain + +## Further Resources + +- [Noir Documentation](https://noir-lang.org/docs) +- [Aztec Protocol](https://aztec.network/) +- [Awesome Noir](https://github.com/noir-lang/awesome-noir) - Collection of resources, tools and examples + + diff --git a/barretenberg/docs/versioned_sidebars/version-v3.0.2-sidebars.json b/barretenberg/docs/versioned_sidebars/version-v3.0.2-sidebars.json new file mode 100644 index 000000000000..1776326a6888 --- /dev/null +++ b/barretenberg/docs/versioned_sidebars/version-v3.0.2-sidebars.json @@ -0,0 +1,47 @@ +{ + "sidebar": [ + { + "type": "doc", + "id": "index" + }, + { + "type": "html", + "value": "
", + "defaultStyle": true + }, + { + "type": "doc", + "id": "getting_started" + }, + { + "type": "category", + "label": "How To Guides", + "items": [ + { + "type": "autogenerated", + "dirName": "how_to_guides" + } + ] + }, + { + "type": "category", + "label": "Explainers", + "items": [ + { + "type": "autogenerated", + "dirName": "explainers" + } + ] + }, + { + "type": "html", + "value": "
", + "defaultStyle": true + }, + { + "type": "html", + "value": "C++ API Reference", + "defaultStyle": true + } + ] +} diff --git a/barretenberg/docs/versions.json b/barretenberg/docs/versions.json index 77479365c8ac..d062f9608f40 100644 --- a/barretenberg/docs/versions.json +++ b/barretenberg/docs/versions.json @@ -1,5 +1,6 @@ [ "v3.0.0-nightly.20251214", + "v3.0.2", "v3.0.1", "v0.87.0" ] diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-cli/_category_.json b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-cli/_category_.json new file mode 100644 index 000000000000..cf227211be18 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-cli/_category_.json @@ -0,0 +1,6 @@ +{ + "label": "Aztec CLI", + "position": 4, + "collapsible": true, + "collapsed": true +} diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-cli/cli_reference.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-cli/cli_reference.md new file mode 100644 index 000000000000..ba10341ffe97 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-cli/cli_reference.md @@ -0,0 +1,2386 @@ +--- +title: Reference +description: Comprehensive auto-generated reference for the Aztec CLI command-line interface with all commands and options. +tags: [cli, reference, autogenerated] +sidebar_position: 2 +--- + +# Aztec CLI Reference + +*This documentation is auto-generated from the `aztec` CLI help output.* + +*Generated: Tue Nov 11 00:40:17 HKT 2025* + +*Command: `aztec`* + +## Table of Contents + +- [aztec](#aztec) + - [aztec add-contract](#aztec-add-contract) + - [aztec add-l1-validator](#aztec-add-l1-validator) + - [aztec advance-epoch](#aztec-advance-epoch) + - [aztec authorize-action](#aztec-authorize-action) + - [aztec block-number](#aztec-block-number) + - [aztec bridge-erc20](#aztec-bridge-erc20) + - [aztec bridge-fee-juice](#aztec-bridge-fee-juice) + - [aztec cancel-tx](#aztec-cancel-tx) + - [aztec codegen](#aztec-codegen) + - [aztec compute-selector](#aztec-compute-selector) + - [aztec create-account](#aztec-create-account) + - [aztec create-authwit](#aztec-create-authwit) + - [aztec debug-rollup](#aztec-debug-rollup) + - [aztec decode-enr](#aztec-decode-enr) + - [aztec deploy](#aztec-deploy) + - [aztec deploy-account](#aztec-deploy-account) + - [aztec deploy-l1-contracts](#aztec-deploy-l1-contracts) + - [aztec deploy-new-rollup](#aztec-deploy-new-rollup) + - [aztec deposit-governance-tokens](#aztec-deposit-governance-tokens) + - [aztec example-contracts](#aztec-example-contracts) + - [aztec execute-governance-proposal](#aztec-execute-governance-proposal) + - [aztec fast-forward-epochs](#aztec-fast-forward-epochs) + - [aztec generate-bls-keypair](#aztec-generate-bls-keypair) + - [aztec generate-bootnode-enr](#aztec-generate-bootnode-enr) + - [aztec generate-keys](#aztec-generate-keys) + - [aztec generate-l1-account](#aztec-generate-l1-account) + - [aztec generate-p2p-private-key](#aztec-generate-p2p-private-key) + - [aztec generate-secret-and-hash](#aztec-generate-secret-and-hash) + - [aztec get-account](#aztec-get-account) + - [aztec get-accounts](#aztec-get-accounts) + - [aztec get-block](#aztec-get-block) + - [aztec get-canonical-sponsored-fpc-address](#aztec-get-canonical-sponsored-fpc-address) + - [aztec get-contract-data](#aztec-get-contract-data) + - [aztec get-current-base-fee](#aztec-get-current-base-fee) + - [aztec get-l1-addresses](#aztec-get-l1-addresses) + - [aztec get-l1-balance](#aztec-get-l1-balance) + - [aztec get-l1-to-l2-message-witness](#aztec-get-l1-to-l2-message-witness) + - [aztec get-logs](#aztec-get-logs) + - [aztec get-node-info](#aztec-get-node-info) + - [aztec get-pxe-info](#aztec-get-pxe-info) + - [aztec get-tx](#aztec-get-tx) + - [aztec import-test-accounts](#aztec-import-test-accounts) + - [aztec inspect-contract](#aztec-inspect-contract) + - [aztec parse-parameter-struct](#aztec-parse-parameter-struct) + - [aztec preload-crs](#aztec-preload-crs) + - [aztec profile](#aztec-profile) + - [aztec propose-with-lock](#aztec-propose-with-lock) + - [aztec prune-rollup](#aztec-prune-rollup) + - [aztec register-contract](#aztec-register-contract) + - [aztec register-sender](#aztec-register-sender) + - [aztec remove-l1-validator](#aztec-remove-l1-validator) + - [aztec send](#aztec-send) + - [aztec sequencers](#aztec-sequencers) + - [aztec setup-protocol-contracts](#aztec-setup-protocol-contracts) + - [aztec simulate](#aztec-simulate) + - [aztec start](#aztec-start) + - [aztec trigger-seed-snapshot](#aztec-trigger-seed-snapshot) + - [aztec update](#aztec-update) + - [aztec validator-keys|valKeys](#aztec-validator-keys|valkeys) + - [aztec vote-on-governance-proposal](#aztec-vote-on-governance-proposal) +## aztec + +Aztec command line interface + +**Usage:** +```bash +aztec [options] [command] +``` + +**Available Commands:** + +- `add-contract [options]` - Adds an existing contract to the PXE. This is useful if you have deployed a contract outside of the PXE and want to use it with the PXE. +- `add-l1-validator [options]` - Adds a validator to the L1 rollup contract via a direct deposit. +- `advance-epoch [options]` - Use L1 cheat codes to warp time until the next epoch. +- `authorize-action [options] ` - Authorizes a public call on the caller, so they can perform an action on behalf of the provided account +- `block-number [options]` - Gets the current Aztec L2 block number. +- `bridge-erc20 [options] ` - Bridges ERC20 tokens to L2. +- `bridge-fee-juice [options] ` - Mints L1 Fee Juice and pushes them to L2. +- `cancel-tx [options] ` - Cancels a pending tx by reusing its nonce with a higher fee and an empty payload +- `codegen [options] ` - Validates and generates an Aztec Contract ABI from Noir ABI. +- `compute-selector ` - Given a function signature, it computes a selector +- `create-account [options]` - Creates an aztec account that can be used for sending transactions. +- `create-authwit [options] ` - Creates an authorization witness that can be privately sent to a caller so they can perform an action on behalf of the provided account +- `debug-rollup [options]` - Debugs the rollup contract. +- `decode-enr ` - Decodes an ENR record +- `deploy [options] [artifact]` - Deploys a compiled Aztec.nr contract to Aztec. +- `deploy-account [options]` - Deploys an already registered aztec account that can be used for sending transactions. +- `deploy-l1-contracts [options]` - Deploys all necessary Ethereum contracts for Aztec. +- `deploy-new-rollup [options]` - Deploys a new rollup contract and adds it to the registry (if you are the owner). +- `deposit-governance-tokens [options]` - Deposits governance tokens to the governance contract. +- `example-contracts` - Lists the example contracts available to deploy from @aztec/noir-contracts.js +- `execute-governance-proposal [options]` - Executes a governance proposal. +- `fast-forward-epochs [options]` - Fast forwards the epoch of the L1 rollup contract. +- `generate-bls-keypair [options]` - Generate a BLS keypair with convenience flags +- `generate-bootnode-enr [options] ` - Generates the encoded ENR record for a bootnode. +- `generate-keys [options]` - Generates encryption and signing private keys. +- `generate-l1-account [options]` - Generates a new private key for an account on L1. +- `generate-p2p-private-key` - Generates a LibP2P peer private key. +- `generate-secret-and-hash` - Generates an arbitrary secret (Fr), and its hash (using aztec-nr defaults) +- `get-account [options]
` - Gets an account given its Aztec address. +- `get-accounts [options]` - Gets all the Aztec accounts stored in the PXE. +- `get-block [options] [blockNumber]` - Gets info for a given block or latest. +- `get-canonical-sponsored-fpc-address` - Gets the canonical SponsoredFPC address for this any testnet running on the same version as this CLI +- `get-contract-data [options] ` - Gets information about the Aztec contract deployed at the specified address. +- `get-current-base-fee [options]` - Gets the current base fee. +- `get-l1-addresses [options]` - Gets the addresses of the L1 contracts. +- `get-l1-balance [options] ` - Gets the balance of an ERC token in L1 for the given Ethereum address. +- `get-l1-to-l2-message-witness [options]` - Gets a L1 to L2 message witness. +- `get-logs [options]` - Gets all the public logs from an intersection of all the filter params. +- `get-node-info [options]` - Gets the information of an Aztec node from a PXE or directly from an Aztec node. +- `get-pxe-info [options]` - Gets the information of a PXE at a URL. +- `get-tx [options] [txHash]` - Gets the status of the recent txs, or a detailed view if a specific transaction hash is provided +- `help [command]` - display help for command +- `import-test-accounts [options]` - Import test accounts from pxe. +- `inspect-contract ` - Shows list of external callable functions for a contract +- `parse-parameter-struct [options] ` - Helper for parsing an encoded string into a contract's parameter struct. +- `preload-crs` - Preload the points data needed for proving and verifying +- `profile [options] ` - Profiles a private function by counting the unconditional operations in its execution steps +- `propose-with-lock [options]` - Makes a proposal to governance with a lock +- `prune-rollup [options]` - Prunes the pending chain on the rollup contract. +- `register-contract [options] [address] [artifact]` - Registers a contract in this wallet's PXE +- `register-sender [options] [address]` - Registers a sender's address in the wallet, so the note synching process will look for notes sent by them +- `remove-l1-validator [options]` - Removes a validator to the L1 rollup contract. +- `send [options] ` - Calls a function on an Aztec contract. +- `sequencers [options] [who]` - Manages or queries registered sequencers on the L1 rollup contract. +- `setup-protocol-contracts [options]` - Bootstrap the blockchain by initializing all the protocol contracts +- `simulate [options] ` - Simulates the execution of a function on an Aztec contract. +- `start [options]` - Starts Aztec modules. Options for each module can be set as key-value pairs (e.g. "option1=value1,option2=value2") or as environment variables. +- `trigger-seed-snapshot [options]` - Triggers a seed snapshot for the next epoch. +- `update [options] [projectPath]` - Updates Nodejs and Noir dependencies +- `validator-keys|valKeys` - Manage validator keystores for node operators +- `vote-on-governance-proposal [options]` - Votes on a governance proposal. + +**Options:** + +- `-V --version` - output the version number +- `-h --help` - display help for command + + +### Subcommands + +### aztec add-contract + +``` +Usage: aztec add-contract [options] + +Adds an existing contract to the PXE. This is useful if you have deployed a +contract outside of the PXE and want to use it with the PXE. + +Options: + -c, --contract-artifact A compiled Aztec.nr contract's ABI in JSON format or name of a contract ABI exported by @aztec/noir-contracts.js + -ca, --contract-address
Aztec address of the contract. + --init-hash Initialization hash + --salt Optional deployment salt + -p, --public-key Optional public key for this contract + --portal-address
Optional address to a portal contract on L1 + --deployer-address
Optional address of the contract deployer + -u, --rpc-url URL of the PXE (default: "http://host.docker.internal:8080", env: PXE_URL) + -h, --help display help for command + +``` + +### aztec add-l1-validator + +``` +Usage: aztec add-l1-validator [options] + +Adds a validator to the L1 rollup contract via a direct deposit. + +Options: + --l1-rpc-urls List of Ethereum host URLs. Chain identifiers + localhost and testnet can be used (comma + separated) (default: + ["http://host.docker.internal:8545"], env: + ETHEREUM_HOSTS) + --network Network to execute against (env: NETWORK) + -pk, --private-key The private key to use sending the transaction + -m, --mnemonic The mnemonic to use sending the transaction + (default: "test test test test test test test + test test test test junk") + -c, --l1-chain-id Chain ID of the ethereum host (default: 31337, + env: L1_CHAIN_ID) + --attester
ethereum address of the attester + --withdrawer
ethereum address of the withdrawer + --bls-secret-key The BN254 scalar field element used as a secret + key for BLS signatures. Will be associated with + the attester address. + --move-with-latest-rollup Whether to move with the latest rollup (default: + true) + --rollup Rollup contract address + -h, --help display help for command + +``` + +### aztec advance-epoch + +``` +Usage: aztec advance-epoch [options] + +Use L1 cheat codes to warp time until the next epoch. + +Options: + --l1-rpc-urls List of Ethereum host URLs. Chain identifiers + localhost and testnet can be used (comma separated) + (default: ["http://host.docker.internal:8545"], env: + ETHEREUM_HOSTS) + -u, --rpc-url URL of the PXE (default: + "http://host.docker.internal:8080", env: PXE_URL) + -h, --help display help for command + +``` + +### aztec authorize-action + +``` +Usage: aztec authorize-action [options] + +Authorizes a public call on the caller, so they can perform an action on behalf +of the provided account + +Arguments: + functionName Name of function to authorize + caller Account to be authorized to perform the action + +Options: + -u, --rpc-url URL of the PXE (default: "http://host.docker.internal:8080", env: PXE_URL) + --args [args...] Function arguments (default: []) + -ca, --contract-address
Aztec address of the contract. + -c, --contract-artifact Path to a compiled Aztec contract's artifact in JSON format. If executed inside a nargo workspace, a package and contract name can be specified as package@contract + -sk, --secret-key The sender's secret key (env: SECRET_KEY) + -h, --help display help for command + +``` + +### aztec block-number + +``` +Usage: aztec block-number [options] + +Gets the current Aztec L2 block number. + +Options: + -u, --rpc-url URL of the PXE (default: + "http://host.docker.internal:8080", env: PXE_URL) + -h, --help display help for command + +``` + +### aztec bridge-erc20 + +``` +Usage: aztec bridge-erc20 [options] + +Bridges ERC20 tokens to L2. + +Arguments: + amount The amount of Fee Juice to mint and bridge. + recipient Aztec address of the recipient. + +Options: + --l1-rpc-urls List of Ethereum host URLs. Chain identifiers + localhost and testnet can be used (comma + separated) (default: + ["http://host.docker.internal:8545"], env: + ETHEREUM_HOSTS) + -m, --mnemonic The mnemonic to use for deriving the Ethereum + address that will mint and bridge (default: "test + test test test test test test test test test test + junk") + --mint Mint the tokens on L1 (default: false) + --private If the bridge should use the private flow + (default: false) + -c, --l1-chain-id Chain ID of the ethereum host (default: 31337, + env: L1_CHAIN_ID) + -t, --token The address of the token to bridge + -p, --portal The address of the portal contract + -f, --faucet The address of the faucet contract (only used if + minting) + --l1-private-key The private key to use for deployment + --json Output the claim in JSON format + -h, --help display help for command + +``` + +### aztec bridge-fee-juice + +``` +Usage: aztec bridge-fee-juice [options] + +Mints L1 Fee Juice and pushes them to L2. + +Arguments: + amount The amount of Fee Juice to mint and bridge. + recipient Aztec address of the recipient. + +Options: + --l1-rpc-urls List of Ethereum host URLs. Chain identifiers + localhost and testnet can be used (comma + separated) (default: + ["http://host.docker.internal:8545"]) + -m, --mnemonic The mnemonic to use for deriving the Ethereum + address that will mint and bridge (default: "test + test test test test test test test test test test + junk") + --mint Mint the tokens on L1 (default: false) + --l1-private-key The private key to the eth account bridging + -u, --rpc-url URL of the PXE (default: + "http://host.docker.internal:8080", env: PXE_URL) + -c, --l1-chain-id Chain ID of the ethereum host (default: 31337, + env: L1_CHAIN_ID) + --json Output the claim in JSON format + --no-wait Wait for the bridged funds to be available in L2, + polling every 60 seconds + --interval The polling interval in seconds for the bridged + funds (default: "60") + -h, --help display help for command + +``` + +### aztec cancel-tx + +*Help for this command is currently unavailable due to a technical issue with option serialization.* + + +### aztec codegen + +``` +Usage: aztec codegen [options] + +Validates and generates an Aztec Contract ABI from Noir ABI. + +Arguments: + noir-abi-path Path to the Noir ABI or project dir. + +Options: + -o, --outdir Output folder for the generated code. + -f, --force Force code generation even when the contract has not + changed. + -h, --help display help for command + +``` + +### aztec compute-selector + +``` +Usage: aztec compute-selector [options] + +Given a function signature, it computes a selector + +Arguments: + functionSignature Function signature to compute selector for e.g. foo(Field) + +Options: + -h, --help display help for command + +``` + +### aztec create-account + +``` +Usage: aztec create-account [options] + +Creates an aztec account that can be used for sending transactions. Registers +the account on the PXE and deploys an account contract. Uses a Schnorr +single-key account which uses the same key for encryption and authentication +(not secure for production usage). + +Options: + --skip-initialization Skip initializing the account contract. Useful for publicly deploying an existing account. + --public-deploy Publishes the account contract instance (and the class, if needed). Needed if the contract contains public functions. + -p, --public-key Public key that identifies a private signing key stored outside of the wallet. Used for ECDSA SSH accounts over the secp256r1 curve. + -u, --rpc-url URL of the PXE (default: "http://host.docker.internal:8080", env: PXE_URL) + -sk, --secret-key Secret key for account. Uses random by default. (env: SECRET_KEY) + -t, --type Type of account to create (choices: "schnorr", "ecdsasecp256r1", "ecdsasecp256r1ssh", "ecdsasecp256k1", default: "schnorr") + --register-only Just register the account on the PXE. Do not deploy or initialize the account contract. + --json Emit output as json + --no-wait Skip waiting for the contract to be deployed. Print the hash of deployment transaction + -v, --verbose Provide timings on all executed operations (synching, simulating, proving) (default: false) + --payment Fee payment method and arguments. + Parameters: + method Valid values: "fee_juice", "fpc-public", "fpc-private", "fpc-sponsored" Default: fee_juice + feePayer The account paying the fee. + asset The asset used for fee payment. Required for "fpc-public" and "fpc-private". + fpc The FPC contract that pays in fee juice. Not required for the "fee_juice" method. + claim Whether to use a previously stored claim to bridge fee juice. + claimSecret The secret to claim fee juice on L1. + claimAmount The amount of fee juice to be claimed. + messageLeafIndex The index of the claim in the l1toL2Message tree. + feeRecipient Recipient of the fee. + Format: --payment method=name,feePayer=address,asset=address ... + --gas-limits Gas limits for the tx. + --max-fees-per-gas Maximum fees per gas unit for DA and L2 computation. + --max-priority-fees-per-gas Maximum priority fees per gas unit for DA and L2 computation. + --estimate-gas Whether to automatically estimate gas limits for the tx. + --estimate-gas-only Only report gas estimation for the tx, do not send it. + -h, --help display help for command + +``` + +### aztec create-authwit + +``` +Usage: aztec create-authwit [options] + +Creates an authorization witness that can be privately sent to a caller so they +can perform an action on behalf of the provided account + +Arguments: + functionName Name of function to authorize + caller Account to be authorized to perform the action + +Options: + -u, --rpc-url URL of the PXE (default: "http://host.docker.internal:8080", env: PXE_URL) + --args [args...] Function arguments (default: []) + -ca, --contract-address
Aztec address of the contract. + -c, --contract-artifact Path to a compiled Aztec contract's artifact in JSON format. If executed inside a nargo workspace, a package and contract name can be specified as package@contract + -sk, --secret-key The sender's secret key (env: SECRET_KEY) + -h, --help display help for command + +``` + +### aztec debug-rollup + +``` +Usage: aztec debug-rollup [options] + +Debugs the rollup contract. + +Options: + --l1-rpc-urls List of Ethereum host URLs. Chain identifiers + localhost and testnet can be used (comma + separated) (default: + ["http://host.docker.internal:8545"], env: + ETHEREUM_HOSTS) + -c, --l1-chain-id Chain ID of the ethereum host (default: 31337, + env: L1_CHAIN_ID) + --rollup
ethereum address of the rollup contract + -h, --help display help for command + +``` + +### aztec decode-enr + +``` +Usage: aztec decode-enr [options] + +Decodes and ENR record + +Arguments: + enr The encoded ENR string + +Options: + -h, --help display help for command + +``` + +### aztec deploy + +``` +Usage: aztec deploy [options] [artifact] + +Deploys a compiled Aztec.nr contract to Aztec. + +Arguments: + artifact Path to a compiled Aztec contract's artifact in JSON format. If executed inside a nargo workspace, a package and contract name can be specified as package@contract + +Options: + --init The contract initializer function to call (default: "constructor") + --no-init Leave the contract uninitialized + -k, --public-key Optional encryption public key for this address. Set this value only if this contract is expected to receive private notes, which will be encrypted using this public key. + -s, --salt Optional deployment salt as a hex string for generating the deployment address. + --universal Do not mix the sender address into the deployment. + -u, --rpc-url URL of the PXE (default: "http://host.docker.internal:8080", env: PXE_URL) + --args [args...] Constructor arguments (default: []) + -sk, --secret-key The sender's secret key (env: SECRET_KEY) + --json Emit output as json + --no-wait Skip waiting for the contract to be deployed. Print the hash of deployment transaction + --no-class-registration Don't register this contract class + --no-public-deployment Don't emit this contract's public bytecode + --timeout The amount of time in seconds to wait for the deployment to post to L2 + -v, --verbose Provide timings on all executed operations (synching, simulating, proving) (default: false) + --payment Fee payment method and arguments. + Parameters: + method Valid values: "fee_juice", "fpc-public", "fpc-private", "fpc-sponsored" Default: fee_juice + asset The asset used for fee payment. Required for "fpc-public" and "fpc-private". + fpc The FPC contract that pays in fee juice. Not required for the "fee_juice" method. + claim Whether to use a previously stored claim to bridge fee juice. + claimSecret The secret to claim fee juice on L1. + claimAmount The amount of fee juice to be claimed. + messageLeafIndex The index of the claim in the l1toL2Message tree. + feeRecipient Recipient of the fee. + Format: --payment method=name,asset=address,fpc=address ... + --gas-limits Gas limits for the tx. + --max-fees-per-gas Maximum fees per gas unit for DA and L2 computation. + --max-priority-fees-per-gas Maximum priority fees per gas unit for DA and L2 computation. + --estimate-gas Whether to automatically estimate gas limits for the tx. + --estimate-gas-only Only report gas estimation for the tx, do not send it. + -h, --help display help for command + +``` + +### aztec deploy-account + +``` +Usage: aztec deploy-account [options] + +Deploys an already registered aztec account that can be used for sending +transactions. + +Options: + -u, --rpc-url URL of the PXE (default: "http://host.docker.internal:8080", env: PXE_URL) + --json Emit output as json + --no-wait Skip waiting for the contract to be deployed. Print the hash of deployment transaction + --register-class Register the contract class (useful for when the contract class has not been deployed yet). + --public-deploy Publishes the account contract instance (and the class, if needed). Needed if the contract contains public functions. + -v, --verbose Provide timings on all executed operations (synching, simulating, proving) (default: false) + --payment Fee payment method and arguments. + Parameters: + method Valid values: "fee_juice", "fpc-public", "fpc-private", "fpc-sponsored" Default: fee_juice + feePayer The account paying the fee. + asset The asset used for fee payment. Required for "fpc-public" and "fpc-private". + fpc The FPC contract that pays in fee juice. Not required for the "fee_juice" method. + claim Whether to use a previously stored claim to bridge fee juice. + claimSecret The secret to claim fee juice on L1. + claimAmount The amount of fee juice to be claimed. + messageLeafIndex The index of the claim in the l1toL2Message tree. + feeRecipient Recipient of the fee. + Format: --payment method=name,feePayer=address,asset=address ... + --gas-limits Gas limits for the tx. + --max-fees-per-gas Maximum fees per gas unit for DA and L2 computation. + --max-priority-fees-per-gas Maximum priority fees per gas unit for DA and L2 computation. + --estimate-gas Whether to automatically estimate gas limits for the tx. + --estimate-gas-only Only report gas estimation for the tx, do not send it. + -h, --help display help for command + +``` + +### aztec deploy-l1-contracts + +``` +Usage: aztec deploy-l1-contracts [options] + +Deploys all necessary Ethereum contracts for Aztec. + +Options: + --l1-rpc-urls List of Ethereum host URLs. Chain + identifiers localhost and testnet can be + used (comma separated) (default: + ["http://host.docker.internal:8545"], env: + ETHEREUM_HOSTS) + -pk, --private-key The private key to use for deployment + --validators Comma separated list of validators + -m, --mnemonic The mnemonic to use in deployment + (default: "test test test test test test + test test test test test junk") + -i, --mnemonic-index The index of the mnemonic to use in + deployment (default: 0) + -c, --l1-chain-id Chain ID of the ethereum host (default: + 31337, env: L1_CHAIN_ID) + --salt The optional salt to use in deployment + --json Output the contract addresses in JSON + format + --test-accounts Populate genesis state with initial fee + juice for test accounts + --sponsored-fpc Populate genesis state with a testing + sponsored FPC contract + --accelerated-test-deployments Fire and forget deployment transactions, + use in testing only (default: false) + --real-verifier Deploy the real verifier (default: false) + --existing-token
Use an existing ERC20 for both fee and + staking + --create-verification-json [path] Create JSON file for etherscan contract + verification (default: false) + -h, --help display help for command + +``` + +### aztec deploy-new-rollup + +``` +Usage: aztec deploy-new-rollup [options] + +Deploys a new rollup contract and adds it to the registry (if you are the +owner). + +Options: + -r, --registry-address The address of the registry contract + --l1-rpc-urls List of Ethereum host URLs. Chain + identifiers localhost and testnet can be + used (comma separated) (default: + ["http://host.docker.internal:8545"], env: + ETHEREUM_HOSTS) + -pk, --private-key The private key to use for deployment + --validators Comma separated list of validators + -m, --mnemonic The mnemonic to use in deployment + (default: "test test test test test test + test test test test test junk") + -i, --mnemonic-index The index of the mnemonic to use in + deployment (default: 0) + -c, --l1-chain-id Chain ID of the ethereum host (default: + 31337, env: L1_CHAIN_ID) + --json Output the contract addresses in JSON + format + --test-accounts Populate genesis state with initial fee + juice for test accounts + --sponsored-fpc Populate genesis state with a testing + sponsored FPC contract + --real-verifier Deploy the real verifier (default: false) + --create-verification-json [path] Create JSON file for etherscan contract + verification (default: false) + -h, --help display help for command + +``` + +### aztec deposit-governance-tokens + +``` +Usage: aztec deposit-governance-tokens [options] + +Deposits governance tokens to the governance contract. + +Options: + -r, --registry-address The address of the registry contract + --recipient The recipient of the tokens + -a, --amount The amount of tokens to deposit + --mint Mint the tokens on L1 (default: false) + --l1-rpc-urls List of Ethereum host URLs. Chain + identifiers localhost and testnet can be + used (comma separated) (default: + ["http://host.docker.internal:8545"], env: + ETHEREUM_HOSTS) + -c, --l1-chain-id Chain ID of the ethereum host (default: + 31337, env: L1_CHAIN_ID) + -p, --private-key The private key to use to deposit + -m, --mnemonic The mnemonic to use to deposit (default: + "test test test test test test test test + test test test junk") + -i, --mnemonic-index The index of the mnemonic to use to deposit + (default: 0) + -h, --help display help for command + +``` + +### aztec example-contracts + +``` +Usage: aztec example-contracts [options] + +Lists the example contracts available to deploy from @aztec/noir-contracts.js + +Options: + -h, --help display help for command + +``` + +### aztec execute-governance-proposal + +``` +Usage: aztec execute-governance-proposal [options] + +Executes a governance proposal. + +Options: + -p, --proposal-id The ID of the proposal + -r, --registry-address The address of the registry contract + --wait Whether to wait until the proposal is + executable + --l1-rpc-urls List of Ethereum host URLs. Chain + identifiers localhost and testnet can be + used (comma separated) (default: + ["http://host.docker.internal:8545"], env: + ETHEREUM_HOSTS) + -c, --l1-chain-id Chain ID of the ethereum host (default: + 31337, env: L1_CHAIN_ID) + -pk, --private-key The private key to use to vote + -m, --mnemonic The mnemonic to use to vote (default: "test + test test test test test test test test test + test junk") + -i, --mnemonic-index The index of the mnemonic to use to vote + (default: 0) + -h, --help display help for command + +``` + +### aztec fast-forward-epochs + +*Help for this command is currently unavailable due to a technical issue with option serialization.* + + +### aztec generate-bls-keypair + +``` +Usage: aztec generate-bls-keypair [options] + +Generate a BLS keypair with convenience flags + +Options: + --mnemonic Mnemonic for BLS derivation + --ikm Initial keying material for BLS (alternative to + mnemonic) + --bls-path EIP-2334 path (default m/12381/3600/0/0/0) + --g2 Derive on G2 subgroup + --compressed Output compressed public key + --json Print JSON output to stdout + --out Write output to file + -h, --help display help for command + +``` + +### aztec generate-bootnode-enr + +``` +Usage: aztec generate-bootnode-enr [options] + +Generates the encoded ENR record for a bootnode. + +Arguments: + privateKey The peer id private key of the bootnode + p2pIp The bootnode P2P IP address + p2pPort The bootnode P2P port + +Options: + -c, --l1-chain-id Chain ID of the ethereum host (default: 31337, + env: L1_CHAIN_ID) + -h, --help display help for command + +``` + +### aztec generate-keys + +``` +Usage: aztec generate-keys [options] + +Generates and encryption and signing private key pair. + +Options: + --json Output the keys in JSON format + -h, --help display help for command + +``` + +### aztec generate-l1-account + +``` +Usage: aztec generate-l1-account [options] + +Generates a new private key for an account on L1. + +Options: + --json Output the private key in JSON format + -h, --help display help for command + +``` + +### aztec generate-p2p-private-key + +``` +Usage: aztec generate-p2p-private-key [options] + +Generates a private key that can be used for running a node on a LibP2P +network. + +Options: + -h, --help display help for command + +``` + +### aztec generate-secret-and-hash + +``` +Usage: aztec generate-secret-and-hash [options] + +Generates an arbitrary secret (Fr), and its hash (using aztec-nr defaults) + +Options: + -h, --help display help for command + +``` + +### aztec get-account + +``` +Usage: aztec get-account [options]
+ +Gets an account given its Aztec address. + +Arguments: + address The Aztec address to get account for + +Options: + -u, --rpc-url URL of the PXE (default: + "http://host.docker.internal:8080", env: PXE_URL) + -h, --help display help for command + +``` + +### aztec get-accounts + +``` +Usage: aztec get-accounts [options] + +Gets all the Aztec accounts stored in the PXE. + +Options: + -u, --rpc-url URL of the PXE (default: + "http://host.docker.internal:8080", env: PXE_URL) + --json Emit output as json + -h, --help display help for command + +``` + +### aztec get-block + +``` +Usage: aztec get-block [options] [blockNumber] + +Gets info for a given block or latest. + +Arguments: + blockNumber Block height + +Options: + -u, --rpc-url URL of the PXE (default: + "http://host.docker.internal:8080", env: PXE_URL) + -h, --help display help for command + +``` + +### aztec get-canonical-sponsored-fpc-address + +``` +Usage: aztec get-canonical-sponsored-fpc-address [options] + +Gets the canonical SponsoredFPC address for this any testnet running on the +same version as this CLI + +Options: + -h, --help display help for command + +``` + +### aztec get-contract-data + +``` +Usage: aztec get-contract-data [options] + +Gets information about the Aztec contract deployed at the specified address. + +Arguments: + contractAddress Aztec address of the contract. + +Options: + -u, --rpc-url URL of the PXE (default: + "http://host.docker.internal:8080", env: + PXE_URL) + -b, --include-bytecode Include the contract's public function + bytecode, if any. (default: false) + -h, --help display help for command + +``` + +### aztec get-current-base-fee + +``` +Usage: aztec get-current-base-fee [options] + +Gets the current base fee. + +Options: + -u, --rpc-url URL of the PXE (default: + "http://host.docker.internal:8080", env: PXE_URL) + -h, --help display help for command + +``` + +### aztec get-l1-addresses + +``` +Usage: aztec get-l1-addresses [options] + +Gets the addresses of the L1 contracts. + +Options: + -r, --registry-address The address of the registry contract + --l1-rpc-urls List of Ethereum host URLs. Chain + identifiers localhost and testnet can be + used (comma separated) (default: + ["http://host.docker.internal:8545"], env: + ETHEREUM_HOSTS) + -v, --rollup-version The version of the rollup + -c, --l1-chain-id Chain ID of the ethereum host (default: + 31337, env: L1_CHAIN_ID) + --json Output the addresses in JSON format + -h, --help display help for command + +``` + +### aztec get-l1-balance + +``` +Usage: aztec get-l1-balance [options] + +Gets the balance of an ERC token in L1 for the given Ethereum address. + +Arguments: + who Ethereum address to check. + +Options: + --l1-rpc-urls List of Ethereum host URLs. Chain identifiers + localhost and testnet can be used (comma + separated) (default: + ["http://host.docker.internal:8545"], env: + ETHEREUM_HOSTS) + -t, --token The address of the token to check the balance of + -c, --l1-chain-id Chain ID of the ethereum host (default: 31337, + env: L1_CHAIN_ID) + --json Output the balance in JSON format + -h, --help display help for command + +``` + +### aztec get-l1-to-l2-message-witness + +``` +Usage: aztec get-l1-to-l2-message-witness [options] + +Gets a L1 to L2 message witness. + +Options: + -ca, --contract-address
Aztec address of the contract. + --message-hash The L1 to L2 message hash. + --secret The secret used to claim the L1 to L2 + message + -u, --rpc-url URL of the PXE (default: + "http://host.docker.internal:8080", env: + PXE_URL) + -h, --help display help for command + +``` + +### aztec get-logs + +``` +Usage: aztec get-logs [options] + +Gets all the public logs from an intersection of all the filter params. + +Options: + -tx, --tx-hash A transaction hash to get the receipt for. + -fb, --from-block Initial block number for getting logs + (defaults to 1). + -tb, --to-block Up to which block to fetch logs (defaults + to latest). + -al --after-log ID of a log after which to fetch the logs. + -ca, --contract-address
Contract address to filter logs by. + -u, --rpc-url URL of the PXE (default: + "http://host.docker.internal:8080", env: + PXE_URL) + --follow If set, will keep polling for new logs + until interrupted. + -h, --help display help for command + +``` + +### aztec get-node-info + +``` +Usage: aztec get-node-info [options] + +Gets the information of an Aztec node from a PXE or directly from an Aztec +node. + +Options: + --node-url URL of the node. + --json Emit output as json + -u, --rpc-url URL of the PXE (default: + "http://host.docker.internal:8080", env: PXE_URL) + -h, --help display help for command + +``` + +### aztec get-pxe-info + +``` +Usage: aztec get-pxe-info [options] + +Gets the information of a PXE at a URL. + +Options: + -u, --rpc-url URL of the PXE (default: + "http://host.docker.internal:8080", env: PXE_URL) + -h, --help display help for command + +``` + +### aztec get-tx + +``` +Usage: aztec get-tx [options] [txHash] + +Gets the status of the recent txs, or a detailed view if a specific transaction +hash is provided + +Arguments: + txHash A transaction hash to get the receipt for. + +Options: + -u, --rpc-url URL of the PXE (default: + "http://host.docker.internal:8080", env: PXE_URL) + -p, --page The page number to display (default: 1) + -s, --page-size The number of transactions to display per page + (default: 10) + -h, --help display help for command + +``` + +### aztec import-test-accounts + +``` +Usage: aztec import-test-accounts [options] + +Import test accounts from pxe. + +Options: + -u, --rpc-url URL of the PXE (default: + "http://host.docker.internal:8080", env: PXE_URL) + --json Emit output as json + -h, --help display help for command + +``` + +### aztec inspect-contract + +``` +Usage: aztec inspect-contract [options] + +Shows list of external callable functions for a contract + +Arguments: + contractArtifactFile A compiled Noir contract's artifact in JSON format or + name of a contract artifact exported by + @aztec/noir-contracts.js + +Options: + -h, --help display help for command + +``` + +### aztec parse-parameter-struct + +``` +Usage: aztec parse-parameter-struct [options] + +Helper for parsing an encoded string into a contract's parameter struct. + +Arguments: + encodedString The encoded hex string + +Options: + -c, --contract-artifact A compiled Aztec.nr contract's ABI in JSON format or name of a contract ABI exported by @aztec/noir-contracts.js + -p, --parameter The name of the struct parameter to decode into + -h, --help display help for command + +``` + +### aztec preload-crs + +``` +Usage: aztec preload-crs [options] + +Preload the points data needed for proving and verifying + +Options: + -h, --help display help for command + +``` + +### aztec profile + +``` +Usage: aztec profile [options] + +Profiles a private function by counting the unconditional operations in its +execution steps + +Arguments: + functionName Name of function to simulate + +Options: + -u, --rpc-url URL of the PXE (default: "http://host.docker.internal:8080", env: PXE_URL) + --args [args...] Function arguments (default: []) + -ca, --contract-address
Aztec address of the contract. + -c, --contract-artifact Path to a compiled Aztec contract's artifact in JSON format. If executed inside a nargo workspace, a package and contract name can be specified as package@contract + --debug-execution-steps-dir
Directory to write execution step artifacts for bb profiling/debugging. + -sk, --secret-key The sender's secret key (env: SECRET_KEY) + --payment Fee payment method and arguments. + Parameters: + method Valid values: "fee_juice", "fpc-public", "fpc-private", "fpc-sponsored" Default: fee_juice + asset The asset used for fee payment. Required for "fpc-public" and "fpc-private". + fpc The FPC contract that pays in fee juice. Not required for the "fee_juice" method. + claim Whether to use a previously stored claim to bridge fee juice. + claimSecret The secret to claim fee juice on L1. + claimAmount The amount of fee juice to be claimed. + messageLeafIndex The index of the claim in the l1toL2Message tree. + feeRecipient Recipient of the fee. + Format: --payment method=name,asset=address,fpc=address ... + --gas-limits Gas limits for the tx. + --max-fees-per-gas Maximum fees per gas unit for DA and L2 computation. + --max-priority-fees-per-gas Maximum priority fees per gas unit for DA and L2 computation. + --estimate-gas Whether to automatically estimate gas limits for the tx. + --estimate-gas-only Only report gas estimation for the tx, do not send it. + -h, --help display help for command + +``` + +### aztec propose-with-lock + +``` +Usage: aztec propose-with-lock [options] + +Makes a proposal to governance with a lock + +Options: + -r, --registry-address The address of the registry contract + -p, --payload-address The address of the payload contract + --l1-rpc-urls List of Ethereum host URLs. Chain + identifiers localhost and testnet can be + used (comma separated) (default: + ["http://host.docker.internal:8545"], env: + ETHEREUM_HOSTS) + -c, --l1-chain-id Chain ID of the ethereum host (default: + 31337, env: L1_CHAIN_ID) + -pk, --private-key The private key to use to propose + -m, --mnemonic The mnemonic to use to propose (default: + "test test test test test test test test + test test test junk") + -i, --mnemonic-index The index of the mnemonic to use to propose + (default: 0) + --json Output the proposal ID in JSON format + -h, --help display help for command + +``` + +### aztec prune-rollup + +``` +Usage: aztec prune-rollup [options] + +Prunes the pending chain on the rollup contract. + +Options: + --l1-rpc-urls List of Ethereum host URLs. Chain identifiers + localhost and testnet can be used (comma + separated) (default: + ["http://host.docker.internal:8545"], env: + ETHEREUM_HOSTS) + -pk, --private-key The private key to use for deployment + -m, --mnemonic The mnemonic to use in deployment (default: + "test test test test test test test test test + test test junk") + -c, --l1-chain-id Chain ID of the ethereum host (default: 31337, + env: L1_CHAIN_ID) + --rollup
ethereum address of the rollup contract + -h, --help display help for command + +``` + +### aztec register-contract + +``` +Usage: aztec register-contract [options] [address] [artifact] + +Registers a contract in this wallet's PXE + +Arguments: + address The address of the contract to register + artifact Path to a compiled Aztec contract's artifact in + JSON format. If executed inside a nargo workspace, + a package and contract name can be specified as + package@contract + +Options: + --init The contract initializer function to call + (default: "constructor") + -k, --public-key Optional encryption public key for this address. + Set this value only if this contract is expected + to receive private notes, which will be encrypted + using this public key. + -s, --salt Optional deployment salt as a hex string for + generating the deployment address. + --deployer The address of the account that deployed the + contract + --args [args...] Constructor arguments (default: []) + -u, --rpc-url URL of the PXE (default: + "http://host.docker.internal:8080", env: PXE_URL) + -h, --help display help for command + +``` + +### aztec register-sender + +``` +Usage: aztec register-sender [options] [address] + +Registers a sender's address in the wallet, so the note synching process will +look for notes sent by them + +Arguments: + address The address of the sender to register + +Options: + -u, --rpc-url URL of the PXE (default: + "http://host.docker.internal:8080", env: PXE_URL) + -h, --help display help for command + +``` + +### aztec remove-l1-validator + +``` +Usage: aztec remove-l1-validator [options] + +Removes a validator to the L1 rollup contract. + +Options: + --l1-rpc-urls List of Ethereum host URLs. Chain identifiers + localhost and testnet can be used (comma + separated) (default: + ["http://host.docker.internal:8545"], env: + ETHEREUM_HOSTS) + -pk, --private-key The private key to use for deployment + -m, --mnemonic The mnemonic to use in deployment (default: + "test test test test test test test test test + test test junk") + -c, --l1-chain-id Chain ID of the ethereum host (default: 31337, + env: L1_CHAIN_ID) + --validator
ethereum address of the validator + --rollup
ethereum address of the rollup contract + -h, --help display help for command + +``` + +### aztec send + +``` +Usage: aztec send [options] + +Calls a function on an Aztec contract. + +Arguments: + functionName Name of function to execute + +Options: + -u, --rpc-url URL of the PXE (default: "http://host.docker.internal:8080", env: PXE_URL) + --args [args...] Function arguments (default: []) + -c, --contract-artifact Path to a compiled Aztec contract's artifact in JSON format. If executed inside a nargo workspace, a package and contract name can be specified as package@contract + -ca, --contract-address
Aztec address of the contract. + -sk, --secret-key The sender's secret key (env: SECRET_KEY) + --no-wait Print transaction hash without waiting for it to be mined + --no-cancel Do not allow the transaction to be cancelled. This makes for cheaper transactions. + -v, --verbose Provide timings on all executed operations (synching, simulating, proving) (default: false) + --payment Fee payment method and arguments. + Parameters: + method Valid values: "fee_juice", "fpc-public", "fpc-private", "fpc-sponsored" Default: fee_juice + asset The asset used for fee payment. Required for "fpc-public" and "fpc-private". + fpc The FPC contract that pays in fee juice. Not required for the "fee_juice" method. + claim Whether to use a previously stored claim to bridge fee juice. + claimSecret The secret to claim fee juice on L1. + claimAmount The amount of fee juice to be claimed. + messageLeafIndex The index of the claim in the l1toL2Message tree. + feeRecipient Recipient of the fee. + Format: --payment method=name,asset=address,fpc=address ... + --gas-limits Gas limits for the tx. + --max-fees-per-gas Maximum fees per gas unit for DA and L2 computation. + --max-priority-fees-per-gas Maximum priority fees per gas unit for DA and L2 computation. + --estimate-gas Whether to automatically estimate gas limits for the tx. + --estimate-gas-only Only report gas estimation for the tx, do not send it. + -h, --help display help for command + +``` + +### aztec sequencers + +``` +Usage: aztec sequencers [options] [who] + +Manages or queries registered sequencers on the L1 rollup contract. + +Arguments: + command Command to run: list, add, remove, who-next + who Who to add/remove + +Options: + --l1-rpc-urls List of Ethereum host URLs. Chain identifiers + localhost and testnet can be used (comma + separated) (default: + ["http://host.docker.internal:8545"]) + -m, --mnemonic The mnemonic for the sender of the tx (default: + "test test test test test test test test test + test test junk") + --block-number Block number to query next sequencer for + -u, --rpc-url URL of the PXE (default: + "http://host.docker.internal:8080", env: PXE_URL) + -c, --l1-chain-id Chain ID of the ethereum host (default: 31337, + env: L1_CHAIN_ID) + -h, --help display help for command + +``` + +### aztec setup-protocol-contracts + +``` +Usage: aztec setup-protocol-contracts [options] + +Bootstrap the blockchain by initializing all the protocol contracts + +Options: + -u, --rpc-url URL of the PXE (default: + "http://host.docker.internal:8080", env: PXE_URL) + --testAccounts Deploy funded test accounts. + --sponsoredFPC Deploy a sponsored FPC. + --json Output the contract addresses in JSON format + --skipProofWait Don't wait for proofs to land. + -h, --help display help for command + +``` + +### aztec simulate + +``` +Usage: aztec simulate [options] + +Simulates the execution of a function on an Aztec contract. + +Arguments: + functionName Name of function to simulate + +Options: + -u, --rpc-url URL of the PXE (default: "http://host.docker.internal:8080", env: PXE_URL) + --args [args...] Function arguments (default: []) + -ca, --contract-address
Aztec address of the contract. + -c, --contract-artifact Path to a compiled Aztec contract's artifact in JSON format. If executed inside a nargo workspace, a package and contract name can be specified as package@contract + -sk, --secret-key The sender's secret key (env: SECRET_KEY) + -v, --verbose Provide timings on all executed operations (synching, simulating, proving) (default: false) + --payment Fee payment method and arguments. + Parameters: + method Valid values: "fee_juice", "fpc-public", "fpc-private", "fpc-sponsored" Default: fee_juice + asset The asset used for fee payment. Required for "fpc-public" and "fpc-private". + fpc The FPC contract that pays in fee juice. Not required for the "fee_juice" method. + claim Whether to use a previously stored claim to bridge fee juice. + claimSecret The secret to claim fee juice on L1. + claimAmount The amount of fee juice to be claimed. + messageLeafIndex The index of the claim in the l1toL2Message tree. + feeRecipient Recipient of the fee. + Format: --payment method=name,asset=address,fpc=address ... + --gas-limits Gas limits for the tx. + --max-fees-per-gas Maximum fees per gas unit for DA and L2 computation. + --max-priority-fees-per-gas Maximum priority fees per gas unit for DA and L2 computation. + --estimate-gas Whether to automatically estimate gas limits for the tx. + --estimate-gas-only Only report gas estimation for the tx, do not send it. + -h, --help display help for command + +``` + +### aztec start + +**MISC** + +- `--network ` + Network to run Aztec on + *Environment: `$NETWORK`* + +- `--auto-update ` (default: `disabled`) + The auto update mode for this node + *Environment: `$AUTO_UPDATE`* + +- `--auto-update-url ` + Base URL to check for updates + *Environment: `$AUTO_UPDATE_URL`* + +- `--sync-mode ` (default: `snapshot`) + Set sync mode to `full` to always sync via L1, `snapshot` to download a snapshot if there is no local data, `force-snapshot` to download even if there is local data. + *Environment: `$SYNC_MODE`* + +- `--snapshots-urls ` + Base URLs for snapshots index, comma-separated. + *Environment: `$SYNC_SNAPSHOTS_URLS`* + +**LOCAL NETWORK** + +- `--local-network` + Starts Aztec Local Network + +- `--local-network.noPXE` + Do not expose PXE service on local network start + *Environment: `$NO_PXE`* + +- `--local-network.l1Mnemonic ` (default: `test test test test test test test test test test test junk`) + Mnemonic for L1 accounts. Will be used + *Environment: `$MNEMONIC`* + +**API** + +- `--port ` (default: `8080`) + Port to run the Aztec Services on + *Environment: `$AZTEC_PORT`* + +- `--admin-port ` (default: `8880`) + Port to run admin APIs of Aztec Services on on + *Environment: `$AZTEC_ADMIN_PORT`* + +- `--api-prefix ` + Prefix for API routes on any service that is started + *Environment: `$API_PREFIX`* + +**ETHEREUM** + +- `--l1-chain-id ` + The chain ID of the ethereum host. + *Environment: `$L1_CHAIN_ID`* + +- `--l1-rpc-urls ` + The RPC Url of the ethereum host. + *Environment: `$ETHEREUM_HOSTS`* + +- `--l1-consensus-host-urls ` + List of URLS for L1 consensus clients + *Environment: `$L1_CONSENSUS_HOST_URLS`* + +- `--l1-consensus-host-api-keys ` + List of API keys for the corresponding L1 consensus clients, if needed. Added to the end of the corresponding URL as "?key=<api-key>" unless a header is defined + *Environment: `$L1_CONSENSUS_HOST_API_KEYS`* + +- `--l1-consensus-host-api-key-headers ` + List of header names for the corresponding L1 consensus client API keys, if needed. Added to the corresponding request as "<api-key-header>: <api-key>" + *Environment: `$L1_CONSENSUS_HOST_API_KEY_HEADERS`* + +- `--registry-address ` + The deployed L1 registry contract address. + *Environment: `$REGISTRY_CONTRACT_ADDRESS`* + +- `--rollup-version ` + The version of the rollup. + *Environment: `$ROLLUP_VERSION`* + +**STORAGE** + +- `--data-directory ` + Optional dir to store data. If omitted will store in memory. + *Environment: `$DATA_DIRECTORY`* + +- `--data-store-map-size-kb ` (default: `134217728`) + DB mapping size to be applied to all key/value stores + *Environment: `$DATA_STORE_MAP_SIZE_KB`* + +**WORLD STATE** + +- `--world-state-data-directory ` + Optional directory for the world state database + *Environment: `$WS_DATA_DIRECTORY`* + +- `--world-state-db-map-size-kb ` + The maximum possible size of the world state DB in KB. Overwrites the general dataStoreMapSizeKb. + *Environment: `$WS_DB_MAP_SIZE_KB`* + +- `--world-state-block-history ` (default: `64`) + The number of historic blocks to maintain. Values less than 1 mean all history is maintained + *Environment: `$WS_NUM_HISTORIC_BLOCKS`* + +**AZTEC NODE** + +- `--node` + Starts Aztec Node with options + +**ARCHIVER** + +- `--archiver` + Starts Aztec Archiver with options + +- `--archiver.blobSinkUrl ` + The URL of the blob sink + *Environment: `$BLOB_SINK_URL`* + +- `--archiver.blobSinkMapSizeKb ` + The maximum possible size of the blob sink DB in KB. Overwrites the general dataStoreMapSizeKb. + *Environment: `$BLOB_SINK_MAP_SIZE_KB`* + +- `--archiver.blobAllowEmptySources ` + Whether to allow having no blob sources configured during startup + *Environment: `$BLOB_ALLOW_EMPTY_SOURCES`* + +- `--archiver.archiveApiUrl ` + The URL of the archive API + *Environment: `$BLOB_SINK_ARCHIVE_API_URL`* + +- `--archiver.archiverPollingIntervalMS ` (default: `500`) + The polling interval in ms for retrieving new L2 blocks and encrypted logs. + *Environment: `$ARCHIVER_POLLING_INTERVAL_MS`* + +- `--archiver.archiverBatchSize ` (default: `100`) + The number of L2 blocks the archiver will attempt to download at a time. + *Environment: `$ARCHIVER_BATCH_SIZE`* + +- `--archiver.maxLogs ` (default: `1000`) + The max number of logs that can be obtained in 1 "getPublicLogs" call. + *Environment: `$ARCHIVER_MAX_LOGS`* + +- `--archiver.archiverStoreMapSizeKb ` + The maximum possible size of the archiver DB in KB. Overwrites the general dataStoreMapSizeKb. + *Environment: `$ARCHIVER_STORE_MAP_SIZE_KB`* + +- `--archiver.skipValidateBlockAttestations ` + Whether to skip validating block attestations (use only for testing). + +**SEQUENCER** + +- `--sequencer` + Starts Aztec Sequencer with options + +- `--sequencer.validatorPrivateKeys ` (default: `[Redacted]`) + List of private keys of the validators participating in attestation duties + *Environment: `$VALIDATOR_PRIVATE_KEYS`* + +- `--sequencer.validatorAddresses ` + List of addresses of the validators to use with remote signers + *Environment: `$VALIDATOR_ADDRESSES`* + +- `--sequencer.disableValidator ` + Do not run the validator + *Environment: `$VALIDATOR_DISABLED`* + +- `--sequencer.disabledValidators ` + Temporarily disable these specific validator addresses + +- `--sequencer.attestationPollingIntervalMs ` (default: `200`) + Interval between polling for new attestations + *Environment: `$VALIDATOR_ATTESTATIONS_POLLING_INTERVAL_MS`* + +- `--sequencer.validatorReexecute ` (default: `true`) + Re-execute transactions before attesting + *Environment: `$VALIDATOR_REEXECUTE`* + +- `--sequencer.validatorReexecuteDeadlineMs ` (default: `6000`) + Will re-execute until this many milliseconds are left in the slot + *Environment: `$VALIDATOR_REEXECUTE_DEADLINE_MS`* + +- `--sequencer.alwaysReexecuteBlockProposals ` + Whether to always reexecute block proposals, even for non-validator nodes (useful for monitoring network status). + *Environment: `$ALWAYS_REEXECUTE_BLOCK_PROPOSALS`* + +- `--sequencer.transactionPollingIntervalMS ` (default: `500`) + The number of ms to wait between polling for pending txs. + *Environment: `$SEQ_TX_POLLING_INTERVAL_MS`* + +- `--sequencer.maxTxsPerBlock ` (default: `32`) + The maximum number of txs to include in a block. + *Environment: `$SEQ_MAX_TX_PER_BLOCK`* + +- `--sequencer.minTxsPerBlock ` (default: `1`) + The minimum number of txs to include in a block. + *Environment: `$SEQ_MIN_TX_PER_BLOCK`* + +- `--sequencer.publishTxsWithProposals ` + Whether to publish txs with proposals. + *Environment: `$SEQ_PUBLISH_TXS_WITH_PROPOSALS`* + +- `--sequencer.maxL2BlockGas ` (default: `10000000000`) + The maximum L2 block gas. + *Environment: `$SEQ_MAX_L2_BLOCK_GAS`* + +- `--sequencer.maxDABlockGas ` (default: `10000000000`) + The maximum DA block gas. + *Environment: `$SEQ_MAX_DA_BLOCK_GAS`* + +- `--sequencer.coinbase ` + Recipient of block reward. + *Environment: `$COINBASE`* + +- `--sequencer.feeRecipient ` + Address to receive fees. + *Environment: `$FEE_RECIPIENT`* + +- `--sequencer.acvmWorkingDirectory ` + The working directory to use for simulation/proving + *Environment: `$ACVM_WORKING_DIRECTORY`* + +- `--sequencer.acvmBinaryPath ` + The path to the ACVM binary + *Environment: `$ACVM_BINARY_PATH`* + +- `--sequencer.maxBlockSizeInBytes ` (default: `1048576`) + Max block size + *Environment: `$SEQ_MAX_BLOCK_SIZE_IN_BYTES`* + +- `--sequencer.enforceTimeTable ` (default: `true`) + Whether to enforce the time table when building blocks + *Environment: `$SEQ_ENFORCE_TIME_TABLE`* + +- `--sequencer.governanceProposerPayload ` (default: `0x0000000000000000000000000000000000000000`) + The address of the payload for the governanceProposer + *Environment: `$GOVERNANCE_PROPOSER_PAYLOAD_ADDRESS`* + +- `--sequencer.maxL1TxInclusionTimeIntoSlot ` + How many seconds into an L1 slot we can still send a tx and get it mined. + *Environment: `$SEQ_MAX_L1_TX_INCLUSION_TIME_INTO_SLOT`* + +- `--sequencer.attestationPropagationTime ` (default: `2`) + How many seconds it takes for proposals and attestations to travel across the p2p layer (one-way) + *Environment: `$SEQ_ATTESTATION_PROPAGATION_TIME`* + +- `--sequencer.secondsBeforeInvalidatingBlockAsCommitteeMember ` (default: `144`) + How many seconds to wait before trying to invalidate a block from the pending chain as a committee member (zero to never invalidate). The next proposer is expected to invalidate, so the committee acts as a fallback. + *Environment: `$SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_COMMITTEE_MEMBER`* + +- `--sequencer.secondsBeforeInvalidatingBlockAsNonCommitteeMember ` (default: `432`) + How many seconds to wait before trying to invalidate a block from the pending chain as a non-committee member (zero to never invalidate). The next proposer is expected to invalidate, then the committee, so other sequencers act as a fallback. + *Environment: `$SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_NON_COMMITTEE_MEMBER`* + +- `--sequencer.injectFakeAttestation ` + Inject a fake attestation (for testing only) + +- `--sequencer.txPublicSetupAllowList ` + The list of functions calls allowed to run in setup + *Environment: `$TX_PUBLIC_SETUP_ALLOWLIST`* + +- `--sequencer.keyStoreDirectory ` + Location of key store directory + *Environment: `$KEY_STORE_DIRECTORY`* + +- `--sequencer.publisherPrivateKeys ` + The private keys to be used by the publisher. + *Environment: `$SEQ_PUBLISHER_PRIVATE_KEYS`* + +- `--sequencer.publisherAddresses ` + The addresses of the publishers to use with remote signers + *Environment: `$SEQ_PUBLISHER_ADDRESSES`* + +- `--sequencer.publisherAllowInvalidStates ` (default: `true`) + True to use publishers in invalid states (timed out, cancelled, etc) if no other is available + *Environment: `$SEQ_PUBLISHER_ALLOW_INVALID_STATES`* + +- `--sequencer.blobSinkUrl ` + The URL of the blob sink + *Environment: `$BLOB_SINK_URL`* + +- `--sequencer.blobAllowEmptySources ` + Whether to allow having no blob sources configured during startup + *Environment: `$BLOB_ALLOW_EMPTY_SOURCES`* + +- `--sequencer.archiveApiUrl ` + The URL of the archive API + *Environment: `$BLOB_SINK_ARCHIVE_API_URL`* + +**BLOB SINK** + +- `--blob-sink` + Starts Aztec Blob Sink with options + +- `--blobSink.port ` + The port to run the blob sink server on + *Environment: `$BLOB_SINK_PORT`* + +- `--blobSink.blobSinkMapSizeKb ` + The maximum possible size of the blob sink DB in KB. Overwrites the general dataStoreMapSizeKb. + *Environment: `$BLOB_SINK_MAP_SIZE_KB`* + +- `--blobSink.blobAllowEmptySources ` + Whether to allow having no blob sources configured during startup + *Environment: `$BLOB_ALLOW_EMPTY_SOURCES`* + +- `--blobSink.archiveApiUrl ` + The URL of the archive API + *Environment: `$BLOB_SINK_ARCHIVE_API_URL`* + +**PROVER NODE** + +- `--prover-node` + Starts Aztec Prover Node with options + +- `--proverNode.keyStoreDirectory ` + Location of key store directory + *Environment: `$KEY_STORE_DIRECTORY`* + +- `--proverNode.acvmWorkingDirectory ` + The working directory to use for simulation/proving + *Environment: `$ACVM_WORKING_DIRECTORY`* + +- `--proverNode.acvmBinaryPath ` + The path to the ACVM binary + *Environment: `$ACVM_BINARY_PATH`* + +- `--proverNode.bbWorkingDirectory ` + The working directory to use for proving + *Environment: `$BB_WORKING_DIRECTORY`* + +- `--proverNode.bbBinaryPath ` + The path to the bb binary + *Environment: `$BB_BINARY_PATH`* + +- `--proverNode.bbSkipCleanup ` + Whether to skip cleanup of bb temporary files + *Environment: `$BB_SKIP_CLEANUP`* + +- `--proverNode.numConcurrentIVCVerifiers ` (default: `8`) + Max number of client IVC verifiers to run concurrently + *Environment: `$BB_NUM_IVC_VERIFIERS`* + +- `--proverNode.bbIVCConcurrency ` (default: `1`) + Number of threads to use for IVC verification + *Environment: `$BB_IVC_CONCURRENCY`* + +- `--proverNode.nodeUrl ` + The URL to the Aztec node to take proving jobs from + *Environment: `$AZTEC_NODE_URL`* + +- `--proverNode.proverId ` + Hex value that identifies the prover. Defaults to the address used for submitting proofs if not set. + *Environment: `$PROVER_ID`* + +- `--proverNode.failedProofStore ` + Store for failed proof inputs. Google cloud storage is only supported at the moment. Set this value as gs://bucket-name/path/to/store. + *Environment: `$PROVER_FAILED_PROOF_STORE`* + +- `--proverNode.publisherAllowInvalidStates ` (default: `true`) + True to use publishers in invalid states (timed out, cancelled, etc) if no other is available + *Environment: `$PROVER_PUBLISHER_ALLOW_INVALID_STATES`* + +- `--proverNode.publisherPrivateKeys ` + The private keys to be used by the publisher. + *Environment: `$PROVER_PUBLISHER_PRIVATE_KEYS`* + +- `--proverNode.publisherAddresses ` + The addresses of the publishers to use with remote signers + *Environment: `$PROVER_PUBLISHER_ADDRESSES`* + +- `--proverNode.proverNodeMaxPendingJobs ` (default: `10`) + The maximum number of pending jobs for the prover node + *Environment: `$PROVER_NODE_MAX_PENDING_JOBS`* + +- `--proverNode.proverNodePollingIntervalMs ` (default: `1000`) + The interval in milliseconds to poll for new jobs + *Environment: `$PROVER_NODE_POLLING_INTERVAL_MS`* + +- `--proverNode.proverNodeMaxParallelBlocksPerEpoch ` (default: `32`) + The Maximum number of blocks to process in parallel while proving an epoch + *Environment: `$PROVER_NODE_MAX_PARALLEL_BLOCKS_PER_EPOCH`* + +- `--proverNode.proverNodeFailedEpochStore ` + File store where to upload node state when an epoch fails to be proven + *Environment: `$PROVER_NODE_FAILED_EPOCH_STORE`* + +- `--proverNode.proverNodeEpochProvingDelayMs ` + Optional delay in milliseconds to wait before proving a new epoch + +- `--proverNode.txGatheringIntervalMs ` (default: `1000`) + How often to check that tx data is available + *Environment: `$PROVER_NODE_TX_GATHERING_INTERVAL_MS`* + +- `--proverNode.txGatheringBatchSize ` (default: `10`) + How many transactions to gather from a node in a single request + *Environment: `$PROVER_NODE_TX_GATHERING_BATCH_SIZE`* + +- `--proverNode.txGatheringMaxParallelRequestsPerNode ` (default: `100`) + How many tx requests to make in parallel to each node + *Environment: `$PROVER_NODE_TX_GATHERING_MAX_PARALLEL_REQUESTS_PER_NODE`* + +- `--proverNode.txGatheringTimeoutMs ` (default: `120000`) + How long to wait for tx data to be available before giving up + *Environment: `$PROVER_NODE_TX_GATHERING_TIMEOUT_MS`* + +- `--proverNode.proverNodeDisableProofPublish ` + Whether the prover node skips publishing proofs to L1 + *Environment: `$PROVER_NODE_DISABLE_PROOF_PUBLISH`* + +**PROVER BROKER** + +- `--prover-broker` + Starts Aztec proving job broker + +- `--proverBroker.proverBrokerJobTimeoutMs ` (default: `30000`) + Jobs are retried if not kept alive for this long + *Environment: `$PROVER_BROKER_JOB_TIMEOUT_MS`* + +- `--proverBroker.proverBrokerPollIntervalMs ` (default: `1000`) + The interval to check job health status + *Environment: `$PROVER_BROKER_POLL_INTERVAL_MS`* + +- `--proverBroker.proverBrokerJobMaxRetries ` (default: `3`) + If starting a prover broker locally, the max number of retries per proving job + *Environment: `$PROVER_BROKER_JOB_MAX_RETRIES`* + +- `--proverBroker.proverBrokerBatchSize ` (default: `100`) + The prover broker writes jobs to disk in batches + *Environment: `$PROVER_BROKER_BATCH_SIZE`* + +- `--proverBroker.proverBrokerBatchIntervalMs ` (default: `50`) + How often to flush batches to disk + *Environment: `$PROVER_BROKER_BATCH_INTERVAL_MS`* + +- `--proverBroker.proverBrokerMaxEpochsToKeepResultsFor ` (default: `1`) + The maximum number of epochs to keep results for + *Environment: `$PROVER_BROKER_MAX_EPOCHS_TO_KEEP_RESULTS_FOR`* + +- `--proverBroker.proverBrokerStoreMapSizeKb ` + The size of the prover broker's database. Will override the dataStoreMapSizeKb if set. + *Environment: `$PROVER_BROKER_STORE_MAP_SIZE_KB`* + +**PROVER AGENT** + +- `--prover-agent` + Starts Aztec Prover Agent with options + +- `--proverAgent.proverAgentCount ` (default: `1`) + Whether this prover has a local prover agent + *Environment: `$PROVER_AGENT_COUNT`* + +- `--proverAgent.proverAgentPollIntervalMs ` (default: `1000`) + The interval agents poll for jobs at + *Environment: `$PROVER_AGENT_POLL_INTERVAL_MS`* + +- `--proverAgent.proverAgentProofTypes ` + The types of proofs the prover agent can generate + *Environment: `$PROVER_AGENT_PROOF_TYPES`* + +- `--proverAgent.proverBrokerUrl ` + The URL where this agent takes jobs from + *Environment: `$PROVER_BROKER_HOST`* + +- `--proverAgent.realProofs ` (default: `true`) + Whether to construct real proofs + *Environment: `$PROVER_REAL_PROOFS`* + +- `--proverAgent.proverTestDelayType ` (default: `fixed`) + The type of artificial delay to introduce + *Environment: `$PROVER_TEST_DELAY_TYPE`* + +- `--proverAgent.proverTestDelayMs ` + Artificial delay to introduce to all operations to the test prover. + *Environment: `$PROVER_TEST_DELAY_MS`* + +- `--proverAgent.proverTestDelayFactor ` (default: `1`) + If using realistic delays, what percentage of realistic times to apply. + *Environment: `$PROVER_TEST_DELAY_FACTOR`* + +- `--p2p-enabled [value]` + Enable P2P subsystem + *Environment: `$P2P_ENABLED`* + +- `--p2p.p2pDiscoveryDisabled ` + A flag dictating whether the P2P discovery system should be disabled. + *Environment: `$P2P_DISCOVERY_DISABLED`* + +- `--p2p.blockCheckIntervalMS ` (default: `100`) + The frequency in which to check for new L2 blocks. + *Environment: `$P2P_BLOCK_CHECK_INTERVAL_MS`* + +- `--p2p.debugDisableColocationPenalty ` + DEBUG: Disable colocation penalty - NEVER set to true in production + *Environment: `$DEBUG_P2P_DISABLE_COLOCATION_PENALTY`* + +- `--p2p.peerCheckIntervalMS ` (default: `30000`) + The frequency in which to check for new peers. + *Environment: `$P2P_PEER_CHECK_INTERVAL_MS`* + +- `--p2p.l2QueueSize ` (default: `1000`) + Size of queue of L2 blocks to store. + *Environment: `$P2P_L2_QUEUE_SIZE`* + +- `--p2p.listenAddress ` (default: `0.0.0.0`) + The listen address. ipv4 address. + *Environment: `$P2P_LISTEN_ADDR`* + +- `--p2p.p2pPort ` (default: `40400`) + The port for the P2P service. Defaults to 40400 + *Environment: `$P2P_PORT`* + +- `--p2p.p2pBroadcastPort ` + The port to broadcast the P2P service on (included in the node's ENR). Defaults to P2P_PORT. + *Environment: `$P2P_BROADCAST_PORT`* + +- `--p2p.p2pIp ` + The IP address for the P2P service. ipv4 address. + *Environment: `$P2P_IP`* + +- `--p2p.peerIdPrivateKey ` + An optional peer id private key. If blank, will generate a random key. + *Environment: `$PEER_ID_PRIVATE_KEY`* + +- `--p2p.peerIdPrivateKeyPath ` + An optional path to store generated peer id private keys. If blank, will default to storing any generated keys in the root of the data directory. + *Environment: `$PEER_ID_PRIVATE_KEY_PATH`* + +- `--p2p.bootstrapNodes ` + A list of bootstrap peer ENRs to connect to. Separated by commas. + *Environment: `$BOOTSTRAP_NODES`* + +- `--p2p.bootstrapNodeEnrVersionCheck ` + Whether to check the version of the bootstrap node ENR. + *Environment: `$P2P_BOOTSTRAP_NODE_ENR_VERSION_CHECK`* + +- `--p2p.bootstrapNodesAsFullPeers ` + Whether to consider our configured bootnodes as full peers + *Environment: `$P2P_BOOTSTRAP_NODES_AS_FULL_PEERS`* + +- `--p2p.maxPeerCount ` (default: `100`) + The maximum number of peers to connect to. + *Environment: `$P2P_MAX_PEERS`* + +- `--p2p.queryForIp ` + If announceUdpAddress or announceTcpAddress are not provided, query for the IP address of the machine. Default is false. + *Environment: `$P2P_QUERY_FOR_IP`* + +- `--p2p.gossipsubInterval ` (default: `700`) + The interval of the gossipsub heartbeat to perform maintenance tasks. + *Environment: `$P2P_GOSSIPSUB_INTERVAL_MS`* + +- `--p2p.gossipsubD ` (default: `8`) + The D parameter for the gossipsub protocol. + *Environment: `$P2P_GOSSIPSUB_D`* + +- `--p2p.gossipsubDlo ` (default: `4`) + The Dlo parameter for the gossipsub protocol. + *Environment: `$P2P_GOSSIPSUB_DLO`* + +- `--p2p.gossipsubDhi ` (default: `12`) + The Dhi parameter for the gossipsub protocol. + *Environment: `$P2P_GOSSIPSUB_DHI`* + +- `--p2p.gossipsubDLazy ` (default: `8`) + The Dlazy parameter for the gossipsub protocol. + *Environment: `$P2P_GOSSIPSUB_DLAZY`* + +- `--p2p.gossipsubFloodPublish ` + Whether to flood publish messages. - For testing purposes only + *Environment: `$P2P_GOSSIPSUB_FLOOD_PUBLISH`* + +- `--p2p.gossipsubMcacheLength ` (default: `6`) + The number of gossipsub interval message cache windows to keep. + *Environment: `$P2P_GOSSIPSUB_MCACHE_LENGTH`* + +- `--p2p.gossipsubMcacheGossip ` (default: `3`) + How many message cache windows to include when gossiping with other peers. + *Environment: `$P2P_GOSSIPSUB_MCACHE_GOSSIP`* + +- `--p2p.gossipsubSeenTTL ` (default: `1200000`) + How long to keep message IDs in the seen cache. + *Environment: `$P2P_GOSSIPSUB_SEEN_TTL`* + +- `--p2p.gossipsubTxTopicWeight ` (default: `1`) + The weight of the tx topic for the gossipsub protocol. + *Environment: `$P2P_GOSSIPSUB_TX_TOPIC_WEIGHT`* + +- `--p2p.gossipsubTxInvalidMessageDeliveriesWeight ` (default: `-20`) + The weight of the tx invalid message deliveries for the gossipsub protocol. + *Environment: `$P2P_GOSSIPSUB_TX_INVALID_MESSAGE_DELIVERIES_WEIGHT`* + +- `--p2p.gossipsubTxInvalidMessageDeliveriesDecay ` (default: `0.5`) + Determines how quickly the penalty for invalid message deliveries decays over time. Between 0 and 1. + *Environment: `$P2P_GOSSIPSUB_TX_INVALID_MESSAGE_DELIVERIES_DECAY`* + +- `--p2p.peerPenaltyValues ` (default: `2,10,50`) + The values for the peer scoring system. Passed as a comma separated list of values in order: low, mid, high tolerance errors. + *Environment: `$P2P_PEER_PENALTY_VALUES`* + +- `--p2p.doubleSpendSeverePeerPenaltyWindow ` (default: `30`) + The "age" (in L2 blocks) of a tx after which we heavily penalize a peer for sending it. + *Environment: `$P2P_DOUBLE_SPEND_SEVERE_PEER_PENALTY_WINDOW`* + +- `--p2p.blockRequestBatchSize ` (default: `20`) + The number of blocks to fetch in a single batch. + *Environment: `$P2P_BLOCK_REQUEST_BATCH_SIZE`* + +- `--p2p.archivedTxLimit ` + The number of transactions that will be archived. If the limit is set to 0 then archiving will be disabled. + *Environment: `$P2P_ARCHIVED_TX_LIMIT`* + +- `--p2p.trustedPeers ` + A list of trusted peer ENRs that will always be persisted. Separated by commas. + *Environment: `$P2P_TRUSTED_PEERS`* + +- `--p2p.privatePeers ` + A list of private peer ENRs that will always be persisted and not be used for discovery. Separated by commas. + *Environment: `$P2P_PRIVATE_PEERS`* + +- `--p2p.preferredPeers ` + A list of preferred peer ENRs that will always be persisted and not be used for discovery. Separated by commas. + *Environment: `$P2P_PREFERRED_PEERS`* + +- `--p2p.p2pStoreMapSizeKb ` + The maximum possible size of the P2P DB in KB. Overwrites the general dataStoreMapSizeKb. + *Environment: `$P2P_STORE_MAP_SIZE_KB`* + +- `--p2p.txPublicSetupAllowList ` + The list of functions calls allowed to run in setup + *Environment: `$TX_PUBLIC_SETUP_ALLOWLIST`* + +- `--p2p.maxTxPoolSize ` (default: `100000000`) + The maximum cumulative tx size of pending txs (in bytes) before evicting lower priority txs. + *Environment: `$P2P_MAX_TX_POOL_SIZE`* + +- `--p2p.txPoolOverflowFactor ` (default: `1.1`) + How much the tx pool can overflow before it starts evicting txs. Must be greater than 1 + *Environment: `$P2P_TX_POOL_OVERFLOW_FACTOR`* + +- `--p2p.seenMessageCacheSize ` (default: `100000`) + The number of messages to keep in the seen message cache + *Environment: `$P2P_SEEN_MSG_CACHE_SIZE`* + +- `--p2p.p2pDisableStatusHandshake ` + True to disable the status handshake on peer connected. + *Environment: `$P2P_DISABLE_STATUS_HANDSHAKE`* + +- `--p2p.p2pAllowOnlyValidators ` + True to only permit validators to connect. + *Environment: `$P2P_ALLOW_ONLY_VALIDATORS`* + +- `--p2p.p2pMaxFailedAuthAttemptsAllowed ` (default: `3`) + Number of auth attempts to allow before peer is banned. Number is inclusive + *Environment: `$P2P_MAX_AUTH_FAILED_ATTEMPTS_ALLOWED`* + +- `--p2p.dropTransactions ` + True to simulate discarding transactions. - For testing purposes only + *Environment: `$P2P_DROP_TX`* + +- `--p2p.dropTransactionsProbability ` + The probability that a transaction is discarded. - For testing purposes only + *Environment: `$P2P_DROP_TX_CHANCE`* + +- `--p2p.disableTransactions ` + Whether transactions are disabled for this node. This means transactions will be rejected at the RPC and P2P layers. + *Environment: `$TRANSACTIONS_DISABLED`* + +- `--p2p.txPoolDeleteTxsAfterReorg ` + Whether to delete transactions from the pool after a reorg instead of moving them back to pending. + *Environment: `$P2P_TX_POOL_DELETE_TXS_AFTER_REORG`* + +- `--p2p.overallRequestTimeoutMs ` (default: `10000`) + The overall timeout for a request response operation. + *Environment: `$P2P_REQRESP_OVERALL_REQUEST_TIMEOUT_MS`* + +- `--p2p.individualRequestTimeoutMs ` (default: `10000`) + The timeout for an individual request response peer interaction. + *Environment: `$P2P_REQRESP_INDIVIDUAL_REQUEST_TIMEOUT_MS`* + +- `--p2p.dialTimeoutMs ` (default: `5000`) + How long to wait for the dial protocol to establish a connection + *Environment: `$P2P_REQRESP_DIAL_TIMEOUT_MS`* + +- `--p2p.p2pOptimisticNegotiation ` + Whether to use optimistic protocol negotiation when dialing to another peer (opposite of `negotiateFully`). + *Environment: `$P2P_REQRESP_OPTIMISTIC_NEGOTIATION`* + +- `--p2p.txCollectionFastNodesTimeoutBeforeReqRespMs ` (default: `200`) + How long to wait before starting reqresp for fast collection + *Environment: `$TX_COLLECTION_FAST_NODES_TIMEOUT_BEFORE_REQ_RESP_MS`* + +- `--p2p.txCollectionSlowNodesIntervalMs ` (default: `12000`) + How often to collect from configured nodes in the slow collection loop + *Environment: `$TX_COLLECTION_SLOW_NODES_INTERVAL_MS`* + +- `--p2p.txCollectionSlowReqRespIntervalMs ` (default: `12000`) + How often to collect from peers via reqresp in the slow collection loop + *Environment: `$TX_COLLECTION_SLOW_REQ_RESP_INTERVAL_MS`* + +- `--p2p.txCollectionSlowReqRespTimeoutMs ` (default: `20000`) + How long to wait for a reqresp response during slow collection + *Environment: `$TX_COLLECTION_SLOW_REQ_RESP_TIMEOUT_MS`* + +- `--p2p.txCollectionReconcileIntervalMs ` (default: `60000`) + How often to reconcile found txs from the tx pool + *Environment: `$TX_COLLECTION_RECONCILE_INTERVAL_MS`* + +- `--p2p.txCollectionDisableSlowDuringFastRequests ` (default: `true`) + Whether to disable the slow collection loop if we are dealing with any immediate requests + *Environment: `$TX_COLLECTION_DISABLE_SLOW_DURING_FAST_REQUESTS`* + +- `--p2p.txCollectionFastNodeIntervalMs ` (default: `500`) + How many ms to wait between retried request to a node via RPC during fast collection + *Environment: `$TX_COLLECTION_FAST_NODE_INTERVAL_MS`* + +- `--p2p.txCollectionNodeRpcUrls ` + A comma-separated list of Aztec node RPC URLs to use for tx collection + *Environment: `$TX_COLLECTION_NODE_RPC_URLS`* + +- `--p2p.txCollectionFastMaxParallelRequestsPerNode ` (default: `4`) + Maximum number of parallel requests to make to a node during fast collection + *Environment: `$TX_COLLECTION_FAST_MAX_PARALLEL_REQUESTS_PER_NODE`* + +- `--p2p.txCollectionNodeRpcMaxBatchSize ` (default: `50`) + Maximum number of transactions to request from a node in a single batch + *Environment: `$TX_COLLECTION_NODE_RPC_MAX_BATCH_SIZE`* + +- `--p2p-bootstrap` + Starts Aztec P2P Bootstrap with options + +- `--p2pBootstrap.p2pBroadcastPort ` + The port to broadcast the P2P service on (included in the node's ENR). Defaults to P2P_PORT. + *Environment: `$P2P_BROADCAST_PORT`* + +- `--p2pBootstrap.peerIdPrivateKeyPath ` + An optional path to store generated peer id private keys. If blank, will default to storing any generated keys in the root of the data directory. + *Environment: `$PEER_ID_PRIVATE_KEY_PATH`* + +- `--p2pBootstrap.queryForIp ` + If announceUdpAddress or announceTcpAddress are not provided, query for the IP address of the machine. Default is false. + *Environment: `$P2P_QUERY_FOR_IP`* + +**TELEMETRY** + +- `--tel.metricsCollectorUrl ` + The URL of the telemetry collector for metrics + *Environment: `$OTEL_EXPORTER_OTLP_METRICS_ENDPOINT`* + +- `--tel.tracesCollectorUrl ` + The URL of the telemetry collector for traces + *Environment: `$OTEL_EXPORTER_OTLP_TRACES_ENDPOINT`* + +- `--tel.logsCollectorUrl ` + The URL of the telemetry collector for logs + *Environment: `$OTEL_EXPORTER_OTLP_LOGS_ENDPOINT`* + +- `--tel.otelCollectIntervalMs ` (default: `60000`) + The interval at which to collect metrics + *Environment: `$OTEL_COLLECT_INTERVAL_MS`* + +- `--tel.otelExportTimeoutMs ` (default: `30000`) + The timeout for exporting metrics + *Environment: `$OTEL_EXPORT_TIMEOUT_MS`* + +- `--tel.otelExcludeMetrics ` + A list of metric prefixes to exclude from export + *Environment: `$OTEL_EXCLUDE_METRICS`* + +- `--tel.publicMetricsCollectorUrl ` + A URL to publish a subset of metrics for public consumption + *Environment: `$PUBLIC_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT`* + +- `--tel.publicMetricsCollectFrom ` + The role types to collect metrics from + *Environment: `$PUBLIC_OTEL_COLLECT_FROM`* + +- `--tel.publicIncludeMetrics ` + A list of metric prefixes to publicly export + *Environment: `$PUBLIC_OTEL_INCLUDE_METRICS`* + +- `--tel.publicMetricsOptOut ` + Whether to opt out of sharing optional telemetry + *Environment: `$PUBLIC_OTEL_OPT_OUT`* + +**BOT** + +- `--bot` + Starts Aztec Bot with options + +- `--bot.nodeUrl ` + The URL to the Aztec node to check for tx pool status. + *Environment: `$AZTEC_NODE_URL`* + +- `--bot.nodeAdminUrl ` + The URL to the Aztec node admin API to force-flush txs if configured. + *Environment: `$AZTEC_NODE_ADMIN_URL`* + +- `--bot.pxeUrl ` + URL to the PXE for sending txs, or undefined if an in-proc PXE is used. + *Environment: `$BOT_PXE_URL`* + +- `--bot.l1Mnemonic ` + The mnemonic for the account to bridge fee juice from L1. + *Environment: `$BOT_L1_MNEMONIC`* + +- `--bot.l1PrivateKey ` + The private key for the account to bridge fee juice from L1. + *Environment: `$BOT_L1_PRIVATE_KEY`* + +- `--bot.l1ToL2MessageTimeoutSeconds ` (default: `3600`) + How long to wait for L1 to L2 messages to become available on L2 + *Environment: `$BOT_L1_TO_L2_TIMEOUT_SECONDS`* + +- `--bot.senderPrivateKey ` + Signing private key for the sender account. + *Environment: `$BOT_PRIVATE_KEY`* + +- `--bot.senderSalt ` + The salt to use to deploys the sender account. + *Environment: `$BOT_ACCOUNT_SALT`* + +- `--bot.recipientEncryptionSecret ` (default: `0x00000000000000000000000000000000000000000000000000000000cafecafe`) + Encryption secret for a recipient account. + *Environment: `$BOT_RECIPIENT_ENCRYPTION_SECRET`* + +- `--bot.tokenSalt ` (default: `0x0000000000000000000000000000000000000000000000000000000000000001`) + Salt for the token contract deployment. + *Environment: `$BOT_TOKEN_SALT`* + +- `--bot.txIntervalSeconds ` (default: `60`) + Every how many seconds should a new tx be sent. + *Environment: `$BOT_TX_INTERVAL_SECONDS`* + +- `--bot.privateTransfersPerTx ` (default: `1`) + How many private token transfers are executed per tx. + *Environment: `$BOT_PRIVATE_TRANSFERS_PER_TX`* + +- `--bot.publicTransfersPerTx ` (default: `1`) + How many public token transfers are executed per tx. + *Environment: `$BOT_PUBLIC_TRANSFERS_PER_TX`* + +- `--bot.feePaymentMethod ` (default: `fee_juice`) + How to handle fee payments. (Options: fee_juice) + *Environment: `$BOT_FEE_PAYMENT_METHOD`* + +- `--bot.noStart ` + True to not automatically setup or start the bot on initialization. + *Environment: `$BOT_NO_START`* + +- `--bot.txMinedWaitSeconds ` (default: `180`) + How long to wait for a tx to be mined before reporting an error. + *Environment: `$BOT_TX_MINED_WAIT_SECONDS`* + +- `--bot.followChain ` (default: `NONE`) + Which chain the bot follows + *Environment: `$BOT_FOLLOW_CHAIN`* + +- `--bot.maxPendingTxs ` (default: `128`) + Do not send a tx if the node's tx pool already has this many pending txs. + *Environment: `$BOT_MAX_PENDING_TXS`* + +- `--bot.flushSetupTransactions ` + Make a request for the sequencer to build a block after each setup transaction. + *Environment: `$BOT_FLUSH_SETUP_TRANSACTIONS`* + +- `--bot.l2GasLimit ` + L2 gas limit for the tx (empty to have the bot trigger an estimate gas). + *Environment: `$BOT_L2_GAS_LIMIT`* + +- `--bot.daGasLimit ` + DA gas limit for the tx (empty to have the bot trigger an estimate gas). + *Environment: `$BOT_DA_GAS_LIMIT`* + +- `--bot.contract ` (default: `TokenContract`) + Token contract to use + *Environment: `$BOT_TOKEN_CONTRACT`* + +- `--bot.maxConsecutiveErrors ` + The maximum number of consecutive errors before the bot shuts down + *Environment: `$BOT_MAX_CONSECUTIVE_ERRORS`* + +- `--bot.stopWhenUnhealthy ` + Stops the bot if service becomes unhealthy + *Environment: `$BOT_STOP_WHEN_UNHEALTHY`* + +- `--bot.ammTxs ` + Deploy an AMM and send swaps to it + *Environment: `$BOT_AMM_TXS`* + +**PXE** + +- `--pxe` + Starts Aztec PXE with options + +- `--pxe.l2BlockBatchSize ` (default: `50`) + Maximum amount of blocks to pull from the stream in one request when synchronizing + *Environment: `$PXE_L2_BLOCK_BATCH_SIZE`* + +- `--pxe.bbBinaryPath ` + Path to the BB binary + *Environment: `$BB_BINARY_PATH`* + +- `--pxe.bbWorkingDirectory ` + Working directory for the BB binary + *Environment: `$BB_WORKING_DIRECTORY`* + +- `--pxe.bbSkipCleanup ` + True to skip cleanup of temporary files for debugging purposes + *Environment: `$BB_SKIP_CLEANUP`* + +- `--pxe.proverEnabled ` (default: `true`) + Enable real proofs + *Environment: `$PXE_PROVER_ENABLED`* + +- `--pxe.nodeUrl ` + Custom Aztec Node URL to connect to + *Environment: `$AZTEC_NODE_URL`* + +**TXE** + +- `--txe` + Starts Aztec TXE with options + +### aztec trigger-seed-snapshot + +``` +Usage: aztec trigger-seed-snapshot [options] + +Triggers a seed snapshot for the next epoch. + +Options: + -pk, --private-key The private key to use for deployment + -m, --mnemonic The mnemonic to use in deployment (default: + "test test test test test test test test test + test test junk") + --rollup
ethereum address of the rollup contract + --l1-rpc-urls List of Ethereum host URLs. Chain identifiers + localhost and testnet can be used (comma + separated) (default: + ["http://host.docker.internal:8545"], env: + ETHEREUM_HOSTS) + -c, --l1-chain-id Chain ID of the ethereum host (default: 31337, + env: L1_CHAIN_ID) + -h, --help display help for command + +``` + +### aztec update + +``` +Usage: aztec update [options] [projectPath] + +Updates Nodejs and Noir dependencies + +Arguments: + projectPath Path to the project directory (default: + "/Users/aztec/code/aztec-packages/docs") + +Options: + --contract [paths...] Paths to contracts to update dependencies (default: + []) + --aztec-version The version to update Aztec packages to. Defaults + to latest (default: "latest") + -h, --help display help for command + +``` + +### aztec validator-keys|valKeys + +*This command help is currently unavailable due to a technical issue.* + + +### aztec vote-on-governance-proposal + +``` +Usage: aztec vote-on-governance-proposal [options] + +Votes on a governance proposal. + +Options: + -p, --proposal-id The ID of the proposal + -a, --vote-amount The amount of tokens to vote + --in-favor Whether to vote in favor of the proposal. + Use "yea" for true, any other value for + false. + --wait Whether to wait until the proposal is active + -r, --registry-address The address of the registry contract + --l1-rpc-urls List of Ethereum host URLs. Chain + identifiers localhost and testnet can be + used (comma separated) (default: + ["http://host.docker.internal:8545"], env: + ETHEREUM_HOSTS) + -c, --l1-chain-id Chain ID of the ethereum host (default: + 31337, env: L1_CHAIN_ID) + -pk, --private-key The private key to use to vote + -m, --mnemonic The mnemonic to use to vote (default: "test + test test test test test test test test test + test junk") + -i, --mnemonic-index The index of the mnemonic to use to vote + (default: 0) + -h, --help display help for command + +``` diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-cli/local-network-reference.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-cli/local-network-reference.md new file mode 100644 index 000000000000..9bfca89fc97c --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-cli/local-network-reference.md @@ -0,0 +1,154 @@ +--- +title: Local Network Reference +description: Comprehensive reference for the Aztec local network development environment. +tags: [local_network] +sidebar_position: 1 +--- + +:::tip + +For a quick start, follow the [guide](../../getting_started_on_local_network.md) to install the local network. + +::: + +## Environment Variables + +There are various environment variables you can use when running the whole local network or when running on of the available modes. + +**Local Network** + +```sh +LOG_LEVEL=debug # Options are 'fatal', 'error', 'warn', 'info', 'verbose', 'debug', 'trace' +HOST_WORKDIR='${PWD}' # The location to store log outputs. Will use ~/.aztec where the binaries are stored by default. +ETHEREUM_HOSTS=http://127.0.0.1:8545 # List of Ethereum JSON RPC URLs. We use an anvil instance that runs in parallel to the local network on docker by default. +ANVIL_PORT=8545 # The port that docker will forward to the anvil instance (default: 8545) +L1_CHAIN_ID=31337 # The Chain ID that the Ethereum host is using. +TEST_ACCOUNTS='true' # Option to deploy 3 test account when local network starts. (default: true) +MODE='local-network' # Option to start the local network or a standalone part of the system. (default: local-network) +PXE_PORT=8080 # The port that the PXE will be listening to (default: 8080) +AZTEC_NODE_PORT=8080 # The port that Aztec Node will be listening to (default: 8080) + +## Polling intervals ## +ARCHIVER_POLLING_INTERVAL_MS=50 +P2P_BLOCK_CHECK_INTERVAL_MS=50 +SEQ_TX_POLLING_INTERVAL_MS=50 +WS_BLOCK_CHECK_INTERVAL_MS=50 +ARCHIVER_VIEM_POLLING_INTERVAL_MS=500 +``` + +**Aztec Node** + +Variables like `DEPLOY_AZTEC_CONTRACTS` & `AZTEC_NODE_PORT` are valid here as described above. +`TEST_ACCOUNTS` cannot be used here because the Aztec node does not control an Aztec account to deploy contracts from. + +```sh +# P2P config # +# Configuration variables for connecting a Node to the Aztec Node P2P network. You'll need a running P2P-Bootstrap node to connect to. +P2P_ENABLED='false' # A flag to enable P2P networking for this node. (default: false) +P2P_BLOCK_CHECK_INTERVAL_MS=100 # The frequency in which to check for new L2 blocks. +P2P_PEER_CHECK_INTERVAL_MS=1000 # The frequency in which to check for peers. +P2P_L2_BLOCK_QUEUE_SIZE=1000 # Size of queue of L2 blocks to store. +P2P_IP='' # Announce IP of the peer. Defaults to working it out using discV5, otherwise set P2P_QUERY_FOR_IP if you are behind a NAT +P2P_LISTEN_ADDR=0.0.0.0 # The address on which the P2P service should listen for connections.(default: 0.0.0.0) +P2P_PORT=40400 # The Port that will be used for sending & listening p2p messages (default: 40400) +PEER_ID_PRIVATE_KEY='' # An optional peer id private key. If blank, will generate a random key. +BOOTSTRAP_NODES='' # A list of bootstrap peers to connect to, separated by commas +P2P_ANNOUNCE_PORT='' # Port to announce to the p2p network +P2P_NAT_ENABLED='false' # Whether to enable NAT from libp2p +P2P_MAX_PEERS=100 # The maximum number of peers (a peer count above this will cause the node to refuse connection attempts) + +## Aztec Contract Addresses ## +# When running a standalone node, you need to have deployed Aztec contracts on your Ethereum host, then declare their addresses as env variables. +REGISTRY_CONTRACT_ADDRESS=0x01234567890abcde01234567890abcde +INBOX_CONTRACT_ADDRESS=0x01234567890abcde01234567890abcde +OUTBOX_CONTRACT_ADDRESS=0x01234567890abcde01234567890abcde +ROLLUP_CONTRACT_ADDRESS=0x01234567890abcde01234567890abcde + +## Sequencer variables ## +SEQ_PUBLISHER_PRIVATE_KEY=0x01234567890abcde01234567890abcde # Private key of an ethereum account that will be used by the sequencer to publish blocks. +SEQ_MAX_TX_PER_BLOCK=32 # Maximum txs to go on a block. (default: 32) +SEQ_MIN_TX_PER_BLOCK=1 # Minimum txs to go on a block. (default: 1) +VALIDATOR_PRIVATE_KEY=0x01234567890abcde01234567890abcde # Private key of the ethereum account that will be used to perform sequencer duties +``` + +**Wallet** + +Variables like `AZTEC_NODE_URL` and `TEST_ACCOUNTS` are valid here as described above. + +```sh +AZTEC_NODE_URL='http://localhost:8080' # The address of an Aztec Node URL that the wallet will connect to (default: http://localhost:8080) +TEST_ACCOUNTS='true' # Option to deploy 3 test account when local network starts. (default: true) +``` + +**P2P Bootstrap Node** + +The P2P Bootstrap node is a standalone app whose purpose is to assist new P2P network participants in acquiring peers. + +```sh +PEER_ID_PRIVATE_KEY='' # The private key to be used by the peer for secure communications with other peers. This key will also be used to derive the Peer ID. +P2P_IP='' # Announce IP of the peer. Defaults to working it out using discV5, otherwise set P2P_QUERY_FOR_IP if you are behind a NAT +P2P_LISTEN_ADDR=0.0.0.0 # The address on which the P2P service should listen for connections.(default: 0.0.0.0) +P2P_PORT=40400 # The Port that will be used for sending & listening p2p messages (default: 40400) +``` + +## Contracts + +We have shipped a number of example contracts in the `@aztec/noir-contracts.js` [npm package](https://www.npmjs.com/package/@aztec/noir-contracts.js). This is included with the local network by default so you are able to use these contracts to test with. + +```bash +AppSubscriptionContractArtifact +AuthContractArtifact +BenchmarkingContractArtifact +CardGameContractArtifact +ChildContractArtifact +ClaimContractArtifact +ContractClassRegistryContractArtifact +ContractInstanceRegistryContractArtifact +CounterContractArtifact +CrowdfundingContractArtifact +PrivateTokenContractArtifact +PrivateVotingContractArtifact +EcdsaAccountContractArtifact +EscrowContractArtifact +FPCContractArtifact +FeeJuiceContractArtifact +ImportTestContractArtifact +LendingContractArtifact +MultiCallEntrypointContractArtifact +ParentContractArtifact +PendingNoteHashesContractArtifact +PriceFeedContractArtifact +ReaderContractArtifact +SchnorrAccountContractArtifact +SchnorrHardcodedAccountContractArtifact +SchnorrSingleKeyAccountContractArtifact +SlowTreeContractArtifact +StatefulTestContractArtifact +TestContractArtifact +TokenBlacklistContractArtifact +TokenBridgeContractArtifact +TokenContractArtifact +UniswapContractArtifact +``` + +> Source code: /yarn-project/end-to-end/src/composed/cli_docs_local_network.test.ts#L95-L118 + +You can see all of our example contracts in the monorepo [here (GitHub link)](https://github.com/AztecProtocol/aztec-packages/tree/master/noir-projects/noir-contracts/contracts). + +## Running Aztec PXE / Node / P2P-Bootstrap node individually + +If you wish to run components of the Aztec network stack separately, you can use the `aztec start` command with various options for enabling components. + +```bash +aztec start --node [nodeOptions] --pxe [pxeOptions] --archiver [archiverOptions] --sequencer [sequencerOptions] --prover [proverOptions] --p2p-bootstrap [p2pOptions] +``` + +Starting the aztec node alongside a PXE, sequencer or archiver, will attach the components to the node. Eg if you want to run a PXE separately to a node, you can [read this guide](../tutorials/local_network.md#running-multiple-pxes-in-the-local-network). + +## Update the local network + +To update the local network, run: + +```bash +aztec-up +``` diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/_category_.json b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/_category_.json new file mode 100644 index 000000000000..5e4bf38d69a3 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/_category_.json @@ -0,0 +1,6 @@ +{ + "label": "Aztec.js", + "position": 3, + "collapsible": true, + "collapsed": true +} diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/aztec_js_reference.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/aztec_js_reference.md new file mode 100644 index 000000000000..9ae2605af87f --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/aztec_js_reference.md @@ -0,0 +1,5407 @@ +--- +title: Reference +description: Comprehensive auto-generated reference for the Aztec.js TypeScript library with all classes, interfaces, types, and functions. +tags: [api, reference, autogenerated, aztec.js, typescript] +sidebar_position: 98 +--- + +# Reference + +*This documentation is auto-generated from the Aztec.js TypeScript source code.* + +:::info +This is an auto-generated reference. For tutorials and guides, see the [Aztec.js Guide](./index.md). +::: + + +*Package: @aztec/aztec.js* + +*Generated: 2025-12-10T22:27:41.987Z* + +This document provides a comprehensive reference for all public APIs in the Aztec.js library. + +Each section is organized by module, with classes, interfaces, types, and functions documented with their full signatures, parameters, and return types. + +## Table of Contents + +- [Account](#account) + - [AccountContract](#accountcontract) + - [getAccountContractAddress](#getaccountcontractaddress) + - [AccountWithSecretKey](#accountwithsecretkey) + - [Account](#account) + - [BaseAccount](#baseaccount) + - [AccountInterface](#accountinterface) + - [SignerlessAccount](#signerlessaccount) +- [Authorization](#authorization) + - [CallAuthorizationRequest](#callauthorizationrequest) +- [Contract](#contract) + - [BaseContractInteraction](#basecontractinteraction) + - [BatchCall](#batchcall) + - [abiChecker](#abichecker) + - [ContractMethod](#contractmethod) + - [ContractStorageLayout](#contractstoragelayout) + - [ContractBase](#contractbase) + - [ContractFunctionInteraction](#contractfunctioninteraction) + - [Contract](#contract) + - [RequestDeployOptions](#requestdeployoptions) + - [DeployOptions](#deployoptions) + - [SimulateDeployOptions](#simulatedeployoptions) + - [DeployMethod](#deploymethod) + - [DeployedWaitOpts](#deployedwaitopts) + - [DeployTxReceipt](#deploytxreceipt) + - [DeploySentTx](#deploysenttx) + - [getGasLimits](#getgaslimits) + - [FeeEstimationOptions](#feeestimationoptions) + - [FeePaymentMethodOption](#feepaymentmethodoption) + - [GasSettingsOption](#gassettingsoption) + - [InteractionFeeOptions](#interactionfeeoptions) + - [SimulationInteractionFeeOptions](#simulationinteractionfeeoptions) + - [RequestInteractionOptions](#requestinteractionoptions) + - [SendInteractionOptions](#sendinteractionoptions) + - [SimulateInteractionOptions](#simulateinteractionoptions) + - [ProfileInteractionOptions](#profileinteractionoptions) + - [SimulationReturn](#simulationreturn) + - [toSendOptions](#tosendoptions) + - [toSimulateOptions](#tosimulateoptions) + - [toProfileOptions](#toprofileoptions) + - [getClassRegistryContract](#getclassregistrycontract) + - [getInstanceRegistryContract](#getinstanceregistrycontract) + - [getFeeJuice](#getfeejuice) + - [WaitOpts](#waitopts) + - [DefaultWaitOpts](#defaultwaitopts) + - [SentTx](#senttx) + - [UnsafeContract](#unsafecontract) + - [WaitForProvenOpts](#waitforprovenopts) + - [DefaultWaitForProvenOpts](#defaultwaitforprovenopts) + - [waitForProven](#waitforproven) +- [Deployment](#deployment) + - [broadcastPrivateFunction](#broadcastprivatefunction) + - [broadcastUtilityFunction](#broadcastutilityfunction) + - [ContractDeployer](#contractdeployer) + - [publishContractClass](#publishcontractclass) + - [publishInstance](#publishinstance) +- [Ethereum](#ethereum) + - [L2Claim](#l2claim) + - [L2AmountClaim](#l2amountclaim) + - [L2AmountClaimWithRecipient](#l2amountclaimwithrecipient) + - [generateClaimSecret](#generateclaimsecret) + - [L1TokenManager](#l1tokenmanager) + - [L1FeeJuicePortalManager](#l1feejuiceportalmanager) + - [L1ToL2TokenPortalManager](#l1tol2tokenportalmanager) + - [L1TokenPortalManager](#l1tokenportalmanager) +- [Fee](#fee) + - [FeeJuicePaymentMethodWithClaim](#feejuicepaymentmethodwithclaim) + - [FeePaymentMethod](#feepaymentmethod) + - [PrivateFeePaymentMethod](#privatefeepaymentmethod) + - [PublicFeePaymentMethod](#publicfeepaymentmethod) + - [SponsoredFeePaymentMethod](#sponsoredfeepaymentmethod) +- [Utils](#utils) + - [FieldLike](#fieldlike) + - [EthAddressLike](#ethaddresslike) + - [AztecAddressLike](#aztecaddresslike) + - [FunctionSelectorLike](#functionselectorlike) + - [EventSelectorLike](#eventselectorlike) + - [U128Like](#u128like) + - [WrappedFieldLike](#wrappedfieldlike) + - [IntentInnerHash](#intentinnerhash) + - [CallIntent](#callintent) + - [ContractFunctionInteractionCallIntent](#contractfunctioninteractioncallintent) + - [computeAuthWitMessageHash](#computeauthwitmessagehash) + - [getMessageHashFromIntent](#getmessagehashfromintent) + - [computeInnerAuthWitHashFromAction](#computeinnerauthwithashfromaction) + - [lookupValidity](#lookupvalidity) + - [SetPublicAuthwitContractInteraction](#setpublicauthwitcontractinteraction) + - [waitForL1ToL2MessageReady](#waitforl1tol2messageready) + - [isL1ToL2MessageReady](#isl1tol2messageready) + - [getFeeJuiceBalance](#getfeejuicebalance) + - [readFieldCompressedString](#readfieldcompressedstring) + - [waitForNode](#waitfornode) + - [createAztecNodeClient](#createaztecnodeclient) + - [AztecNode](#aztecnode) + - [generatePublicKey](#generatepublickey) +- [Wallet](#wallet) + - [AccountEntrypointMetaPaymentMethod](#accountentrypointmetapaymentmethod) + - [AccountManager](#accountmanager) + - [RequestDeployAccountOptions](#requestdeployaccountoptions) + - [DeployAccountOptions](#deployaccountoptions) + - [SimulateDeployAccountOptions](#simulatedeployaccountoptions) + - [DeployAccountMethod](#deployaccountmethod) + - [Aliased](#aliased) + - [SimulateOptions](#simulateoptions) + - [ProfileOptions](#profileoptions) + - [SendOptions](#sendoptions) + - [BatchableMethods](#batchablemethods) + - [BatchedMethod](#batchedmethod) + - [BatchedMethodResult](#batchedmethodresult) + - [BatchedMethodResultWrapper](#batchedmethodresultwrapper) + - [BatchResults](#batchresults) + - [PrivateEventFilter](#privateeventfilter) + - [PrivateEvent](#privateevent) + - [Wallet](#wallet) + - [FunctionCallSchema](#functioncallschema) + - [ExecutionPayloadSchema](#executionpayloadschema) + - [GasSettingsOptionSchema](#gassettingsoptionschema) + - [WalletSimulationFeeOptionSchema](#walletsimulationfeeoptionschema) + - [SendOptionsSchema](#sendoptionsschema) + - [SimulateOptionsSchema](#simulateoptionsschema) + - [ProfileOptionsSchema](#profileoptionsschema) + - [MessageHashOrIntentSchema](#messagehashorintentschema) + - [BatchedMethodSchema](#batchedmethodschema) + - [ContractMetadataSchema](#contractmetadataschema) + - [ContractClassMetadataSchema](#contractclassmetadataschema) + - [EventMetadataDefinitionSchema](#eventmetadatadefinitionschema) + - [PrivateEventSchema](#privateeventschema) + - [PrivateEventFilterSchema](#privateeventfilterschema) + - [WalletSchema](#walletschema) + +--- + + +## Account + + +--- + +### `account/account_contract.ts` + + +#### AccountContract + +**Type:** Interface + +An account contract instance. Knows its artifact, deployment arguments, how to create transaction execution requests out of function calls, and how to authorize actions. + + +#### Methods + + +##### getContractArtifact + +Returns the artifact of this account contract. + +**Signature:** + +```typescript +getContractArtifact(): Promise +``` + +**Returns:** + +`Promise` + +##### getInitializationFunctionAndArgs + +Returns the initializer function name and arguments for this instance, or undefined if this contract does not require initialization. + +**Signature:** + +```typescript +getInitializationFunctionAndArgs(): Promise<{ + constructorName: string; + constructorArgs: any[]; + } | undefined> +``` + +**Returns:** + +```typescript +Promise< + | { + /** The name of the function used to initialize the contract */ + constructorName: string; + /** The args to the function used to initialize the contract */ + constructorArgs: any[]; + } + | undefined + > +``` + +##### getInterface + +Returns the account interface for this account contract given an instance at the provided address. The account interface is responsible for assembling tx requests given requested function calls, and for creating signed auth witnesses given action identifiers (message hashes). + +**Signature:** + +```typescript +getInterface( + address: CompleteAddress, + chainInfo: ChainInfo +): AccountInterface +``` + +**Parameters:** + +- `address`: `CompleteAddress` + - Address of this account contract. +- `chainInfo`: `ChainInfo` + - Chain id and version of the rollup where the account contract is initialized / published. + +**Returns:** + +`AccountInterface` - An account interface instance for creating tx requests and authorizing actions. + +##### getAuthWitnessProvider + +Returns the auth witness provider for the given address. + +**Signature:** + +```typescript +getAuthWitnessProvider(address: CompleteAddress): AuthWitnessProvider +``` + +**Parameters:** + +- `address`: `CompleteAddress` + - Address for which to create auth witnesses. + +**Returns:** + +`AuthWitnessProvider` + +#### getAccountContractAddress + +**Type:** Function + +Compute the address of an account contract from secret and salt. + +**Signature:** + +```typescript +export async getAccountContractAddress( + accountContract: AccountContract, + secret: Fr, + salt: Fr +) +``` + +**Parameters:** + +- `accountContract`: `AccountContract` +- `secret`: `Fr` +- `salt`: `Fr` + +**Returns:** + +`Promise` + +--- + +### `account/account_with_secret_key.ts` + + +#### AccountWithSecretKey + +**Type:** Class + +Extends Account with the encryption private key. Not required for implementing the wallet interface but useful for testing purposes or exporting an account to another pxe. + +**Extends:** `BaseAccount` + + +#### Constructor + +**Signature:** + +```typescript +constructor( + account: AccountInterface, + private secretKey: Fr, + public readonly salt: Salt +) +``` + +**Parameters:** + +- `account`: `AccountInterface` +- `secretKey`: `Fr` +- `salt`: `Salt` + - Deployment salt for this account contract. + +#### Methods + + +##### getSecretKey + +Returns the encryption private key associated with this account. + +**Signature:** + +```typescript +public getSecretKey() +``` + +**Returns:** + +`Fr` + +##### getEncryptionSecret + +Returns the encryption secret, the secret of the encryption point—the point that others use to encrypt messages to this account note - this ensures that the address secret always corresponds to an address point with y being positive dev - this is also referred to as the address secret, which decrypts payloads encrypted to an address point + +**Signature:** + +```typescript +public async getEncryptionSecret() +``` + +**Returns:** + +`Promise` + +--- + +### `account/account.ts` + + +#### Account + +**Type:** Type Alias + +A type defining an account, capable of both creating authwits and using them to authenticate transaction execution requests. + +**Signature:** + +```typescript +export type Account = AccountInterface & AuthwitnessIntentProvider; +``` + +#### BaseAccount + +**Type:** Class + +An account implementation that uses authwits as an authentication mechanism and can assemble transaction execution requests for an entrypoint. + +**Implements:** `Account` + + +#### Constructor + +**Signature:** + +```typescript +constructor(protected account: AccountInterface) +``` + +**Parameters:** + +- `account`: `AccountInterface` + +#### Methods + + +##### createTxExecutionRequest + +**Signature:** + +```typescript +createTxExecutionRequest( + exec: ExecutionPayload, + gasSettings: GasSettings, + options: DefaultAccountEntrypointOptions +): Promise +``` + +**Parameters:** + +- `exec`: `ExecutionPayload` +- `gasSettings`: `GasSettings` +- `options`: `DefaultAccountEntrypointOptions` + +**Returns:** + +`Promise` + +##### getChainId + +**Signature:** + +```typescript +getChainId(): Fr +``` + +**Returns:** + +`Fr` + +##### getVersion + +**Signature:** + +```typescript +getVersion(): Fr +``` + +**Returns:** + +`Fr` + +##### getCompleteAddress + +Returns the complete address of the account that implements this wallet. + +**Signature:** + +```typescript +public getCompleteAddress() +``` + +**Returns:** + +`CompleteAddress` + +##### getAddress + +Returns the address of the account that implements this wallet. + +**Signature:** + +```typescript +public getAddress() +``` + +**Returns:** + +`any` + +##### createAuthWit + +Computes an authentication witness from either a message hash or an intent. If a message hash is provided, it will create a witness for the hash directly. Otherwise, it will compute the message hash using the intent, along with the chain id and the version values provided by the wallet. + +**Signature:** + +```typescript +async createAuthWit(messageHashOrIntent: Fr | Buffer | CallIntent | IntentInnerHash): Promise +``` + +**Parameters:** + +- `messageHashOrIntent`: `Fr | Buffer | CallIntent | IntentInnerHash` + - The message hash of the intent to approve + +**Returns:** + +`Promise` - The authentication witness + +--- + +### `account/interface.ts` + + +#### AccountInterface + +**Type:** Interface + +Handler for interfacing with an account. Knows how to create transaction execution requests and authorize actions for its corresponding account. + +**Extends:** `EntrypointInterface`, `AuthWitnessProvider` + + +#### Methods + + +##### getCompleteAddress + +Returns the complete address for this account. + +**Signature:** + +```typescript +getCompleteAddress(): CompleteAddress +``` + +**Returns:** + +`CompleteAddress` + +##### getAddress + +Returns the address for this account. + +**Signature:** + +```typescript +getAddress(): AztecAddress +``` + +**Returns:** + +`AztecAddress` + +##### getChainId + +Returns the chain id for this account + +**Signature:** + +```typescript +getChainId(): Fr +``` + +**Returns:** + +`Fr` + +##### getVersion + +Returns the rollup version for this account + +**Signature:** + +```typescript +getVersion(): Fr +``` + +**Returns:** + +`Fr` + +--- + +### `account/signerless_account.ts` + + +#### SignerlessAccount + +**Type:** Class + +Account implementation which creates a transaction using the multicall protocol contract as entrypoint. + +**Implements:** `Account` + + +#### Constructor + +**Signature:** + +```typescript +constructor(chainInfo: ChainInfo) +``` + +**Parameters:** + +- `chainInfo`: `ChainInfo` + +#### Methods + + +##### createTxExecutionRequest + +**Signature:** + +```typescript +createTxExecutionRequest( + exec: ExecutionPayload, + gasSettings: GasSettings +): Promise +``` + +**Parameters:** + +- `exec`: `ExecutionPayload` +- `gasSettings`: `GasSettings` + +**Returns:** + +`Promise` + +##### getChainId + +**Signature:** + +```typescript +getChainId(): Fr +``` + +**Returns:** + +`Fr` + +##### getVersion + +**Signature:** + +```typescript +getVersion(): Fr +``` + +**Returns:** + +`Fr` + +##### getCompleteAddress + +**Signature:** + +```typescript +getCompleteAddress(): CompleteAddress +``` + +**Returns:** + +`CompleteAddress` + +##### getAddress + +**Signature:** + +```typescript +getAddress(): AztecAddress +``` + +**Returns:** + +`AztecAddress` + +##### createAuthWit + +**Signature:** + +```typescript +createAuthWit(_intent: Fr | Buffer | IntentInnerHash | CallIntent): Promise +``` + +**Parameters:** + +- `_intent`: `Fr | Buffer | IntentInnerHash | CallIntent` + +**Returns:** + +`Promise` + +## Authorization + + +--- + +### `authorization/call_authorization_request.ts` + + +#### CallAuthorizationRequest + +**Type:** Class + +An authwit request for a function call. Includes the preimage of the data to be signed, as opposed of just the inner hash. + + +#### Constructor + +**Signature:** + +```typescript +constructor( + public selector: AuthorizationSelector, + public innerHash: Fr, + public msgSender: AztecAddress, + public functionSelector: FunctionSelector, + public argsHash: Fr, + public args: Fr[] +) +``` + +**Parameters:** + +- `selector`: `AuthorizationSelector` + - The selector of the authwit type, used to identify it when emitted from `emit_offchain_effect`oracle. Computed as poseidon2("CallAuthwit((Field),(u32),Field)".to_bytes()) +- `innerHash`: `Fr` + - The inner hash of the authwit, computed as poseidon2([msg_sender, selector, args_hash]) +- `msgSender`: `AztecAddress` + - The address performing the call +- `functionSelector`: `FunctionSelector` + - The selector of the function that is to be authorized +- `argsHash`: `Fr` + - The hash of the arguments to the function call, +- `args`: `Fr[]` + - The arguments to the function call. + +#### Methods + + +##### getSelector + +**Signature:** + +```typescript +static getSelector(): Promise +``` + +**Returns:** + +`Promise` + +##### fromFields + +**Signature:** + +```typescript +static async fromFields(fields: Fr[]): Promise +``` + +**Parameters:** + +- `fields`: `Fr[]` + +**Returns:** + +`Promise` + +## Contract + + +--- + +### `contract/base_contract_interaction.ts` + + +#### BaseContractInteraction + +**Type:** Class + +Base class for an interaction with a contract, be it a deployment, a function call, or a batch. Implements the sequence create/simulate/send. + + +#### Constructor + +**Signature:** + +```typescript +constructor( + protected wallet: Wallet, + protected authWitnesses: AuthWitness[] = [], + protected capsules: Capsule[] = [] +) +``` + +**Parameters:** + +- `wallet`: `Wallet` +- `authWitnesses` (optional): `AuthWitness[]` +- `capsules` (optional): `Capsule[]` + +#### Properties + + +##### log + +**Type:** `any` + + +#### Methods + + +##### request + +Returns an execution request that represents this operation. Can be used as a building block for constructing batch requests. + +**Signature:** + +```typescript +public abstract request(options?: RequestInteractionOptions): Promise +``` + +**Parameters:** + +- `options` (optional): `RequestInteractionOptions` + - An optional object containing additional configuration for the transaction. + +**Returns:** + +`Promise` - An execution request wrapped in promise. + +##### send + +Sends a transaction to the contract function with the specified options. This function throws an error if called on a utility function. It creates and signs the transaction if necessary, and returns a SentTx instance, which can be used to track the transaction status, receipt, and events. + +**Signature:** + +```typescript +public send(options: SendInteractionOptions): SentTx +``` + +**Parameters:** + +- `options`: `SendInteractionOptions` + - An object containing 'from' property representing the AztecAddress of the sender and optional fee configuration + +**Returns:** + +`SentTx` - A SentTx instance for tracking the transaction status and information. + +--- + +### `contract/batch_call.ts` + + +#### BatchCall + +**Type:** Class + +A batch of function calls to be sent as a single transaction through a wallet. + +**Extends:** `BaseContractInteraction` + + +#### Constructor + +**Signature:** + +```typescript +constructor( + wallet: Wallet, + protected interactions: (BaseContractInteraction | ExecutionPayload)[] +) +``` + +**Parameters:** + +- `wallet`: `Wallet` +- `interactions`: `(BaseContractInteraction | ExecutionPayload)[]` + +#### Methods + + +##### request + +Returns an execution request that represents this operation. + +**Signature:** + +```typescript +public async request(options: RequestInteractionOptions = {}): Promise +``` + +**Parameters:** + +- `options` (optional): `RequestInteractionOptions` + - An optional object containing additional configuration for the request generation. + +**Returns:** + +`Promise` - An execution payload wrapped in promise. + +##### simulate + +Simulates the batch, supporting private, public and utility functions. Although this is a single interaction with the wallet, private and public functions will be grouped into a single ExecutionPayload that the wallet will simulate as a single transaction. Utility function calls will simply be executed one by one. + +**Signature:** + +```typescript +public async simulate(options: SimulateInteractionOptions): Promise +``` + +**Parameters:** + +- `options`: `SimulateInteractionOptions` + - An optional object containing additional configuration for the interaction. + +**Returns:** + +`Promise` - The results of all the interactions that make up the batch + +##### getExecutionPayloads + +**Signature:** + +```typescript +protected async getExecutionPayloads(): Promise +``` + +**Returns:** + +`Promise` + +--- + +### `contract/checker.ts` + + +#### abiChecker + +**Type:** Function + +Validates the given ContractArtifact object by checking its functions and their parameters. Ensures that the ABI has at least one function, a constructor, valid bytecode, and correct parameter types. Throws an error if any inconsistency is detected during the validation process. + +**Signature:** + +```typescript +export abiChecker(artifact: ContractArtifact) +``` + +**Parameters:** + +- `artifact`: `ContractArtifact` + - The ContractArtifact object to be validated. + +**Returns:** + +`boolean` - A boolean value indicating whether the artifact is valid or not. + +--- + +### `contract/contract_base.ts` + + +#### ContractMethod + +**Type:** Type Alias + +Type representing a contract method that returns a ContractFunctionInteraction instance and has a readonly 'selector' property of type Buffer. Takes any number of arguments. + +**Signature:** + +```typescript +export type ContractMethod = ((...args: any[]) => ContractFunctionInteraction) & { + selector: () => Promise; +}; +``` + +**Type Members:** + +##### selector + +The unique identifier for a contract function in bytecode. + +**Type:** `() => Promise` + + +#### ContractStorageLayout + +**Type:** Type Alias + +Type representing the storage layout of a contract. + +**Signature:** + +```typescript +export type ContractStorageLayout = { + [K in T]: FieldLayout; +}; +``` + +**Type Members:** + +##### [K in T] + +**Signature:** `[K in T]: FieldLayout` + +**Key Type:** `T` + +**Value Type:** `FieldLayout` + + +#### ContractBase + +**Type:** Class + +Abstract implementation of a contract extended by the Contract class and generated contract types. + + +#### Constructor + +**Signature:** + +```typescript +protected constructor( + public readonly address: AztecAddress, + public readonly artifact: ContractArtifact, + public wallet: Wallet +) +``` + +**Parameters:** + +- `address`: `AztecAddress` + - The contract's address. +- `artifact`: `ContractArtifact` + - The Application Binary Interface for the contract. +- `wallet`: `Wallet` + - The wallet used for interacting with this contract. + +#### Properties + + +##### methods + +An object containing contract methods mapped to their respective names. + +**Type:** `{ [name: string]: ContractMethod }` + + +#### Methods + + +##### withWallet + +Creates a new instance of the contract wrapper attached to a different wallet. + +**Signature:** + +```typescript +public withWallet(wallet: Wallet): this +``` + +**Parameters:** + +- `wallet`: `Wallet` + - Wallet to use for sending txs. + +**Returns:** + +`this` - A new contract instance. + +--- + +### `contract/contract_function_interaction.ts` + + +#### ContractFunctionInteraction + +**Type:** Class + +This is the class that is returned when calling e.g. `contract.methods.myMethod(arg0, arg1)`. It contains available interactions one can call on a method, including view. + +**Extends:** `BaseContractInteraction` + + +#### Constructor + +**Signature:** + +```typescript +constructor( + wallet: Wallet, + protected contractAddress: AztecAddress, + protected functionDao: FunctionAbi, + protected args: any[], + authWitnesses: AuthWitness[] = [], + capsules: Capsule[] = [], + private extraHashedArgs: HashedValues[] = [] +) +``` + +**Parameters:** + +- `wallet`: `Wallet` +- `contractAddress`: `AztecAddress` +- `functionDao`: `FunctionAbi` +- `args`: `any[]` +- `authWitnesses` (optional): `AuthWitness[]` +- `capsules` (optional): `Capsule[]` +- `extraHashedArgs` (optional): `HashedValues[]` + +#### Methods + + +##### getFunctionCall + +Returns the encoded function call wrapped by this interaction Useful when generating authwits + +**Signature:** + +```typescript +public async getFunctionCall() +``` + +**Returns:** + +`Promise<{ name: any; args: any; selector: any; type: any; to: AztecAddress; isStatic: any; hideMsgSender: boolean; returnTypes: any; }>` - An encoded function call + +##### request + +Returns the execution payload that allows this operation to happen on chain. + +**Signature:** + +```typescript +public override async request(options: RequestInteractionOptions = {}): Promise +``` + +**Parameters:** + +- `options` (optional): `RequestInteractionOptions` + - Configuration options. + +**Returns:** + +`Promise` - The execution payload for this operation + +##### simulate + +Simulate a transaction and get information from its execution. Differs from prove in a few important ways: 1. It returns the values of the function execution, plus additional metadata if requested 2. It supports `utility`, `private` and `public` functions + +**Signature:** + +```typescript +public async simulate(options: T): Promise['estimateGas']>> +``` + +**Parameters:** + +- `options`: `T` + - An optional object containing additional configuration for the simulation. + +**Returns:** + +`Promise['estimateGas']>>` - Depending on the simulation options, this method directly returns the result value of the executed function or a rich object containing extra metadata, such as estimated gas costs (if requested via options), execution statistics and emitted offchain effects + +##### simulate + +**Signature:** + +```typescript +public async simulate(options: T): Promise> +``` + +**Parameters:** + +- `options`: `T` + +**Returns:** + +`Promise>` + +##### simulate + +**Signature:** + +```typescript +public async simulate(options: SimulateInteractionOptions): Promise> +``` + +**Parameters:** + +- `options`: `SimulateInteractionOptions` + +**Returns:** + +`Promise>` + +##### profile + +Simulate a transaction and profile the gate count for each function in the transaction. + +**Signature:** + +```typescript +public async profile(options: ProfileInteractionOptions): Promise +``` + +**Parameters:** + +- `options`: `ProfileInteractionOptions` + - Same options as `simulate`, plus profiling method + +**Returns:** + +`Promise` - An object containing the function return value and profile result. + +##### with + +Augments this ContractFunctionInteraction with additional metadata, such as authWitnesses, capsules, and extraHashedArgs. This is useful when creating a "batteries included" interaction, such as registering a contract class with its associated capsule instead of having the user provide them externally. + +**Signature:** + +```typescript +public with({ authWitnesses = [], capsules = [], extraHashedArgs = [], }: { + authWitnesses?: AuthWitness[]; + capsules?: Capsule[]; + extraHashedArgs?: HashedValues[]; +}): ContractFunctionInteraction +``` + +**Parameters:** + +- `{ + authWitnesses = [], + capsules = [], + extraHashedArgs = [], + }`: `{ + /** The authWitnesses to add to the interaction */ + authWitnesses?: AuthWitness[]; + /** The capsules to add to the interaction */ + capsules?: Capsule[]; + /** The extra hashed args to add to the interaction */ + extraHashedArgs?: HashedValues[]; + }` + +**Returns:** + +`ContractFunctionInteraction` - A new ContractFunctionInteraction with the added metadata, but calling the same original function in the same manner + +--- + +### `contract/contract.ts` + + +#### Contract + +**Type:** Class + +The Contract class represents a contract and provides utility methods for interacting with it. It enables the creation of ContractFunctionInteraction instances for each function in the contract's ABI, allowing users to call or send transactions to these functions. Additionally, the Contract class can be used to attach the contract instance to a deployed contract onchain through the PXE, which facilitates interaction with Aztec's privacy protocol. + +**Extends:** `ContractBase` + + +#### Methods + + +##### at + +Gets a contract instance. + +**Signature:** + +```typescript +public static at( + address: AztecAddress, + artifact: ContractArtifact, + wallet: Wallet +): Contract +``` + +**Parameters:** + +- `address`: `AztecAddress` + - The address of the contract instance. +- `artifact`: `ContractArtifact` + - Build artifact of the contract. +- `wallet`: `Wallet` + - The wallet to use when interacting with the contract. + +**Returns:** + +`Contract` - A promise that resolves to a new Contract instance. + +##### deploy + +Creates a tx to deploy (initialize and/or publish) a new instance of a contract. + +**Signature:** + +```typescript +public static deploy( + wallet: Wallet, + artifact: ContractArtifact, + args: any[], + constructorName?: string +) +``` + +**Parameters:** + +- `wallet`: `Wallet` + - The wallet for executing the deployment. +- `artifact`: `ContractArtifact` + - Build artifact of the contract to deploy +- `args`: `any[]` + - Arguments for the constructor. +- `constructorName` (optional): `string` + - The name of the constructor function to call. + +**Returns:** + +`DeployMethod` + +##### deployWithPublicKeys + +Creates a tx to deploy (initialize and/or publish) a new instance of a contract using the specified public keys hash to derive the address. + +**Signature:** + +```typescript +public static deployWithPublicKeys( + publicKeys: PublicKeys, + wallet: Wallet, + artifact: ContractArtifact, + args: any[], + constructorName?: string +) +``` + +**Parameters:** + +- `publicKeys`: `PublicKeys` + - Hash of public keys to use for deriving the address. +- `wallet`: `Wallet` + - The wallet for executing the deployment. +- `artifact`: `ContractArtifact` + - Build artifact of the contract. +- `args`: `any[]` + - Arguments for the constructor. +- `constructorName` (optional): `string` + - The name of the constructor function to call. + +**Returns:** + +`DeployMethod` + +--- + +### `contract/deploy_method.ts` + + +#### RequestDeployOptions + +**Type:** Type Alias + +Options for deploying a contract on the Aztec network. Allows specifying a contract address salt and different options to tweak contract publication and initialization + +**Signature:** + +```typescript +export type RequestDeployOptions = RequestInteractionOptions & { + contractAddressSalt?: Fr; + deployer?: AztecAddress; + skipClassPublication?: boolean; + skipInstancePublication?: boolean; + skipInitialization?: boolean; + skipRegistration?: boolean; +}; +``` + +**Type Members:** + +##### contractAddressSalt + +An optional salt value used to deterministically calculate the contract address. + +**Type:** `Fr` + +##### deployer + +Deployer address that will be used for the deployed contract's address computation. If set to 0, the sender's address won't be mixed in + +**Type:** `AztecAddress` + +##### skipClassPublication + +Skip contract class publication. + +**Type:** `boolean` + +##### skipInstancePublication + +Skip publication, instead just privately initialize the contract. + +**Type:** `boolean` + +##### skipInitialization + +Skip contract initialization. + +**Type:** `boolean` + +##### skipRegistration + +Skip contract registration in the wallet + +**Type:** `boolean` + + +#### DeployOptions + +**Type:** Type Alias + +Extends the deployment options with the required parameters to send the transaction + +**Signature:** + +```typescript +export type DeployOptions = Omit & { + universalDeploy?: boolean; +} & Pick; +``` + +**Type Members:** + +##### universalDeploy + +Set to true to *not* include the sender in the address computation. This option is mutually exclusive with "deployer" + +**Type:** `boolean` + + +#### SimulateDeployOptions + +**Type:** Type Alias + +Options for simulating the deployment of a contract Allows skipping certain validations and computing gas estimations + +**Signature:** + +```typescript +export type SimulateDeployOptions = Omit & { + fee?: SimulationInteractionFeeOptions; + skipTxValidation?: boolean; + skipFeeEnforcement?: boolean; + includeMetadata?: boolean; +}; +``` + +**Type Members:** + +##### fee + +The fee options for the transaction. + +**Type:** `SimulationInteractionFeeOptions` + +##### skipTxValidation + +Simulate without checking for the validity of the resulting transaction, e.g. whether it emits any existing nullifiers. + +**Type:** `boolean` + +##### skipFeeEnforcement + +Whether to ensure the fee payer is not empty and has enough balance to pay for the fee. + +**Type:** `boolean` + +##### includeMetadata + +Whether to include metadata such as offchain effects and performance statistics (e.g. timing information of the different circuits and oracles) in the simulation result, instead of just the return value of the function + +**Type:** `boolean` + + +#### DeployMethod + +**Type:** Class + +Contract interaction for deployment. Handles class publication, instance publication, and initialization of the contract. Note that for some contracts, a tx is not required as part of its "creation": If there are no public functions, and if there are no initialization functions, then technically the contract has already been "created", and all of the contract's functions (private and utility) can be interacted-with immediately, without any "deployment tx". Extends the BaseContractInteraction class. + +**Extends:** `BaseContractInteraction` + + +#### Constructor + +**Signature:** + +```typescript +constructor( + private publicKeys: PublicKeys, + wallet: Wallet, + protected artifact: ContractArtifact, + protected postDeployCtor: (instance: ContractInstanceWithAddress, wallet: Wallet) => TContract, + private args: any[] = [], + constructorNameOrArtifact?: string | FunctionArtifact, + authWitnesses: AuthWitness[] = [], + capsules: Capsule[] = [] +) +``` + +**Parameters:** + +- `publicKeys`: `PublicKeys` +- `wallet`: `Wallet` +- `artifact`: `ContractArtifact` +- `postDeployCtor`: `(instance: ContractInstanceWithAddress, wallet: Wallet) => TContract` +- `args` (optional): `any[]` +- `constructorNameOrArtifact` (optional): `string | FunctionArtifact` +- `authWitnesses` (optional): `AuthWitness[]` +- `capsules` (optional): `Capsule[]` + +#### Methods + + +##### request + +Returns the execution payload that allows this operation to happen on chain. + +**Signature:** + +```typescript +public async request(options?: RequestDeployOptions): Promise +``` + +**Parameters:** + +- `options` (optional): `RequestDeployOptions` + - Configuration options. + +**Returns:** + +`Promise` - The execution payload for this operation + +##### convertDeployOptionsToRequestOptions + +**Signature:** + +```typescript +convertDeployOptionsToRequestOptions(options: DeployOptions): RequestDeployOptions +``` + +**Parameters:** + +- `options`: `DeployOptions` + +**Returns:** + +`RequestDeployOptions` + +##### register + +Adds this contract to the wallet and returns the Contract object. + +**Signature:** + +```typescript +public async register(options?: RequestDeployOptions): Promise +``` + +**Parameters:** + +- `options` (optional): `RequestDeployOptions` + - Deployment options. + +**Returns:** + +`Promise` + +##### getPublicationExecutionPayload + +Returns an execution payload for: - publication of the contract class and - publication of the contract instance to enable public execution depending on the provided options. + +**Signature:** + +```typescript +protected async getPublicationExecutionPayload(options?: RequestDeployOptions): Promise +``` + +**Parameters:** + +- `options` (optional): `RequestDeployOptions` + - Contract creation options. + +**Returns:** + +`Promise` - An execution payload with potentially calls (and bytecode capsule) to the class registry and instance registry. + +##### getInitializationExecutionPayload + +Returns the calls necessary to initialize the contract. + +**Signature:** + +```typescript +protected async getInitializationExecutionPayload(options?: RequestDeployOptions): Promise +``` + +**Parameters:** + +- `options` (optional): `RequestDeployOptions` + - Deployment options. + +**Returns:** + +`Promise` - An array of function calls. + +##### send + +Send a contract deployment transaction (initialize and/or publish) using the provided options. This function extends the 'send' method from the ContractFunctionInteraction class, allowing us to send a transaction specifically for contract deployment. + +**Signature:** + +```typescript +public override send(options: DeployOptions): DeploySentTx +``` + +**Parameters:** + +- `options`: `DeployOptions` + - An object containing various deployment options such as contractAddressSalt and from. + +**Returns:** + +`DeploySentTx` - A SentTx object that returns the receipt and the deployed contract instance. + +##### getInstance + +Builds the contract instance and returns it. + +**Signature:** + +```typescript +public async getInstance(options?: RequestDeployOptions): Promise +``` + +**Parameters:** + +- `options` (optional): `RequestDeployOptions` + - An object containing various initialization and publication options. + +**Returns:** + +`Promise` - An instance object. + +##### simulate + +Simulate the deployment + +**Signature:** + +```typescript +public async simulate(options: SimulateDeployOptions): Promise> +``` + +**Parameters:** + +- `options`: `SimulateDeployOptions` + - An optional object containing additional configuration for the simulation. + +**Returns:** + +`Promise>` - A simulation result object containing metadata of the execution, including gas estimations (if requested via options), execution statistics and emitted offchain effects + +##### profile + +Simulate a deployment and profile the gate count for each function in the transaction. + +**Signature:** + +```typescript +public async profile(options: DeployOptions & ProfileInteractionOptions): Promise +``` + +**Parameters:** + +- `options`: `DeployOptions & ProfileInteractionOptions` + - Same options as `send`, plus extra profiling options. + +**Returns:** + +`Promise` - An object containing the function return value and profile result. + +##### with + +Augments this DeployMethod with additional metadata, such as authWitnesses and capsules. + +**Signature:** + +```typescript +public with({ authWitnesses = [], capsules = [], }: { + authWitnesses?: AuthWitness[]; + capsules?: Capsule[]; +}): DeployMethod +``` + +**Parameters:** + +- `{ + authWitnesses = [], + capsules = [], + }`: `{ + /** The authWitnesses to add to the deployment */ + authWitnesses?: AuthWitness[]; + /** The capsules to add to the deployment */ + capsules?: Capsule[]; + }` + +**Returns:** + +`DeployMethod` - A new DeployMethod with the added metadata, but calling the same original function in the same manner + +#### Getters + + +##### address (getter) + +Return this deployment address. + +**Signature:** + +```typescript +public get address() { +``` + +**Returns:** `any` + +##### partialAddress (getter) + +Returns the partial address for this deployment. + +**Signature:** + +```typescript +public get partialAddress() { +``` + +**Returns:** `any` + +--- + +### `contract/deploy_sent_tx.ts` + + +#### DeployedWaitOpts + +**Type:** Type Alias + +Options related to waiting for a deployment tx. + +**Signature:** + +```typescript +export type DeployedWaitOpts = WaitOpts & { + wallet?: Wallet; +}; +``` + +**Type Members:** + +##### wallet + +Wallet to use for creating a contract instance. Uses the one set in the deployer constructor if not set. + +**Type:** `Wallet` + + +#### DeployTxReceipt + +**Type:** Type Alias + +Extends a transaction receipt with a contract instance that represents the newly deployed contract. + +**Signature:** + +```typescript +export type DeployTxReceipt = FieldsOf & { + contract: TContract; + instance: ContractInstanceWithAddress; +}; +``` + +**Type Members:** + +##### contract + +Instance of the newly deployed contract. + +**Type:** `TContract` + +##### instance + +The deployed contract instance with address and metadata. + +**Type:** `ContractInstanceWithAddress` + + +#### DeploySentTx + +**Type:** Class + +A contract deployment transaction sent to the network, extending SentTx with methods to publish a contract instance. + +**Extends:** `SentTx` + + +#### Constructor + +**Signature:** + +```typescript +constructor( + wallet: Wallet, + sendTx: () => Promise, + private postDeployCtor: (instance: ContractInstanceWithAddress, wallet: Wallet) => TContract, + private instanceGetter: () => Promise +) +``` + +**Parameters:** + +- `wallet`: `Wallet` +- `sendTx`: `() => Promise` +- `postDeployCtor`: `(instance: ContractInstanceWithAddress, wallet: Wallet) => TContract` +- `instanceGetter`: `() => Promise` + - A getter for the deployed contract instance + +#### Methods + + +##### getInstance + +Returns the contract instance for this deployment. + +**Signature:** + +```typescript +public async getInstance(): Promise +``` + +**Returns:** + +`Promise` - The deployed contract instance with address and metadata. + +##### deployed + +Awaits for the tx to be mined and returns the contract instance. Throws if tx is not mined. + +**Signature:** + +```typescript +public async deployed(opts?: DeployedWaitOpts): Promise +``` + +**Parameters:** + +- `opts` (optional): `DeployedWaitOpts` + - Options for configuring the waiting for the tx to be mined. + +**Returns:** + +`Promise` - The deployed contract instance. + +##### wait + +Awaits for the tx to be mined and returns the receipt along with a contract instance. Throws if tx is not mined. + +**Signature:** + +```typescript +public override async wait(opts?: DeployedWaitOpts): Promise> +``` + +**Parameters:** + +- `opts` (optional): `DeployedWaitOpts` + - Options for configuring the waiting for the tx to be mined. + +**Returns:** + +`Promise>` - The transaction receipt with the deployed contract instance. + +--- + +### `contract/get_gas_limits.ts` + + +#### getGasLimits + +**Type:** Function + +Returns suggested total and teardown gas limits for a simulated tx. + +**Signature:** + +```typescript +export getGasLimits( + simulationResult: TxSimulationResult, + pad = 0.1 +): { + gasLimits: Gas; + teardownGasLimits: Gas; +} +``` + +**Parameters:** + +- `simulationResult`: `TxSimulationResult` +- `pad` (optional): `any` + - Percentage to pad the suggested gas limits by, (as decimal, e.g., 0.10 for 10%). + +**Returns:** + +```typescript +{ + /** + * Gas limit for the tx, excluding teardown gas + */ + gasLimits: Gas; + /** + * Gas limit for the teardown phase + */ + teardownGasLimits: Gas; +} +``` + +--- + +### `contract/interaction_options.ts` + + +#### FeeEstimationOptions + +**Type:** Type Alias + +Options used to tweak the simulation and add gas estimation capabilities + +**Signature:** + +```typescript +export type FeeEstimationOptions = { + estimateGas?: boolean; + estimatedGasPadding?: number; +}; +``` + +**Type Members:** + +##### estimateGas + +Whether to modify the fee settings of the simulation with high gas limit to figure out actual gas settings. + +**Type:** `boolean` + +##### estimatedGasPadding + +Percentage to pad the estimated gas limits by, if empty, defaults to 0.1. Only relevant if estimateGas is set. + +**Type:** `number` + + +#### FeePaymentMethodOption + +**Type:** Type Alias + +Interactions allow configuring a custom fee payment method that gets bundled with the transaction before sending it to the wallet + +**Signature:** + +```typescript +export type FeePaymentMethodOption = { + paymentMethod?: FeePaymentMethod; +}; +``` + +**Type Members:** + +##### paymentMethod + +Fee payment method to embed in the interaction + +**Type:** `FeePaymentMethod` + + +#### GasSettingsOption + +**Type:** Type Alias + +User-defined partial gas settings for the interaction. This type is completely optional since the wallet will fill in the missing options + +**Signature:** + +```typescript +export type GasSettingsOption = { + gasSettings?: Partial>; +}; +``` + +**Type Members:** + +##### gasSettings + +The gas settings + +**Type:** `Partial>` + + +#### InteractionFeeOptions + +**Type:** Type Alias + +Fee options as set by a user. + +**Signature:** + +```typescript +export type InteractionFeeOptions = GasSettingsOption & FeePaymentMethodOption; +``` + +#### SimulationInteractionFeeOptions + +**Type:** Type Alias + +Fee options that can be set for simulation *only* + +**Signature:** + +```typescript +export type SimulationInteractionFeeOptions = InteractionFeeOptions & FeeEstimationOptions; +``` + +#### RequestInteractionOptions + +**Type:** Type Alias + +Represents the options to configure a request from a contract interaction. Allows specifying additional auth witnesses and capsules to use during execution + +**Signature:** + +```typescript +export type RequestInteractionOptions = { + authWitnesses?: AuthWitness[]; + capsules?: Capsule[]; + fee?: FeePaymentMethodOption; +}; +``` + +**Type Members:** + +##### authWitnesses + +Extra authwits to use during execution + +**Type:** `AuthWitness[]` + +##### capsules + +Extra capsules to use during execution + +**Type:** `Capsule[]` + +##### fee + +Fee payment method to embed in the interaction request + +**Type:** `FeePaymentMethodOption` + + +#### SendInteractionOptions + +**Type:** Type Alias + +Represents options for calling a (constrained) function in a contract. + +**Signature:** + +```typescript +export type SendInteractionOptions = RequestInteractionOptions & { + from: AztecAddress; + fee?: InteractionFeeOptions; +}; +``` + +**Type Members:** + +##### from + +The sender's Aztec address. + +**Type:** `AztecAddress` + +##### fee + +The fee options for the transaction. + +**Type:** `InteractionFeeOptions` + + +#### SimulateInteractionOptions + +**Type:** Type Alias + +Represents the options for simulating a contract function interaction. Allows specifying the address from which the method should be called. Disregarded for simulation of public functions + +**Signature:** + +```typescript +export type SimulateInteractionOptions = Omit & { + fee?: SimulationInteractionFeeOptions; + skipTxValidation?: boolean; + skipFeeEnforcement?: boolean; + includeMetadata?: boolean; +}; +``` + +**Type Members:** + +##### fee + +The fee options for the transaction. + +**Type:** `SimulationInteractionFeeOptions` + +##### skipTxValidation + +Simulate without checking for the validity of the resulting transaction, e.g. whether it emits any existing nullifiers. + +**Type:** `boolean` + +##### skipFeeEnforcement + +Whether to ensure the fee payer is not empty and has enough balance to pay for the fee. + +**Type:** `boolean` + +##### includeMetadata + +Whether to include metadata such as offchain effects and performance statistics (e.g. timing information of the different circuits and oracles) in the simulation result, instead of just the return value of the function + +**Type:** `boolean` + + +#### ProfileInteractionOptions + +**Type:** Type Alias + +Represents the options for profiling an interaction. + +**Signature:** + +```typescript +export type ProfileInteractionOptions = SimulateInteractionOptions & { + profileMode: 'gates' | 'execution-steps' | 'full'; + skipProofGeneration?: boolean; +}; +``` + +**Type Members:** + +##### profileMode + +Whether to return gates information or the bytecode/witnesses. + +**Type:** `'gates' | 'execution-steps' | 'full'` + +##### skipProofGeneration + +Whether to generate a Chonk proof or not + +**Type:** `boolean` + + +#### SimulationReturn + +**Type:** Type Alias + +Represents the result type of a simulation. By default, it will just be the return value of the simulated function If `includeMetadata` is set to true in `SimulateInteractionOptions` on the input of `simulate(...)`, it will provide extra information. + +**Signature:** + +```typescript +export type SimulationReturn = T extends true + ? { + stats: SimulationStats; + offchainEffects: OffchainEffect[]; + result: any; + estimatedGas: Pick; + } + : any; +``` + +#### toSendOptions + +**Type:** Function + +Transforms and cleans up the higher level SendInteractionOptions defined by the interaction into SendOptions, which are the ones that can be serialized and forwarded to the wallet + +**Signature:** + +```typescript +export toSendOptions(options: SendInteractionOptions): SendOptions +``` + +**Parameters:** + +- `options`: `SendInteractionOptions` + +**Returns:** + +`SendOptions` + +#### toSimulateOptions + +**Type:** Function + +Transforms and cleans up the higher level SimulateInteractionOptions defined by the interaction into SimulateOptions, which are the ones that can be serialized and forwarded to the wallet + +**Signature:** + +```typescript +export toSimulateOptions(options: SimulateInteractionOptions): SimulateOptions +``` + +**Parameters:** + +- `options`: `SimulateInteractionOptions` + +**Returns:** + +`SimulateOptions` + +#### toProfileOptions + +**Type:** Function + +Transforms and cleans up the higher level ProfileInteractionOptions defined by the interaction into ProfileOptions, which are the ones that can be serialized and forwarded to the wallet + +**Signature:** + +```typescript +export toProfileOptions(options: ProfileInteractionOptions): ProfileOptions +``` + +**Parameters:** + +- `options`: `ProfileInteractionOptions` + +**Returns:** + +`ProfileOptions` + +--- + +### `contract/protocol_contracts.ts` + + +#### getClassRegistryContract + +**Type:** Function + +Returns a Contract wrapper for the contract class registry. + +**Signature:** + +```typescript +export async getClassRegistryContract(wallet: Wallet) +``` + +**Parameters:** + +- `wallet`: `Wallet` + +**Returns:** + +`Promise` + +#### getInstanceRegistryContract + +**Type:** Function + +Returns a Contract wrapper for the contract instance registry. + +**Signature:** + +```typescript +export async getInstanceRegistryContract(wallet: Wallet) +``` + +**Parameters:** + +- `wallet`: `Wallet` + +**Returns:** + +`Promise` + +#### getFeeJuice + +**Type:** Function + +Returns a Contract wrapper for the fee juice contract + +**Signature:** + +```typescript +export async getFeeJuice(wallet: Wallet) +``` + +**Parameters:** + +- `wallet`: `Wallet` + +**Returns:** + +`Promise` + +--- + +### `contract/sent_tx.ts` + + +#### WaitOpts + +**Type:** Type Alias + +Options related to waiting for a tx. + +**Signature:** + +```typescript +export type WaitOpts = { + ignoreDroppedReceiptsFor?: number; + timeout?: number; + interval?: number; + dontThrowOnRevert?: boolean; +}; +``` + +**Type Members:** + +##### ignoreDroppedReceiptsFor + +The amount of time to ignore TxStatus.DROPPED receipts (in seconds) due to the presumption that it is being propagated by the p2p network. Defaults to 5. + +**Type:** `number` + +##### timeout + +The maximum time (in seconds) to wait for the transaction to be mined. Defaults to 60. + +**Type:** `number` + +##### interval + +The time interval (in seconds) between retries to fetch the transaction receipt. Defaults to 1. + +**Type:** `number` + +##### dontThrowOnRevert + +Whether to accept a revert as a status code for the tx when waiting for it. If false, will throw if the tx reverts. + +**Type:** `boolean` + + +#### DefaultWaitOpts + +**Type:** Constant + +**Value Type:** `WaitOpts` + + +#### SentTx + +**Type:** Class + +The SentTx class represents a sent transaction through the PXE (or directly to a node) providing methods to fetch its hash, receipt, and mining status. + + +#### Constructor + +**Signature:** + +```typescript +constructor( + protected walletOrNode: Wallet | AztecNode, + sendTx: () => Promise +) +``` + +**Parameters:** + +- `walletOrNode`: `Wallet | AztecNode` +- `sendTx`: `() => Promise` + +#### Properties + + +##### sendTxPromise + +**Type:** `Promise` + + +##### sendTxError + +**Type:** `Error` + + +##### txHash + +**Type:** `TxHash` + + +#### Methods + + +##### getTxHash + +Retrieves the transaction hash of the SentTx instance. The function internally awaits for the 'txHashPromise' to resolve, and then returns the resolved transaction hash. + +**Signature:** + +```typescript +public async getTxHash(): Promise +``` + +**Returns:** + +`Promise` - A promise that resolves to the transaction hash of the SentTx instance. TODO(#7717): Don't throw here. + +##### getReceipt + +Retrieve the transaction receipt associated with the current SentTx instance. The function fetches the transaction hash using 'getTxHash' and then queries the PXE to get the corresponding transaction receipt. + +**Signature:** + +```typescript +public async getReceipt(): Promise +``` + +**Returns:** + +`Promise` - A promise that resolves to a TxReceipt object representing the fetched transaction receipt. + +##### wait + +Awaits for a tx to be mined and returns the receipt. Throws if tx is not mined. + +**Signature:** + +```typescript +public async wait(opts?: WaitOpts): Promise> +``` + +**Parameters:** + +- `opts` (optional): `WaitOpts` + - Options for configuring the waiting for the tx to be mined. + +**Returns:** + +`Promise>` - The transaction receipt. + +##### waitForReceipt + +**Signature:** + +```typescript +protected async waitForReceipt(opts?: WaitOpts): Promise +``` + +**Parameters:** + +- `opts` (optional): `WaitOpts` + +**Returns:** + +`Promise` + +--- + +### `contract/unsafe_contract.ts` + + +#### UnsafeContract + +**Type:** Class + +Unsafe constructor for ContractBase that bypasses the check that the instance is registered in the wallet. + +**Extends:** `ContractBase` + + +#### Constructor + +**Signature:** + +```typescript +constructor( + instance: ContractInstanceWithAddress, + artifact: ContractArtifact, + wallet: Wallet +) +``` + +**Parameters:** + +- `instance`: `ContractInstanceWithAddress` + - The deployed contract instance definition. +- `artifact`: `ContractArtifact` + - The Application Binary Interface for the contract. +- `wallet`: `Wallet` + - The wallet used for interacting with this contract. + +--- + +### `contract/wait_for_proven.ts` + + +#### WaitForProvenOpts + +**Type:** Type Alias + +Options for waiting for a transaction to be proven. + +**Signature:** + +```typescript +export type WaitForProvenOpts = { + provenTimeout?: number; + interval?: number; +}; +``` + +**Type Members:** + +##### provenTimeout + +Time to wait for the tx to be proven before timing out + +**Type:** `number` + +##### interval + +Elapsed time between polls to the node + +**Type:** `number` + + +#### DefaultWaitForProvenOpts + +**Type:** Constant + +**Value Type:** `WaitForProvenOpts` + + +#### waitForProven + +**Type:** Function + +Wait for a transaction to be proven by polling the node + +**Signature:** + +```typescript +export async waitForProven( + node: AztecNode, + receipt: TxReceipt, + opts?: WaitForProvenOpts +) +``` + +**Parameters:** + +- `node`: `AztecNode` +- `receipt`: `TxReceipt` +- `opts` (optional): `WaitForProvenOpts` + +**Returns:** + +`Promise` + +## Deployment + + +--- + +### `deployment/broadcast_function.ts` + + +#### broadcastPrivateFunction + +**Type:** Function + +Sets up a call to broadcast a private function's bytecode via the ClassRegistry contract. Note that this is not required for users to call the function, but is rather a convenience to make this code publicly available so dapps or wallets do not need to redistribute it. + +**Signature:** + +```typescript +export async broadcastPrivateFunction( + wallet: Wallet, + artifact: ContractArtifact, + selector: FunctionSelector +): Promise +``` + +**Parameters:** + +- `wallet`: `Wallet` + - Wallet to send the transaction. +- `artifact`: `ContractArtifact` + - Contract artifact that contains the function to be broadcast. +- `selector`: `FunctionSelector` + - Selector of the function to be broadcast. + +**Returns:** + +`Promise` - A ContractFunctionInteraction object that can be used to send the transaction. + +#### broadcastUtilityFunction + +**Type:** Function + +Sets up a call to broadcast a utility function's bytecode via the ClassRegistry contract. Note that this is not required for users to call the function, but is rather a convenience to make this code publicly available so dapps or wallets do not need to redistribute it. + +**Signature:** + +```typescript +export async broadcastUtilityFunction( + wallet: Wallet, + artifact: ContractArtifact, + selector: FunctionSelector +): Promise +``` + +**Parameters:** + +- `wallet`: `Wallet` + - Wallet to send the transaction. +- `artifact`: `ContractArtifact` + - Contract artifact that contains the function to be broadcast. +- `selector`: `FunctionSelector` + - Selector of the function to be broadcast. + +**Returns:** + +`Promise` - A ContractFunctionInteraction object that can be used to send the transaction. + +--- + +### `deployment/contract_deployer.ts` + + +#### ContractDeployer + +**Type:** Class + +A class for deploying contract. + + +#### Constructor + +**Signature:** + +```typescript +constructor( + private artifact: ContractArtifact, + private wallet: Wallet, + private publicKeys?: PublicKeys, + private constructorName?: string +) +``` + +**Parameters:** + +- `artifact`: `ContractArtifact` +- `wallet`: `Wallet` +- `publicKeys` (optional): `PublicKeys` +- `constructorName` (optional): `string` + +#### Methods + + +##### deploy + +Deploy a contract using the provided ABI and constructor arguments. This function creates a new DeployMethod instance that can be used to send deployment transactions and query deployment status. The method accepts any number of constructor arguments, which will be passed to the contract's constructor during deployment. + +**Signature:** + +```typescript +public deploy(...args: any[]) +``` + +**Parameters:** + +- `args`: `any[]` + - The constructor arguments for the contract being deployed. + +**Returns:** + +`DeployMethod` - A DeployMethod instance configured with the ABI, PXE, and constructor arguments. + +--- + +### `deployment/publish_class.ts` + + +#### publishContractClass + +**Type:** Function + +Sets up a call to publish a contract class given its artifact. + +**Signature:** + +```typescript +export async publishContractClass( + wallet: Wallet, + artifact: ContractArtifact +): Promise +``` + +**Parameters:** + +- `wallet`: `Wallet` +- `artifact`: `ContractArtifact` + +**Returns:** + +`Promise` + +--- + +### `deployment/publish_instance.ts` + + +#### publishInstance + +**Type:** Function + +Sets up a call to the canonical contract instance registry to publish a contract instance. + +**Signature:** + +```typescript +export async publishInstance( + wallet: Wallet, + instance: ContractInstanceWithAddress +): Promise +``` + +**Parameters:** + +- `wallet`: `Wallet` + - The wallet to use for the publication (setup) tx. +- `instance`: `ContractInstanceWithAddress` + - The instance to publish. + +**Returns:** + +`Promise` + +## Ethereum + + +--- + +### `ethereum/portal_manager.ts` + + +#### L2Claim + +**Type:** Type Alias + +L1 to L2 message info to claim it on L2. + +**Signature:** + +```typescript +export type L2Claim = { + claimSecret: Fr; + claimSecretHash: Fr; + messageHash: Hex; + messageLeafIndex: bigint; +}; +``` + +**Type Members:** + +##### claimSecret + +Secret for claiming. + +**Type:** `Fr` + +##### claimSecretHash + +Hash of the secret for claiming. + +**Type:** `Fr` + +##### messageHash + +Hash of the message. + +**Type:** `Hex` + +##### messageLeafIndex + +Leaf index in the L1 to L2 message tree. + +**Type:** `bigint` + + +#### L2AmountClaim + +**Type:** Type Alias + +L1 to L2 message info that corresponds to an amount to claim. + +**Signature:** + +```typescript +export type L2AmountClaim = L2Claim & { claimAmount: bigint }; +``` + +**Type Members:** + +##### claimAmount + +**Type:** `bigint` + + +#### L2AmountClaimWithRecipient + +**Type:** Type Alias + +L1 to L2 message info that corresponds to an amount to claim with associated recipient. + +**Signature:** + +```typescript +export type L2AmountClaimWithRecipient = L2AmountClaim & { + recipient: AztecAddress; +}; +``` + +**Type Members:** + +##### recipient + +Address that will receive the newly minted notes. + +**Type:** `AztecAddress` + + +#### generateClaimSecret + +**Type:** Function + +Generates a pair secret and secret hash + +**Signature:** + +```typescript +export async generateClaimSecret(logger?: Logger): Promise<[ + Fr, + Fr + ]> +``` + +**Parameters:** + +- `logger` (optional): `Logger` + +**Returns:** + +`Promise<[Fr, Fr]>` + +#### L1TokenManager + +**Type:** Class + +Helper for managing an ERC20 on L1. + + +#### Constructor + +**Signature:** + +```typescript +public constructor( + public readonly tokenAddress: EthAddress, + public readonly handlerAddress: EthAddress | undefined, + private readonly extendedClient: ExtendedViemWalletClient, + private logger: Logger +) +``` + +**Parameters:** + +- `tokenAddress`: `EthAddress` + - Address of the ERC20 contract. +- `handlerAddress`: `EthAddress | undefined` + - Address of the handler/faucet contract. +- `extendedClient`: `ExtendedViemWalletClient` +- `logger`: `Logger` + +#### Methods + + +##### getMintAmount + +Returns the amount of tokens available to mint via the handler. + +**Signature:** + +```typescript +public async getMintAmount() +``` + +**Returns:** + +`Promise` + +##### getL1TokenBalance + +Returns the balance of the given address. + +**Signature:** + +```typescript +public async getL1TokenBalance(address: Hex) +``` + +**Parameters:** + +- `address`: `Hex` + - Address to get the balance of. + +**Returns:** + +`Promise` + +##### mint + +Mints a fixed amount of tokens for the given address. Returns once the tx has been mined. + +**Signature:** + +```typescript +public async mint( + address: Hex, + addressName?: string +) +``` + +**Parameters:** + +- `address`: `Hex` + - Address to mint the tokens for. +- `addressName` (optional): `string` + - Optional name of the address for logging. + +**Returns:** + +`Promise` + +##### approve + +Approves tokens for the given address. Returns once the tx has been mined. + +**Signature:** + +```typescript +public async approve( + amount: bigint, + address: Hex, + addressName = '' +) +``` + +**Parameters:** + +- `amount`: `bigint` + - Amount to approve. +- `address`: `Hex` + - Address to approve the tokens for. +- `addressName` (optional): `any` + - Optional name of the address for logging. + +**Returns:** + +`Promise` + +#### L1FeeJuicePortalManager + +**Type:** Class + +Helper for interacting with the FeeJuicePortal on L1. + + +#### Constructor + +**Signature:** + +```typescript +constructor( + portalAddress: EthAddress, + tokenAddress: EthAddress, + handlerAddress: EthAddress, + private readonly extendedClient: ExtendedViemWalletClient, + private readonly logger: Logger +) +``` + +**Parameters:** + +- `portalAddress`: `EthAddress` +- `tokenAddress`: `EthAddress` +- `handlerAddress`: `EthAddress` +- `extendedClient`: `ExtendedViemWalletClient` +- `logger`: `Logger` + +#### Methods + + +##### getTokenManager + +Returns the associated token manager for the L1 ERC20. + +**Signature:** + +```typescript +public getTokenManager() +``` + +**Returns:** + +`L1TokenManager` + +##### bridgeTokensPublic + +Bridges fee juice from L1 to L2 publicly. Handles L1 ERC20 approvals. Returns once the tx has been mined. + +**Signature:** + +```typescript +public async bridgeTokensPublic( + to: AztecAddress, + amount: bigint | undefined, + mint = false +): Promise +``` + +**Parameters:** + +- `to`: `AztecAddress` + - Address to send the tokens to on L2. +- `amount`: `bigint | undefined` + - Amount of tokens to send. +- `mint` (optional): `any` + - Whether to mint the tokens before sending (only during testing). + +**Returns:** + +`Promise` + +##### new + +Creates a new instance + +**Signature:** + +```typescript +public static async new( + node: AztecNode, + extendedClient: ExtendedViemWalletClient, + logger: Logger +): Promise +``` + +**Parameters:** + +- `node`: `AztecNode` + - Aztec node client used for retrieving the L1 contract addresses. +- `extendedClient`: `ExtendedViemWalletClient` + - Wallet client, extended with public actions. +- `logger`: `Logger` + - Logger. + +**Returns:** + +`Promise` + +#### L1ToL2TokenPortalManager + +**Type:** Class + +Helper for interacting with a test TokenPortal on L1 for sending tokens to L2. + + +#### Constructor + +**Signature:** + +```typescript +constructor( + portalAddress: EthAddress, + tokenAddress: EthAddress, + handlerAddress: EthAddress | undefined, + protected extendedClient: ExtendedViemWalletClient, + protected logger: Logger +) +``` + +**Parameters:** + +- `portalAddress`: `EthAddress` +- `tokenAddress`: `EthAddress` +- `handlerAddress`: `EthAddress | undefined` +- `extendedClient`: `ExtendedViemWalletClient` +- `logger`: `Logger` + +#### Properties + + +##### portal + +**Type:** `ViemContract` + + +##### tokenManager + +**Type:** `L1TokenManager` + + +#### Methods + + +##### getTokenManager + +Returns the token manager for the underlying L1 token. + +**Signature:** + +```typescript +public getTokenManager() +``` + +**Returns:** + +`L1TokenManager` + +##### bridgeTokensPublic + +Bridges tokens from L1 to L2. Handles token approvals. Returns once the tx has been mined. + +**Signature:** + +```typescript +public async bridgeTokensPublic( + to: AztecAddress, + amount: bigint, + mint = false +): Promise +``` + +**Parameters:** + +- `to`: `AztecAddress` + - Address to send the tokens to on L2. +- `amount`: `bigint` + - Amount of tokens to send. +- `mint` (optional): `any` + - Whether to mint the tokens before sending (only during testing). + +**Returns:** + +`Promise` + +##### bridgeTokensPrivate + +Bridges tokens from L1 to L2 privately. Handles token approvals. Returns once the tx has been mined. + +**Signature:** + +```typescript +public async bridgeTokensPrivate( + to: AztecAddress, + amount: bigint, + mint = false +): Promise +``` + +**Parameters:** + +- `to`: `AztecAddress` + - Address to send the tokens to on L2. +- `amount`: `bigint` + - Amount of tokens to send. +- `mint` (optional): `any` + - Whether to mint the tokens before sending (only during testing). + +**Returns:** + +`Promise` + +#### L1TokenPortalManager + +**Type:** Class + +Helper for interacting with a test TokenPortal on L1 for both withdrawing from and bridging to L2. + +**Extends:** `L1ToL2TokenPortalManager` + + +#### Constructor + +**Signature:** + +```typescript +constructor( + portalAddress: EthAddress, + tokenAddress: EthAddress, + handlerAddress: EthAddress | undefined, + outboxAddress: EthAddress, + extendedClient: ExtendedViemWalletClient, + logger: Logger +) +``` + +**Parameters:** + +- `portalAddress`: `EthAddress` +- `tokenAddress`: `EthAddress` +- `handlerAddress`: `EthAddress | undefined` +- `outboxAddress`: `EthAddress` +- `extendedClient`: `ExtendedViemWalletClient` +- `logger`: `Logger` + +#### Methods + + +##### withdrawFunds + +Withdraws funds from the portal by consuming an L2 to L1 message. Returns once the tx is mined on L1. + +**Signature:** + +```typescript +public async withdrawFunds( + amount: bigint, + recipient: EthAddress, + blockNumber: bigint, + messageIndex: bigint, + siblingPath: SiblingPath +) +``` + +**Parameters:** + +- `amount`: `bigint` + - Amount to withdraw. +- `recipient`: `EthAddress` + - Who will receive the funds. +- `blockNumber`: `bigint` + - L2 block number of the message. +- `messageIndex`: `bigint` + - Index of the message. +- `siblingPath`: `SiblingPath` + - Sibling path of the message. + +**Returns:** + +`Promise` + +##### getL2ToL1MessageLeaf + +Computes the L2 to L1 message leaf for the given parameters. + +**Signature:** + +```typescript +public async getL2ToL1MessageLeaf( + amount: bigint, + recipient: EthAddress, + l2Bridge: AztecAddress, + callerOnL1: EthAddress = EthAddress.ZERO +): Promise +``` + +**Parameters:** + +- `amount`: `bigint` + - Amount to bridge. +- `recipient`: `EthAddress` + - Recipient on L1. +- `l2Bridge`: `AztecAddress` + - Address of the L2 bridge. +- `callerOnL1` (optional): `EthAddress` + - Caller address on L1. + +**Returns:** + +`Promise` + +## Fee + + +--- + +### `fee/fee_juice_payment_method_with_claim.ts` + + +#### FeeJuicePaymentMethodWithClaim + +**Type:** Class + +Pay fee directly with Fee Juice claimed in the same tx. Claiming consumes an L1 to L2 message that "contains" the fee juice bridged from L1. + +**Implements:** `FeePaymentMethod` + + +#### Constructor + +**Signature:** + +```typescript +constructor( + private sender: AztecAddress, + private claim: Pick +) +``` + +**Parameters:** + +- `sender`: `AztecAddress` +- `claim`: `Pick` + +#### Methods + + +##### getExecutionPayload + +Creates an execution payload to pay the fee in Fee Juice. + +**Signature:** + +```typescript +async getExecutionPayload(): Promise +``` + +**Returns:** + +`Promise` - An execution payload that just contains the `claim_and_end_setup` function call. + +##### getAsset + +**Signature:** + +```typescript +getAsset() +``` + +**Returns:** + +`Promise` + +##### getFeePayer + +**Signature:** + +```typescript +getFeePayer(): Promise +``` + +**Returns:** + +`Promise` + +##### getGasSettings + +**Signature:** + +```typescript +getGasSettings(): GasSettings | undefined +``` + +**Returns:** + +`GasSettings | undefined` + +--- + +### `fee/fee_payment_method.ts` + + +#### FeePaymentMethod + +**Type:** Interface + +Holds information about how the fee for a transaction is to be paid. + + +#### Methods + + +##### getAsset + +The asset used to pay the fee. + +**Signature:** + +```typescript +getAsset(): Promise +``` + +**Returns:** + +`Promise` + +##### getExecutionPayload + +Returns the data to be added to the final execution request to pay the fee in the given asset + +**Signature:** + +```typescript +getExecutionPayload(): Promise +``` + +**Returns:** + +`Promise` - The function calls to pay the fee. + +##### getFeePayer + +The expected fee payer for this tx. + +**Signature:** + +```typescript +getFeePayer(): Promise +``` + +**Returns:** + +`Promise` + +##### getGasSettings + +The gas settings (if any) used to compute the execution payload of the payment method + +**Signature:** + +```typescript +getGasSettings(): GasSettings | undefined +``` + +**Returns:** + +`GasSettings | undefined` + +--- + +### `fee/private_fee_payment_method.ts` + + +#### PrivateFeePaymentMethod + +**Type:** Class + +Holds information about how the fee for a transaction is to be paid. + +**Implements:** `FeePaymentMethod` + + +#### Constructor + +**Signature:** + +```typescript +constructor( + private paymentContract: AztecAddress, + private sender: AztecAddress, + private wallet: Wallet, + protected gasSettings: GasSettings, + private setMaxFeeToOne = false +) +``` + +**Parameters:** + +- `paymentContract`: `AztecAddress` + - Address which will hold the fee payment. +- `sender`: `AztecAddress` + - Address of the account that will pay the fee +- `wallet`: `Wallet` + - A wallet to perform the simulation to get the accepted asset +- `gasSettings`: `GasSettings` + - Gas settings used to compute the maximum fee the user is willing to pay +- `setMaxFeeToOne` (optional): `any` + - If true, the max fee will be set to 1. TODO(#7694): Remove this param once the lacking feature in TXE is implemented. + +#### Methods + + +##### getAsset + +The asset used to pay the fee. + +**Signature:** + +```typescript +async getAsset(): Promise +``` + +**Returns:** + +`Promise` - The asset used to pay the fee. + +##### getFeePayer + +**Signature:** + +```typescript +getFeePayer(): Promise +``` + +**Returns:** + +`Promise` + +##### getExecutionPayload + +Creates an execution payload to pay the fee using a private function through an FPC in the desired asset + +**Signature:** + +```typescript +async getExecutionPayload(): Promise +``` + +**Returns:** + +`Promise` - An execution payload that contains the required function calls and auth witnesses. + +##### getGasSettings + +**Signature:** + +```typescript +getGasSettings(): GasSettings | undefined +``` + +**Returns:** + +`GasSettings | undefined` + +--- + +### `fee/public_fee_payment_method.ts` + + +#### PublicFeePaymentMethod + +**Type:** Class + +Holds information about how the fee for a transaction is to be paid. + +**Implements:** `FeePaymentMethod` + + +#### Constructor + +**Signature:** + +```typescript +constructor( + protected paymentContract: AztecAddress, + protected sender: AztecAddress, + protected wallet: Wallet, + protected gasSettings: GasSettings +) +``` + +**Parameters:** + +- `paymentContract`: `AztecAddress` + - Address which will hold the fee payment. +- `sender`: `AztecAddress` + - An auth witness provider to authorize fee payments +- `wallet`: `Wallet` + - A wallet to perform the simulation to get the accepted asset +- `gasSettings`: `GasSettings` + - Gas settings used to compute the maximum fee the user is willing to pay + +#### Methods + + +##### getAsset + +The asset used to pay the fee. + +**Signature:** + +```typescript +async getAsset(): Promise +``` + +**Returns:** + +`Promise` - The asset used to pay the fee. + +##### getFeePayer + +**Signature:** + +```typescript +getFeePayer(): Promise +``` + +**Returns:** + +`Promise` + +##### getExecutionPayload + +Creates an execution payload to pay the fee using a public function through an FPC in the desired asset + +**Signature:** + +```typescript +async getExecutionPayload(): Promise +``` + +**Returns:** + +`Promise` - An execution payload that contains the required function calls. + +##### getGasSettings + +**Signature:** + +```typescript +getGasSettings(): GasSettings | undefined +``` + +**Returns:** + +`GasSettings | undefined` + +--- + +### `fee/sponsored_fee_payment.ts` + + +#### SponsoredFeePaymentMethod + +**Type:** Class + +A fee payment method that uses a contract that blindly sponsors transactions. This contract is expected to be prefunded in testing environments. + +**Implements:** `FeePaymentMethod` + + +#### Constructor + +**Signature:** + +```typescript +constructor(private paymentContract: AztecAddress) +``` + +**Parameters:** + +- `paymentContract`: `AztecAddress` + +#### Methods + + +##### getAsset + +**Signature:** + +```typescript +getAsset(): Promise +``` + +**Returns:** + +`Promise` + +##### getFeePayer + +**Signature:** + +```typescript +getFeePayer() +``` + +**Returns:** + +`Promise` + +##### getExecutionPayload + +**Signature:** + +```typescript +async getExecutionPayload(): Promise +``` + +**Returns:** + +`Promise` + +##### getGasSettings + +**Signature:** + +```typescript +getGasSettings(): GasSettings | undefined +``` + +**Returns:** + +`GasSettings | undefined` + +## Utils + + +--- + +### `utils/abi_types.ts` + + +#### FieldLike + +**Type:** Type Alias + +Any type that can be converted into a field for a contract call. + +**Signature:** + +```typescript +export type FieldLike = Fr | Buffer | bigint | number | { toField: () => Fr }; +``` + +#### EthAddressLike + +**Type:** Type Alias + +Any type that can be converted into an EthAddress Aztec.nr struct. + +**Signature:** + +```typescript +export type EthAddressLike = { address: FieldLike } | EthAddress; +``` + +#### AztecAddressLike + +**Type:** Type Alias + +Any type that can be converted into an AztecAddress Aztec.nr struct. + +**Signature:** + +```typescript +export type AztecAddressLike = { address: FieldLike } | AztecAddress; +``` + +#### FunctionSelectorLike + +**Type:** Type Alias + +Any type that can be converted into a FunctionSelector Aztec.nr struct. + +**Signature:** + +```typescript +export type FunctionSelectorLike = FieldLike | FunctionSelector; +``` + +#### EventSelectorLike + +**Type:** Type Alias + +Any type that can be converted into an EventSelector Aztec.nr struct. + +**Signature:** + +```typescript +export type EventSelectorLike = FieldLike | EventSelector; +``` + +#### U128Like + +**Type:** Type Alias + +Any type that can be converted into a U128. + +**Signature:** + +```typescript +export type U128Like = bigint | number; +``` + +#### WrappedFieldLike + +**Type:** Type Alias + +Any type that can be converted into a struct with a single `inner` field. + +**Signature:** + +```typescript +export type WrappedFieldLike = { inner: FieldLike } | FieldLike; +``` + +--- + +### `utils/authwit.ts` + + +#### IntentInnerHash + +**Type:** Type Alias + +Intent with an inner hash + +**Signature:** + +```typescript +export type IntentInnerHash = { + consumer: AztecAddress; + innerHash: Fr; +}; +``` + +**Type Members:** + +##### consumer + +The consumer + +**Type:** `AztecAddress` + +##### innerHash + +The action to approve + +**Type:** `Fr` + + +#### CallIntent + +**Type:** Type Alias + +Intent with a call + +**Signature:** + +```typescript +export type CallIntent = { + caller: AztecAddress; + call: FunctionCall; +}; +``` + +**Type Members:** + +##### caller + +The caller to approve + +**Type:** `AztecAddress` + +##### call + +The call to approve + +**Type:** `FunctionCall` + + +#### ContractFunctionInteractionCallIntent + +**Type:** Type Alias + +Intent with a ContractFunctionInteraction + +**Signature:** + +```typescript +export type ContractFunctionInteractionCallIntent = { + caller: AztecAddress; + action: ContractFunctionInteraction; +}; +``` + +**Type Members:** + +##### caller + +The caller to approve + +**Type:** `AztecAddress` + +##### action + +The action to approve + +**Type:** `ContractFunctionInteraction` + + +#### computeAuthWitMessageHash + +**Type:** Constant + +Compute an authentication witness message hash from an intent and metadata If using the `IntentInnerHash`, the consumer is the address that can "consume" the authwit, for token approvals it is the token contract itself. The `innerHash` itself will be the message that a contract is allowed to execute. At the point of "approval checking", the validating contract (account for private and registry for public) will be computing the message hash (`H(consumer, chainid, version, inner_hash)`) where the all but the `inner_hash` is injected from the context (consumer = msg_sender), and use it for the authentication check. Therefore, any allowed `innerHash` will therefore also have information around where it can be spent (version, chainId) and who can spend it (consumer). If using the `CallIntent`, the caller is the address that is making the call, for a token approval from Alice to Bob, this would be Bob. The action is then used along with the `caller` to compute the `innerHash` and the consumer. + +**Value Type:** `any` + + +#### getMessageHashFromIntent + +**Type:** Function + +Compute an authentication witness message hash from an intent and metadata. This is just a wrapper around computeAuthwitMessageHash that allows receiving an already computed messageHash as input + +**Signature:** + +```typescript +export async getMessageHashFromIntent( + messageHashOrIntent: Fr | IntentInnerHash | CallIntent | ContractFunctionInteractionCallIntent, + chainInfo: ChainInfo +) +``` + +**Parameters:** + +- `messageHashOrIntent`: `Fr | IntentInnerHash | CallIntent | ContractFunctionInteractionCallIntent` + - The precomputed messageHash or intent to approve (consumer and innerHash or caller and call/action) +- `chainInfo`: `ChainInfo` + +**Returns:** + +`Promise` - The message hash for the intent + +#### computeInnerAuthWitHashFromAction + +**Type:** Constant + +Computes the inner authwitness hash for either a function call or an action, for it to later be combined with the metadata required for the outer hash and eventually the full AuthWitness. + +**Value Type:** `any` + + +#### lookupValidity + +**Type:** Function + +Lookup the validity of an authwit in private and public contexts. Uses the chain id and version of the wallet. + +**Signature:** + +```typescript +export async lookupValidity( + wallet: Wallet, + onBehalfOf: AztecAddress, + intent: IntentInnerHash | CallIntent | ContractFunctionInteractionCallIntent, + witness: AuthWitness +): Promise<{ + isValidInPrivate: boolean; + isValidInPublic: boolean; + }> +``` + +**Parameters:** + +- `wallet`: `Wallet` + - The wallet use to simulate and read the public data +- `onBehalfOf`: `AztecAddress` + - The address of the "approver" +- `intent`: `IntentInnerHash | CallIntent | ContractFunctionInteractionCallIntent` + - The consumer and inner hash or the caller and action to lookup +- `witness`: `AuthWitness` + - The computed authentication witness to check + +**Returns:** + +```typescript +Promise<{ + /** boolean flag indicating if the authwit is valid in private context */ + isValidInPrivate: boolean; + /** boolean flag indicating if the authwit is valid in public context */ + isValidInPublic: boolean; +}> +``` + +A struct containing the validity of the authwit in private and public contexts. + +#### SetPublicAuthwitContractInteraction + +**Type:** Class + +Convenience class designed to wrap the very common interaction of setting a public authwit in the AuthRegistry contract + +**Extends:** `ContractFunctionInteraction` + + +#### Constructor + +**Signature:** + +```typescript +private constructor( + wallet: Wallet, + private from: AztecAddress, + messageHash: Fr, + authorized: boolean +) +``` + +**Parameters:** + +- `wallet`: `Wallet` +- `from`: `AztecAddress` +- `messageHash`: `Fr` +- `authorized`: `boolean` + +#### Methods + + +##### create + +**Signature:** + +```typescript +static async create( + wallet: Wallet, + from: AztecAddress, + messageHashOrIntent: Fr | IntentInnerHash | CallIntent | ContractFunctionInteractionCallIntent, + authorized: boolean +) +``` + +**Parameters:** + +- `wallet`: `Wallet` +- `from`: `AztecAddress` +- `messageHashOrIntent`: `Fr | IntentInnerHash | CallIntent | ContractFunctionInteractionCallIntent` +- `authorized`: `boolean` + +**Returns:** + +`Promise` + +##### simulate + +Overrides the simulate method, adding the sender of the authwit (authorizer) as from and preventing misuse + +**Signature:** + +```typescript +public override simulate(options: Omit): Promise> +``` + +**Parameters:** + +- `options`: `Omit` + - An optional object containing additional configuration for the transaction. + +**Returns:** + +`Promise>` - The result of the transaction as returned by the contract function. + +##### simulate + +**Signature:** + +```typescript +public override simulate(options: Omit = {}): Promise> +``` + +**Parameters:** + +- `options` (optional): `Omit` + +**Returns:** + +`Promise>` + +##### profile + +Overrides the profile method, adding the sender of the authwit (authorizer) as from and preventing misuse + +**Signature:** + +```typescript +public override profile(options: Omit = { profileMode: 'gates' }): Promise +``` + +**Parameters:** + +- `options` (optional): `Omit` + - Same options as `simulate`, plus profiling method + +**Returns:** + +`Promise` - An object containing the function return value and profile result. + +##### send + +Overrides the send method, adding the sender of the authwit (authorizer) as from and preventing misuse + +**Signature:** + +```typescript +public override send(options: Omit = {}): SentTx +``` + +**Parameters:** + +- `options` (optional): `Omit` + - An optional object containing 'fee' options information + +**Returns:** + +`SentTx` - A SentTx instance for tracking the transaction status and information. + +--- + +### `utils/cross_chain.ts` + + +#### waitForL1ToL2MessageReady + +**Type:** Function + +Waits for the L1 to L2 message to be ready to be consumed. + +**Signature:** + +```typescript +export async waitForL1ToL2MessageReady( + node: Pick, + l1ToL2MessageHash: Fr, + opts: { + timeoutSeconds: number; + forPublicConsumption: boolean; +} +) +``` + +**Parameters:** + +- `node`: `Pick` + - Aztec node instance used to obtain the information about the message +- `l1ToL2MessageHash`: `Fr` + - Hash of the L1 to L2 message +- `opts`: `{ + /** Timeout for the operation in seconds */ timeoutSeconds: number; + /** True if the message is meant to be consumed from a public function */ forPublicConsumption: boolean; + }` + - Options + +**Returns:** + +`Promise` + +#### isL1ToL2MessageReady + +**Type:** Function + +Returns whether the L1 to L2 message is ready to be consumed. + +**Signature:** + +```typescript +export async isL1ToL2MessageReady( + node: Pick, + l1ToL2MessageHash: Fr, + opts: { + forPublicConsumption: boolean; + messageBlockNumber?: number; +} +): Promise +``` + +**Parameters:** + +- `node`: `Pick` + - Aztec node instance used to obtain the information about the message +- `l1ToL2MessageHash`: `Fr` + - Hash of the L1 to L2 message +- `opts`: `{ + /** True if the message is meant to be consumed from a public function */ forPublicConsumption: boolean; + /** Cached synced block number for the message (will be fetched from PXE otherwise) */ messageBlockNumber?: number; + }` + - Options + +**Returns:** + +`Promise` - True if the message is ready to be consumed, false otherwise + +--- + +### `utils/fee_juice.ts` + + +#### getFeeJuiceBalance + +**Type:** Function + +Returns the owner's fee juice balance. Note: This is used only e2e_local_network_example test. TODO: Consider nuking. + +**Signature:** + +```typescript +export async getFeeJuiceBalance( + owner: AztecAddress, + node: AztecNode +): Promise +``` + +**Parameters:** + +- `owner`: `AztecAddress` +- `node`: `AztecNode` + +**Returns:** + +`Promise` + +--- + +### `utils/field_compressed_string.ts` + + +#### readFieldCompressedString + +**Type:** Constant + +This turns + +**Value Type:** `any` + + +--- + +### `utils/node.ts` + + +#### waitForNode + +**Type:** Constant + +**Value Type:** `any` + + +#### createAztecNodeClient + +**Type:** Constant + +This is re-exported from `@aztec/stdlib/interfaces/client`. See the source module for full documentation. + +**Value Type:** `Re-export` + + +#### AztecNode + +**Type:** Type Alias + +This is a type re-exported from `@aztec/stdlib/interfaces/client`. See the source module for full type definition and documentation. + +**Signature:** + +```typescript +export type { AztecNode } from '@aztec/stdlib/interfaces/client' +``` + +--- + +### `utils/pub_key.ts` + + +#### generatePublicKey + +**Type:** Function + +Method for generating a public grumpkin key from a private key. + +**Signature:** + +```typescript +export generatePublicKey(privateKey: GrumpkinScalar): Promise +``` + +**Parameters:** + +- `privateKey`: `GrumpkinScalar` + - The private key. + +**Returns:** + +`Promise` - The generated public key. + +## Wallet + + +--- + +### `wallet/account_entrypoint_meta_payment_method.ts` + + +#### AccountEntrypointMetaPaymentMethod + +**Type:** Class + +Fee payment method that allows an account contract to pay for its own deployment It works by rerouting the provided fee payment method through the account's entrypoint, which sets itself as fee payer. If no payment method is provided, it is assumed the account will pay with its own fee juice balance. Usually, in order to pay fees it is necessary to obtain an ExecutionPayload that encodes the necessary information that is sent to the user's account entrypoint, that has plumbing to handle it. If there's no account contract yet (it's being deployed) a MultiCallContract is used, which doesn't have a concept of fees or how to handle this payload. HOWEVER, the account contract's entrypoint does, so this method reshapes that fee payload into a call to the account contract entrypoint being deployed with the original fee payload. This class can be seen in action in DeployAccountMethod.ts#getSelfPaymentMethod + +**Implements:** `FeePaymentMethod` + + +#### Constructor + +**Signature:** + +```typescript +constructor( + private wallet: Wallet, + private artifact: ContractArtifact, + private feePaymentNameOrArtifact: string | FunctionArtifact, + private accountAddress: AztecAddress, + private paymentMethod?: FeePaymentMethod +) +``` + +**Parameters:** + +- `wallet`: `Wallet` +- `artifact`: `ContractArtifact` +- `feePaymentNameOrArtifact`: `string | FunctionArtifact` +- `accountAddress`: `AztecAddress` +- `paymentMethod` (optional): `FeePaymentMethod` + +#### Methods + + +##### getAsset + +**Signature:** + +```typescript +getAsset(): Promise +``` + +**Returns:** + +`Promise` + +##### getExecutionPayload + +**Signature:** + +```typescript +async getExecutionPayload(): Promise +``` + +**Returns:** + +`Promise` + +##### getFeePayer + +**Signature:** + +```typescript +getFeePayer(): Promise +``` + +**Returns:** + +`Promise` + +##### getGasSettings + +**Signature:** + +```typescript +getGasSettings(): GasSettings | undefined +``` + +**Returns:** + +`GasSettings | undefined` + +--- + +### `wallet/account_manager.ts` + + +#### AccountManager + +**Type:** Class + +Manages a user account. Provides methods for calculating the account's address and other related data, plus a helper to return a preconfigured deploy method. + + +#### Constructor + +**Signature:** + +```typescript +private constructor( + private wallet: Wallet, + private secretKey: Fr, + private accountContract: AccountContract, + private instance: ContractInstanceWithAddress, + public readonly salt: Salt +) +``` + +**Parameters:** + +- `wallet`: `Wallet` +- `secretKey`: `Fr` +- `accountContract`: `AccountContract` +- `instance`: `ContractInstanceWithAddress` +- `salt`: `Salt` + - Contract instantiation salt for the account contract + +#### Methods + + +##### create + +**Signature:** + +```typescript +static async create( + wallet: Wallet, + secretKey: Fr, + accountContract: AccountContract, + salt?: Salt +) +``` + +**Parameters:** + +- `wallet`: `Wallet` +- `secretKey`: `Fr` +- `accountContract`: `AccountContract` +- `salt` (optional): `Salt` + +**Returns:** + +`Promise` + +##### getPublicKeys + +**Signature:** + +```typescript +protected getPublicKeys() +``` + +**Returns:** + +`any` + +##### getPublicKeysHash + +**Signature:** + +```typescript +protected getPublicKeysHash() +``` + +**Returns:** + +`any` + +##### getAccountInterface + +Returns the entrypoint for this account as defined by its account contract. + +**Signature:** + +```typescript +public async getAccountInterface(): Promise +``` + +**Returns:** + +`Promise` - An entrypoint. + +##### getCompleteAddress + +Gets the calculated complete address associated with this account. Does not require the account to have been published for public execution. + +**Signature:** + +```typescript +public getCompleteAddress(): Promise +``` + +**Returns:** + +`Promise` - The address, partial address, and encryption public key. + +##### getSecretKey + +Returns the secret key used to derive the rest of the privacy keys for this contract + +**Signature:** + +```typescript +public getSecretKey() +``` + +**Returns:** + +`Fr` + +##### getInstance + +Returns the contract instance definition associated with this account. Does not require the account to have been published for public execution. + +**Signature:** + +```typescript +public getInstance(): ContractInstanceWithAddress +``` + +**Returns:** + +`ContractInstanceWithAddress` - ContractInstance instance. + +##### getAccount + +Returns a Wallet instance associated with this account. Use it to create Contract instances to be interacted with from this account. + +**Signature:** + +```typescript +public async getAccount(): Promise +``` + +**Returns:** + +`Promise` - A Wallet instance. + +##### getAccountContract + +Returns the account contract that backs this account. + +**Signature:** + +```typescript +getAccountContract(): AccountContract +``` + +**Returns:** + +`AccountContract` - The account contract + +##### getDeployMethod + +Returns a preconfigured deploy method that contains all the necessary function calls to deploy the account contract. + +**Signature:** + +```typescript +public async getDeployMethod(): Promise +``` + +**Returns:** + +`Promise` + +##### hasInitializer + +Returns whether this account contract has an initializer function. + +**Signature:** + +```typescript +public async hasInitializer() +``` + +**Returns:** + +`Promise` + +#### Getters + + +##### address (getter) + +**Signature:** + +```typescript +get address() { +``` + +**Returns:** `any` + +--- + +### `wallet/deploy_account_method.ts` + + +#### RequestDeployAccountOptions + +**Type:** Type Alias + +The configuration options for the request method. Omits the contractAddressSalt, since for account contracts that is fixed in the constructor + +**Signature:** + +```typescript +export type RequestDeployAccountOptions = Omit; +``` + +#### DeployAccountOptions + +**Type:** Type Alias + +The configuration options for the send/prove methods. Omits: - The contractAddressSalt, since for account contracts that is fixed in the constructor. - UniversalDeployment flag, since account contracts are always deployed with it set to true + +**Signature:** + +```typescript +export type DeployAccountOptions = Omit; +``` + +#### SimulateDeployAccountOptions + +**Type:** Type Alias + +The configuration options for the simulate method. Omits the contractAddressSalt, since for account contracts that is fixed in the constructor + +**Signature:** + +```typescript +export type SimulateDeployAccountOptions = Omit; +``` + +#### DeployAccountMethod + +**Type:** Class + +Modified version of the DeployMethod used to deploy account contracts. Supports deploying contracts that can pay for their own fee, plus some preconfigured options to avoid errors. + +**Extends:** `DeployMethod` + + +#### Constructor + +**Signature:** + +```typescript +constructor( + publicKeys: PublicKeys, + wallet: Wallet, + artifact: ContractArtifact, + postDeployCtor: (instance: ContractInstanceWithAddress, wallet: Wallet) => TContract, + private salt: Fr, + args: any[] = [], + constructorNameOrArtifact?: string | FunctionArtifact +) +``` + +**Parameters:** + +- `publicKeys`: `PublicKeys` +- `wallet`: `Wallet` +- `artifact`: `ContractArtifact` +- `postDeployCtor`: `(instance: ContractInstanceWithAddress, wallet: Wallet) => TContract` +- `salt`: `Fr` +- `args` (optional): `any[]` +- `constructorNameOrArtifact` (optional): `string | FunctionArtifact` + +#### Methods + + +##### request + +Returns the execution payload that allows this operation to happen on chain. + +**Signature:** + +```typescript +public override async request(opts?: RequestDeployAccountOptions): Promise +``` + +**Parameters:** + +- `opts` (optional): `RequestDeployAccountOptions` + - Configuration options. + +**Returns:** + +`Promise` - The execution payload for this operation + +##### convertDeployOptionsToRequestOptions + +**Signature:** + +```typescript +override convertDeployOptionsToRequestOptions(options: DeployOptions): RequestDeployOptions +``` + +**Parameters:** + +- `options`: `DeployOptions` + +**Returns:** + +`RequestDeployOptions` + +--- + +### `wallet/wallet.ts` + + +#### Aliased + +**Type:** Type Alias + +A wrapper type that allows any item to be associated with an alias. + +**Signature:** + +```typescript +export type Aliased = { + alias: string; + item: T; +}; +``` + +**Type Members:** + +##### alias + +The alias + +**Type:** `string` + +##### item + +The item being aliased. + +**Type:** `T` + + +#### SimulateOptions + +**Type:** Type Alias + +Options for simulating interactions with the wallet. Overrides the fee settings of an interaction with a simplified version that only hints at the wallet wether the interaction contains a fee payment method or not + +**Signature:** + +```typescript +export type SimulateOptions = Omit & { + fee?: GasSettingsOption & FeeEstimationOptions; +}; +``` + +**Type Members:** + +##### fee + +The fee options + +**Type:** `GasSettingsOption & FeeEstimationOptions` + + +#### ProfileOptions + +**Type:** Type Alias + +Options for profiling interactions with the wallet. Overrides the fee settings of an interaction with a simplified version that only hints at the wallet wether the interaction contains a fee payment method or not + +**Signature:** + +```typescript +export type ProfileOptions = Omit & { + fee?: GasSettingsOption; +}; +``` + +**Type Members:** + +##### fee + +The fee options + +**Type:** `GasSettingsOption` + + +#### SendOptions + +**Type:** Type Alias + +Options for sending/proving interactions with the wallet. Overrides the fee settings of an interaction with a simplified version that only hints at the wallet wether the interaction contains a fee payment method or not + +**Signature:** + +```typescript +export type SendOptions = Omit & { + fee?: GasSettingsOption; +}; +``` + +**Type Members:** + +##### fee + +The fee options + +**Type:** `GasSettingsOption` + + +#### BatchableMethods + +**Type:** Type Alias + +Helper type that represents all methods that can be batched. + +**Signature:** + +```typescript +export type BatchableMethods = Pick< + Wallet, + 'registerContract' | 'sendTx' | 'registerSender' | 'simulateUtility' | 'simulateTx' +>; +``` + +#### BatchedMethod + +**Type:** Type Alias + +From the batchable methods, we create a type that represents a method call with its name and arguments. This is what the wallet will accept as arguments to the `batch` method. + +**Signature:** + +```typescript +export type BatchedMethod = { + name: T; + args: Parameters; +}; +``` + +**Type Members:** + +##### name + +The method name + +**Type:** `T` + +##### args + +The method arguments + +**Type:** `Parameters` + + +#### BatchedMethodResult + +**Type:** Type Alias + +Helper type to extract the return type of a batched method + +**Signature:** + +```typescript +export type BatchedMethodResult = + T extends BatchedMethod ? Awaited> : never; +``` + +#### BatchedMethodResultWrapper + +**Type:** Type Alias + +Wrapper type for batch results that includes the method name for discriminated union deserialization. Each result is wrapped as \{ name: 'methodName', result: ActualResult \} to allow proper deserialization when AztecAddress and TxHash would otherwise be ambiguous (both are hex strings). + +**Signature:** + +```typescript +export type BatchedMethodResultWrapper> = { + name: T['name']; + result: BatchedMethodResult; +}; +``` + +**Type Members:** + +##### name + +The method name + +**Type:** `T['name']` + +##### result + +The method result + +**Type:** `BatchedMethodResult` + + +#### BatchResults + +**Type:** Type Alias + +Maps a tuple of BatchedMethod to a tuple of their wrapped return types + +**Signature:** + +```typescript +export type BatchResults[]> = { + [K in keyof T]: BatchedMethodResultWrapper; +}; +``` + +**Type Members:** + +##### [K in keyof T] + +**Signature:** `[K in keyof T]: BatchedMethodResultWrapper` + +**Key Type:** `keyof T` + +**Value Type:** `BatchedMethodResultWrapper` + + +#### PrivateEventFilter + +**Type:** Type Alias + +Filter options when querying private events. + +**Signature:** + +```typescript +export type PrivateEventFilter = { + contractAddress: AztecAddress; + scopes: AztecAddress[]; + txHash?: TxHash; + fromBlock?: BlockNumber; + toBlock?: BlockNumber; +}; +``` + +**Type Members:** + +##### contractAddress + +The address of the contract that emitted the events. + +**Type:** `AztecAddress` + +##### scopes + +Addresses of accounts that are in scope for this filter. + +**Type:** `AztecAddress[]` + +##### txHash + +Transaction in which the events were emitted. + +**Type:** `TxHash` + +##### fromBlock + +The block number from which to start fetching events (inclusive). Optional. If provided, it must be greater or equal than 1. Defaults to the initial L2 block number (INITIAL_L2_BLOCK_NUM). + +**Type:** `BlockNumber` + +##### toBlock + +The block number until which to fetch logs (not inclusive). Optional. If provided, it must be greater than fromBlock. Defaults to the latest known block to PXE + 1. + +**Type:** `BlockNumber` + + +#### PrivateEvent + +**Type:** Type Alias + +An ABI decoded private event with associated metadata. + +**Signature:** + +```typescript +export type PrivateEvent = { + event: T; + metadata: InTx; +}; +``` + +**Type Members:** + +##### event + +The ABI decoded event + +**Type:** `T` + +##### metadata + +Metadata describing event context information such as tx and block + +**Type:** `InTx` + + +#### Wallet + +**Type:** Type Alias + +The wallet interface. + +**Signature:** + +```typescript +export type Wallet = { + getContractClassMetadata(id: Fr, includeArtifact?: boolean): Promise; + getContractMetadata(address: AztecAddress): Promise; + getPrivateEvents( + eventMetadata: EventMetadataDefinition, + eventFilter: PrivateEventFilter, + ): Promise[]>; + getChainInfo(): Promise; + getTxReceipt(txHash: TxHash): Promise; + registerSender(address: AztecAddress, alias?: string): Promise; + getAddressBook(): Promise[]>; + getAccounts(): Promise[]>; + registerContract( + instance: ContractInstanceWithAddress, + artifact?: ContractArtifact, + secretKey?: Fr, + ): Promise; + simulateTx(exec: ExecutionPayload, opts: SimulateOptions): Promise; + simulateUtility(call: FunctionCall, authwits?: AuthWitness[]): Promise; + profileTx(exec: ExecutionPayload, opts: ProfileOptions): Promise; + sendTx(exec: ExecutionPayload, opts: SendOptions): Promise; + createAuthWit(from: AztecAddress, messageHashOrIntent: Fr | IntentInnerHash | CallIntent): Promise; + batch[]>(methods: T): Promise>; +}; +``` + +**Type Members:** + +##### getContractClassMetadata + +**Signature:** + +```typescript +getContractClassMetadata( + id: Fr, + includeArtifact?: boolean +): Promise +``` + +**Parameters:** + +- `id`: `Fr` +- `includeArtifact` (optional): `boolean` + +**Returns:** + +`Promise` +##### getContractMetadata + +**Signature:** + +```typescript +getContractMetadata(address: AztecAddress): Promise +``` + +**Parameters:** + +- `address`: `AztecAddress` + +**Returns:** + +`Promise` +##### getPrivateEvents + +**Signature:** + +```typescript +getPrivateEvents( + eventMetadata: EventMetadataDefinition, + eventFilter: PrivateEventFilter +): Promise[]> +``` + +**Parameters:** + +- `eventMetadata`: `EventMetadataDefinition` +- `eventFilter`: `PrivateEventFilter` + +**Returns:** + +`Promise[]>` +##### getChainInfo + +**Signature:** + +```typescript +getChainInfo(): Promise +``` + +**Returns:** + +`Promise` +##### getTxReceipt + +**Signature:** + +```typescript +getTxReceipt(txHash: TxHash): Promise +``` + +**Parameters:** + +- `txHash`: `TxHash` + +**Returns:** + +`Promise` +##### registerSender + +**Signature:** + +```typescript +registerSender( + address: AztecAddress, + alias?: string +): Promise +``` + +**Parameters:** + +- `address`: `AztecAddress` +- `alias` (optional): `string` + +**Returns:** + +`Promise` +##### getAddressBook + +**Signature:** + +```typescript +getAddressBook(): Promise[]> +``` + +**Returns:** + +`Promise[]>` +##### getAccounts + +**Signature:** + +```typescript +getAccounts(): Promise[]> +``` + +**Returns:** + +`Promise[]>` +##### registerContract + +**Signature:** + +```typescript +registerContract( + instance: ContractInstanceWithAddress, + artifact?: ContractArtifact, + secretKey?: Fr +): Promise +``` + +**Parameters:** + +- `instance`: `ContractInstanceWithAddress` +- `artifact` (optional): `ContractArtifact` +- `secretKey` (optional): `Fr` + +**Returns:** + +`Promise` +##### simulateTx + +**Signature:** + +```typescript +simulateTx( + exec: ExecutionPayload, + opts: SimulateOptions +): Promise +``` + +**Parameters:** + +- `exec`: `ExecutionPayload` +- `opts`: `SimulateOptions` + +**Returns:** + +`Promise` +##### simulateUtility + +**Signature:** + +```typescript +simulateUtility( + call: FunctionCall, + authwits?: AuthWitness[] +): Promise +``` + +**Parameters:** + +- `call`: `FunctionCall` +- `authwits` (optional): `AuthWitness[]` + +**Returns:** + +`Promise` +##### profileTx + +**Signature:** + +```typescript +profileTx( + exec: ExecutionPayload, + opts: ProfileOptions +): Promise +``` + +**Parameters:** + +- `exec`: `ExecutionPayload` +- `opts`: `ProfileOptions` + +**Returns:** + +`Promise` +##### sendTx + +**Signature:** + +```typescript +sendTx( + exec: ExecutionPayload, + opts: SendOptions +): Promise +``` + +**Parameters:** + +- `exec`: `ExecutionPayload` +- `opts`: `SendOptions` + +**Returns:** + +`Promise` +##### createAuthWit + +**Signature:** + +```typescript +createAuthWit( + from: AztecAddress, + messageHashOrIntent: Fr | IntentInnerHash | CallIntent +): Promise +``` + +**Parameters:** + +- `from`: `AztecAddress` +- `messageHashOrIntent`: `Fr | IntentInnerHash | CallIntent` + +**Returns:** + +`Promise` +##### batch + +**Signature:** + +```typescript +batch[]>(methods: T): Promise> +``` + +**Parameters:** + +- `methods`: `T` + +**Returns:** + +`Promise>` + +#### FunctionCallSchema + +**Type:** Constant + +**Value Type:** `any` + + +#### ExecutionPayloadSchema + +**Type:** Constant + +**Value Type:** `any` + + +#### GasSettingsOptionSchema + +**Type:** Constant + +**Value Type:** `any` + + +#### WalletSimulationFeeOptionSchema + +**Type:** Constant + +**Value Type:** `any` + + +#### SendOptionsSchema + +**Type:** Constant + +**Value Type:** `any` + + +#### SimulateOptionsSchema + +**Type:** Constant + +**Value Type:** `any` + + +#### ProfileOptionsSchema + +**Type:** Constant + +**Value Type:** `any` + + +#### MessageHashOrIntentSchema + +**Type:** Constant + +**Value Type:** `any` + + +#### BatchedMethodSchema + +**Type:** Constant + +**Value Type:** `any` + + +#### ContractMetadataSchema + +**Type:** Constant + +**Value Type:** `any` + + +#### ContractClassMetadataSchema + +**Type:** Constant + +**Value Type:** `any` + + +#### EventMetadataDefinitionSchema + +**Type:** Constant + +**Value Type:** `any` + + +#### PrivateEventSchema + +**Type:** Constant + +**Value Type:** `ZodFor>` + + +#### PrivateEventFilterSchema + +**Type:** Constant + +**Value Type:** `any` + + +#### WalletSchema + +**Type:** Constant + +**Value Type:** `ApiSchemaFor` diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/how_to_connect_to_local_network.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/how_to_connect_to_local_network.md new file mode 100644 index 000000000000..95f341269935 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/how_to_connect_to_local_network.md @@ -0,0 +1,88 @@ +--- +title: Getting Started +tags: [local_network, connection, wallet] +sidebar_position: 1 +description: Connect your application to the Aztec local network and interact with accounts. +--- + +This guide shows you how to connect your application to the Aztec local network and interact with the network. + +## Prerequisites + +- Running Aztec local network (see [Quickstart](../../getting_started_on_local_network.md)) on port 8080 +- Node.js installed +- TypeScript project set up + +## Install Aztec.js + +### Install the Aztec.js package + +```bash +yarn add @aztec/aztec.js@3.0.2 +``` + +## Create a Node Client + +The local network is essentially a one-node network. Just like on a real network, you need to interface with it: + +```typescript +const node = createAztecNodeClient("http://localhost:8080"); +const l1Contracts = await node.getL1ContractAddresses(); +``` + +As the name implies, we want to know the L1 Contracts addresses for our wallet. + +## Create a TestWallet + +You will need to create your own TestWallet to connect to local network accounts. Let's create a TestWallet: + +```typescript +import { createAztecNodeClient } from "@aztec/aztec.js/node"; +import { TestWallet } from "@aztec/test-wallet/server"; + +export async function setupWallet(): Promise { + const nodeUrl = "http://localhost:8080"; + const node = createAztecNodeClient(nodeUrl); + const wallet = await TestWallet.create(node); + return wallet; +} +``` + +### Verify the connection + +Get node information to confirm your connection: + +```typescript +const nodeInfo = await pxe.getNodeInfo(); +console.log("Connected to local network version:", nodeInfo.nodeVersion); +console.log("Chain ID:", nodeInfo.l1ChainId); +``` + +### Get local network accounts + +The local network has some accounts pre-funded with fee-juice to pay for gas. You can import them and create accounts: + +```typescript +import { getInitialTestAccountsData } from "@aztec/accounts/testing"; + +const [aliceAccount, bobAccount] = await getInitialTestAccountsData(); +await wallet.createSchnorrAccount(aliceAccount.secret, aliceAccount.salt); +await wallet.createSchnorrAccount(bobAccount.secret, bobAccount.salt); +``` + +### Check account balances + +Verify that the accounts have fee juice for transactions: + +```typescript +import { getFeeJuiceBalance } from "@aztec/aztec.js/utils"; + +const aliceBalance = await getFeeJuiceBalance(aliceAccount.address, node); +console.log(`Alice's fee juice balance: ${aliceBalance}`); +``` + +## Next steps + +- [Create an account](./how_to_create_account.md) - Deploy new accounts on the network +- [Deploy a contract](./how_to_deploy_contract.md) - Deploy your smart contracts +- [Send transactions](./how_to_send_transaction.md) - Execute contract functions diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/how_to_create_account.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/how_to_create_account.md new file mode 100644 index 000000000000..cee0cb0f2a67 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/how_to_create_account.md @@ -0,0 +1,121 @@ +--- +title: Creating Accounts +tags: [accounts] +sidebar_position: 2 +description: Step-by-step guide to creating and deploying user accounts in Aztec.js applications. +--- + +This guide walks you through creating and deploying a new account contract in Aztec. + +## Prerequisites + +- Running Aztec local network or testnet +- Node.js and TypeScript environment +- `@aztec/aztec.js` package installed +- Understanding of [account concepts](../foundational-topics/accounts/index.md) + +## Install dependencies + +```bash +yarn add @aztec/aztec.js@3.0.2 @aztec/accounts@3.0.2 +``` + +## Create account keys + +Every account on Aztec requires a secret, a salt, and a signing key. + +```typescript +import { Fr, GrumpkinScalar } from "@aztec/aztec.js"; + +const secretKey = Fr.random(); +const salt = new Fr(0); +const signingPrivateKey = GrumpkinScalar.random(); +``` + +These keys serve the following purposes: + +- `secretKey`: Derives encryption keys for private state +- `signingPrivateKey`: Signs transactions + +## Create a wallet + +You need a Wallet to hold your account contract. Use `TestWallet` since most third-party wallets implement the same interface: + +```typescript +// for use in the browser +import { TestWallet } from "@aztec/test-wallet/client/lazy"; +// for use on a server +import { TestWallet } from "@aztec/test-wallet/server"; +import { createAztecNodeClient } from "@aztec/aztec.js/node"; + +const nodeUrl = process.env.AZTEC_NODE_URL || "http://localhost:8080"; +const node = createAztecNodeClient(nodeUrl); +const wallet = await TestWallet.create(node); +``` + +## Deploy the account + +### Get Fee Juice + +On the local network, all test accounts come pre-funded with Fee Juice. [Import them](./how_to_connect_to_local_network.md) to start using them immediately. + +On testnet, accounts start without Fee Juice. You can either [use an account that has Fee Juice](./how_to_pay_fees.md#pay-with-fee-juice) or [use the Sponsored Fee Payment Contract](./how_to_pay_fees.md#sponsored-fee-payment-contracts). + +### Register and deploy accounts + +Test accounts on the local network are already deployed but need to be registered in the wallet: + +```typescript +// on the local network, you can get the initial test accounts data using getInitialTestAccountsData +const [initialAccountData] = await getInitialTestAccountsData(); +// add the funded account to the wallet +const initialAccount = await wallet.createSchnorrAccount( + initialAccountData.secret, + initialAccountData.salt +); +``` + +Other accounts require deployment. To deploy an account that already has Fee Juice: + +```ts +const anotherAccount = await wallet.createSchnorrAccount( + accountWithFeeJuice.secret, + accountWithFeeJuice.salt +); +const deployMethod = await anotherAccount.getDeployMethod(); + +// using the default fee payment method (Fee Juice) +await deployMethod + .send({ + from: AztecAddress.ZERO, // the zero address is used because there's no account to send from: the transaction itself will create the account! + }) + .wait(); +``` + +To deploy using the Sponsored FPC: + +```typescript +// deploy an account with random salt and secret +const anotherAccount = await wallet.createSchnorrAccount( + Fr.random(), + Fr.random() +); +const deployMethod = await anotherAccount.getDeployMethod(); +await deployMethod + .send({ + from: AztecAddress.ZERO, + fee: { paymentMethod: sponsoredPaymentMethod }, + }) + .wait(); +``` + +:::info +See the [guide on fees](./how_to_pay_fees.md) for setting up `sponsoredPaymentMethod`. +::: + +## Next steps + +- [Deploy contracts](./how_to_deploy_contract.md) with a new account +- [Send transactions](./how_to_send_transaction.md) from an account +- Learn about [account abstraction](../foundational-topics/accounts/index.md) +- Implement [authentication witnesses](./how_to_use_authwit.md) diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/how_to_deploy_contract.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/how_to_deploy_contract.md new file mode 100644 index 000000000000..6441a5f4b5d8 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/how_to_deploy_contract.md @@ -0,0 +1,289 @@ +--- +title: Deploying Contracts +tags: [contracts, deployment] +sidebar_position: 3 +description: Deploy smart contracts to Aztec using generated TypeScript classes. +--- + +This guide shows you how to deploy compiled contracts to Aztec using the generated TypeScript interfaces. + +## Prerequisites + +- Compiled contract artifacts (see [How to Compile](../aztec-nr/how_to_compile_contract.md)) +- Running Aztec local network +- Funded wallet for deployment fees +- TypeScript project set up + +## Generate TypeScript bindings + +### Compile and generate code + +```bash +# Compile the contract +aztec compile + +# Generate TypeScript interface +aztec codegen ./target/my_contract-MyContract.json -o src/artifacts +``` + +:::info +The codegen command creates a TypeScript class with typed methods for deployment and interaction. This provides type safety and autocompletion in your IDE. +::: + +## Deploy a contract + +### Step 1: Import and connect + +```typescript +import { MyContract } from "./artifacts/MyContract"; +``` + +### Step 2: Deploy the contract + +Deploying the contract really depends on how you're paying for it. If paying using an account's fee juice (like a test account on the local network): + +```typescript +// Deploy with constructor arguments +const contract = await MyContract.deploy( + deployer_wallet, + constructorArg1, + constructorArg2 +) + .send({ from: testAccount.address }) // testAccount has fee juice and is registered in the deployer_wallet + .deployed(); +``` + +On the testnet, you'll likely not have funds in `testAccount` to pay for fee Juice. You want to instead pay fees using the [Sponsored Fee Payment Contract method](./how_to_pay_fees.md), for example: + +```typescript +const contract = await MyContract.deploy( + wallet, + constructorArg1, + constructorArg2 +) + .send({ from: alice.address, fee: { paymentMethod: sponsoredPaymentMethod } }) // using the Sponsored FPC + .deployed(); +``` + +## Use deployment options + +### Deploy with custom salt + +By default, the deployment's salt is random, but you can specify it (for example, if you want to get a deterministic address): + +```typescript +import { Fr } from "@aztec/aztec.js/fields"; + +const salt = Fr.random(); + +const contract = await MyContract.deploy(wallet, arg1, arg2) + .send({ + from: testAccount.address, + contractAddressSalt: salt, + }) + .deployed(); +``` + +### Deploy universally + +Deploy to the same address across networks: + +```typescript +const contract = await MyContract.deploy(wallet, arg1, arg2) + .send({ + from: testAccount.address, + universalDeploy: true, + contractAddressSalt: salt, + }) + .deployed(); +``` + +:::info +Universal deployment excludes the sender from address computation, allowing the same address on any network with the same salt. +::: + +### Skip initialization + +Deploy without running the constructor: + +```typescript +const contract = await MyContract.deploy(wallet) + .send({ + from: testAccount.address, + skipInitialization: true, + }) + .deployed(); + +// Initialize later +await contract.methods + .initialize(arg1, arg2) + .send({ from: testAccount.address }) + .wait(); +``` + +## Calculate deployment address + +### Get address before deployment + +```typescript +import { Fr } from "@aztec/aztec.js/fields"; + +const salt = Fr.random(); +const deployer = testAccount.address; + +// Calculate address without deploying +const deployer = MyContract.deploy(wallet, arg1, arg2); +const instance = await deployer.getInstance(); +const address = instance.address; + +console.log(`Contract will deploy at: ${address}`); +``` + +:::warning +This is an advanced pattern. For most use cases, deploy the contract directly and get the address from the deployed instance. +::: + +## Monitor deployment progress + +### Track deployment transaction + +```typescript +const deployTx = MyContract.deploy(wallet, arg1, arg2).send({ + from: testAccount.address, +}); + +// Get transaction hash immediately +const txHash = await deployTx.getTxHash(); +console.log(`Deployment tx: ${txHash}`); + +// Wait for the transaction to be mined +const receipt = await deployTx.wait(); +console.log(`Deployed in block ${receipt.blockNumber}`); + +// Get the deployed contract instance +const contract = await deployTx.deployed(); +console.log(`Contract address: ${contract.address}`); +``` + +## Deploy multiple contracts + +### Deploy contracts with dependencies + +```typescript +// Deploy first contract +const token = await TokenContract.deploy( + wallet, + wallet.address, + "MyToken", + "MTK", + 18n +) + .send({ from: testAccount.address }) + .deployed(); + +// Deploy second contract with reference to first +const vault = await VaultContract.deploy( + wallet, + token.address // Pass first contract's address +) + .send({ from: wallet.address }) + .deployed(); +``` + +### Deploy contracts in parallel + +```typescript +// Start all deployments simultaneously +const deployments = [ + Contract1.deploy(wallet, arg1).send({ from: testAccount.address }), + Contract2.deploy(wallet, arg2).send({ from: testAccount.address }), + Contract3.deploy(wallet, arg3).send({ from: testAccount.address }), +]; + +// Wait for all to complete +const receipts = await Promise.all(deployments.map((d) => d.wait())); + +// Get deployed contract instances +const contracts = await Promise.all(deployments.map((d) => d.deployed())); +``` + +:::tip +Parallel deployment is faster but be aware of nonce management if deploying many contracts from the same account. +::: + +## Verify deployment + +### Check contract registration + +At the moment the easiest way to get contract data is by querying a wallet directly: + +```typescript +// Get contract metadata +const metadata = await wallet.getContractMetadata(myContractInstance.address); +if (metadata) { + console.log("Contract metadata found"); +} +``` + +### Verify contract is callable + +```typescript +try { + // Try calling a view function + const result = await contract.methods + .get_version() + .simulate({ from: testAccount.address }); + console.log("Contract is callable, version:", result); +} catch (error) { + console.error("Contract not accessible:", error.message); +} +``` + +## Register deployed contracts + +### Add existing contract to wallet + +If a contract was deployed by another account: + +```typescript +import { loadContractArtifact } from "@aztec/stdlib/abi"; + +const artifact = loadContractArtifact(MyContract.artifact); +const contract = await MyContract.at(contractAddress, wallet); + +// To register an existing contract instance, you need to know +// its exact deployment parameters. The registerContract method +// requires both the artifact and instance details. +// This is typically handled automatically when deploying. +await wallet.registerContract({ + instance: contract.instance, + artifact: artifact, +}); +``` + +:::warning +You need the exact deployment parameters (salt, initialization hash, etc.) to correctly register an externally deployed contract. + +For example: + +```typescript +import { getContractInstanceFromInstantiationParams } from "@aztec/stdlib/contracts"; +const contract = await getContractInstanceFromInstantiationParams( + contractArtifact, + { + publicKeys: PublicKeys.default(), + constructorArtifact: initializer, + constructorArgs: parameters, + deployer: from, + salt, + } +); +``` + +::: + +## Next steps + +- [Send transactions](./how_to_send_transaction.md) to interact with your contract +- [Simulate functions](./how_to_simulate_function.md) to read contract state +- [Use authentication witnesses](./how_to_use_authwit.md) for delegated calls diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/how_to_pay_fees.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/how_to_pay_fees.md new file mode 100644 index 000000000000..f7e99bfd241e --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/how_to_pay_fees.md @@ -0,0 +1,267 @@ +--- +title: Paying Fees +tags: [fees, transactions, accounts] +sidebar_position: 7 +description: Pay transaction fees on Aztec using different payment methods and fee paying contracts. +--- + +import { Fees } from '@site/src/components/Snippets/general_snippets'; + +This guide walks you through paying transaction fees on Aztec using various payment methods. + +## Prerequisites + +- Running Aztec local network +- Deployed account wallet +- Understanding of [fee concepts](../foundational-topics/fees.md) + +:::info + +::: + +## Pay with Fee Juice + +Fee Juice is the native fee token on Aztec. + +If your account has Fee Juice (for example, from a faucet), is [deployed](./how_to_create_account.md), and is registered in your wallet, it will be used automatically to pay for the fee of the transaction: + +```typescript +const tx = await contract.methods + .myFunction(param1, param2) + .send({ + from: fundedAccount.address, + // no fee payment method needed + }) + .wait(); + +console.log("Transaction fee:", tx.transactionFee); +``` + +## Use Fee Payment Contracts + +Fee Payment Contracts (FPC) pay fees on your behalf, typically accepting a different token than Fee Juice. Since Fee Juice is non-transferable on L2, FPCs are the most common fee payment method. + +### Sponsored Fee Payment Contracts + +The Sponsored FPC pays for fees unconditionally without requiring payment in return. It is available on both the local network and the testnet (deployed by Aztec Labs). + +You can derive the Sponsored FPC address from its deployment parameters and salt (which defaults to `0`): + +```typescript +import { SponsoredFPCContract } from "@aztec/noir-contracts.js/SponsoredFPC"; +import { getContractInstanceFromInstantiationParams } from "@aztec/stdlib/contracts"; +import { SponsoredFeePaymentMethod } from "@aztec/aztec.js/fee/testing"; + +const sponsoredFPCInstance = await getContractInstanceFromInstantiationParams( + SponsoredFPCContract.artifact, + { + salt: new Fr(0), + } +); +``` + +Register the contract with your wallet before deploying and using it: + +```typescript +await wallet.registerContract( + sponsoredFPCInstance, + SponsoredFPCContract.artifact +); +const sponsoredPaymentMethod = new SponsoredFeePaymentMethod( + sponsoredFPCInstance.address +); + +// deploy account for free +const deployMethod = await yourAccount.getDeployMethod(); +const txHash = await deployMethod + .send({ + from: AztecAddress.ZERO, + fee: { paymentMethod: sponsoredPaymentMethod }, + }) + .wait(); +``` + +### Use other Fee Paying Contracts + +Third-party FPCs can pay for your fees using custom logic, such as accepting different tokens instead of Fee Juice. + +#### Set gas settings + +```typescript +import { GasSettings } from "@aztec/stdlib/gas"; + +const maxFeesPerGas = (await node.getCurrentBaseFees()).mul(1.5); //adjust this to your needs +const gasSettings = GasSettings.default({ maxFeesPerGas }); +``` + +Private FPCs enable fee payments without revealing the payer's identity onchain: + +```typescript +import { PrivateFeePaymentMethod } from "@aztec/aztec.js/fee"; + +const paymentMethod = new PrivateFeePaymentMethod( + fpcAddress, + senderAddress, + wallet, + gasSettings +); + +const tx = await contract.methods + .myFunction(param1) + .send({ + from: wallet.address, + fee: { + paymentMethod, + }, + }) + .wait(); +``` + +Public FPCs can be used in the same way: + +```typescript +import { PublicFeePaymentMethod } from "@aztec/aztec.js/fee"; + +const paymentMethod = new PublicFeePaymentMethod( + fpcAddress, + senderAddress, + wallet, + gasSettings +); +``` + +## Bridge Fee Juice from L1 + +Fee Juice is non-transferable on L2, but you can bridge it from L1, claim it on L2, and use it. This involves a few components that are part of a running network's infrastructure: + +- An L1 fee juice contract +- An L1 fee juice portal +- An L2 fee juice portal +- An L2 fee juice contract + +`aztec.js` provides helpers to simplify the process: + +```typescript +// essentially returns an extended wallet from Viem +import { createExtendedL1Client } from "@aztec/ethereum"; +const walletClient = createExtendedL1Client( + ["https://your-ethereum-host"], // ex. http://localhost:8545 on the local network (yes it runs Anvil under the hood) + privateKey // the private key for some account, needs funds for gas! +); + +// a helper to interact with the L1 fee juice portal +import { L1FeeJuicePortalManager } from "@aztec/aztec.js/ethereum"; +const portalManager = await L1FeeJuicePortalManager.new( + node, // your Aztec node, ex. https://aztec-testnet-fullnode.zkv.xyz, or http://localhost:8080 for local network + walletClient, + logger // a logger, ex. import { createLogger } from "@aztec/aztec.js" +); +``` + +Under the hood, `L1FeeJuicePortalManager` gets the L1 addresses from the node `node_getNodeInfo` endpoint. It then exposes an easy method `bridgeTokensPublic` which mints fee juice on L1 and sends it to an L2 address via the L1 portal: + +```typescript +const claim = await portalManager.bridgeTokensPublic( + acc.address, // the L2 address + 1000000000000000000000n, // the amount to send to the L1 portal + true // whether to mint or not (set to false if your walletClient account already has fee juice!) +); + +console.log("Claim secret:", claim.claimSecret); +console.log("Claim amount:", claim.claimAmount); +``` + +After this transaction is minted on L1 and a few blocks pass, you can claim the message on L2 and use it directly to pay for fees: + +```typescript +import { FeeJuicePaymentMethodWithClaim } from "@aztec/aztec.js/fee"; +const feeJuiceWithClaim = new FeeJuicePaymentMethodWithClaim( + acc.address, + claim +); // the l2 address and the claim + +yourContract.methods + .some_method(acc.address) + .send({ from: acc.address, fee: { paymentMethod: feeJuiceWithClaim } }) + .wait(); +``` + +:::tip Creating blocks + +To advance time quickly, send a couple of dummy transactions and `.wait()` for them. For example: + +```typescript +// using the `sponsoredFeePaymentMethod` so the network has transactions to build blocks with! +await contract.methods + .some_other_method(acc.address) + .send({ + from: acc.address, + fee: { paymentMethod: sponsoredFeePaymentMethod }, + }) + .wait(); +await contract.methods + .some_other_method(acc.address) + .send({ + from: acc.address, + fee: { paymentMethod: sponsoredFeePaymentMethod }, + }) + .wait(); +``` + +This will add a transaction to each block! + +::: + +## Configure gas settings + +### Set custom gas limits + +Set custom gas limits by importing from `stdlib`: + +```typescript +import { GasSettings, Gas, GasFees } from "@aztec/stdlib/gas"; + +const gasSettings = new GasSettings( + new Gas(100000, 100000), // gasLimits (DA, L2) + new Gas(10000, 10000), // teardownGasLimits + new GasFees(10, 10), // maxFeesPerGas + new GasFees(1, 1) // maxPriorityFeesPerGas +); + +const tx = await contract.methods + .myFunction() + .send({ + from: wallet.address, + fee: { + paymentMethod, + gasSettings, + }, + }) + .wait(); +``` + +### Use automatic gas estimation + +```typescript +const tx = await contract.methods + .myFunction() + .send({ + from: wallet.address, + fee: { + paymentMethod, + estimateGas: true, + estimatedGasPadding: 0.2, // 20% padding + }, + }) + .wait(); +``` + +:::tip +Gas estimation runs a simulation first to determine actual gas usage, then adds padding for safety. +::: + +## Next steps + +- Learn about [fee concepts](../foundational-topics/fees.md) in detail +- Explore [authentication witnesses](./how_to_use_authwit.md) for delegated payments +- See [testing guide](./how_to_test.md) for fee testing strategies diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/how_to_send_transaction.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/how_to_send_transaction.md new file mode 100644 index 000000000000..205cb8a32e21 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/how_to_send_transaction.md @@ -0,0 +1,127 @@ +--- +title: Sending Transactions +sidebar_position: 4 +description: Send transactions to Aztec contracts using Aztec.js with various options and error handling +tags: [transactions, contracts, aztec.js] +--- + +This guide shows you how to send transactions to smart contracts on Aztec. + +## Prerequisites + +- Deployed contract with its address and ABI +- Funded account wallet +- Running Aztec local network or connected to a network +- Understanding of [contract interactions](../aztec-nr/framework-description/how_to_call_contracts.md) + +## Sending a basic transaction + +Let's say you've connected to a contract, for example: + +```typescript +import { Contract } from "@aztec/aztec.js"; + +const contract = await Contract.at(contractAddress, artifact, wallet); +``` + +or + +```typescript +import { MyContract } from "./artifacts/MyContract"; + +const contract = await MyContract.at(contractAddress, wallet); +``` + +You should [choose your fee-paying method](./how_to_pay_fees.md) and just call a function on it: + +```typescript +const withFeeJuice = await contract.methods + .transfer(recipientAddress, amount) + .send({ from: fundedAccount.address }) // if this account has fee-juice + .wait(); + +// or using the Sponsored FPC + +const sponsored = await contract.methods + .transfer(recipientAddress, amount) + .send({ fee: { paymentMethod: sponsoredPaymentMethod } }) + .wait(); +``` + +### Send without waiting + +```typescript +// Send transaction and get a SentTx object +const sentTx = contract.methods + .transfer(recipientAddress, amount) + .send({ from: fundedAccount.address }); + +// Get transaction hash immediately +const txHash = await sentTx.getTxHash(); +console.log(`Transaction sent with hash: ${txHash.toString()}`); + +// Wait for inclusion later +const receipt = await sentTx.wait(); +console.log(`Transaction mined in block ${receipt.blockNumber}`); +``` + +## Send batch transactions + +### Execute multiple calls atomically + +```typescript +import { BatchCall } from "@aztec/aztec.js"; + +const batch = new BatchCall(wallet, [ + token.methods.approve(spender, amount), + contract.methods.deposit(amount), + contract.methods.updateState(), +]); + +const receipt = await batch.send({ from: fundedAccount.address }).wait(); +console.log( + `Batch executed in block ${receipt.blockNumber} with fee ${receipt.transactionFee}` +); +``` + +:::warning +All calls in a batch must succeed or the entire batch reverts. Use batch transactions when you need atomic execution of multiple operations. +::: + +## Query transaction status + +### Get transaction receipt + +```typescript +const txHash = await sentTx.getTxHash(); +const receipt = await wallet.getTxReceipt(txHash); // or node.getTxReceipt(txHash); +``` + +### Check transaction effects + +```typescript +const txHash = await sentTx.getTxHash(); +const effect = await node.getTxEffect(txHash); + +// Access public data writes +effect.data.publicDataWrites.forEach((write) => { + console.log(`Wrote ${write.value} to slot ${write.leafSlot}`); +}); + +// Check note hashes (private note commitments) +effect.data.noteHashes.forEach((noteHash) => { + console.log(`Created note: ${noteHash.toString()}`); +}); + +// Check nullifiers (consumed notes) +effect.data.nullifiers.forEach((nullifier) => { + console.log(`Nullified: ${nullifier.toString()}`); +}); +``` + +## Next steps + +- Learn to [simulate functions](./how_to_simulate_function.md) before sending +- Understand [authentication witnesses](./how_to_use_authwit.md) for delegated transactions +- Configure [gas and fees](./how_to_pay_fees.md) for optimal transaction costs +- Set up [transaction testing](./how_to_test.md) in your development workflow diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/how_to_simulate_function.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/how_to_simulate_function.md new file mode 100644 index 000000000000..054cb104cd21 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/how_to_simulate_function.md @@ -0,0 +1,127 @@ +--- +title: Simulating Functions +tags: [functions, view, simulation] +sidebar_position: 5 +description: Step-by-step guide to simulating function calls and reading state from Aztec contracts. +--- + +This guide shows you how to simulate function calls to read contract state. + +## Prerequisites + +- Deployed contract address and ABI +- Wallet connection +- Understanding of [contract functions](../aztec-nr/framework-description/functions/how_to_define_functions.md) + +## Connect to a contract + +Let's say you've connected to a contract, for example: + +```typescript +import { Contract } from "@aztec/aztec.js"; + +const contract = await Contract.at(contractAddress, artifact, wallet); +``` + +or + +```typescript +import { MyContract } from "./artifacts/MyContract"; + +const contract = await MyContract.at(contractAddress, wallet); +``` + +## Simulate public functions + +### Step 1: Call a public view function + +```typescript +const result = await contract.methods + .get_public_value(param1) + .simulate({ from: callerAddress }); // assuming callerAddress is already registered on the wallet, i.e. wallet.createSchnorrAccount(caller.secret, caller.salt) + +console.log("Public value:", result); +``` + +### Step 2: Handle return values + +```typescript +const result = await contract.methods + .get_multiple_values() + .simulate({ from: callerAddress }); + +// Destructure if returning multiple values +const [value1, value2] = result; +``` + +## Simulate private functions + +### Step 1: Call a private view function + +```typescript +const privateResult = await contract.methods + .get_private_balance(ownerAddress) + .simulate({ from: ownerAddress }); +``` + +### Step 2: Access private notes + +```typescript +// Private functions can access the caller's private state +const notes = await contract.methods + .get_my_notes() + .simulate({ from: ownerAddress }); +``` + +:::warning +Private simulations only work if the caller has access to the private state being queried. +::: + +## Simulate utility functions + +### Step 1: Call utility function + +```typescript +const result = await contract.methods + .compute_value(input1, input2) + .simulate({ from: account.address }); + +console.log("Computed value:", result); +``` + +### Step 2: Use utility functions for complex queries + +```typescript +const aggregatedData = await contract.methods + .get_aggregated_stats(startBlock, endBlock) + .simulate({ from: account.address }); + +// Returns structured data based on function signature +console.log("Stats:", aggregatedData); +``` + +## Simulate with different contexts + +### Simulate from different addresses + +```typescript +// Simulate as different users to test access control +const asOwner = await contract.methods + .admin_function() + .simulate({ from: ownerAddress }); + +try { + const asUser = await contract.methods + .admin_function() + .simulate({ from: userAddress }); +} catch (error) { + console.log("User cannot access admin function"); +} +``` + +## Next steps + +- [Send transactions](./how_to_send_transaction.md) to modify contract state +- Learn about [private and public functions](../aztec-nr/framework-description/functions/how_to_define_functions.md) +- Explore [testing patterns](./how_to_test.md) for simulations +- Understand [state management](../aztec-nr/framework-description/how_to_define_storage.md) diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/how_to_test.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/how_to_test.md new file mode 100644 index 000000000000..ed1b1d8a039f --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/how_to_test.md @@ -0,0 +1,16 @@ +--- +title: Testing Aztec.nr contracts with TypeScript +tags: [contracts, tests] +sidebar_position: 8 +description: Learn how to write and run tests for your Aztec.js applications. +--- + +Note: This section became completely stale so it got removed and will be rewritten. + +## Further reading + +- [How to simulate functions in Aztec.js](./how_to_simulate_function.md) +- [How to send transactions in Aztec.js](./how_to_send_transaction.md) +- [How to deploy a contract in Aztec.js](./how_to_deploy_contract.md) +- [How to create an account in Aztec.js](./how_to_create_account.md) +- [How to compile a contract](../aztec-nr/how_to_compile_contract.md). diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/how_to_use_authwit.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/how_to_use_authwit.md new file mode 100644 index 000000000000..5e7b46d4691a --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/how_to_use_authwit.md @@ -0,0 +1,124 @@ +--- +title: Using Authentication Witnesses +tags: [accounts, authwit] +sidebar_position: 6 +description: Step-by-step guide to implementing authentication witnesses in Aztec.js for delegated transactions. +--- + +This guide shows you how to create and use authentication witnesses (authwits) to authorize other accounts to perform actions on your behalf. + +:::warning aztec-nr + +Using AuthWitnesses is always a two-part process. This guide shows how to generate and use them, but you still need to set up your contract to accept and authenticate them. + +Therefore it is recommended to read the `aztec-nr` [guide on authwitnesses](../aztec-nr/framework-description/how_to_use_authwit.md) before this one. + +::: + +## Prerequisites + +- Deployed account wallets +- Contract with authwit validation (see [smart contract authwits](../aztec-nr/framework-description/how_to_use_authwit.md)) +- Understanding of [authwit concepts](../foundational-topics/advanced/authwit.md) + +## AuthWits + +Let's also assume we have a contract with functions `some_public_function` and `some_private_function` with the macro `#[authorize_once("from", "authwit_nonce")]`, meaning it will check if: + +- `from` is `msg_sender`, or +- there's an authwitness allowing `from` to call this function + +Regardless of its type, you'll want to define what is being delegated (let's call it "action") and the intent ("who intends to act"). For example: + +```typescript +const nonce = Fr.random() + +// bob creates an authwit that authorizes alice to call the function on his behalf +const action = contract.methods.some_private_function(bob, 10n, nonce) +const intent = { + caller: alice.address, // alice "intends" to call the function on bob's behalf + action +}; +``` + +:::tip + +The nonce is necessary to avoid replay attacks. However, the contract is smart enough to allow bob to call the function himself by setting the nonce to `0`. + +::: + +## Create private authwits + +Private AuthWits mean that some action is authorized in private. No specific transaction is made, the authorization is just sent as part of the actual transaction: + +```typescript +const authWit = await wallet.createAuthWit(bob.address, intent); +``` + +Now alice can call the function by providing the authwit: + +```typescript +await action.send({ from: alice.address, authWitnesses: [authWit] }).wait(); +``` + +## Create public authwits + +Public authwits mean the authorization is public, so it requires a transaction. You create the authwit just as above, but the wallet needs to authorize it in the canonical `AuthRegistry` contract: + +```typescript +// "true" is specific here... because you may want to revoke it later! +const authwit = await wallet.setPublicAuthWit(bob.address, intent, true); +await authwit.send({ from: bob.address }).wait() +``` + +Now that everyone knows about the public authorization, alice can call the function normally: + +```typescript +await action.send({ from: alice.address }).wait() +``` + +## Create arbitrary message authwits + +This is useful when you need to authorize arbitrary data rather than a specific contract function call. For example, authorizing a signature over a message for offchain verification. + +### Step 1: Create inner hash + +You can use `computeInnerAuthWitHash` to get yourself a hash of arbitrary hash you can use in an authwit: + +```typescript +import { computeInnerAuthWitHash, computeAuthWitMessageHash } from "@aztec/aztec.js"; + +// Create hash of arbitrary data +const innerHash = computeInnerAuthWitHash([ + field1, + field2, + field3 +]); + +// Create full authwit message hash +const messageHash = computeAuthWitMessageHash( + executorAddress, + chainId, + version, + innerHash +); +``` + +## Revoke public authwits + +Because public authwits are... well, public, that means you should be able to revoke them. Just set the last parameter to `false` and send the transaction: + +```typescript +// Set authorized to false to revoke +const revoked = await authorizerWallet.setPublicAuthWit({ + caller: executorAddress, + action: action +}, false).send({ from: account.address }); +``` + +## Next steps + +- Learn about [authwits in smart contracts](../aztec-nr/framework-description/how_to_use_authwit.md) +- Understand [authwit concepts](../foundational-topics/advanced/authwit.md) +- Explore [account abstraction](../foundational-topics/accounts/index.md) +- Implement [cross-chain messaging](../aztec-nr/framework-description/how_to_communicate_cross_chain.md) diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/index.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/index.md new file mode 100644 index 000000000000..b58cefcb70e6 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-js/index.md @@ -0,0 +1,25 @@ +--- +title: Aztec.js +sidebar_position: 0 +tags: [aztec.js, javascript, typescript] +description: Complete guide to Aztec.js library for managing accounts and interacting with contracts on the Aztec network, including installation, importing, and core workflow functions. +--- + +import DocCardList from "@theme/DocCardList"; + +Aztec.js is a library that provides APIs for managing accounts and interacting with contracts on the Aztec network. It communicates with the [Private eXecution Environment (PXE)](../foundational-topics/pxe/index.md) through a `PXE` implementation, allowing developers to easily register new accounts, deploy contracts, view functions, and send transactions. + +## Installing + +```bash +npm install @aztec/aztec.js +``` + +## Flow + +These are some of the important functions you'll need to use in your Aztec.js: + +- [Create an account with `@aztec/accounts`](./how_to_create_account.md) +- [Deploy a contract](./how_to_deploy_contract.md) +- [Simulate a function call](./how_to_simulate_function.md) +- [Send a transaction](./how_to_send_transaction.md) diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/_category_.json b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/_category_.json new file mode 100644 index 000000000000..aa2589a597d7 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/_category_.json @@ -0,0 +1,6 @@ +{ + "position": 2, + "collapsible": true, + "collapsed": true, + "label": "Aztec.nr" +} diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/api.mdx b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/api.mdx new file mode 100644 index 000000000000..c964f23e8a83 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/api.mdx @@ -0,0 +1,82 @@ +--- +title: Aztec.nr API Reference +sidebar_position: 100 +description: Auto-generated API reference documentation for the Aztec.nr smart contract framework. +aztec_nr_api_version: next +--- + +import Link from "@docusaurus/Link"; +import { useActiveVersion } from "@docusaurus/plugin-content-docs/client"; + +export const useApiVersion = () => { + const version = useActiveVersion("developer"); + const versionName = version?.name || "current"; + // Map Docusaurus version to API docs folder + // Use stable paths for nightly/devnet, version-specific for others + if (versionName === "current") return "next"; + if (versionName.includes("nightly")) return "nightly"; + if (versionName.includes("devnet")) return "devnet"; + return versionName; +}; + +export const ApiLink = () => { + const apiVersion = useApiVersion(); + const href = `/aztec-nr-api/${apiVersion}/all.html`; + return ( +

+ + + Open Aztec.nr API Reference → + + +

+ ); +}; + +export const ModuleLink = ({ path, children }) => { + const apiVersion = useApiVersion(); + const href = `/aztec-nr-api/${apiVersion}/${path}/index.html`; + return ( + + {children} + + ); +}; + +# Aztec.nr API Reference + +The Aztec.nr API reference documentation is auto-generated from the source code using `nargo doc`. + +## View the API Documentation + + + +The API reference includes documentation for all public modules, functions, structs, and types in the aztec-nr workspace: + +### Core Crates + +- **noir_aztec** - Core Aztec contract framework including: + - `context` - Private and public execution contexts + - `state_vars` - State variable types (PrivateMutable, PublicMutable, Map, etc.) + - `note` - Note interfaces and utilities + - `authwit` - Authentication witness support + - `history` - Historical state proofs + - `messages` - Cross-chain messaging + - `oracle` - Oracle interfaces + - `macros` - Contract macros and attributes + - `hash` - Hash functions and utilities + - `keys` - Key management utilities + - `event` - Event emission and interfaces + - `test` - Testing utilities + - `utils` - General utilities + +### Note Types + +- **address_note** - Note type for storing Aztec addresses +- **value_note** - Note type for storing field values +- **uint_note** - Note type for storing unsigned integers + +### Utilities + +- **compressed_string** - Compressed string utilities for efficient storage +- **easy_private_state** - Simplified private state management diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/debugging.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/debugging.md new file mode 100644 index 000000000000..b22751cf6336 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/debugging.md @@ -0,0 +1,234 @@ +--- +title: Debugging Aztec Code +sidebar_position: 4 +tags: [debugging, errors, logging, local_network, aztec.nr] +description: This guide shows you how to debug issues in your Aztec contracts. +--- + + + +This guide shows you how to debug issues in your Aztec development environment. + +## Prerequisites + +- Running Aztec local network +- Aztec.nr contract or aztec.js application +- Basic understanding of Aztec architecture + +## Enable logging + +Enable different levels of logging on the local network or node by setting `LOG_LEVEL`: + +```bash +# Set log level (options: fatal, error, warn, info, verbose, debug, trace) +LOG_LEVEL=debug aztec start --local-network + +# Different levels for different services +LOG_LEVEL="verbose;info:sequencer" aztec start --local-network +``` + +## Logging in Aztec.nr contracts + +Log values from your contract using `debug_log`: + +```rust +// Import debug logging +use dep::aztec::oracle::debug_log::{ debug_log, debug_log_format, debug_log_field, debug_log_array }; + +// Log simple messages +debug_log("checkpoint reached"); + +// Log field values with context +debug_log_format("slot:{0}, hash:{1}", [storage_slot, note_hash]); + +// Log single field +debug_log_field(my_field); + +// Log arrays +debug_log_array(my_array); +``` + +:::note +Debug logs appear only during local execution. Private functions always execute locally, but public functions must be simulated to show logs. Use `.simulate()` or `.prove()` in TypeScript, or `env.simulate_public_function()` in TXE tests. +::: + +To see debug logs from your tests, set `LOG_LEVEL` when running: + +```bash +LOG_LEVEL="debug" yarn run test +``` + +To filter specific modules, use a semicolon-delimited list: + +```bash +LOG_LEVEL="info;debug:simulator:client_execution_context;debug:simulator:client_view_context" yarn run test +``` + +:::info Log filter format +`LOG_LEVEL` accepts a semicolon-delimited list of filters. Each filter can be: + +- `level` - Sets default level for all modules +- `level:module` - Sets level for a specific module +- `level:module:submodule` - Sets level for a specific submodule + +```bash +# Default level only +LOG_LEVEL="debug" + +# Default level + specific module overrides +LOG_LEVEL="info;debug:simulator;debug:execution" + +# Default level + specific submodule overrides +LOG_LEVEL="info;debug:simulator:client_execution_context;debug:simulator:client_view_context" +``` + +::: + +## Debugging common errors + +### Contract Errors + +| Error | Solution | +| -------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Aztec dependency not found` | Add to Nargo.toml: `aztec = { git="https://github.com/AztecProtocol/aztec-packages/", tag="v3.0.2", directory="noir-projects/aztec-nr/aztec" }` | +| `Public state writes only supported in public functions` | Move state writes to public functions | +| `Unknown contract 0x0` | Call `wallet.registerContract(...)` to register contract | +| `No public key registered for address` | Call `wallet.registerSender(...)` | +| `Failed to solve brillig function` | Check function parameters and note validity | + +### Circuit Errors + +| Error Code | Meaning | Fix | +| ----------- | ---------------------------- | -------------------------------------------------- | +| `2002` | Invalid contract address | Ensure contract is deployed and address is correct | +| `2005/2006` | Static call violations | Remove state modifications from static calls | +| `2017` | User intent mismatch | Verify transaction parameters match function call | +| `3001` | Unsupported operation | Check if operation is supported in current context | +| `3005` | Non-empty private call stack | Ensure private functions complete before public | +| `4007/4008` | Chain ID/version mismatch | Verify L1 chain ID and Aztec version | +| `7008` | Membership check failed | Ensure using valid historical state | +| `7009` | Array overflow | Reduce number of operations in transaction | + +### Quick Fixes for Common Issues + +```bash +# Archiver sync issues - force progress with dummy transactions +aztec-wallet send transfer --from test0 --to test0 --amount 0 +aztec-wallet send transfer --from test0 --to test0 --amount 0 + +# L1 to L2 message pending - wait for inclusion +# Messages need 2 blocks to be processed +``` + +## Debugging WASM errors + +### Enable debug WASM + +```javascript +// In vite.config.ts or similar +export default { + define: { + "process.env.BB_WASM_PATH": JSON.stringify("https://debug.wasm.url"), + }, +}; +``` + +### Profile transactions + +```javascript +import { serializePrivateExecutionSteps } from "@aztec/stdlib"; + +// Profile the transaction +const profileTx = await contract.methods + .myMethod(param1, param2) + .profile({ profileMode: "execution-steps" }); + +// Serialize for debugging +const ivcMessagePack = serializePrivateExecutionSteps(profileTx.executionSteps); + +// Download debug file +const blob = new Blob([ivcMessagePack]); +const url = URL.createObjectURL(blob); +const link = document.createElement("a"); +link.href = url; +link.download = "debug-steps.msgpack"; +link.click(); +``` + +⚠️ **Warning:** Debug files may contain private data. Use only in development. + +## Interpret error messages + +### Kernel circuit errors (2xxx) + +- **Private kernel errors (2xxx)**: Issues with private function execution +- **Public kernel errors (3xxx)**: Issues with public function execution +- **Rollup errors (4xxx)**: Block production issues +- **Generic errors (7xxx)**: Resource limits or state validation + +### Transaction limits + +Current limits that trigger `7009 - ARRAY_OVERFLOW`: + +- Max new notes per tx: Check `MAX_NOTE_HASHES_PER_TX` +- Max nullifiers per tx: Check `MAX_NULLIFIERS_PER_TX` +- Max function calls: Check call stack size limits +- Max L2→L1 messages: Check message limits + +## Debugging sequencer issues + +### Common sequencer errors + +| Error | Cause | Solution | +| ------------------------------------ | --------------------- | ------------------------------------------ | +| `tree root mismatch` | State inconsistency | Restart local network or check state transitions | +| `next available leaf index mismatch` | Tree corruption | Verify tree updates are sequential | +| `Public call stack size exceeded` | Too many public calls | Reduce public function calls | +| `Failed to publish block` | L1 submission failed | Check L1 connection and gas | + +## Reporting issues + +When debugging fails: + +1. Collect error messages and codes +2. Generate transaction profile (if applicable) +3. Note your environment setup +4. Create issue at [aztec-packages](https://github.com/AztecProtocol/aztec-packages/issues/new) + +## Quick reference + +### Enable verbose logging + +```bash +LOG_LEVEL=verbose aztec start --local-network +``` + +### Common debug imports + +```rust +use dep::aztec::oracle::debug_log::{ debug_log, debug_log_format }; +``` + +### Check contract registration + +```javascript +await wallet.getContractMetadata(myContractInstance.address); +``` + +### Decode L1 errors + +Check hex errors against [Errors.sol](https://github.com/AztecProtocol/aztec-packages/blob/master/l1-contracts/src/core/libraries/Errors.sol) + +## Tips + +- Always check logs before diving into circuit errors +- State-related errors often indicate timing issues +- Array overflow errors mean you hit transaction limits +- Use debug WASM for detailed stack traces +- Profile transactions when errors are unclear + +## Next steps + +- [Circuit Architecture](../foundational-topics/advanced/circuits/index.md) +- [Private-Public Execution](./framework-description/functions/public_private_calls.md) +- [Aztec.nr Dependencies](./framework-description/dependencies.md) diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/_category_.json b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/_category_.json new file mode 100644 index 000000000000..3eac7b6e0a9c --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/_category_.json @@ -0,0 +1,6 @@ +{ + "position": 4, + "collapsible": true, + "collapsed": true, + "label": "Framework Description" +} diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/advanced/_category_.json b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/advanced/_category_.json new file mode 100644 index 000000000000..ac5114338490 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/advanced/_category_.json @@ -0,0 +1,6 @@ +{ + "position": 15, + "collapsible": true, + "collapsed": true, + "label": "Advanced Topics" +} diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/advanced/how_to_profile_transactions.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/advanced/how_to_profile_transactions.md new file mode 100644 index 000000000000..389051fdf68d --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/advanced/how_to_profile_transactions.md @@ -0,0 +1,256 @@ +--- +title: Profiling and Optimizing Contracts +sidebar_position: 2 +tags: [contracts, profiling, optimization] +description: Step-by-step guide to profiling Aztec transactions and optimizing contract performance for efficient proof generation. +--- + +This guide shows you how to profile your Aztec transactions to identify bottlenecks and optimize gas usage. + +## Prerequisites + +- `aztec` command installed ([see installation](../../../aztec-cli/local-network-reference.md)) +- `aztec-wallet` installed +- Aztec contract deployed and ready to test +- Basic understanding of proving and gate counts + +## Profile with aztec-wallet + +### Step 1: Import test accounts + +```bash +aztec-wallet import-test-accounts +``` + +### Step 2: Deploy your contract + +```bash +aztec-wallet deploy MyContractArtifact \ + --from accounts:test0 \ + --args \ + -a mycontract +``` + +### Step 3: Set up initial state + +```bash +aztec-wallet send setup_state \ + -ca mycontract \ + --args \ + -f test0 +``` + +### Step 4: Profile a transaction + +Instead of `send`, use `profile` with the same parameters: + +```bash +aztec-wallet profile private_function \ + -ca mycontract \ + --args \ + -f accounts:test0 +``` + +### Step 5: Analyze the output + +```bash +Gate count per circuit: + SchnorrAccount:entrypoint Gates: 21,724 Acc: 21,724 + private_kernel_init Gates: 45,351 Acc: 67,075 + MyContract:private_function Gates: 31,559 Acc: 98,634 + private_kernel_inner Gates: 78,452 Acc: 177,086 + private_kernel_reset Gates: 91,444 Acc: 268,530 + private_kernel_tail Gates: 31,201 Acc: 299,731 + +Total gates: 299,731 +``` + +The output shows: + +- Gate count per circuit component +- Accumulated gate count +- Total gates for the entire transaction + +## Profile with aztec.js + +:::tip Profile Modes + +- `gates`: Shows gate counts per circuit +- `execution-steps`: Detailed execution trace +- `full`: Complete profiling information + +::: + +### Step 1: Profile a transaction + +```javascript +const result = await contract.methods + .my_function(args) + .profile({ + from: address, + profileMode: 'gates', + skipProofGeneration: false + }); + +console.log('Gate count:', result.gateCount); +``` + +### Step 2: Profile deployment + +```javascript +const deploy = await Contract.deploy(args).profile({ from: address, profileMode: 'full' }); +``` + +:::warning Experimental +Flamegraph generation is experimental and may not be available in all versions. +::: + +## Generate flamegraphs (if available) + +### Generate and view + +```bash +# Compile first +aztec compile + +# Generate flamegraph +aztec flamegraph target/contract.json function_name + +# Serve locally +SERVE=1 aztec flamegraph target/contract.json function_name +``` + +:::info Reading Flamegraphs + +- **Width** = Time in operation +- **Height** = Call depth +- **Wide sections** = Optimization targets + +::: + +## Common optimizations + +:::info Key Metrics + +- **Gate count**: Circuit complexity +- **Kernel overhead**: Per-function cost +- **Storage access**: Read/write operations + +::: + +:::tip Optimization Pattern +Batch operations to reduce kernel circuit overhead. +::: + +```rust +// ❌ Multiple kernel invocations +for i in 0..3 { + transfer_single(amounts[i], recipients[i]); +} + +// ✅ Single kernel invocation +for i in 0..3 { + let note = Note::new(amounts[i], recipients[i]); + storage.notes.at(recipients[i]).insert(note); +} +``` + +:::tip Storage Optimization +Group storage reads to reduce overhead. +::: + +```rust +// Read once, use multiple times +let values = [storage.v1.get(), storage.v2.get(), storage.v3.get()]; +for v in values { + assert(v > 0); +} +``` + +### Minimize note operations + +:::tip Note Aggregation +Combine multiple small notes into fewer larger ones to reduce proving overhead. +::: + +```rust +// ❌ Many small notes = high overhead +for value in values { + storage.notes.insert(Note::new(value, owner)); +} + +// ✅ Single aggregated note = lower overhead +let total = values.reduce(|a, b| a + b); +storage.notes.insert(Note::new(total, owner)); +``` + +## Profile different scenarios + +### Profile with different inputs + +```bash +# Small values +aztec-wallet profile function -ca mycontract --args 10 -f test0 + +# Large values +aztec-wallet profile function -ca mycontract --args 1000000 -f test0 +``` + +### Profile execution modes + +```javascript +// Profile gates only +await contract.methods.function().profile({ profileMode: 'gates' }); + +// Profile execution steps +await contract.methods.function().profile({ profileMode: 'execution-steps' }); + +// Full profile +await contract.methods.function().profile({ profileMode: 'full' }); +``` + +### Skip proof generation for faster iteration + +```javascript +await contract.methods.function().profile({ + profileMode: 'gates', + skipProofGeneration: true // Faster but less accurate +}); +``` + +## Interpret profiling results + +### Gate count guidelines + +- **< 50,000 gates**: Excellent performance +- **50,000 - 200,000 gates**: Acceptable for most use cases +- **200,000 - 500,000 gates**: May cause delays, consider optimizing +- **> 500,000 gates**: Requires optimization for production + +### Common optimization targets + +1. **private_kernel_inner** - Reduce nested function calls +2. **private_kernel_reset** - Minimize note nullifications +3. **Contract functions** - Optimize computation logic +4. **private_kernel_tail** - Reduce public function calls + +## Best practices + +### Development workflow + +1. **Profile early** - Establish baseline metrics +2. **Profile often** - Check impact of changes +3. **Profile realistically** - Use production-like data +4. **Document findings** - Track optimization progress + +### Optimization priorities + +1. **User-facing functions** - Optimize most-used features first +2. **Critical paths** - Focus on transaction bottlenecks +3. **Batch operations** - Combine related operations +4. **Cache calculations** - Store reusable results + +## Next steps + +- Learn about [gas optimization techniques](../../../foundational-topics/transactions.md) +- Review [benchmarking best practices](../../how_to_test_contracts.md) diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/advanced/how_to_prove_history.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/advanced/how_to_prove_history.md new file mode 100644 index 000000000000..532052dc7d1b --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/advanced/how_to_prove_history.md @@ -0,0 +1,88 @@ +--- +title: Proving Historic State +sidebar_position: 15 +tags: [contracts] +description: Prove historical state and note inclusion in your Aztec smart contracts using the Archive tree. +--- + +This guide shows you how to prove historical state transitions and note inclusion using Aztec's Archive tree. + +## Prerequisites + +- An Aztec contract project set up with `aztec-nr` dependency +- Understanding of Aztec's note and nullifier system +- Knowledge of Merkle tree concepts + +## Understand what you can prove + +You can create proofs for these elements at any past block height: + +- Note inclusion/exclusion +- Nullifier inclusion/exclusion +- Note validity (included and not nullified) +- Public value existence +- Contract deployment + +Use cases include: + +- Timestamp verification in private contexts +- Eligibility verification based on historical note ownership +- Item ownership verification +- Public data existence proofs +- Contract deployment verification + +:::info Historical Proofs +Prove state at any past block using the Archive tree. Useful for timestamps, eligibility checks, and ownership verification. +::: + +## Retrieve notes for proofs + +```rust +use aztec::note::note_getter_options::NoteGetterOptions; + +let options = NoteGetterOptions::new(); +let notes = storage.notes.at(owner).get_notes(options); + +// Access first note as retrieved_note +let retrieved_note = notes.get(0); +``` + +## Prove note inclusion + +```rust +use dep::aztec::history::note_validity::ProveNoteValidity; + +// Get block header for historical proof +let header = context.get_block_header(); + +// Prove note existed and wasn't nullified +// Requires: RetrievedNote, storage_slot, context +header.prove_note_validity(retrieved_note, storage_slot, &mut context); +``` + +:::tip +Use `prove_note_validity` to verify both inclusion and non-nullification in one call. +::: + +## Prove nullifier inclusion + +```rust +use dep::aztec::history::nullifier_inclusion::ProveNullifierInclusion; +use dep::aztec::protocol_types::hash::compute_siloed_nullifier; + +// Compute nullifier (requires note hash) +let nullifier = note.compute_nullifier(&mut context, note_hash_for_nullification); +let siloed_nullifier = compute_siloed_nullifier(context.this_address(), nullifier); + +// Prove nullifier was included +context.get_block_header().prove_nullifier_inclusion(siloed_nullifier); +``` + +:::info Additional Proofs + +Other available proofs: +- Note inclusion without validity check +- Nullifier non-inclusion (prove something wasn't nullified) +- Public data inclusion at historical blocks + +::: diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/advanced/how_to_retrieve_filter_notes.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/advanced/how_to_retrieve_filter_notes.md new file mode 100644 index 000000000000..ad2a247bb443 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/advanced/how_to_retrieve_filter_notes.md @@ -0,0 +1,204 @@ +--- +title: Retrieving and Filtering Notes +sidebar_position: 0 +tags: [private-state, smart-contracts, notes] +description: Step-by-step guide to retrieving, filtering, and sorting notes from private storage in Aztec contracts. +--- + +This guide shows you how to retrieve and filter notes from private storage using `NoteGetterOptions`. + +## Prerequisites + +- Aztec contract with note storage +- Understanding of note structure and properties +- Familiarity with PropertySelector and Comparator + +## Set up basic note retrieval + +### Step 1: Create default options + +```rust +let mut options = NoteGetterOptions::new(); +``` + +This returns up to `MAX_NOTE_HASH_READ_REQUESTS_PER_CALL` notes without filtering. + +### Step 2: Retrieve notes from storage + +```rust +let notes = storage.my_notes.at(owner).get_notes(options); +``` + +## Filter notes by properties + +### Step 1: Select notes with specific field values + +```rust +// Assuming MyNote has an 'owner' field +let mut options = NoteGetterOptions::new(); +options = options.select( + MyNote::properties().owner, + Comparator.EQ, + owner +); +``` + +### Step 2: Apply multiple selection criteria + +```rust +let mut options = NoteGetterOptions::new(); +options = options + .select(MyNote::properties().value, Comparator.EQ, value) + .select(MyNote::properties().owner, Comparator.EQ, owner); +``` + +:::tip +Chain multiple `select` calls to filter by multiple fields. Remember to call `get_notes(options)` after applying all your selection criteria to retrieve the filtered notes. +::: + +## Sort retrieved notes + +### Sort and paginate results + +```rust +let mut options = NoteGetterOptions::new(); +options = options + .select(MyNote::properties().owner, Comparator.EQ, owner) + .sort(MyNote::properties().value, SortOrder.DESC) + .set_limit(10) // Max 10 notes + .set_offset(20); // Skip first 20 +``` + +## Apply custom filters + +:::tip Filter Performance +Database `select` is more efficient than custom filters. Use custom filters only for complex logic. +::: + +### Create and use a custom filter + +```rust +fn filter_above_threshold( + notes: [Option>; MAX_NOTES], + min: Field, +) -> [Option>; MAX_NOTES] { + let mut result = [Option::none(); MAX_NOTES]; + let mut count = 0; + + for note in notes { + if note.is_some() & (note.unwrap().note.value >= min) { + result[count] = note; + count += 1; + } + } + result +} + +// Use the filter +let options = NoteGetterOptions::with_filter(filter_above_threshold, min_value); +``` + +:::warning Note Limits +Maximum notes per call: `MAX_NOTE_HASH_READ_REQUESTS_PER_CALL` (currently 128) +::: + +:::info Available Comparators + +- `EQ`: Equal to +- `NEQ`: Not equal to +- `LT`: Less than +- `LTE`: Less than or equal +- `GT`: Greater than +- `GTE`: Greater than or equal + +::: + +## Use comparators effectively + +### Available comparators + +```rust +// Equal to +options.select(MyNote::properties().value, Comparator.EQ, target_value) + +// Greater than or equal +options.select(MyNote::properties().value, Comparator.GTE, min_value) + +// Less than +options.select(MyNote::properties().value, Comparator.LT, max_value) +``` + +### Call from TypeScript with comparator + +```typescript +// Pass comparator from client +contract.methods.read_notes(Comparator.GTE, 5).simulate({ from: defaultAddress }) +``` + +## View notes without constraints + +```rust +use dep::aztec::note::note_viewer_options::NoteViewerOptions; + +#[external("utility")] +unconstrained fn view_notes(comparator: u8, value: Field) -> auto { + let mut options = NoteViewerOptions::new(); + options = options.select(MyNote::properties().value, comparator, value); + storage.my_notes.view_notes(options) +} +``` + +:::tip Viewer vs Getter + +- `NoteGetterOptions`: For constrained functions (private/public) +- `NoteViewerOptions`: For unconstrained viewing (utilities) + +::: + +## Query notes with different status + +### Set status to include nullified notes + +```rust +let mut options = NoteGetterOptions::new(); +options.set_status(NoteStatus.ACTIVE_OR_NULLIFIED); +``` + +:::info Note Status Options + +- `NoteStatus.ACTIVE`: Only active (non-nullified) notes (default) +- `NoteStatus.ACTIVE_OR_NULLIFIED`: Both active and nullified notes + +::: + +## Optimize note retrieval + +:::tip Best Practices + +1. **Use select over filter** - Database-level filtering is more efficient +2. **Set limits early** - Reduce unnecessary note processing +3. **Sort before limiting** - Get the most relevant notes first +4. **Batch operations** - Retrieve all needed notes in one call + +::: + +### Example: Optimized retrieval + +```rust +// Get highest value note for owner +let mut options = NoteGetterOptions::new(); +options = options + .select(MyNote::properties().owner, Comparator.EQ, owner) + .sort(MyNote::properties().value, SortOrder.DESC) + .set_limit(1); + +let notes = storage.my_notes.at(owner).get_notes(options); +assert(notes.len() > 0, "No notes found"); +let highest_note = notes.get(0); +``` + +## Next steps + +- Learn about [custom note implementations](../how_to_implement_custom_notes.md) +- Explore [note discovery mechanisms](../../../foundational-topics/advanced/storage/note_discovery.md) +- Understand [note lifecycle](../../../foundational-topics/advanced/storage/indexed_merkle_tree.mdx) diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/advanced/how_to_use_capsules.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/advanced/how_to_use_capsules.md new file mode 100644 index 000000000000..ca0b541ac1ac --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/advanced/how_to_use_capsules.md @@ -0,0 +1,96 @@ +--- +title: Using Capsules +sidebar_position: 17 +tags: [functions, oracles] +description: Learn how to use capsules to add data to the private execution environment for use in your Aztec smart contracts. +--- + +:::info What are Capsules? +Capsules provide per-contract non-volatile storage in the PXE. Data is: + +- Stored locally (not onchain) +- Scoped per contract address +- Persistent until explicitly deleted +- Useful for caching computation results + +::: + +## Available functions + +- `store` - Store data at a slot +- `load` - Retrieve data from a slot +- `delete` - Remove data at a slot +- `copy` - Copy contiguous entries between slots + +## Basic usage + +```rust +use dep::aztec::oracle::capsules; + +// Store data at a slot +unconstrained fn store_data(context: &mut PrivateContext) { + capsules::store(context.this_address(), slot, value); +} + +// Load data (returns Option) +unconstrained fn load_data(context: &mut PrivateContext) -> Option { + capsules::load(context.this_address(), slot) +} + +// Delete data at a slot +unconstrained fn delete_data(context: &mut PrivateContext) { + capsules::delete(context.this_address(), slot); +} + +// Copy multiple contiguous slots +unconstrained fn copy_data(context: &mut PrivateContext) { + // Copy 3 slots from src_slot to dst_slot + capsules::copy(context.this_address(), src_slot, dst_slot, 3); +} +``` + +:::warning Safety +All capsule operations are `unconstrained`. Data loaded from capsules should be validated in constrained contexts. Contracts can only access their own capsules - attempts to access other contracts' capsules will fail. +::: + +## CapsuleArray for dynamic storage + +```rust +use dep::aztec::capsules::CapsuleArray; + +unconstrained fn manage_array(context: &mut PrivateContext) { + // Create/access array at base_slot + let array = CapsuleArray::at(context.this_address(), base_slot); + + // Array operations + array.push(value); // Append to end + let value = array.get(index); // Read at index + let length = array.len(); // Get current size + array.remove(index); // Delete & shift elements + + // Iterate over all elements + array.for_each(|index, value| { + // Process each element + if some_condition(value) { + array.remove(index); // Safe to remove current element + } + }); +} +``` + +:::tip Use Cases + +- Caching expensive computations between simulation and execution +- Storing intermediate proof data +- Managing dynamic task lists +- Persisting data across multiple transactions + +::: + +:::info Storage Layout +CapsuleArray stores the length at the base slot, with elements in consecutive slots: +- Slot N: array length +- Slot N+1: element at index 0 +- Slot N+2: element at index 1 +- And so on... +::: diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/advanced/partial_notes.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/advanced/partial_notes.md new file mode 100644 index 000000000000..8ac02471bd64 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/advanced/partial_notes.md @@ -0,0 +1,154 @@ +--- +title: Partial Notes +sidebar_position: 1 +tags: [Developers, Contracts, Notes] +description: How partial notes work and how they can be used. +--- + +import Image from "@theme/IdealImage"; + +## What are Partial Notes? + +Partial notes are notes created with incomplete data, usually during private execution, which can be completed with additional information that becomes available later, usually during public execution. + +Let's say, for example, we have a `UintNote`: + +```rust title="uint_note_def" showLineNumbers +#[derive(Deserialize, Eq, Serialize, Packable)] +#[custom_note] +pub struct UintNote { + /// The number stored in the note. + pub value: u128, +} +``` +> Source code: noir-projects/aztec-nr/uint-note/src/uint_note.nr#L27-L34 + + +The `UintNote` struct itself only contains the `value` field. Additional fields including `owner`, `randomness`, and `storage_slot` are passed as parameters during note hash computation. + +When creating the note locally during private execution, the `owner` and `storage_slot` are known, but the `value` potentially is not (e.g., it depends on some onchain dynamic variable). First, a **partial note** can be created during private execution that commits to the `owner`, `randomness`, and `storage_slot`, and then the note is *"completed"* to create a full note by later adding the `value` field, usually during public execution. + + + +## Use Cases + +Partial notes are useful when a e.g., part of the note struct is a value that depends on dynamic, public onchain data that isn't available during private execution, such as: + +- AMM swap prices +- Current gas prices +- Time-dependent interest accrual + +## Implementation + +All notes in Aztec use the partial note format internally. This ensures that notes produce identical note hashes regardless of whether they were created as complete notes (with all fields known in private) or as partial notes (completed later in public). By having all notes follow the same two-phase hash commitment process, the protocol maintains consistency and allows notes created through different flows to behave identically. + +### Note Structure Example + +The `UintNote` struct contains only the `value` field: + +```rust title="uint_note_def" showLineNumbers +#[derive(Deserialize, Eq, Serialize, Packable)] +#[custom_note] +pub struct UintNote { + /// The number stored in the note. + pub value: u128, +} +``` +> Source code: noir-projects/aztec-nr/uint-note/src/uint_note.nr#L27-L34 + + +### Two-Phase Commitment Process + +**Phase 1: Partial Commitment (Private Execution)** + +The private fields (`owner`, `randomness`, and `storage_slot`) are committed during local, private execution: + +```rust title="compute_partial_commitment" showLineNumbers +fn compute_partial_commitment( + owner: AztecAddress, + storage_slot: Field, + randomness: Field, +) -> Field { + poseidon2_hash_with_separator( + [owner.to_field(), storage_slot, randomness], + GENERATOR_INDEX__NOTE_HASH, + ) +} +``` +> Source code: noir-projects/aztec-nr/uint-note/src/uint_note.nr#L160-L171 + + +This creates a partial note commitment: + +``` +partial_commitment = H(owner, storage_slot, randomness) +``` + +**Phase 2: Note Completion (Public Execution)** + +The note is completed by hashing the partial commitment with the public value: + +```rust title="compute_complete_note_hash" showLineNumbers +fn compute_complete_note_hash(self, value: u128) -> Field { + // Here we finalize the note hash by including the (public) value into the partial note commitment. Note that we + // use the same generator index as we used for the first round of poseidon - this is not an issue. + poseidon2_hash_with_separator( + [self.commitment, value.to_field()], + GENERATOR_INDEX__NOTE_HASH, + ) +} +``` +> Source code: noir-projects/aztec-nr/uint-note/src/uint_note.nr#L284-L293 + + +The resulting structure is a nested commitment: + +``` +note_hash = H(H(owner, storage_slot, randomness), value) + = H(partial_commitment, value) +``` + +## Universal Note Format + +All notes in Aztec use the partial note format internally, even when all data is known during private execution. This ensures consistent note hash computation regardless of how the note was created. + +When a note is created with all fields known (including `owner`, `storage_slot`, `randomness`, and `value`): + +1. A partial commitment is computed from the private fields (`owner`, `storage_slot`, `randomness`) +2. The partial commitment is immediately completed with the `value` field + +```rust title="compute_note_hash" showLineNumbers +fn compute_note_hash( + self, + owner: AztecAddress, + storage_slot: Field, + randomness: Field, +) -> Field { + // Partial notes can be implemented by having the note hash be either the result of multiscalar multiplication + // (MSM), or two rounds of poseidon. MSM results in more constraints and is only required when multiple variants + // of partial notes are supported. Because UintNote has just one variant (where the value is public), we use + // poseidon instead. + + // We must compute the same note hash as would be produced by a partial note created and completed with the same + // values, so that notes all behave the same way regardless of how they were created. To achieve this, we + // perform both steps of the partial note computation. + + // First we create the partial note from a commitment to the private content (including storage slot). + let partial_note = PartialUintNote { + commitment: compute_partial_commitment(owner, storage_slot, randomness), + }; + + // Then compute the completion note hash. In a real partial note this step would be performed in public. + partial_note.compute_complete_note_hash(self.value) +} +``` +> Source code: noir-projects/aztec-nr/uint-note/src/uint_note.nr#L37-L61 + + +This two-step process ensures that notes with identical field values produce identical note hashes, regardless of whether they were created as partial notes or complete notes. + + + +## Partial Notes in Practice + +To understand how to use partial notes in practice, [this AMM contract](https://github.com/AztecProtocol/aztec-packages/tree/next/noir-projects/noir-contracts/contracts/app/amm_contract) uses partial notes to initiate and complete the swap of `token1` to `token2`. Since the exchange rate is onchain, it cannot be known ahead of time while executing in private so a full note cannot be created. Instead, a partial note is created for the `owner` swapping the tokens. This partial note is then completed during public execution once the exchange rate can be read. diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/advanced/protocol_oracles.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/advanced/protocol_oracles.md new file mode 100644 index 000000000000..5618f97455d3 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/advanced/protocol_oracles.md @@ -0,0 +1,40 @@ +--- +title: Oracle Functions +sidebar_position: 18 +tags: [functions, oracles] +description: Learn about oracles in Aztec, which provide external data to smart contracts during execution. +--- + +This page goes over what oracles are in Aztec and how they work. + +Looking for a hands-on guide? You can learn how to use oracles in a smart contract [here](./how_to_use_capsules.md). + +An oracle is something that allows us to get data from the outside world into our contracts. The most widely-known types of oracles in blockchain systems are probably Chainlink price feeds, which allow us to get the price of an asset in USD taking non-blockchain data into account. + +While this is one type of oracle, the more general oracle, allows us to get any data into the contract. In the context of oracle functions or oracle calls in Aztec, it can essentially be seen as user-provided arguments, that can be fetched at any point in the circuit, and don't need to be an input parameter. + +**Why is this useful? Why don't just pass them as input parameters?** +In the world of EVM, you would just read the values directly from storage and call it a day. However, when we are working with circuits for private execution, this becomes more tricky as you cannot just read the storage directly from your state tree, because there are only commitments (e.g. hashes) there. The pre-images (content) of your commitments need to be provided to the function to prove that you actually allowed to modify them. + +If we fetch the notes using an oracle call, we can keep the function signature independent of the underlying data and make it easier to use. A similar idea, applied to the authentication mechanism is used for the Authentication Witnesses that allow us to have a single function signature for any wallet implementation, see [AuthWit](../how_to_use_authwit.md) for more information on this. + +Oracles introduce **non-determinism** into a circuit, and thus are `unconstrained`. It is important that any information that is injected into a circuit through an oracle is later constrained for correctness. Otherwise, the circuit will be **under-constrained** and potentially insecure! + +`Aztec.nr` has a module dedicated to its oracles. If you are interested, you can view them by following the link below: +```rust title="oracles-module" showLineNumbers +/// Oracles module +``` +> Source code: noir-projects/aztec-nr/aztec/src/oracle/mod.nr#L1-L3 + + +## Inbuilt oracles + +- [`debug_log`](https://github.com/AztecProtocol/aztec-packages/blob/master/noir-projects/aztec-nr/aztec/src/oracle/debug_log.nr) - Provides a couple of debug functions that can be used to log information to the console. Read more about debugging [here](../../debugging.md). +- [`auth_witness`](https://github.com/AztecProtocol/aztec-packages/blob/master/noir-projects/aztec-nr/authwit/src/auth_witness.nr) - Provides a way to fetch the authentication witness for a given address. This is useful when building account contracts to support approve-like functionality. +- [`get_l1_to_l2_message`](https://github.com/AztecProtocol/aztec-packages/blob/master/noir-projects/aztec-nr/aztec/src/oracle/get_l1_to_l2_message.nr) - Useful for application that receive messages from L1 to be consumed on L2, such as token bridges or other cross-chain applications. +- [`notes`](https://github.com/AztecProtocol/aztec-packages/blob/master/noir-projects/aztec-nr/aztec/src/oracle/notes.nr) - Provides a lot of functions related to notes, such as fetches notes from storage etc, used behind the scenes for value notes and other pre-build note implementations. +- [`logs`](https://github.com/AztecProtocol/aztec-packages/blob/master/noir-projects/aztec-nr/aztec/src/oracle/logs.nr) - Provides the to log encrypted and unencrypted data. + +Find a full list [on GitHub](https://github.com/AztecProtocol/aztec-packages/tree/master/noir-projects/aztec-nr/aztec/src/oracle). + +Please note that it is **not** possible to write a custom oracle for your dapp. Oracles are implemented in the PXE, so all users of your dapp would have to use a PXE with your custom oracle included. If you want to inject some arbitrary data that does not have a dedicated oracle, you can use [capsules](./how_to_use_capsules.md). diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/advanced/writing_efficient_contracts.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/advanced/writing_efficient_contracts.md new file mode 100644 index 000000000000..52814a100935 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/advanced/writing_efficient_contracts.md @@ -0,0 +1,362 @@ +--- +title: Writing Efficient Contracts +sidebar_position: 2 +tags: [Developers, Contracts] +description: Best practices and techniques for writing gas-efficient contracts on Aztec, optimizing for both proving and execution costs. +--- + +import Image from "@theme/IdealImage"; + +## Writing functions + +On Ethereum L1, all data is public and all execution is completely reproducible. The Aztec L2 takes on the challenge of execution of private functions on private data. This is done client side, along with the generation of corresponding proofs, so that the network can verify the proofs and append any encrypted data/nullifiers (privacy preserving state update). + +This highlights a key difference with how public vs private functions are written. + +:::info Writing efficiently + +- **Public functions** can be written intuitively - optimising for execution/gas as one would for EVM L2s +- **Private functions** are optimized differently, as they are compiled to a circuit to be proven locally (see [Thinking in Circuits](https://noir-lang.org/docs/explainers/explainer-writing-noir)) + +::: + +## Assessing efficiency + +On Aztec (like other L2s) there are several costs/limit to consider... + +- L1 costs - execution, blobs, events +- L2 costs - public execution, data, logs +- Local limits - proof generation time, execution + +### Local Proof generation + +Since proof generation is a significant local burden, being mindful of the gate-count of private functions is important. The gate-count is a proportionate indicator of the memory and time required to prove locally, so should not be ignored. + +#### Noir for circuits + +An explanation of efficient use of Noir for circuits should be considered for each subsection under [writing efficient Noir](https://noir-lang.org/docs/explainers/explainer-writing-noir#writing-efficient-noir-for-performant-products) to avoid hitting local limits. The general theme is to use language features that favour the underlying primitives and representation of a circuit from code. + +A couple of examples: + +- Since the underlying cryptography uses an equation made of additions and multiplications, these are more efficient (wrt gate count) in Noir than say bit-shifting. +- Unconstrained functions by definition do not constrain their operations/output, so do not contribute to gate count. Using them carefully can bring in some savings, but the results must then be constrained so that proofs are meaningful for your application. + +:::warning Tradeoffs and caveats +Each optimisation technique has its own tradeoffs and caveats so should be carefully considered with the full details in the linked [section](https://noir-lang.org/docs/explainers/explainer-writing-noir#writing-efficient-noir-for-performant-products). +::: + +#### Overhead of nested Private Calls + +When private functions are called, the overhead of a "kernel circuit" is added each time, so be mindful of calling/nesting too many private functions. This may influence the design towards larger private functions rather than conventionally atomic functions. + +#### Profiling using FlameGraph + +Measuring the gate count across a private function is explained in the [profiling guide](./how_to_profile_transactions). + +### L2 Data costs + +Of the L2 costs, the public/private data being updated is most significant. As L2 functions create notes, nullifiers, encrypted logs, all of this get posted into blobs on ethereum and will be quite expensive + +### L1 Limits + +While most zk rollups don't leverage the zero-knowledge property like Aztec, they do leverage the succinctness property. +That is, what is stored in an L1 contract is simply a hash. + +For data availability, blobs are utilized since data storage is often cheaper here than in contracts. Like other L2s such costs are factored into the L2 fee mechanisms. These limits can be seen and iterated on when a transaction is simulated/estimated. + +## Examples for private functions (reducing gate count) + +After the first section about generating a flamegraph for an Aztec function, each section shows an example of different optimisation techniques. + +### Inspecting with Flamegraph + +You can see the params for the Aztec's flamegraph using: `aztec help flamegraph` + +For example, the resulting flamegraph (as an .svg file) of a counter's increment function can be generated and served with: `SERVE=1 aztec flamegraph target/counter-Counter.json increment` + + + +To get a sense of things, here is a table of gate counts for common operations: + +| Gates | Operation | +| ----- | ------------------------------------------------------------------------------ | +| ~75 | Hashing 3 fields with Poseidon2 | +| 3500 | Reading a value from a tree (public data tree, note hash tree, nullifier tree) | +| 4000 | Reading a delayed public mutable read | +| X000 | Calculating sha256 | +| X000 | Constrained encryption of a log of Y fields | +| X000 | Constrained encryption and tag a log of Y fields | + +### Optimization: use arithmetic instead of non-arithmetic operations + +Because the underlying equation in the proving backend makes use of multiplication and addition, these operations incur less gates than bit-shifting or bit-masking. + +For example: + +```rust +comptime global TWO_POW_32: Field = 2.pow_32(16); +// ... +{ + #[external("private")] + fn mul_inefficient(number: Field) -> u128 { + number as u128 << 16 as u8 + } // 5244 gates + + #[external("private")] + fn mul_efficient(number: Field) -> u128 { + (number * TWO_POW_32) as u128 + } // 5184 gates (60 gates less) +} +``` + +When comparing the flamegraph of the two functions, the inefficient shift example has a section of gates not present in the multiplication example. This difference equates to a saving of 60 gates. + +In the same vein bitwise `AND`/`OR`, and inequality relational operators (`>`, `<`) are expensive. Try avoid these in your circuits. + +For example, use boolean equality effectively instead of `>=`: + +```rust +{ + #[external("private")] + fn sum_from_inefficient(from: u32, array: [u32; 1000]) -> u32 { + let mut sum: u32 = 0; + for i in 0..1000 { + if i >= from { // condition based on `>=` each time (higher gate count) + sum += array[i]; + } + } + sum + } // 44317 gates + + #[external("private")] + fn sum_from_efficient(from: u32, array: [u32; 1000]) -> u32 { + let mut sum: u32 = 0; + let mut do_sum = false; + for i in 0..1000 { + if i == from { // latches boolean at transition (equality comparison) + do_sum = true; + } + if do_sum { // condition based on boolean true (lower gate count) + sum += array[i]; + } + } + sum + } // 45068 gates (751 gates less) +} +``` + +So for a loop of 1000 iterations, 751 gates were saved by: + +- Adding an equivalence check and a boolean assignment +- Replacing `>=` with a boolean equivalence check + +:::note Difference with Rust +Such designs with boolean flags lend themselves well into logical comparisons too since `&&` and `||` do not exist. With booleans, using `&` and `|` can give you the required logic efficiently. For more points specific to the Noir language, see [this](https://noir-lang.org/docs/explainers/explainer-writing-noir#translating-from-rust) section. + +::: + +### Optimization: Loop design + +Since private functions are circuits, their size must be known at compile time, which is equivalent to its execution trace. +See [this example](https://github.com/noir-lang/noir-examples/blob/master/noir_by_example/loops/noir/src/main.nr#L11) for how to use loops when dynamic execution lengths (ie variable number of loops) is not possible. + +### Optimization: considered use of `unconstrained` functions + +#### Example - calculating square root + +Consider the following example of an implementation of the `sqrt` function: + +```rust +use dep::aztec::macros::aztec; + +#[aztec] +pub contract OptimisationExample { + use dep::aztec::macros::{functions::{external, initializer}, storage::storage}; + + #[storage] + struct Storage {} + + #[external("public")] + #[initializer] + fn constructor() {} + + #[external("private")] + fn sqrt_inefficient(number: Field) -> Field { + super::sqrt_constrained(number) + } + + #[external("private")] + fn sqrt_efficient(number: Field) -> Field { + // Safety: calculate in unconstrained function, then constrain the result + let x = unsafe { super::sqrt_unconstrained(number) }; + assert(x * x == number, "x*x should be number"); + x + } + +} + +fn sqrt_constrained(number: Field) -> Field { + let MAX_LEN = 100; + + let mut guess = number; + let mut guess_squared = guess * guess; + for _ in 1..MAX_LEN as u32 + 1 { + // only use square root part of circuit when required, otherwise use alternative part of circuit that does nothing + // Note: both parts of the circuit exist MAX_LEN times in the circuit, regardless of whether the square root part is used or not + if (guess_squared != number) { + guess = (guess + number / guess) / 2; + guess_squared = guess * guess; + } + } + + guess +} + +unconstrained fn sqrt_unconstrained(number: Field) -> Field { + let mut guess = number; + let mut guess_squared = guess * guess; + while guess_squared != number { + guess = (guess + number / guess) / 2; + guess_squared = guess * guess; + } + guess +} + +``` + +The two implementations after the contract differ in one being constrained vs unconstrained, as well as the loop implementation (which has other design considerations). +Measuring the two, we find the `sqrt_inefficient` to require around 1500 extra gates compared to `sqrt_efficient`. + +To see each flamegraph: + +- `SERVE=1 aztec flamegraph target/optimisation_example-OptimisationExample.json sqrt_inefficient` +- `SERVE=1 aztec flamegraph target/optimisation_example-OptimisationExample.json sqrt_efficient` +- (if you make changes to the code, you will need to compile and regenerate the flamegraph, then refresh in your browser to use the latest svg file) + +Note: this is largely a factor of the loop size choice based on the maximum size of `number` you are required to be calculating the square root of. For larger numbers, the loop would have to be much larger, so perform in an unconstrained way (then constraining the result) is much more efficient. + +#### Example - sorting an array + +Like with sqrt, we have the inefficient function that does the sort with constrained operations, and the efficient function that uses the unconstrained sort function then constrains the result. + +```rust +//... +{ + #[external("private")] + fn sort_inefficient(array: [u32; super::ARRAY_SIZE]) -> [u32; super::ARRAY_SIZE] { + let mut sorted_array = array; + for i in 0..super::ARRAY_SIZE as u32 { + for j in 0..super::ARRAY_SIZE as u32 { + if sorted_array[i] < sorted_array[j] { + let temp = sorted_array[i as u32]; + sorted_array[i as u32] = sorted_array[j as u32]; + sorted_array[j as u32] = temp; + } + } + } + sorted_array + } // 6823 gates for 10 elements, 127780 gates for 100 elements + + #[external("private")] + fn sort_efficient(array: [u32; super::ARRAY_SIZE]) -> [u32; super::ARRAY_SIZE] { + // Safety: calculate in unconstrained function, then constrain the result + let sorted_array = unsafe { super::sort_array(array) }; + // constrain that sorted_array elements are sorted + for i in 0..super::ARRAY_SIZE as u32 { + assert(sorted_array[i] <= sorted_array[i + 1], "array should be sorted"); + } + sorted_array + } // 5870 gates (953 gates less) for 10 elements, 12582 gates for 100 elements (115198 gates less) +} + +unconstrained fn sort_array(array: [u32; ARRAY_SIZE]) -> [u32; ARRAY_SIZE] { + let mut sorted_array = array; + for i in 0..ARRAY_SIZE as u32 { + for j in 0..ARRAY_SIZE as u32 { + if sorted_array[i] < sorted_array[j] { + let temp = sorted_array[i as u32]; + sorted_array[i as u32] = sorted_array[j as u32]; + sorted_array[j as u32] = temp; + } + } + } + sorted_array +} + +``` + +Like before, the flamegraph command can be used to present the gate counts of the private functions, highlighting that 953 gates could be saved. + +Note: The stdlib provides a highly optimized version of sort on arrays, `array.sort()`, which saves even more gates. + +```rust + #[external("private")] + fn sort_stdlib(array: [u32; super::ARRAY_SIZE]) -> [u32; super::ARRAY_SIZE] { + array.sort(); + } // 5943 gates (880 gates less) for 10 elements, 13308 gates for 100 elements (114472 gates less) +``` + +#### Example - refactoring arrays + +In the same vein, refactoring is inefficient when done constrained, and more efficient to do unconstrained then constrain the output. + +```rust +{ + #[external("private")] + fn refactor_inefficient(array: [u32; super::ARRAY_SIZE]) -> [u32; super::ARRAY_SIZE] { + let mut compacted_array = [0; super::ARRAY_SIZE]; + let mut index = 0; + for i in 0..super::ARRAY_SIZE as u32 { + if (array[i] != 0) { + compacted_array[index] = array[i]; + index += 1; + } + } + compacted_array + } // 6570 gates for 10 elements, 93071 gates for 100 elements + + #[external("private")] + fn refactor_efficient(array: [u32; super::ARRAY_SIZE]) -> [u32; super::ARRAY_SIZE] { + let compacted_array = unsafe { super::refactor_array(array) }; + // count non-zero elements in array + let mut count = 0; + for i in 0..super::ARRAY_SIZE as u32 { + if (array[i] != 0) { + count += 1; + } + } + // count non-zero elements in compacted_array + let mut count_compacted = 0; + for i in 0..super::ARRAY_SIZE as u32 { + if (compacted_array[i] != 0) { + count_compacted += 1; + } else { + assert(compacted_array[i] == 0, "trailing compacted_array elements should be 0"); + } + } + assert(count == count_compacted, "count should be equal to count_compacted"); + compacted_array + } // 5825 gates (745 gates less), 12290 gates for 100 elements (80781 gates less) +} + +unconstrained fn refactor_array(array: [u32; ARRAY_SIZE]) -> [u32; ARRAY_SIZE] { + let mut compacted_array = [0; ARRAY_SIZE]; + let mut index = 0; + for i in 0..ARRAY_SIZE as u32 { + if (array[i] != 0) { + compacted_array[index] = array[i]; + index += 1; + } + } + compacted_array +} + +``` + +### Optimizing: Reducing L2 reads + +If a struct has many fields to be read, we can design an extra variable maintained as the hash of all values within it (like a checksum). When it comes to reading, we can now do an unconstrained read (incurring no read requests), and then check the hash of the result against that stored for the struct. This final check is thus only one read request rather than one per variable. + +:::note Leverage unconstrained functions +When needing to make use of large private operations (eg private execution or many read requests), use of [unconstrained functions](https://noir-lang.org/docs/explainers/explainer-writing-noir#leverage-unconstrained-execution) wisely to reduce the gate count of private functions. +::: diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/contract_artifact.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/contract_artifact.md new file mode 100644 index 000000000000..d2fe84011164 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/contract_artifact.md @@ -0,0 +1,112 @@ +--- +title: "Contract Artifacts" +description: Understand the structure and contents of Aztec smart contract artifacts. +tags: [contracts] +sidebar_position: 13 +--- + +After compiling a contract you'll get a Contract Artifact file, that contains the data needed to interact with a specific contract, including its name, functions that can be executed, and the interface and code of those functions. Since private functions are not published in the Aztec network, you'll need this artifact file to be able to call private functions of contracts. + +The artifact file can be used with `aztec.js` to instantiate contract objects and interact with them. + +## Contract Artifact Structure + +The structure of a contract artifact is as follows: +```json +{ + "name": "CardGame", + "functions": [ + { + "name": "constructor", + "functionType": "private", + "isInternal": false, + "parameters": [], + "returnTypes": [], + "bytecode": "...", + "verificationKey": "..." + }, + { + "name": "on_card_played", + "functionType": "public", + "isInternal": true, + "parameters": [ + { + "name": "game", + "type": { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + "visibility": "private" + }, + { + "name": "player", + "type": { + "kind": "field" + }, + "visibility": "private" + }, + { + "name": "card_as_field", + "type": { + "kind": "field" + }, + "visibility": "private" + } + ], + "returnTypes": [ + ... + ], + "bytecode": "...", + "verificationKey": "..." + }, + ... + ] +} + +``` + +### `name` +It is a simple string that matches the name that the contract developer used for this contract in noir. It's used for logs and errors. + +### `functions` +A contract is a collection of several functions that can be called. Each function has the following properties: + +#### `function.name` +A simple string that matches the name that the contract developer used for this function in noir. For logging and debugging purposes. + +#### `function.functionType` +The function type can have one of the following values: + +- Private: The function is ran and proved locally by the clients, and its bytecode not published to the network. +- Public: The function is ran and proved by the sequencer, and its bytecode is published to the network. +- Utility: The function is ran locally by the clients to generate digested information useful for the user. It cannot be called in a transaction. + +#### `function.isInternal` +The is internal property is a boolean that indicates whether the function is internal to the contract and cannot be called from outside. + +#### `function.parameters` +Each function can have multiple parameters that are arguments to execute the function. Parameters have a name, and type (like integers, strings, or complex types like arrays and structures). + +#### `function.returnTypes` +The return types property defines the types of values that the function returns after execution. + +#### `function.bytecode` +The bytecode is a string representing the compiled ACIR of the function, ready for execution on the network. + +#### `function.verificationKey` +The verification key is an optional property that contains the verification key of the function. This key is used to verify the proof of the function execution. + +### `debug` (Optional) +Although not significant for non-developer users, it is worth mentioning that there is a debug section in the contract artifact which helps contract developers to debug and test their contracts. This section mainly contains debug symbols and file maps that link back to the original source code. + +## Understanding Parameter and Return Types +To make the most of the functions, it's essential to understand the types of parameters and return values. Here are some common types you might encounter: + + - `field`: A basic type representing a field element in the finite field of the curve used in the Aztec protocol. + - `boolean`: A simple true/false value. + - `integer`: Represents whole numbers. It has attributes defining its sign (positive or negative) and width (the number of bits representing the integer). + - `array`: Represents a collection of elements, all of the same type. It has attributes defining its length and the type of elements it holds. + - `string`: Represents a sequence of characters with a specified length. + - `struct`: A complex type representing a structure with various fields, each having a specific type and name. + diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/contract_structure.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/contract_structure.md new file mode 100644 index 000000000000..0ea6ee0106f4 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/contract_structure.md @@ -0,0 +1,41 @@ +--- +title: Contract Structure +sidebar_position: 1 +tags: [contracts] +description: Learn the fundamental structure of Aztec smart contracts including the contract keyword, directory layout, and how contracts manage state and functions. +--- + +A contract is a collection of persistent state variables and [functions](./functions/index.md) which may manipulate these variables. Functions and state variables within a contract's scope are said to belong to that contract. A contract can only access and modify its own state. If a contract wishes to access or modify another contract's state, it must make a call to an external function of the other contract. For anything to happen on the Aztec network, an external function of a contract needs to be called. + +## Contract + +A contract may be declared and given a name using the `contract` keyword (see snippet below). By convention, contracts are named in `PascalCase`. + +```rust title="contract keyword" +// highlight-next-line +contract MyContract { + + // Imports + + // Storage + + // Functions +} +``` + +:::info A note for vanilla Noir devs +There is no [`main()`](https://noir-lang.org/docs/getting_started/project_breakdown/#mainnr) function within a Noir `contract` scope. More than one function can be an entrypoint. +::: + +## Directory structure + +Here's a common layout for a basic Aztec.nr Contract project: + +```title="layout of an aztec contract project" +─── my_aztec_contract_project + ├── src + │ ├── main.nr <-- your contract + └── Nargo.toml <-- package and dependency management +``` + +- See the vanilla Noir docs for [more info on packages](https://noir-lang.org/docs/noir/modules_packages_crates/crates_and_packages). diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/contract_upgrades.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/contract_upgrades.md new file mode 100644 index 000000000000..fee477370508 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/contract_upgrades.md @@ -0,0 +1,186 @@ +--- +title: Contract Upgrades +sidebar_position: 14 +tags: [contracts] +description: Understand contract upgrade patterns in Aztec and how to implement upgradeable contracts. +--- + +For familiarity we've used terminology like "deploying a contract instance of a contract class". When considering how it works with contract upgrades it helps to be more specific. + +Each contract instance refers to a class id for its code. Upgrading a contract's implementation is achieved by updating its current class id to a new class id, whilst retaining the "original class id" for reasons explained below. + +## Original class id + +A contract keeps track of the original contract class that it was instantiated with, which is the "original" class id. It is this original class that is used when calculating and verifying the contract's [address](../../foundational-topics/contract_creation#instance-address). +This variable remains unchanged even if a contract is upgraded. + +## Current class id + +When a contract is first deployed, its current class ID is set equal to its original class ID. The current class ID determines which code implementation the contract actually executes. + +During an upgrade: + +- The original class ID remains unchanged +- The current class ID is updated to refer to the new implementation +- All contract state/data is preserved + +## How to upgrade + +Contract upgrades in Aztec have to be initiated by the contract that wishes to be upgraded calling the `ContractInstanceRegistry`: + +```rust +use dep::aztec::protocol_types::contract_class_id::ContractClassId; +use contract_instance_registry::ContractInstanceRegistry; + +#[external("private")] +fn update_to(new_class_id: ContractClassId) { + ContractInstanceRegistry::at(CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS) + .update(new_class_id) + .enqueue(&mut context); +} +``` + +The `update` function in the registry is a public function, so you can enqueue it from a private function like the example or call it from a public function directly. + +:::note +Recall that `#[external("private")]` means calling this function preserves privacy, and it still CAN be called externally by anyone. +So the `update_to` function above allows anyone to update the contract that implements it. A more complete implementation should have a proper authorization systems to secure contracts from malicious upgrades. +::: + +Contract upgrades are implemented using a DelayedPublicMutable storage variable in the `ContractInstanceRegistry`, since the upgrade applies to both public and private functions. +This means that they have a delay before entering into effect. The default delay is `86400` seconds (one day) but can be configured by the contract: + +```rust +use dep::aztec::protocol_types::contract_class_id::ContractClassId; +use contract_instance_registry::ContractInstanceRegistry; + +#[external("private")] +fn set_update_delay(new_delay: u64) { + ContractInstanceRegistry::at(CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS) + .set_update_delay(new_delay) + .enqueue(&mut context); +} +``` + +Where `new_delay` is denominated in seconds. However, take into account that changing the update delay also has as its delay that is the previous delay. So the first delay change will take `86400` seconds to take into effect. + +:::info +The update delay cannot be set lower than `600` seconds +::: + +When sending a transaction, the expiration timestamp of your tx will be the timestamp of the current block number you're simulating with + the minimum of the update delays that you're interacting with. +If your tx interacts with a contract that can be upgraded in 1000 seconds and another one that can be upgraded in 10000 seconds, the expiration timestamp (include_by_timestamp property on the tx) will be current block timestamp + 1000. +Note that this can be even lower if there is an upgrade pending in one of the contracts you're interacting with. +If the contract you interacted with will upgrade in 100 seconds, the expiration timestamp of your tx will be current block timestamp + 99 seconds. +Other DelayedPublicMutable storage variables read in your tx might reduce this expiration timestamp further. + +:::note +Only deployed contract instances can upgrade or change its upgrade delay currently. This restriction might be lifted in the future. +::: + +### Upgrade Process + +1. **Register New Implementation** + + - First, register the new contract class if it contains public functions + - The new implementation must maintain state variable compatibility with the original contract + +2. **Perform Upgrade** + + - Call the update function with the new contract class ID + - The contract's original class ID remains unchanged + - The current class ID is updated to the new implementation + - All contract state and data are preserved + +3. **Verify Upgrade** + - After upgrade, the contract will execute functions from the new implementation + - The contract's address remains the same since it's based on the original class ID + - Existing state variables and their values are preserved + +### How to interact with an upgraded contract + +The PXE in the wallet stores the contract instances and classes in a local database. When a contract is updated, in order to interact with it we need to pass the new artifact to the PXE in the wallet, since the protocol doesn't publish artifacts. +Consider this contract as an example: + +```rust +#[aztec] +contract Updatable { +... + + #[external("private")] + fn update_to(new_class_id: ContractClassId) { + ContractInstanceRegistry::at(CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS).update(new_class_id).enqueue( + &mut context, + ); + } +... +``` + +You'd upgrade it in aztec.js doing something similar to this: + +```typescript +const contract = await UpdatableContract.deploy(wallet, ...args) + .send() + .deployed(); +const updatedContractClassId = ( + await getContractClassFromArtifact(UpdatedContractArtifact) +).id; +await contract.methods.update_to(updatedContractClassId).send().wait(); +``` + +Now, when the update has happened, calling `at` with the new contract artifact will automatically update the contract instance in the wallet if it's outdated: + +```typescript +// 'at' will call wallet updateContract if outdated +const updatedContract = await UpdatedContract.at(address, wallet); +``` + +If you try to call `at` with a different contract that is not the current version, it'll fail + +```typescript +// throws when trying to update the wallet instance to RandomContract +// since the current one is UpdatedContract +await RandomContract.at(address, wallet); +``` + +### Security Considerations + +1. **Access Control** + + - Implement proper access controls for upgrade functions + - Consider customizing the upgrades delay for your needs using `set_update_delay` + +2. **State Compatibility** + + - Ensure new implementation is compatible with existing state + - Maintain the same storage layout to prevent data corruption + +3. **Testing** + + - Test upgrades thoroughly in a development environment + - Verify all existing functionality works with the new implementation + +### Example + +```rust +contract Updatable { + #[external("private")] + fn update_to(new_class_id: ContractClassId) { + // TODO: Add access control + assert(context.msg_sender() == owner, "Unauthorized"); + + // Perform the upgrade + ContractInstanceRegistry::at(CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS) + .update(new_class_id) + .enqueue(&mut context); + } + + #[external("private")] + fn set_update_delay(new_delay: u64) { + // TODO: Add access control + ContractInstanceRegistry::at(CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS) + .set_update_delay(new_delay) + .enqueue(&mut context); + } +} +``` diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/dependencies.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/dependencies.md new file mode 100644 index 000000000000..c6cec92ffe84 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/dependencies.md @@ -0,0 +1,46 @@ +--- +title: Importing Aztec.nr +description: Learn how to manage dependencies in your Aztec smart contract projects. +tags: [contracts] +sidebar_position: 2 +--- + +On this page you will find information about Aztec.nr libraries and up-to-date paths for use in your `Nargo.toml`. + +## Aztec + +```toml +aztec = { git="https://github.com/AztecProtocol/aztec-packages/", tag="v3.0.2", directory="noir-projects/aztec-nr/aztec" } +``` + +This is the core Aztec library that is required for every Aztec.nr smart contract. + +## Address note + +```toml +address_note = { git="https://github.com/AztecProtocol/aztec-packages/", tag="v3.0.2", directory="noir-projects/aztec-nr/address-note" } +``` + +This is a library for utilizing notes that hold addresses. Find it on [GitHub](https://github.com/AztecProtocol/aztec-packages/tree/master/noir-projects/aztec-nr/address-note/src). + +## Easy private state + +```toml +easy_private_state = { git="https://github.com/AztecProtocol/aztec-packages/", tag="v3.0.2", directory="noir-projects/aztec-nr/easy-private-state" } +``` + +This is an abstraction library for using private variables like [`EasyPrivateUint` (GitHub link)](https://github.com/AztecProtocol/aztec-packages/blob/6c20b45993ee9cbd319ab8351e2722e0c912f427/noir-projects/aztec-nr/easy-private-state/src/easy_private_state.nr#L17). + +## Protocol Types + +```toml +protocol_types = { git="https://github.com/AztecProtocol/aztec-packages/", tag="v3.0.2", directory="noir-projects/noir-protocol-circuits/crates/types"} +``` + +This library contains types that are used in the Aztec protocol. Find it on [GitHub](https://github.com/AztecProtocol/aztec-packages/tree/master/noir-projects/noir-protocol-circuits/crates/types/src). + +## Value note + +```toml +value_note = { git="https://github.com/AztecProtocol/aztec-packages/", tag="v3.0.2", directory="noir-projects/aztec-nr/value-note" } +``` diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/ethereum-aztec-messaging/_category_.json b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/ethereum-aztec-messaging/_category_.json new file mode 100644 index 000000000000..0f5423420d39 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/ethereum-aztec-messaging/_category_.json @@ -0,0 +1,6 @@ +{ + "label": "Aztec<>Ethereum Messaging", + "position": 10, + "collapsible": true, + "collapsed": true +} diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/ethereum-aztec-messaging/data_structures.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/ethereum-aztec-messaging/data_structures.md new file mode 100644 index 000000000000..02efc48c5cb9 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/ethereum-aztec-messaging/data_structures.md @@ -0,0 +1,116 @@ +--- +title: Data Structures +description: Learn about the data structures used in Aztec portals for L1-L2 communication. +--- + +The `DataStructures` are structs that we are using throughout the message infrastructure and registry. + +**Links**: [Implementation (GitHub link)](https://github.com/AztecProtocol/aztec-packages/blob/master/l1-contracts/src/core/libraries/DataStructures.sol). + +## `L1Actor` + +An entity on L1, specifying the address and the chainId for the entity. Used when specifying sender/recipient with an entity that is on L1. + +```solidity title="l1_actor" showLineNumbers +/** + * @notice Actor on L1. + * @param actor - The address of the actor + * @param chainId - The chainId of the actor + */ +struct L1Actor { + address actor; + uint256 chainId; +} +``` +> Source code: l1-contracts/src/core/libraries/DataStructures.sol#L11-L22 + + +| Name | Type | Description | +| -------------- | ------- | ----------- | +| `actor` | `address` | The L1 address of the actor | +| `chainId` | `uint256` | The chainId of the actor. Defines the blockchain that the actor lives on. | + + +## `L2Actor` + +An entity on L2, specifying the address and the version for the entity. Used when specifying sender/recipient with an entity that is on L2. + +```solidity title="l2_actor" showLineNumbers +/** + * @notice Actor on L2. + * @param actor - The aztec address of the actor + * @param version - Ahe Aztec instance the actor is on + */ +struct L2Actor { + bytes32 actor; + uint256 version; +} +``` +> Source code: l1-contracts/src/core/libraries/DataStructures.sol#L24-L35 + + +| Name | Type | Description | +| -------------- | ------- | ----------- | +| `actor` | `bytes32` | The aztec address of the actor. | +| `version` | `uint256` | The version of Aztec that the actor lives on. | + +## `L1ToL2Message` + +A message that is sent from L1 to L2. + +```solidity title="l1_to_l2_msg" showLineNumbers +/** + * @notice Struct containing a message from L1 to L2 + * @param sender - The sender of the message + * @param recipient - The recipient of the message + * @param content - The content of the message (application specific) padded to bytes32 or hashed if larger. + * @param secretHash - The secret hash of the message (make it possible to hide when a specific message is consumed on + * L2). + * @param index - Global leaf index on the L1 to L2 messages tree. + */ +struct L1ToL2Msg { + L1Actor sender; + L2Actor recipient; + bytes32 content; + bytes32 secretHash; + uint256 index; +} +``` +> Source code: l1-contracts/src/core/libraries/DataStructures.sol#L37-L55 + + +| Name | Type | Description | +| -------------- | ------- | ----------- | +| `sender` | `L1Actor` | The actor on L1 that is sending the message. | +| `recipient` | `L2Actor` | The actor on L2 that is to receive the message. | +| `content` | `field (~254 bits)` | The field element containing the content to be sent to L2. | +| `secretHash` | `field (~254 bits)` | The hash of a secret pre-image that must be known to consume the message on L2. Use [`computeSecretHash` (GitHub link)](https://github.com/AztecProtocol/aztec-packages/blob/master/yarn-project/aztec.js/src/utils/secrets.ts) to compute it from a secret. | + +## `L2ToL1Message` + +A message that is sent from L2 to L1. + +```solidity title="l2_to_l1_msg" showLineNumbers +/** + * @notice Struct containing a message from L2 to L1 + * @param sender - The sender of the message + * @param recipient - The recipient of the message + * @param content - The content of the message (application specific) padded to bytes32 or hashed if larger. + * @dev Not to be confused with L2ToL1Message in Noir circuits + */ +struct L2ToL1Msg { + DataStructures.L2Actor sender; + DataStructures.L1Actor recipient; + bytes32 content; +} +``` +> Source code: l1-contracts/src/core/libraries/DataStructures.sol#L57-L70 + + +| Name | Type | Description | +| -------------- | ------- | ----------- | +| `sender` | `L2Actor` | The actor on L2 that is sending the message. | +| `recipient` | `L1Actor` | The actor on L1 that is to receive the message. | +| `content` | `field (~254 bits)` | The field element containing the content to be consumed by the portal on L1. | + + diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/ethereum-aztec-messaging/inbox.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/ethereum-aztec-messaging/inbox.md new file mode 100644 index 000000000000..9022419795b6 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/ethereum-aztec-messaging/inbox.md @@ -0,0 +1,72 @@ +--- +title: Inbox +description: Learn about the inbox mechanism in Aztec portals for receiving messages from L1. +tags: [portals, contracts] +--- + +The `Inbox` is a contract deployed on L1 that handles message passing from L1 to the rollup (L2) + +**Links**: [Interface (GitHub link)](https://github.com/AztecProtocol/aztec-packages/blob/master/l1-contracts/src/core/interfaces/messagebridge/IInbox.sol), [Implementation (GitHub link)](https://github.com/AztecProtocol/aztec-packages/blob/master/l1-contracts/src/core/messagebridge/Inbox.sol). + +## `sendL2Message()` + +Sends a message from L1 to L2. + +```solidity title="send_l1_to_l2_message" showLineNumbers +/** + * @notice Inserts a new message into the Inbox + * @dev Emits `MessageSent` with data for easy access by the sequencer + * @param _recipient - The recipient of the message + * @param _content - The content of the message (application specific) + * @param _secretHash - The secret hash of the message (make it possible to hide when a specific message is consumed + * on L2) + * @return The key of the message in the set and its leaf index in the tree + */ +function sendL2Message(DataStructures.L2Actor memory _recipient, bytes32 _content, bytes32 _secretHash) + external + returns (bytes32, uint256); +``` +> Source code: l1-contracts/src/core/interfaces/messagebridge/IInbox.sol#L35-L48 + + + +| Name | Type | Description | +| -------------- | ------- | ----------- | +| Recipient | `L2Actor` | The recipient of the message. This **MUST** match the rollup version and an Aztec contract that is **attached** to the contract making this call. If the recipient is not attached to the caller, the message cannot be consumed by it. | +| Content | `field` (~254 bits) | The content of the message. This is the data that will be passed to the recipient. The content is limited to be a single field for rollup purposes. If the content is small enough it can just be passed along, otherwise it should be hashed and the hash passed along (you can use our [`Hash` (GitHub link)](https://github.com/AztecProtocol/aztec-packages/blob/master/l1-contracts/src/core/libraries/Hash.sol) utilities with `sha256ToField` functions) | +| Secret Hash | `field` (~254 bits) | A hash of a secret that is used when consuming the message on L2. Keep this preimage a secret to make the consumption private. To consume the message the caller must know the pre-image (the value that was hashed) - so make sure your app keeps track of the pre-images! Use [`computeSecretHash` (GitHub link)](https://github.com/AztecProtocol/aztec-packages/blob/master/yarn-project/aztec.js/src/utils/secrets.ts) to compute it from a secret. | +| ReturnValue | `bytes32` | The message hash, used as an identifier | + +#### Edge cases + +- Will revert with `Inbox__ActorTooLarge(bytes32 actor)` if the recipient is larger than the field size (~254 bits). +- Will revert with `Inbox__ContentTooLarge(bytes32 content)` if the content is larger than the field size (~254 bits). +- Will revert with `Inbox__SecretHashTooLarge(bytes32 secretHash)` if the secret hash is larger than the field size (~254 bits). + +## `consume()` + +Allows the `Rollup` to consume multiple messages in a single transaction. + +```solidity title="consume" showLineNumbers +/** + * @notice Consumes the current tree, and starts a new one if needed + * @dev Only callable by the rollup contract + * @dev In the first iteration we return empty tree root because first checkpoint's messages tree is always + * empty because there has to be a 1 checkpoint lag to prevent sequencer DOS attacks + * + * @param _toConsume - The checkpoint number to consume + * + * @return The root of the consumed tree + */ +function consume(uint256 _toConsume) external returns (bytes32); +``` +> Source code: l1-contracts/src/core/interfaces/messagebridge/IInbox.sol#L50-L62 + + +| Name | Type | Description | +| -------------- | ----------- | -------------------------- | +| ReturnValue | `bytes32` | Root of the consumed tree. | + +#### Edge cases + +- Will revert with `Inbox__Unauthorized()` if `msg.sender != ROLLUP` (rollup contract is sometimes referred to as state transitioner in the docs). diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/ethereum-aztec-messaging/index.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/ethereum-aztec-messaging/index.md new file mode 100644 index 000000000000..71d5ecb45aab --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/ethereum-aztec-messaging/index.md @@ -0,0 +1,153 @@ +--- +id: portals +title: L1 <--> L2 communication (Portals) +description: "This page is a conceptual introduction to Portals, how Aztec communicates with L1 (Ethereum)" +keywords: [portals] +tags: [portals, protocol, ethereum] +importance: 1 +sidebar_position: 12 +--- + +# L1-L2 Communication (Portals) + +import Image from "@theme/IdealImage"; + +In Aztec, what we call _portals_ are the key element in facilitating communication between L1 and L2. While typical L2 solutions rely on synchronous communication with L1, Aztec's privacy-first nature means this is not possible. You can learn more about why in the previous section. + +Traditional L1 \<-\> L2 communication might involve direct calls between L2 and L1 contracts. However, in Aztec, due to the privacy components and the way transactions are processed (kernel proofs built on historical data), direct calls between L1 and L2 would not be possible if we want to maintain privacy. + +Portals are the solution to this problem, acting as bridges for communication between the two layers. These portals can transmit messages from public functions in L1 to private functions in L2 and vice versa, thus enabling messaging while maintaining privacy. + +This page covers: + +- How portals enable privacy communication between L1 and L2 +- How messages are sent, received, and processed +- Message Boxes and how they work +- How and why linking of contracts between L1 and L2 occurs + +## Objective + +The goal is to set up a minimal-complexity mechanism, that will allow a base-layer (L1) and the Aztec Network (L2) to communicate arbitrary messages such that: + +- L2 functions can `call` L1 functions. +- L1 functions can `call` L2 functions. +- The rollup-block size have a limited impact by the messages and their size. + +## High Level Overview + +This document will contain communication abstractions that we use to support interaction between _private_ functions, _public_ functions and Layer 1 portal contracts. + +Fundamental restrictions for Aztec: + +- L1 and L2 have very different execution environments, stuff that is cheap on L1 is most often expensive on L2 and vice versa. As an example, `keccak256` is cheap on L1, but very expensive on L2. +- _Private_ function calls are fully "prepared" and proven by the user, which provides the kernel proof along with commitments and nullifiers to the sequencer. +- _Public_ functions altering public state (updatable storage) must be executed at the current "head" of the chain, which only the sequencer can ensure, so these must be executed separately to the _private_ functions. +- _Private_ and _public_ functions within Aztec are therefore ordered such that first _private_ functions are executed, and then _public_. For a more detailed description of why, see above. +- Messages are consumables, and can only be consumed by the recipient. See [Message Boxes](#message-boxes) for more information. + +With the aforementioned restrictions taken into account, cross-chain messages can be operated in a similar manner to when _public_ functions must transmit information to _private_ functions. In such a scenario, a "message" is created and conveyed to the recipient for future use. It is worth noting that any call made between different domains (_private, public, cross-chain_) is unilateral in nature. In other words, the caller is unaware of the outcome of the initiated call until told when some later rollup is executed (if at all). This can be regarded as message passing, providing us with a consistent mental model across all domains, which is convenient. + +As an illustration, suppose a private function adds a cross-chain call. In such a case, the private function would not have knowledge of the result of the cross-chain call within the same rollup (since it has yet to be executed). + +Similarly to the ordering of private and public functions, we can also reap the benefits of intentionally ordering messages between L1 and L2. When a message is sent from L1 to L2, it has been "emitted" by an action in the past (an L1 interaction), allowing us to add it to the list of consumables at the "beginning" of the block execution. This practical approach means that a message could be consumed in the same block it is included. In a sophisticated setup, rollup $n$ could send an L2 to L1 message that is then consumed on L1, and the response is added already in $n+1$. However, messages going from L2 to L1 will be added as they are emitted. + +:::info +Because everything is unilateral and async, the application developer have to explicitly handle failure cases such that user can gracefully recover. Example where recovering is of utmost importance is token bridges, where it is very inconvenient if the locking of funds on one domain occur, but never the minting or unlocking on the other. +::: + +## Components + +### Portal + +A "portal" refers to the part of an application residing on L1, which is associated with a particular L2 address (the confidential part of the application). It could be a contract or even an EOA on L1. + +### Message Boxes + +In a logical sense, a Message Box functions as a one-way message passing mechanism with two ends, one residing on each side of the divide, i.e., one component on L1 and another on L2. Essentially, these boxes are utilized to transmit messages between L1 and L2 via the rollup contract. The boxes can be envisaged as multi-sets that enable the same message to be inserted numerous times, a feature that is necessary to accommodate scenarios where, for instance, "deposit 10 eth to A" is required multiple times. The diagram below provides a detailed illustration of how one can perceive a message box in a logical context. + + + +- Here, a `sender` will insert a message into the `pending` set, the specific constraints of the actions depend on the implementation domain, but for now, say that anyone can insert into the pending set. +- At some point, a rollup will be executed, in this step messages are "moved" from pending on Domain A, to ready on Domain B. Note that consuming the message is "pulling & deleting" (or nullifying). The action is atomic, so a message that is consumed from the pending set MUST be added to the ready set, or the state transition should fail. A further constraint on moving messages along the way, is that only messages where the `sender` and `recipient` pair exists in a leaf in the contracts tree are allowed! +- When the message has been added to the ready set, the `recipient` can consume the message as part of a function call. + +A difference when compared to other cross-chain setups, is that Aztec is "pulling" messages, and that the message doesn't need to be calldata for a function call. For other rollups, execution is happening FROM the "message bridge", which then calls the L1 contract. For Aztec, you call the L1 contract, and it should then consume messages from the message box. + +Why? _Privacy_! When pushing, we would be needing full `calldata`. Which for functions with private inputs is not really something we want as that calldata for L1 -> L2 transactions are committed to on L1, e.g., publicly sharing the inputs to a private function. + +By instead pulling, we can have the "message" be something that is derived from the arguments instead. This way, a private function to perform second half of a deposit, leaks the "value" deposited and "who" made the deposit (as this is done on L1), but the new owner can be hidden on L2. + +To support messages in both directions we require two of these message boxes (one in each direction). However, due to the limitations of each domain, the message box for sending messages into the rollup and sending messages out are not fully symmetrical. In reality, the setup looks closer to the following: + + + +:::info +The L2 -> L1 pending messages set only exist logically, as it is practically unnecessary. For anything to happen to the L2 state (e.g., update the pending messages), the state will be updated on L1, meaning that we could just as well insert the messages directly into the ready set. +::: + +### Rollup Contract + +The rollup contract has a few very important responsibilities. The contract must keep track of the _L2 rollup state root_, perform _state transitions_ and ensure that the data is available for anyone else to synchronize to the current state. + +To ensure that _state transitions_ are performed correctly, the contract will derive public inputs for the **rollup circuit** based on the input data, and then use a _verifier_ contract to validate that inputs correctly transition the current state to the next. All data needed for the public inputs to the circuit must be from the rollup block, ensuring that the block is available. For a valid proof, the _rollup state root_ is updated and it will emit an _event_ to make it easy for anyone to find the data. + +As part of _state transitions_ where cross-chain messages are included, the contract must "move" messages along the way, e.g., from "pending" to "ready". + +### Kernel Circuit + +For L2 to L1 messages, the public inputs of a user-proof will contain a dynamic array of messages to be added, of size at most `MAX_MESSAGESTACK_DEPTH`, limited to ensure it is not impossible to include the transaction. The circuit must ensure, that all messages have a `sender/recipient` pair, and that those pairs exist in the contracts tree and that the `sender` is the L2 contract that actually emitted the message. +For consuming L1 to L2 messages the circuit must create proper nullifiers. + +### Rollup Circuit + +The rollup circuit must ensure that, provided two states $S$ and $S'$ and the rollup block $B$, applying $B$ to $S$ using the transition function must give us $S'$, e.g., $T(S, B) \mapsto S'$. If this is not the case, the constraints are not satisfied. + +For the sake of cross-chain messages, this means inserting and nullifying L1 $\rightarrow$ L2 in the trees, and publish L2 $\rightarrow$ L1 messages on chain. These messages should only be inserted if the `sender` and `recipient` match an entry in the contracts leaf (as checked by the kernel). + +### Messages + +While a message could theoretically be arbitrarily long, we want to limit the cost of the insertion on L1 as much as possible. Therefore, we allow the users to send 32 bytes of "content" between L1 and L2. If 32 suffices, no packing required. If the 32 is too "small" for the message directly, the sender should simply pass along a `sha256(content)` instead of the content directly (note that this hash should fit in a field element which is ~254 bits. More info on this below). The content can then either be emitted as an event on L2 or kept by the sender, who should then be the only entity that can "unpack" the message. +In this manner, there is some way to "unpack" the content on the receiving domain. + +The message that is passed along, require the `sender/recipient` pair to be communicated as well (we need to know who should receive the message and be able to check). By having the pending messages be a contract on L1, we can ensure that the `sender = msg.sender` and let only `content` and `recipient` be provided by the caller. Summing up, we can use the structs seen below, and only store the commitment (`sha256(LxToLyMsg)`) on chain or in the trees, this way, we need only update a single storage slot per message. + +```solidity +struct L1Actor { + address: actor, + uint256: chainId, +} + +struct L2Actor { + bytes32: actor, + uint256: version, +} + +struct L1ToL2Msg { + L1Actor: sender, + L2Actor: recipient, + bytes32: content, + bytes32: secretHash, +} + +struct L2ToL1Msg { + L2Actor: sender, + L1Actor: recipient, + bytes32: content, +} +``` + +:::info +The `bytes32` elements for `content` and `secretHash` hold values that must fit in a field element (~ 254 bits). +::: + +:::info +The nullifier computation should include the index of the message in the message tree to ensure that it is possible to send duplicate messages (e.g., 2 x deposit of 500 dai to the same account). + +To make it possible to hide when a specific message is consumed, the `L1ToL2Msg` is extended with a `secretHash` field, where the `secretPreimage` is used as part of the nullifier computation. This way, it is not possible for someone just seeing the `L1ToL2Msg` on L1 to know when it is consumed on L2. +::: + +## Combined Architecture + +The following diagram shows the overall architecture, combining the earlier sections. + + diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/ethereum-aztec-messaging/outbox.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/ethereum-aztec-messaging/outbox.md new file mode 100644 index 000000000000..b520d9285de9 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/ethereum-aztec-messaging/outbox.md @@ -0,0 +1,108 @@ +--- +title: Outbox +description: Learn about the outbox mechanism in Aztec portals for sending messages to L1. +tags: [portals, contracts] +--- + +The `Outbox` is a contract deployed on L1 that handles message passing from the rollup and to L1. + +**Links**: [Interface (GitHub link)](https://github.com/AztecProtocol/aztec-packages/blob/master/l1-contracts/src/core/interfaces/messagebridge/IOutbox.sol), [Implementation (GitHub link)](https://github.com/AztecProtocol/aztec-packages/blob/master/l1-contracts/src/core/messagebridge/Outbox.sol). + +## `insert()` + +Inserts the root of a merkle tree containing all of the L2 to L1 messages in a checkpoint specified by checkpointNumber. + +```solidity title="outbox_insert" showLineNumbers +/** + * @notice Inserts the root of a merkle tree containing all of the L2 to L1 messages in + * a checkpoint specified by _checkpointNumber. + * @dev Only callable by the rollup contract + * @dev Emits `RootAdded` upon inserting the root successfully + * @param _checkpointNumber - The checkpoint number in which the L2 to L1 messages reside + * @param _root - The merkle root of the tree where all the L2 to L1 messages are leaves + */ +function insert(uint256 _checkpointNumber, bytes32 _root) external; +``` +> Source code: l1-contracts/src/core/interfaces/messagebridge/IOutbox.sol#L19-L29 + + +| Name | Type | Description | +| ------------------- | --------- | ---------------------------------------------------------------------- | +| `_checkpointNumber` | `uint256` | The checkpoint Number in which the L2 to L1 messages reside | +| `_root` | `bytes32` | The merkle root of the tree where all the L2 to L1 messages are leaves | +| `_minHeight` | `uint256` | The minimum height of the merkle tree that the root corresponds to | + +#### Edge cases + +- Will revert with `Outbox__Unauthorized()` if `msg.sender != ROLLUP_CONTRACT`. +- Will revert with `Errors.Outbox__RootAlreadySetAtCheckpoint(uint256 checkpointNumber)` if the root for the specific checkpoint has already been set. +- Will revert with `Errors.Outbox__InsertingInvalidRoot()` if the rollup is trying to insert bytes32(0) as the root. + +## `consume()` + +Allows a recipient to consume a message from the `Outbox`. + +```solidity title="outbox_consume" showLineNumbers +/** + * @notice Consumes an entry from the Outbox + * @dev Only useable by portals / recipients of messages + * @dev Emits `MessageConsumed` when consuming messages + * @param _message - The L2 to L1 message + * @param _checkpointNumber - The checkpoint number specifying the checkpoint that contains the message we want to + * consume + * @param _leafIndex - The index inside the merkle tree where the message is located + * @param _path - The sibling path used to prove inclusion of the message, the _path length directly depends + * on the total amount of L2 to L1 messages in the checkpoint. i.e. the length of _path is equal to the depth of the + * L1 to L2 message tree. + */ +function consume( + DataStructures.L2ToL1Msg calldata _message, + uint256 _checkpointNumber, + uint256 _leafIndex, + bytes32[] calldata _path +) external; +``` +> Source code: l1-contracts/src/core/interfaces/messagebridge/IOutbox.sol#L31-L50 + + +| Name | Type | Description | +| ------------------- | ----------- | -------------------------------------------------------------------------------------------- | +| `_message` | `L2ToL1Msg` | The L2 to L1 message we want to consume | +| `_checkpointNumber` | `uint256` | The checkpoint number specifying the checkpoint that contains the message we want to consume | +| `_leafIndex` | `uint256` | The index inside the merkle tree where the message is located | +| `_path` | `bytes32[]` | The sibling path used to prove inclusion of the message, the \_path length directly depends | + +#### Edge cases + +- Will revert with `Outbox__InvalidRecipient(address expected, address actual);` if `msg.sender != _message.recipient.actor`. +- Will revert with `Outbox__InvalidChainId()` if `block.chainid != _message.recipient.chainId`. +- Will revert with `Outbox__NothingToConsumeAtCheckpoint(uint256 checkpointNumber)` if the root for the checkpoint has not been set yet. +- Will revert with `Outbox__AlreadyNullified(uint256 checkpointNumber, uint256 leafIndex)` if the message at leafIndex for the checkpoint has already been consumed. +- Will revert with `Outbox__InvalidPathLength(uint256 expected, uint256 actual)` if the supplied height is less than the existing minimum height of the L2 to L1 message tree, or the supplied height is greater than the maximum (minimum height + log2(maximum messages)). +- Will revert with `MerkleLib__InvalidRoot(bytes32 expected, bytes32 actual, bytes32 leaf, uint256 leafIndex)` if unable to verify the message existence in the tree. It returns the message as a leaf, as well as the index of the leaf to expose more info about the error. + +## `hasMessageBeenConsumedAtCheckpointAndIndex()` + +Checks to see if an index of the L2 to L1 message tree for a specific checkpoint has been consumed. + +```solidity title="outbox_has_message_been_consumed_at_checkpoint_and_index" showLineNumbers +/** + * @notice Checks to see if an L2 to L1 message in a specific checkpoint has been consumed + * @dev - This function does not throw. Out-of-bounds access is considered valid, but will always return false + * @param _checkpointNumber - The checkpoint number specifying the checkpoint that contains the message we want to + * check + * @param _leafId - The unique id of the message leaf + */ +function hasMessageBeenConsumedAtCheckpoint(uint256 _checkpointNumber, uint256 _leafId) external view returns (bool); +``` +> Source code: l1-contracts/src/core/interfaces/messagebridge/IOutbox.sol#L52-L61 + + +| Name | Type | Description | +| ------------------- | --------- | ------------------------------------------------------------------------------------------------------- | +| `_checkpointNumber` | `uint256` | The checkpoint number specifying the checkpoint that contains the index of the message we want to check | +| `_leafIndex` | `uint256` | The index of the message inside the merkle tree | + +#### Edge cases + +- This function does not throw. Out-of-bounds access is considered valid, but will always return false. diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/ethereum-aztec-messaging/registry.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/ethereum-aztec-messaging/registry.md new file mode 100644 index 000000000000..7e80800b0c3d --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/ethereum-aztec-messaging/registry.md @@ -0,0 +1,51 @@ +--- +title: Registry +description: Learn about the portal registry and how it manages L1-L2 contract mappings. +tags: [portals, contracts] +--- + +The registry is a contract deployed on L1, that contains addresses for the `Rollup`. It also keeps track of the different versions that have been deployed and let you query prior deployments easily. + +**Links**: [Interface (GitHub link)](https://github.com/AztecProtocol/aztec-packages/blob/master/l1-contracts/src/governance/interfaces/IRegistry.sol), [Implementation (GitHub link)](https://github.com/AztecProtocol/aztec-packages/blob/master/l1-contracts/src/governance/Registry.sol). + +## `numberOfVersions()` + +Retrieves the number of versions that have been deployed. + +```solidity title="registry_number_of_versions" showLineNumbers +function numberOfVersions() external view returns (uint256); +``` +> Source code: l1-contracts/src/governance/interfaces/IRegistry.sol#L25-L27 + + +| Name | Description | +| ----------- | ---------------------------------------------- | +| ReturnValue | The number of versions that have been deployed | + +## `getCanonicalRollup()` + +Retrieves the current rollup contract. + +```solidity title="registry_get_canonical_rollup" showLineNumbers +function getCanonicalRollup() external view returns (IHaveVersion); +``` +> Source code: l1-contracts/src/governance/interfaces/IRegistry.sol#L17-L19 + + +| Name | Description | +| ----------- | ------------------ | +| ReturnValue | The current rollup | + +## `getRollup(uint256 _version)` + +Retrieves the rollup contract for a specfic version. + +```solidity title="registry_get_rollup" showLineNumbers +function getRollup(uint256 _chainId) external view returns (IHaveVersion); +``` +> Source code: l1-contracts/src/governance/interfaces/IRegistry.sol#L21-L23 + + +| Name | Description | +| ----------- | ------------------ | +| ReturnValue | The current rollup | diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/functions/attributes.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/functions/attributes.md new file mode 100644 index 000000000000..518c552a73ed --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/functions/attributes.md @@ -0,0 +1,404 @@ +--- +title: Function Attributes and Macros +sidebar_position: 6 +tags: [functions] +description: Explore function attributes in Aztec contracts that control visibility, mutability, and execution context. +--- + +On this page you will learn about function attributes and macros. + +If you are looking for a reference of function macros, go [here](../macros.md). + +# External functions #[external("...")] + +Like in Solidity, external functions can be called from outside the contract. +There are 3 types of external functions differing in the execution environment they are executed in: private, public, and utility. +We will describe each type in the following sections. + +## Private functions #[external("private")] + +A private function operates on private information, and is executed by the user on their device. Annotate the function with the `#[external("private")]` attribute to tell the compiler it's a private function. This will make the [private context](./context.md#the-private-context) available within the function's execution scope. The compiler will create a circuit to define this function. + +`#[external("private")]` is just syntactic sugar. At compile time, the Aztec.nr framework inserts code that allows the function to interact with the [kernel](../../../foundational-topics/advanced/circuits/kernels/private_kernel.md). + +If you are interested in what exactly the macros are doing we encourage you to run `nargo expand` on your contract. +This will display your contract's code after the transformations are performed. + +(If you are using VSCode you can display the expanded code by pressing `CMD + Shift + P` and typing `nargo expand` and selecting `Noir: nargo expand on current package.) + +#### The expansion broken down + +Viewing the expanded Aztec contract uncovers a lot about how Aztec contracts interact with the kernel. To aid with developing intuition, we will break down each inserted line. + +**Receiving context from the kernel.** + +Private function calls are able to interact with each other through orchestration from within the kernel circuits. The kernel circuit forwards information to each contract function (recall each contract function is a circuit). This information then becomes part of the private context. +For example, within each private function we can access some global variables. To access them we can call on the `self.context`, e.g. `self.context.chain_id()`. The value of the chain ID comes from the values passed into the circuit from the kernel. + +The kernel checks that all of the values passed to each circuit in a function call are the same. + +**Creating the function's `self.`** + +Each Aztec function has access to a `self` object. Upon creation it accepts storage and context. Context is initialized from the inputs provided by the kernel, and a hash of the function's inputs. + +We use the kernel to pass information between circuits. This means that the return values of functions must also be passed to the kernel (where they can be later passed on to another function). +We achieve this by pushing return values to the execution context, which we then pass to the kernel. + +**Hashing the function inputs.** + +Inside the kernel circuits, the inputs to functions are reduced to a single value; the inputs hash. This prevents the need for multiple different kernel circuits; each supporting differing numbers of inputs. Hashing the inputs allows to reduce all of the inputs to a single value. + +**Returning the context to the kernel.** + +The contract function must return information about the execution back to the kernel. This is done through a rigid structure we call the `PrivateCircuitPublicInputs`. + +> _Why is it called the `PrivateCircuitPublicInputs`?_ +> When verifying zk programs, return values are not computed at verification runtime, rather expected return values are provided as inputs and checked for correctness. Hence, the return values are considered public inputs. + +This structure contains a host of information about the executed program. It will contain any newly created nullifiers, any messages to be sent to l2 and most importantly it will contain the return values of the function. + +**Making the contract's storage available** + +Each `self` has a `storage` variable exposed on it. +When a `Storage` struct is declared within a contract, the `self.storage` contains real variables. + +If Storage is note defined `self.storage` contains only a placeholder value. + +Any state variables declared in the `Storage` struct can now be accessed as normal struct members. + +**Returning the function context to the kernel.** + +This function takes the application context, and converts it into the `PrivateCircuitPublicInputs` structure. This structure is then passed to the kernel circuit. + +## Utility functions #[external("utility")] + +Contract functions marked with `#[external("utility")]` are used to perform state queries from an offchain client (from both private and public state!) or to modify local contract-related PXE state (e.g. when processing logs in Aztec.nr), and are never included in any transaction. No guarantees are made on the correctness of the result since the entire execution is unconstrained and heavily reliant on [oracle calls](https://noir-lang.org/docs/explainers/explainer-oracle). + +Any programming language could be used to construct these queries, since all they do is perform arbitrary computation on data that is either publicly available from any node, or locally available from the PXE. Utility functions exist as Noir contract code because they let developers utilize the rest of the contract code directly by being part of the same Noir crate, and e.g. use the same libraries, structs, etc. instead of having to rely on manual computation of storage slots, struct layout and padding, and so on. + +A reasonable mental model for them is that of a Solidity `view` function that can never be called in any transaction, and is only ever invoked via `eth_call`. Note that in these the caller assumes that the node is acting honestly by executing the true contract bytecode with correct blockchain state, the same way the Aztec version assumes the oracles are returning legitimate data. Unlike `view` functions however, `utility` functions can modify local offchain PXE state via oracle calls - this can be leveraged for example to process messages delivered offchain and then notify PXE of newly discovered notes. + +When a utility function is called, it prompts the ACIR simulator to + +1. generate the execution environment +2. execute the function within this environment + +To generate the environment, the simulator gets the block header from the [PXE database](../../../foundational-topics/pxe/index.md#database) and passes it along with the contract address to `UtilityExecutionOracle`. This creates a context that simulates the state of the blockchain at a specific block, allowing the utility function to access and interact with blockchain data as it would appear in that block, but without affecting the actual blockchain state. + +Once the execution environment is created, `runUtility` function is invoked on the simulator: + +```typescript title="execute_utility_function" showLineNumbers +/** + * Runs a utility function. + * @param call - The function call to execute. + * @param authwits - Authentication witnesses required for the function call. + * @param scopes - Optional array of account addresses whose notes can be accessed in this call. Defaults to all + * accounts if not specified. + * @returns A return value of the utility function in a form as returned by the simulator (Noir fields) + */ +public async runUtility(call: FunctionCall, authwits: AuthWitness[], scopes?: AztecAddress[]): Promise { + await verifyCurrentClassId(call.to, this.executionDataProvider); + + const entryPointArtifact = await this.executionDataProvider.getFunctionArtifact(call.to, call.selector); + + if (entryPointArtifact.functionType !== FunctionType.UTILITY) { + throw new Error(`Cannot run ${entryPointArtifact.functionType} function as utility`); + } + + const oracle = new UtilityExecutionOracle(call.to, authwits, [], this.executionDataProvider, undefined, scopes); + + try { + this.log.verbose(`Executing utility function ${entryPointArtifact.name}`, { + contract: call.to, + selector: call.selector, + }); + + const initialWitness = toACVMWitness(0, call.args); + const acirExecutionResult = await this.simulator + .executeUserCircuit(initialWitness, entryPointArtifact, new Oracle(oracle).toACIRCallback()) + .catch((err: Error) => { + err.message = resolveAssertionMessageFromError(err, entryPointArtifact); + throw new ExecutionError( + err.message, + { + contractAddress: call.to, + functionSelector: call.selector, + }, + extractCallStack(err, entryPointArtifact.debug), + { cause: err }, + ); + }); + + this.log.verbose(`Utility simulation for ${call.to}.${call.selector} completed`); + return witnessMapToFields(acirExecutionResult.returnWitness); + } catch (err) { + throw createSimulationError(err instanceof Error ? err : new Error('Unknown error during private execution')); + } +} +``` +> Source code: yarn-project/pxe/src/contract_function_simulator/contract_function_simulator.ts#L211-L259 + + +This: + +1. Prepares the ACIR for execution +2. Converts `args` into a format suitable for the ACVM (Abstract Circuit Virtual Machine), creating an initial witness (witness = set of inputs required to compute the function). `args` might be an oracle to request a user's balance +3. Executes the function in the ACVM, which involves running the ACIR with the initial witness and the context. If requesting a user's balance, this would query the balance from the PXE database +4. Extracts the return values from the `partialWitness` and decodes them based on the artifact to get the final function output. The artifact is the compiled output of the contract, and has information like the function signature, parameter types, and return types + +Beyond using them inside your other functions, they are convenient for providing an interface that reads storage, applies logic and returns values to a UI or test. Below is a snippet from exposing the `balance_of_private` function from a token implementation, which allows a user to easily read their balance, similar to the `balanceOf` function in the ERC20 standard. + +```rust title="balance_of_private" showLineNumbers +#[external("utility")] +unconstrained fn balance_of_private(owner: AztecAddress) -> u128 { + self.storage.balances.at(owner).balance_of() +} +``` +> Source code: noir-projects/noir-contracts/contracts/app/token_contract/src/main.nr#L510-L515 + + +:::info +Note, that utility functions can have access to both private and (historical) public data when executed on the user's device. This is possible since these functions are not invoked as part of transactions, so we don't need to worry about preventing a contract from e.g. accidentally using stale or unverified public state. +::: + +## Public functions #[external("public")] + +A public function is executed by the sequencer and has access to a state model that is very similar to that of the EVM and Ethereum. Even though they work in an EVM-like model for public transactions, they are able to write data into private storage that can be consumed later by a private function. + +:::note +All data inserted into private storage from a public function will be publicly viewable (not private). +::: + +To create a public function you can annotate it with the `#[external("public")]` attribute. This will make the public context available within the function's execution scope. + +```rust title="set_minter" showLineNumbers +#[external("public")] +fn set_minter(minter: AztecAddress, approve: bool) { + assert(self.storage.admin.read().eq(self.msg_sender().unwrap()), "caller is not admin"); + self.storage.minters.at(minter).write(approve); +} +``` +> Source code: noir-projects/noir-contracts/contracts/app/token_contract/src/main.nr#L147-L153 + + +Under the hood: + +- Context Creation: The macro inserts code at the beginning of the function to create a`PublicContext` object: + +```rust +let mut context = PublicContext::new(args_hasher); +``` + +This context provides access to public state and transaction information + +- Storage Access: If the contract has a storage struct defined, the macro inserts code to initialize the storage: + +```rust +let storage = Storage::init(&mut context); +``` + +- Function Body Wrapping: The original function body is wrapped in a new scope that handles the context and return value +- Visibility Control: The function is marked as pub, making it accessible from outside the contract. +- Unconstrained Execution: Public functions are marked as unconstrained, meaning they don't generate proofs and are executed directly by the sequencer. + +## Constrained `view` Functions #[view] + +The `#[view]` attribute can be applied to a `#[external("private")]` or a `#[external("public")]` function and it guarantees that the function cannot modify any contract state (just like `view` functions in Solidity). + +## `Initializer` Functions #[initializer] + +This is used to designate functions as initializers (or constructors) for an Aztec contract. These functions are responsible for setting up the initial state of the contract when it is first deployed. The macro does two important things: + +- `assert_initialization_matches_address_preimage(context)`: This checks that the arguments and sender to the initializer match the commitments from the address preimage +- `mark_as_initialized(&mut context)`: This is called at the end of the function to emit the initialization nullifier, marking the contract as fully initialized and ensuring this function cannot be called again + +Key things to keep in mind: + +- A contract can have multiple initializer functions defined, but only one initializer function should be called for the lifetime of a contract instance +- Other functions in the contract will have an initialization check inserted, ie they cannot be called until the contract is initialized, unless they are marked with [`#[noinitcheck]`](#noinitcheck) + +## #[noinitcheck] + +In normal circumstances, all functions in an Aztec contract (except initializers) have an initialization check inserted at the beginning of the function body. This check ensures that the contract has been initialized before any other function can be called. However, there may be scenarios where you want a function to be callable regardless of the contract's initialization state. This is when you would use `#[noinitcheck]`. + +When a function is annotated with `#[noinitcheck]`: + +- The Aztec macro processor skips the [insertion of the initialization check](#initializer-functions-initializer) for this specific function +- The function can be called at any time, even if the contract hasn't been initialized yet + +## #[only_self] + +External functions marked with #[only_self] attribute can only be called by the contract itself - if other contracts try to make the call it will fail. + +This attribute is commonly used when an action starts in private but needs to be completed in public. The public +function must be marked with #[only_self] to restrict access to only the contract itself. A typical example is a private +token mint operation that needs to enqueue a call to a public function to update the publicly tracked total token +supply. + +It is also useful in private functions when dealing with tasks of an unknown size but with a large upper bound (e.g. when needing to process an unknown amount of notes or nullifiers) as they allow splitting the work in multiple circuits, possibly resulting in performance improvements for low-load scenarios. + +This macro inserts a check at the beginning of the function to ensure that the caller is the contract itself. This is done by adding the following assertion: + +```rust +assert(self.msg_sender() == self.address, "Function can only be called by the same contract"); +``` + +## Implementing notes + +The `#[note]` attribute is used to define notes in Aztec contracts. + +When a struct is annotated with `#[note]`, the Aztec macro applies a series of transformations and generates implementations to turn it into a note that can be used in contracts to store private data. + +1. **Note Interface Implementation**: The macro automatically implements the `NoteType`, `NoteHash` and `Packable` traits for the annotated struct. This includes the following methods: + + - `get_id` + - `compute_note_hash` + - `compute_nullifier` + - `pack` + - `unpack` + +2. **Property Metadata**: A separate struct is generated to describe the note's fields, which is used for efficient retrieval of note data + +3. **Export Information**: The note type and its ID are automatically exported + +### Before expansion + +Here is how you could define a custom note: + +```rust +#[note] +struct CustomNote { + data: Field, + owner: Address, +} +``` + +### After expansion + +```rust +impl NoteType for CustomNote { + fn get_id() -> Field { + // Assigned by macros by incrementing a counter + 2 + } +} + +impl NoteHash for CustomNote { + fn compute_note_hash(self, storage_slot: Field) -> Field { + let inputs = array_concat(self.pack(), [storage_slot]); + poseidon2_hash_with_separator(inputs, GENERATOR_INDEX__NOTE_HASH) + } + + fn compute_nullifier(self, context: &mut PrivateContext, note_hash_for_nullification: Field) -> Field { + let owner_npk_m_hash = get_public_keys(self.owner).npk_m.hash(); + let secret = context.request_nsk_app(owner_npk_m_hash); + poseidon2_hash_with_separator( + [ + note_hash_for_nullification, + secret + ], + GENERATOR_INDEX__NOTE_NULLIFIER as Field + ) + } + + unconstrained fn compute_nullifier_unconstrained(self, storage_slot: Field, contract_address: AztecAddress, note_nonce: Field) -> Field { + // We set the note_hash_counter to 0 as the note is not transient and the concept of transient note does + // not make sense in an unconstrained context. + let retrieved_note = RetrievedNote { note: self, contract_address, nonce: note_nonce, note_hash_counter: 0 }; + let note_hash_for_nullification = compute_note_hash_for_nullification(retrieved_note, storage_slot); + let owner_npk_m_hash = get_public_keys(self.owner).npk_m.hash(); + let secret = get_nsk_app(owner_npk_m_hash); + poseidon2_hash_with_separator( + [ + note_hash_for_nullification, + secret + ], + GENERATOR_INDEX__NOTE_NULLIFIER as Field + ) + } +} + +impl CustomNote { + pub fn new(x: [u8; 32], y: [u8; 32], owner: AztecAddress) -> Self { + CustomNote { x, y, owner } + } +} + +struct CustomNoteProperties { + data: aztec::note::note_getter_options::PropertySelector, + owner: aztec::note::note_getter_options::PropertySelector, +} +``` + +Key things to keep in mind: + +- Developers can override any of the auto-generated methods by specifying a note interface +- The note's fields are automatically serialized and deserialized in the order they are defined in the struct + +## Storage struct #[storage] + +The `#[storage]` attribute is used to define the storage structure for an Aztec contract. + +When a struct is annotated with `#[storage]`, the macro does this under the hood: + +1. **Context Injection**: injects a `Context` generic parameter into the storage struct and all its fields. This allows the storage to interact with the Aztec context, eg when using `context.msg_sender()` + +2. **Storage Implementation Generation**: generates an `impl` block for the storage struct with an `init` function. The developer can override this by implementing a `impl` block themselves + +3. **Storage Slot Assignment**: automatically assigns storage slots to each field in the struct based on their serialized length + +4. **Storage Layout Generation**: a `StorageLayout` struct and a global variable are generated to export the storage layout information for use in the contract artifact + +### Before expansion + +```rust +#[storage] +struct Storage { + balance: PublicMutable, + owner: PublicMutable
, + token_map: Map, +} +``` + +### After expansion + +```rust +struct Storage { + balance: PublicMutable, + owner: PublicMutable, + token_map: Map, +} + +impl Storage { + fn init(context: Context) -> Self { + Storage { + balance: PublicMutable::new(context, 1), + owner: PublicMutable::new(context, 2), + token_map: Map::new(context, 3, |context, slot| Field::new(context, slot)), + } + } +} + +struct StorageLayout { + balance: dep::aztec::prelude::Storable, + owner: dep::aztec::prelude::Storable, + token_map: dep::aztec::prelude::Storable, +} + +#[abi(storage)] +global CONTRACT_NAME_STORAGE_LAYOUT = StorageLayout { + balance: dep::aztec::prelude::Storable { slot: 1 }, + owner: dep::aztec::prelude::Storable { slot: 2 }, + token_map: dep::aztec::prelude::Storable { slot: 3 }, +}; +``` + +Key things to keep in mind: + +- Only one storage struct can be defined per contract +- `Map` types and private `Note` types always occupy a single storage slot + +## Further reading + +- [Macros reference](../macros.md) +- [How do macros work](./attributes.md) diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/functions/context.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/functions/context.md new file mode 100644 index 000000000000..ef271c6b8734 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/functions/context.md @@ -0,0 +1,234 @@ +--- +title: Understanding Function Context +sidebar_position: 3 +tags: [functions, context] +description: Learn about the execution context available to Aztec contract functions, including caller information and block data. +--- + +import Image from '@theme/IdealImage'; + +## What is the context + +The context is an object that is made available within every function in `Aztec.nr`. As mentioned in the [kernel circuit documentation](../../../foundational-topics/advanced/circuits/kernels/private_kernel.md). At the beginning of a function's execution, the context contains all of the kernel information that application needs to execute. During the lifecycle of a transaction, the function will update the context with each of its side effects (created notes, nullifiers etc.). At the end of a function's execution the mutated context is returned to the kernel to be checked for validity. + +Behind the scenes, Aztec.nr will pass data the kernel needs to and from a circuit, this is abstracted away from the developer. In a developer's eyes; the context is a useful structure that allows access and mutate the state of the `Aztec` blockchain. + +On this page, you'll learn + +- The details and functionalities of the private context in Aztec.nr +- Difference between the private and public contexts and their unified APIs +- Components of the private context, such as inputs and block header. +- Elements like return values, read requests, new note hashes, and nullifiers in transaction processing +- Differences between the private and public contexts, especially the unique features and variables in the public context + +## Two contexts, one API + +The `Aztec` blockchain contains two environments - public and private. + +- Private, for private transactions taking place on user's devices. +- Public, for public transactions taking place on the network's sequencers. + +As there are two distinct execution environments, they both require slightly differing execution contexts. Despite their differences; the API's for interacting with each are unified. Leading to minimal context switch when working between the two environments. + +The following section will cover both contexts. + +## The Private Context + +The code snippet below shows what is contained within the private context. +```rust title="private-context" showLineNumbers +pub inputs: PrivateContextInputs, +pub side_effect_counter: u32, + +pub min_revertible_side_effect_counter: u32, +pub is_fee_payer: bool, + +pub args_hash: Field, +pub return_hash: Field, + +pub include_by_timestamp: u64, + +pub note_hash_read_requests: BoundedVec>, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL>, +pub nullifier_read_requests: BoundedVec>, MAX_NULLIFIER_READ_REQUESTS_PER_CALL>, +key_validation_requests_and_generators: BoundedVec, + +pub note_hashes: BoundedVec, MAX_NOTE_HASHES_PER_CALL>, +pub nullifiers: BoundedVec, MAX_NULLIFIERS_PER_CALL>, + +pub private_call_requests: BoundedVec, +pub public_call_requests: BoundedVec, MAX_ENQUEUED_CALLS_PER_CALL>, +pub public_teardown_call_request: PublicCallRequest, +pub l2_to_l1_msgs: BoundedVec, MAX_L2_TO_L1_MSGS_PER_CALL>, +``` +> Source code: noir-projects/aztec-nr/aztec/src/context/private_context.nr#L171-L194 + + +### Private Context Broken Down + +#### Inputs + +The context inputs includes all of the information that is passed from the kernel circuit into the application circuit. It contains the following values. + +```rust title="private-context-inputs" showLineNumbers +#[derive(Eq)] +pub struct PrivateContextInputs { + pub call_context: CallContext, + pub anchor_block_header: BlockHeader, + pub tx_context: TxContext, + pub start_side_effect_counter: u32, +} +``` +> Source code: noir-projects/aztec-nr/aztec/src/context/inputs/private_context_inputs.nr#L9-L17 + + +As shown in the snippet, the application context is made up of 4 main structures. The call context, the block header, and the private global variables. + +First of all, the call context. + +```rust title="call-context" showLineNumbers +#[derive(Deserialize, Eq, Serialize)] +pub struct CallContext { + pub msg_sender: AztecAddress, + pub contract_address: AztecAddress, + pub function_selector: FunctionSelector, + pub is_static_call: bool, +} +``` +> Source code: noir-projects/noir-protocol-circuits/crates/types/src/abis/call_context.nr#L8-L16 + + +The call context contains information about the current call being made: + +1. Msg Sender + - The message sender is the account (Aztec Contract) that sent the message to the current context. In the first call of the kernel circuit (often the account contract call), this value will be empty. For all subsequent calls the value will be the previous call. + +> The graphic below illustrates how the message sender changes throughout the kernel circuit iterations. + + + +2. Storage contract address + + - This value is the address of the current context's contract address. This value will be the value of the current contract that is being executed except for when the current call is a delegate call (Warning: This is yet to be implemented). In this case the value will be that of the sending contract. + +3. Flags + - Furthermore there are a series of flags that are stored within the application context: + - is_delegate_call: Denotes whether the current call is a delegate call. If true, then the storage contract address will be the address of the sender. + - is_static_call: This will be set if and only if the current call is a static call. In a static call, state changing altering operations are not allowed. + +### Block Header + +Another structure that is contained within the context is the `BlockHeader` object, which is the header of the block used to generate proofs against. + +```rust title="block-header" showLineNumbers +#[derive(Deserialize, Eq, Serialize)] +pub struct BlockHeader { + pub last_archive: AppendOnlyTreeSnapshot, + pub state: StateReference, + + // The hash of the sponge blob for this block, which commits to the tx effects added in this block. + // Note: it may also include tx effects from previous blocks within the same checkpoint. + // When proving tx effects from this block only, we must refer to the `sponge_blob_hash` in the previous block + // header to show that the effect was added after the previous block. + // The previous block header can be validated using a membership proof of the last leaf in `last_archive`. + pub sponge_blob_hash: Field, + + pub global_variables: GlobalVariables, + pub total_fees: Field, + pub total_mana_used: Field, +} +``` +> Source code: noir-projects/noir-protocol-circuits/crates/types/src/abis/block_header.nr#L12-L29 + + +### Transaction Context + +The private context provides access to the transaction context as well, which are user-defined values for the transaction in general that stay constant throughout its execution. + +```rust title="tx-context" showLineNumbers +#[derive(Deserialize, Eq, Serialize)] +pub struct TxContext { + pub chain_id: Field, + pub version: Field, + pub gas_settings: GasSettings, +} +``` +> Source code: noir-projects/noir-protocol-circuits/crates/types/src/abis/transaction/tx_context.nr#L8-L15 + + +### Args Hash + +To allow for flexibility in the number of arguments supported by Aztec functions, all function inputs are reduced to a singular value which can be proven from within the application. + +The `args_hash` is the result of pedersen hashing all of a function's inputs. + +### Return Values + +The return values are a set of values that are returned from an applications execution to be passed to other functions through the kernel. Developers do not need to worry about passing their function return values to the `context` directly as `Aztec.nr` takes care of it for you. See the documentation surrounding `Aztec.nr` [macro expansion](./attributes.md#after-expansion) for more details. + +```rust +return_values : BoundedVec\, +``` +## Include By Timestamp + +Some data structures impose time constraints, e.g. they may make it so that a value can only be changed after a certain delay. Interacting with these in private involves creating proofs that are only valid as long as they are included before a certain future point in time. To achieve this, the `set_include_by_timestamp` function can be used to set this property: + +```rust title="include-by-timestamp" showLineNumbers +pub fn set_include_by_timestamp(&mut self, include_by_timestamp: u64) { +``` +> Source code: noir-projects/aztec-nr/aztec/src/context/private_context.nr#L742-L744 + + +A transaction that sets this value will never be included in a block with a timestamp larger than the requested value, since it would be considered invalid. This can also be used to make transactions automatically expire after some time if not included. + +### Read Requests + + + +### New Note Hashes + +New note hashes contains an array of all of the note hashes created in the current execution context. + +### New Nullifiers + +New nullifiers contains an array of the new nullifiers emitted from the current execution context. + +### Nullified Note Hashes + +Nullified note hashes is an optimization for introduced to help reduce state growth. There are often cases where note hashes are created and nullified within the same transaction. +In these cases there is no reason that these note hashes should take up space on the node's commitment/nullifier trees. Keeping track of nullified note hashes allows us to "cancel out" and prove these cases. + +### Private Call Stack + +The private call stack contains all of the external private function calls that have been created within the current context. Any function call objects are hashed and then pushed to the execution stack. +The kernel circuit will orchestrate dispatching the calls and returning the values to the current context. + +### Public Call Stack + +The public call stack contains all of the external function calls that are created within the current context. Like the private call stack above, the calls are hashed and pushed to this stack. Unlike the private call stack, these calls are not executed client side. Whenever the function is sent to the network, it will have the public call stack attached to it. At this point the sequencer will take over and execute the transactions. + +### New L2 to L1 msgs + +New L2 to L1 messages contains messages that are delivered to the l1 outbox on the execution of each rollup. + +## Public Context + +The Public Context includes all of the information passed from the `Public VM` into the execution environment. Its interface is very similar to the [Private Context](#the-private-context), however it has some minor differences (detailed below). + +### Public Global Variables + +The public global variables are provided by the rollup sequencer and consequently contain some more values than the private global variables. + +```rust title="global-variables" showLineNumbers +#[derive(Deserialize, Eq, Serialize)] +pub struct GlobalVariables { + pub chain_id: Field, + pub version: Field, + pub block_number: u32, + pub slot_number: Field, + pub timestamp: u64, + pub coinbase: EthAddress, + pub fee_recipient: AztecAddress, + pub gas_fees: GasFees, +} +``` +> Source code: noir-projects/noir-protocol-circuits/crates/types/src/abis/global_variables.nr#L7-L19 + diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/functions/function_transforms.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/functions/function_transforms.md new file mode 100644 index 000000000000..59b1e17c9c5f --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/functions/function_transforms.md @@ -0,0 +1,240 @@ +--- +title: Inner Workings of Functions +sidebar_position: 5 +tags: [functions] +description: Understand how Aztec transforms contract functions during compilation for privacy and efficiency. +--- + +Below, we go more into depth of what is happening under the hood when you create a function in an Aztec contract. The [next page](./attributes.md) will give you more information about what the attributes are really doing. + + +## Function transformation + +When you define a function in an Aztec contract, it undergoes several transformations when it is compiled. These transformations prepare the function for execution. These transformations include: + +- [Creating a context for the function](#context-creation) +- [Handling function inputs](#private-and-public-input-injection) +- [Processing return values](#return-value-handling) +- [Generating function signatures](#function-signature-generation) +- [Generating contract artifacts](#contract-artifacts) + +Let's explore each of these transformations in detail. + +## Context creation + +Every function in an Aztec contract operates within a specific context which provides some extra information and functionality. This is either a `PrivateContext` or `PublicContext` object, depending on whether it is a private or public function. For private functions, it creates a hash of all input parameters to ensure privacy. + +### Private functions + +For private functions, the context creation involves hashing all input parameters: + +```rust +let mut args_hasher = ArgsHasher::new(); +// Hash each parameter +args_hasher.add(param1); +args_hasher.add(param2); +// add all parameters + +let mut context = PrivateContext::new(inputs, args_hasher.hash()); +``` + +This hashing process is important because it is used to verify the function's execution without exposing the input data. + +### Public functions + +For public functions, context creation is simpler: + +```rust +let mut context = PublicContext::new(inputs); +``` + +These `inputs` are explained in the [private and public input injection](#private-and-public-input-injection) further down on this page. + +### Using the context in functions + +Once created, the context object provides various useful methods. Here are some common use cases: + +#### Accessing storage + +The context allows you to interact with contract storage. eg if you have a function that calls storage like this: + +```rust +let sender_balance = storage.balances.at(owner); +``` + +This calls the context to read from the appropriate storage slot. + +#### Interacting with other contracts + +The context provides methods to call other contracts: + +```rust +let token_contract = TokenContract::at(token); +``` + +Under the hood, this creates a new instance of the contract interface with the specified address. + +## Private and public input injection + +An additional parameter is automatically added to every function. + +The injected input is always the first parameter of the transformed function and is of type `PrivateContextInputs` for private functions or `PublicContextInputs` for public functions. + +Original function definition + ```rust + fn my_function(param1: Type1, param2: Type2) { ... } + ``` + +Transformed function with injected input + ```rust + fn my_function(inputs: PrivateContextInputs, param1: Type1, param2: Type2) { ... } + ``` + +The `inputs` parameter includes: + +- msg sender, ie the address of the account calling the function +- contract address +- chain ID +- block context, eg the block number & timestamp +- function selector of the function being called + +This makes these inputs available to be consumed within private annotated functions. + +## Return value handling + +Return values in Aztec contracts are processed differently from traditional smart contracts when using private functions. + +### Private functions + +- The original return value is assigned to a special variable: + ```rust + let macro__returned__values = original_return_expression; + ``` + +- A new `ArgsHasher` is created for the return values: + ```rust + let mut returns_hasher = ArgsHasher::new(); + ``` + +- The hash of the return value is set in the context: + ```rust + context.set_return_hash(returns_hasher); + ``` + +- The function's return type is changed to `PrivateCircuitPublicInputs`, which is returned by calling `context.finish()` at the end of the function. + +This process allows the return values to be included in the function's computation result while maintaining privacy. + +### Public functions + +In public functions, the return value is directly used, and the function's return type remains as specified by the developer. + +## Function signature generation + +Unique function signatures are generated for each contract function. + +The function signature is computed like this: + +```rust +fn compute_fn_signature_hash(fn_name: &str, parameters: &[Type]) -> u32 { + let signature = format!( + "{}({})", + fn_name, + parameters.iter().map(signature_of_type).collect::>().join(",") + ); + let mut keccak = Keccak::v256(); + let mut result = [0u8; 32]; + keccak.update(signature.as_bytes()); + keccak.finalize(&mut result); + // Take the first 4 bytes of the hash and convert them to an integer + // If you change the following value you have to change NUM_BYTES_PER_NOTE_TYPE_ID in l1_note_payload.ts as well + let num_bytes_per_note_type_id = 4; + u32::from_be_bytes(result[0..num_bytes_per_note_type_id].try_into().unwrap()) +} +``` + +- A string representation of the function is created, including the function name and parameter types +- This signature string is then hashed using Keccak-256 +- The first 4 bytes of the resulting hash are converted to a u32 integer + +### Integration into contract interface + +The computed function signatures are integrated into the contract interface like this: + +- During contract compilation, placeholder values (0) are initially used for function selectors + +- After type checking, the `update_fn_signatures_in_contract_interface()` function is called to replace these placeholders with the actual computed signatures + +- For each function in the contract interface: + - The function's parameters are extracted + - The signature hash is computed using `compute_fn_signature_hash` + - The placeholder in the contract interface is replaced with the computed hash + +This process ensures that each function in the contract has a unique, deterministic signature based on its name and parameter types. They are inspired by Solidity's function selector mechanism. + +## Contract artifacts + +Contract artifacts in Aztec are automatically generated structures that describe the contract's interface. They provide information about the contract's functions, their parameters, and return types. + +### Contract artifact generation process + +For each function in the contract, an artifact is generated like this: + +- A struct is created to represent the function's parameters: + + ```rust + struct {function_name}_parameters { + // Function parameters are listed here + } + ``` + + This struct is only created if the function has parameters. + +- An ABI struct is generated for the function: + +```rust + let export_struct_source = format!( + " + #[abi(functions)] + struct {}_abi {{ + {}{} + }}", + func.name(), + parameters, + return_type + ); +``` + +- These structs are added to the contract's types. + +### Content of artifacts + +The artifacts contain: + +- Function name +- Parameters (if any), including their names and types +- Return type (if the function has returns) + +For example, for a function `transfer(recipient: Address, amount: Field) -> bool`, the artifact would look like: + +```rust +struct transfer_parameters { + recipient: Address, + amount: Field, +} + +#[abi(functions)] +struct transfer_abi { + parameters: transfer_parameters, + return_type: bool, +} +``` + +Contract artifacts are important because: + +- They provide a machine-readable description of the contract +- They can be used to generate bindings for interacting with the contract (read [here](../../../aztec-nr/how_to_compile_contract.md) to learn how to create TypeScript bindings) +- They help decode function return values in the simulator + +## Further reading +- [Function attributes and macros](./attributes.md) diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/functions/how_to_define_functions.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/functions/how_to_define_functions.md new file mode 100644 index 000000000000..6a493272ef14 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/functions/how_to_define_functions.md @@ -0,0 +1,123 @@ +--- +title: How to Define Functions +sidebar_position: 1 +tags: [functions, smart-contracts] +description: Define different types of functions in your Aztec smart contracts for various execution environments. +--- + +This guide shows you how to define different types of functions in your Aztec contracts, each serving specific purposes and execution environments. + +## Prerequisites + +- An Aztec contract project set up with `aztec-nr` dependency +- Basic understanding of Noir programming language +- Familiarity with Aztec's execution model (private vs public) + +## Define private functions + +Create functions that execute privately on user devices using the `#[external("private")]` annotation. For example: + +```rust +#[external("private")] +fn execute_private_action(param1: AztecAddress, param2: u128) { + // logic +} +``` + +Private functions maintain privacy of user inputs and execution logic. Private functions only have access to private state. + +## Define public functions + +Create functions that execute on the sequencer using the `#[external("public")]` annotation: + +```rust +#[external("public")] +fn create_item(recipient: AztecAddress, item_id: Field) { + // logic +} +``` + +Public functions can access public state, similar to EVM contracts. Public functions do not have direct access to private state. + +## Define utility functions + +Create offchain query functions using the `#[external("utility")]` annotation. + +Utility functions are standalone unconstrained functions that cannot be called from private or public functions: they are meant to be called by _applications_ to perform auxiliary tasks: query contract state (e.g. a token balance), process messages received offchain, etc. Example: + +```rust +#[external("utility")] +unconstrained fn get_private_items( + owner: AztecAddress, + page_index: u32, +) -> ([Field; MAX_NOTES_PER_PAGE], bool) { + // logic +} +``` + +## Define view functions + +Create read-only functions using the `#[view]` annotation combined with `#[external("private")]` or `#[external("public")]`: + +```rust +#[external("public")] +#[view] +fn get_config_value() -> Field { + // logic +} +``` + +View functions cannot modify contract state. They're akin to Ethereum's `view` functions. + +## Define only-self functions + +Create contract-only functions using the `#[only_self]` annotation: + +```rust +#[external("public")] +#[only_self] +fn update_counter_public(item: Field) { + // logic +} +``` + +Internal functions are only callable within the same contract. + +## Define initializer functions + +Create constructor-like functions using the `#[initializer]` annotation: + +```rust +#[external("private")] +#[initializer] +fn constructor() { + // logic +} +``` + +### Use multiple initializers + +Define multiple initialization options: + +1. Mark each function with `#[initializer]` +2. Choose which one to call during deployment +3. Any initializer marks the contract as initialized + +## Create library methods + +Define reusable contract logic as regular functions (no special annotation needed): + +```rust +#[contract_library_method] +fn process_value( + context: &mut PrivateContext, + storage: Storage<&mut PrivateContext>, + account: AztecAddress, + value: u128, + max_items: u32, +) -> u128 { + // logic +} +``` + +Library methods are inlined when called and reduce code duplication. diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/functions/index.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/functions/index.md new file mode 100644 index 000000000000..386fa23e850e --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/functions/index.md @@ -0,0 +1,29 @@ +--- +title: Defining Functions +sidebar_position: 0 +tags: [functions] +description: Overview of Aztec contract functions, including private, public, and utility function types. +--- + +Functions serve as the building blocks of smart contracts. Functions can be either **public**, ie they are publicly available for anyone to see and can directly interact with public state, or **private**, meaning they are executed completely client-side in the [PXE](../../../foundational-topics/pxe/index.md). Read more about how private functions work [here](./attributes.md#private-functions-private). + +Currently, any function is "mutable" in the sense that it might alter state. However, we also support static calls, similarly to EVM. A static call is essentially a call that does not alter state (it keeps state static). + +## Initializer functions + +Smart contracts may have one, or many, initializer functions which are called when the contract is deployed. + +Initializers are regular functions that set an "initialized" flag (a nullifier) for the contract. A contract can only be initialized once, and contract functions can only be called after the contract has been initialized, much like a constructor. However, if a contract defines no initializers, it can be called at any time. Additionally, you can define as many initializer functions in a contract as you want, both private and public. + +## Oracles + +There are also special oracle functions, which can get data from outside of the smart contract. In the context of Aztec, oracles are often used to get user-provided inputs. + +## Learn more about functions + +- [How function visibility works in Aztec](./visibility.md) +- How to write an [initializer function](./how_to_define_functions.md#initializer-functions) +- [Oracles](../advanced/protocol_oracles.md) and how Aztec smart contracts might use them +- [How functions work under the hood](./attributes.md) + +Find a function macros reference [here](../macros.md) diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/functions/public_private_calls.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/functions/public_private_calls.md new file mode 100644 index 000000000000..e86298adaaf6 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/functions/public_private_calls.md @@ -0,0 +1,93 @@ +--- +title: Private <> Public Communication +sidebar_position: 7 +tags: [functions] +description: Learn how to make calls between public and private functions in Aztec contracts. +--- + + +import Image from "@theme/IdealImage"; + +import Disclaimer from "@site/src/components/Disclaimers/_wip_disclaimer.mdx"; + + + +Aztec operates on a model of private and public functions that are able to work together. Private functions work by providing evidence of correct execution generated locally through kernel proofs. Public functions, on the other hand, are able to utilize the latest state to manage updates and perform alterations. + +On this page, you’ll learn: + +- How private and public functions work +- The role of public functions in managing state alterations and updates +- Communication and interactions between private and public functions +- How the sequencer manages the order of operations of private functions + +### Objectives + +The goal for L2 communication is to setup the most simple mechanism that will support + +- _private_ and _public_ functions +- _private_ functions that can call _private_ or _public_ functions +- _public_ functions that can call _private_ or _public_ functions + +Before diving into the communication abstracts for Aztec, we need to understand some of our limitations. One being that public functions (as known from Ethereum) must operate on the current state to provide meaningful utility, e.g., at the tip. +This works fine when there is only one builder (sequencer) executing it first, and then others verifying as the builder always knows the tip. On the left in the diagram below, we see a block where the transactions are applied one after another each building on the state before it. For example, if Tx 1 update storage `a = 5`, then in Tx 2 reading `a` will return `5`. + +This works perfectly well when everything is public and a single builder is aware of all changes. However, in a private setting, we require the user to present evidence of correct execution as part of their transaction in the form of a kernel proof (generated locally on user device ahead of time). This way, the builder doesn't need to have knowledge of everything happening in the transaction, only the results. If we were to build this proof on the latest state, we would encounter problems. How can two different users build proofs at the same time, given that they will be executed one after the other by the sequencer? The simple answer is that they cannot, as race conditions would arise where one of the proofs would be invalidated by the other due to a change in the state root (which would nullify Merkle paths). + +To avoid this issue, we permit the use of historical data as long as the data has not been nullified previously. Note, that because this must include nullifiers that were inserted after the proof generation, but before execution we need to nullify (and insert the data again) to prove that it was not nullified. Without emitting the nullifier we would need our proof to point to the current head of the nullifier tree to have the same effect, e.g., back to the race conditions we were trying to avoid. + +In this model, instead of informing the builder of our intentions, we construct the proof $\pi$ and then provide them with the transaction results (new note hashes and nullifiers, contract deployments and cross-chain messages) in addition to $\pi$. The builder will then be responsible for inserting these new note hashes and nullifiers into the state. They will be aware of the intermediates and can discard transactions that try to produce existing nullifiers (double spend), as doing so would invalidate the rollup proof. + +On the left-hand side of the diagram below, we see the fully public world where storage is shared, while on the right-hand side, we see the private world where all reads are historical. + + + +Given that Aztec will comprise both private and public functions, it is imperative that we determine the optimal ordering for these functions. From a logical standpoint, it is reasonable to execute the private functions first as they are executed on a state $S_i$, where $i \le n$, with $S_n$ representing the current state where the public functions always operate on the current state $S_n$. Prioritizing the private functions would also afford us the added convenience of enabling them to invoke the public functions, which is particularly advantageous when implementing a peer-to-pool architecture such as that employed by Uniswap. + +Transactions that involve both private and public functions will follow a specific order of execution, wherein the private functions will be executed first, followed by the public functions, and then moving on to the next transaction. + +It is important to note that the execution of private functions is prioritized before executing any public functions. This means that private functions cannot "wait" on the results of any of their calls to public functions. Stated differently, any calls made across domains are unilateral in nature, akin to shouting into the void with the hope that something will occur at a later time. The figure below illustrates the order of function calls on the left-hand side, while the right-hand side shows how the functions will be executed. Notably, the second private function call is independent of the output of the public function and merely occurs after its execution. + + + +Multiple of these transactions are then ordered into a L2 block by the sequencer, who will also be executing the public functions (as they require the current head). Example seen below. + + + +:::info +Be mindful that if part of a transaction is reverting, say the public part of a call, it will revert the entire transaction. Similarly to Ethereum, it might be possible for the block builder to create a block such that your valid transaction reverts because of altered state, e.g., trade incurring too much slippage or the like. +::: + +To summarize: + +- _Private_ function calls are fully "prepared" and proven by the user, which provides the kernel proof along with new note hashes and nullifiers to the sequencer. +- _Public_ functions altering public state (updatable storage) must be executed at the current "head" of the chain, which only the sequencer can ensure, so these must be executed separately to the _private_ functions. +- _Private_ and _public_ functions within an Aztec transaction are therefore ordered such that first _private_ functions are executed, and then _public_. + +A more comprehensive overview of the interplay between private and public functions and their ability to manipulate data is presented below. It is worth noting that all data reads performed by private functions are historical in nature, and that private functions are not capable of modifying public storage. Conversely, public functions have the capacity to manipulate private storage (e.g., inserting new note hashes, potentially as part of transferring funds from the public domain to the private domain). + + + +:::info +You can think of private and public functions as being executed by two actors that can only communicate to each other by mailbox. +::: + +So, with private functions being able to call public functions (unilaterally) we had a way to go from private to public, what about the other way? Recall that public functions CANNOT call private functions directly. Instead, you can use the append-only merkle tree to save messages from a public function call, that can later be executed by a private function. Note, only a transaction coming after the one including the message from a public function can consume it. In practice this means that unless you are the sequencer it will not be within the same rollup. + +Given that private functions have the capability of calling public functions unilaterally, it is feasible to transition from a private to public function within the same transaction. However, the converse is not possible. To achieve this, the append-only merkle tree can be employed to save messages from a public function call, which can then be executed by a private function at a later point in time. It is crucial to reiterate that this can only occur at a later stage and cannot take place within the same rollup because the proof cannot be generated by the user. + +:::info +Theoretically the builder has all the state trees after the public function has inserted a message in the public tree, and is able to create a proof consuming those messages in the same block. But it requires pending UTXO's on a block-level. +::: + +From the above, we should have a decent idea about what private and public functions can do inside the L2, and how they might interact. + +## A note on L2 access control + +Many applications rely on some form of access control to function well. USDC have a blacklist, where only parties not on the list should be able to transfer. And other systems such as Aave have limits such that only the pool contract is able to mint debt tokens and transfers held funds. + +Access control like this cannot easily be enforced in the private domain, as reading is also nullifying (to ensure data is up to date). However, as it is possible to read historical public state, one can combine private and public functions to get the desired effect. + +This concept is known as delayed public mutable state, and relies on using delays when changing public data so that it can also be read in private with currentness guarantees. Since values cannot be immediately modified but instead require delays to elapse, it is possible to privately prove that an application is using the current value _as long as the transaction gets included before some time in the future_, which would be the earliest the value could possibly change. + +If the public state is only changed infrequently, and it is acceptable to have delays when doing so, then delayed public mutable state is a good solution to this problem. diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/functions/visibility.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/functions/visibility.md new file mode 100644 index 000000000000..9cd2cd395b81 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/functions/visibility.md @@ -0,0 +1,26 @@ +--- +title: Visibility +sidebar_position: 4 +tags: [functions] +description: Understand function visibility modifiers in Aztec and how they affect function execution and accessibility. +--- + +In Aztec there are multiple different types of visibility that can be applied to functions. Namely we have `data visibility` and `function visibility`. This page explains these types of visibility. + +### Data Visibility + +Data visibility is used to describe whether the data (or state) used in a function is generally accessible (public) or on a need to know basis (private). + +### Function visibility + +This is the kind of visibility you are more used to seeing in Solidity and more traditional programming languages. It is used to describe whether a function is callable from other contracts, or only from within the same contract. + +By default, all functions are callable from other contracts, similarly to the Solidity `public` visibility. To make them only callable from the contract itself, you can mark them as `internal`. Contrary to solidity, we don't have the `external` nor `private` keywords. `external` since it is limited usage when we don't support inheritance, and `private` since we don't support inheritance and it would also be confusing with multiple types of `private`. + +A good place to use `internal` is when you want a private function to be able to alter public state. As mentioned above, private functions cannot do this directly. They are able to call public functions and by making these internal we can ensure that this state manipulating function is only callable from our private function. + +:::danger +Note that non-internal functions could be used directly as an entry-point, which currently means that the `msg_sender` would be `0`, so for now, using address `0` as a burn address is not recommended. You can learn more about this in the [Accounts concept page](../../../foundational-topics/accounts/keys.md). +::: + +To understand how visibility works under the hood, check out the [Inner Workings page](./attributes.md). diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/globals.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/globals.md new file mode 100644 index 000000000000..68dff1d3b0e8 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/globals.md @@ -0,0 +1,88 @@ +--- +title: Global Variables +description: Documentation of Aztec's Global Variables in the Public and Private Contexts +sidebar_position: 9 +--- + +# Global Variables + +For developers coming from solidity, this concept will be similar to how the global `block` variable exposes a series of block values. The idea is the same in Aztec. Developers can access a namespace of values made available in each function. + +`Aztec` has two execution environments, Private and Public. Each execution environment contains a different global variables object. + +## Private Global Variables + +```rust title="tx-context" showLineNumbers +#[derive(Deserialize, Eq, Serialize)] +pub struct TxContext { + pub chain_id: Field, + pub version: Field, + pub gas_settings: GasSettings, +} +``` +> Source code: noir-projects/noir-protocol-circuits/crates/types/src/abis/transaction/tx_context.nr#L8-L15 + + +The private global variables are equal to the transaction context and contain: + +### Chain Id + +The chain id differs depending on which Aztec instance you are on ( NOT the Ethereum hardfork that the rollup is settling to ). On original deployment of the network, this value will be 1. + +```rust +context.chain_id(); +``` + +### Version + +The version number indicates which Aztec hardfork you are on. The Genesis block of the network will have the version number 1. + +```rust +context.version(); +``` + +### Gas Settings + +The gas limits set by the user for the transaction, the max fee per gas, and the inclusion fee. + +## Public Global Variables + +```rust title="global-variables" showLineNumbers +#[derive(Deserialize, Eq, Serialize)] +pub struct GlobalVariables { + pub chain_id: Field, + pub version: Field, + pub block_number: u32, + pub slot_number: Field, + pub timestamp: u64, + pub coinbase: EthAddress, + pub fee_recipient: AztecAddress, + pub gas_fees: GasFees, +} +``` +> Source code: noir-projects/noir-protocol-circuits/crates/types/src/abis/global_variables.nr#L7-L19 + + +The public global variables contain the values present in the `private global variables` described above, with the addition of: + +### Timestamp + +The timestamp is the unix timestamp in which the block has been executed. The value is provided by the block's proposer (therefore can have variance). This value will always increase. + +```rust +context.timestamp(); +``` + +### Block Number + +The block number is a sequential identifier that labels each individual block of the network. This value will be the block number of the block the accessing transaction is included in. +The block number of the genesis block will be 1, with the number increasing by 1 for every block after. + +```rust +context.block_number(); +``` + +:::info _Why do the available global variables differ per execution environment?_ +The global variables are constrained by the proving environment. In the case of public functions, they are executed on a sequencer that will know the timestamp and number of the next block ( as they are the block producer ). +In the case of private functions, we cannot be sure which block our transaction will be included in, hence we can not guarantee values for the timestamp or block number. +::: diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/how_to_call_contracts.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/how_to_call_contracts.md new file mode 100644 index 000000000000..c75c6e8a8993 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/how_to_call_contracts.md @@ -0,0 +1,74 @@ +--- +title: Calling Other Contracts +sidebar_position: 5 +tags: [functions, contracts, composability] +description: Call functions in other contracts from your Aztec smart contracts to enable composability. +--- + +This guide shows you how to call functions in other contracts from your Aztec smart contracts, enabling contract composability and interaction. + +## Prerequisites + +- An Aztec contract project with dependencies properly configured +- Access to the target contract's source code or ABI +- Understanding of Aztec contract compilation and deployment + +## Add the target contract as a dependency + +Add the contract you want to call to your `Nargo.toml` dependencies: + +```toml +other_contract = { git="https://github.com/your-repo/", tag="v1.0.0", directory="path/to/contract" } +``` + +## Import the contract interface + +Import the contract at the top of your contract file: + +```rust +use other_contract::OtherContract; +``` + +## Call contract functions + +Use this pattern to call functions in other contracts: + +1. Specify the contract address: `Contract::at(contract_address)` +2. Call the function: `.function_name(param1, param2)` +3. Execute the call: `.call(&mut context)` + +### Make private function calls + +Call private functions directly using `.call()`: + +```rust +OtherContract::at(contract_address).private_function(param1, param2).call(&mut context); +``` + +### Make public-to-public calls + +Call public functions from other public functions using `.call()`: + +```rust +let result = OtherContract::at(contract_address) + .public_function(param1, param2, param3) + .call(&mut context); +``` + +### Make private-to-public calls + +Enqueue public functions to be executed after private execution completes: + +```rust +OtherContract::at(contract_address) + .public_function(param1, param2) + .enqueue(&mut context); +``` + +:::info +Public functions always execute after private execution completes. Learn more in the [concepts overview](../../foundational-topics/index.md). +::: + +### Use other call types + +Explore additional call types for specialized use cases in the [call types reference](../../foundational-topics/call_types.md). diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/how_to_communicate_cross_chain.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/how_to_communicate_cross_chain.md new file mode 100644 index 000000000000..9fbe1787dd6d --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/how_to_communicate_cross_chain.md @@ -0,0 +1,198 @@ +--- +title: Communicating Cross-Chain +tags: [contracts, portals] +sidebar_position: 12 +description: Send messages and data between L1 and L2 contracts using portal contracts and cross-chain messaging. +--- + +This guide shows you how to implement cross-chain communication between Ethereum (L1) and Aztec (L2) contracts using portal contracts. + +## Prerequisites + +- An Aztec contract project set up with `aztec-nr` dependency +- Understanding of Aztec L1/L2 architecture +- Access to Ethereum development environment for L1 contracts +- Deployed portal contract on L1 (see [token bridge tutorial](../../tutorials/js_tutorials/token_bridge.md)) + +## Send messages from L1 to L2 + +### Send a message from your L1 portal contract + +Use the `Inbox` contract to send messages from L1 to L2. Call `sendL2Message` with these parameters: + +| Parameter | Type | Description | +| ------------- | --------- | ------------------------------------------------------- | +| `actor` | `L2Actor` | Your L2 contract address and rollup version | +| `contentHash` | `bytes32` | Hash of your message content (use `Hash.sha256ToField`) | +| `secretHash` | `bytes32` | Hash of a secret for message consumption | + +In your Solidity contract: + +```solidity +import {IInbox} from "@aztec/core/interfaces/messagebridge/IInbox.sol"; +import {DataStructures} from "@aztec/core/libraries/DataStructures.sol"; +import {Hash} from "@aztec/core/libraries/crypto/Hash.sol"; + +// ... initialize inbox, get rollupVersion from rollup contract ... + +DataStructures.L2Actor memory actor = DataStructures.L2Actor(l2ContractAddress, rollupVersion); + +// Hash your message content with a unique function signature +bytes32 contentHash = Hash.sha256ToField( + abi.encodeWithSignature("your_action_name(uint256,address)", param1, param2) +); + +// Send the message +(bytes32 key, uint256 index) = inbox.sendL2Message(actor, contentHash, secretHash); +``` + +### Consume the message in your L2 contract + +To consume a message coming from L1, use the `consume_l1_to_l2_message` function within the context: + +- The `content_hash` must match the hash that was sent from L1 +- The `secret` is the pre-image of the `secretHash` sent from L1 +- The `sender` is the L1 portal contract address +- The `message_leaf_index` helps the RPC find the correct message +- If the content or secret doesn't match, the transaction will revert +- "Consuming" a message pushes a nullifier to prevent double-spending + +```rust +#[external("public")] +fn consume_message_from_l1( + secret: Field, + message_leaf_index: Field, + // your function parameters +) { + // Recreate the same content hash as on L1 + let content_hash = /* compute your content hash */; + + // Consume the L1 message + context.consume_l1_to_l2_message( + content_hash, + secret, + portal_address, // Your L1 portal contract address + message_leaf_index + ); + + // Execute your contract logic here +} +``` + +## Send messages from L2 to L1 + +### Send a message from your L2 contract + +Use `message_portal` in your `context` to send messages from L2 to L1: + +```rust +#[external("public")] +fn send_message_to_l1( + // your function parameters +) { + // Note: This can be called from both public and private functions + // Create your message content (must fit in a single Field) + let content = /* compute your content hash */; + + // Send message to L1 portal + context.message_portal(portal_address, content); +} +``` + +### Consume the message in your L1 portal + +Use the `Outbox` to consume L2 messages on L1: + +```solidity +import {IOutbox} from "@aztec/core/interfaces/messagebridge/IOutbox.sol"; +import {DataStructures} from "@aztec/core/libraries/DataStructures.sol"; +import {Hash} from "@aztec/core/libraries/crypto/Hash.sol"; + +function consumeMessageFromL2( + // your parameters + uint256 _l2BlockNumber, + uint256 _leafIndex, + bytes32[] calldata _path +) external { + // Recreate the message structure + DataStructures.L2ToL1Msg memory message = DataStructures.L2ToL1Msg({ + sender: DataStructures.L2Actor(l2ContractAddress, rollupVersion), + recipient: DataStructures.L1Actor(address(this), block.chainid), + content: Hash.sha256ToField( + abi.encodeWithSignature( + "your_action_name(address,uint256,address)", + param1, param2, param3 + ) + ) + }); + + // Consume the message + outbox.consume(message, _l2BlockNumber, _leafIndex, _path); + + // Execute your L1 logic here +} +``` + +:::info + +You can get the witness for the l2 to l1 message as follows: + +```ts +import { computeL2ToL1MembershipWitness } from "@aztec/stdlib/messaging"; +import { computeL2ToL1MessageHash } from "@aztec/stdlib/hash"; + +// Compute the message hash +const l2ToL1Message = computeL2ToL1MessageHash({ + l2Sender: l2ContractAddress, + l1Recipient: EthAddress.fromString(portalAddress), + content: messageContent, + rollupVersion: new Fr(version), + chainId: new Fr(chainId), +}); + +const witness = await computeL2ToL1MembershipWitness( + node, + exitReceipt.blockNumber!, + l2ToL1Message +); +``` + +::: + +## Best practices + +### Structure messages properly + +Use function signatures to prevent message misinterpretation: + +```solidity +// ❌ Ambiguous format +bytes memory message = abi.encode(_value, _contract, _recipient); + +// ✅ Clear function signature +bytes memory message = abi.encodeWithSignature( + "execute_action(uint256,address,address)", + _value, _contract, _recipient +); +``` + +### Use designated callers + +Control message execution order with designated callers: + +```solidity +bytes memory message = abi.encodeWithSignature( + "execute_action(uint256,address,address)", + _value, _recipient, + _withCaller ? msg.sender : address(0) +); +``` + +## Example implementations + +- [Token Portal (L1)](https://github.com/AztecProtocol/aztec-packages/blob/v3.0.2/l1-contracts/test/portals/TokenPortal.sol) +- [Token Bridge (L2)](https://github.com/AztecProtocol/aztec-packages/blob/v3.0.2/noir-projects/noir-contracts/contracts/app/token_bridge_contract/src/main.nr) + +## Next steps + +Follow the [cross-chain messaging tutorial](../../tutorials/js_tutorials/token_bridge.md) for a complete implementation example. diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/how_to_define_storage.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/how_to_define_storage.md new file mode 100644 index 000000000000..e09f05863032 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/how_to_define_storage.md @@ -0,0 +1,637 @@ +--- +title: Declaring Contract Storage +sidebar_position: 3 +tags: [contracts, storage, data-types, smart-contracts] +description: Define and manage storage state in your Aztec smart contracts using various storage types. +--- + +This guide shows you how to declare storage and use various storage types provided by Aztec.nr for managing contract state. + +## Prerequisites + +- An Aztec contract project set up with `aztec-nr` dependency +- Understanding of Aztec's private and public state model +- Familiarity with Noir struct syntax +- Basic knowledge of maps and data structures + +For storage concepts, see [storage overview](../../foundational-topics/state_management.md). + +## Define your storage struct + +### Create a storage struct with #[storage] + +Declare storage using a struct annotated with `#[storage]`. For example: + +```rust +#[storage] +struct Storage { + // The admin of the contract + admin: PublicMutable, +} +``` + +### Context parameter + +The `Context` parameter provides execution mode information. + +### Access storage in functions + +Use the `storage` keyword to access your storage variables in contract functions. + +## Use maps for key-value storage + +Maps store key-value pairs where keys are `Field` elements and values can be any type. + +You can import `Map` as: + +```noir +use dep::aztec::state_vars::Map; +``` + +### Understand map structure + +- Keys: Always `Field` or serializable types +- Values: Any type, including other maps +- Multiple maps: Supported in the same contract + +### Declare private maps + +Specify the note type for private storage maps: + +```rust +private_items: Map, Context>, +``` + +### Declare public maps + +Use `PublicState` for public storage maps: + +```rust +authorized_users: Map, Context>, +``` + +### Access map values + +Use the `.at()` method to access values by key: + +```rust +assert(storage.authorized_users.at(context.msg_sender()).read(), "caller is not authorized"); +``` + +:::tip + +This is equivalent to Solidity's `authorized_users[msg.sender]` pattern. + +::: + +## Use private storage types + +Aztec.nr provides three private state variable types: + +- `PrivateMutable`: Single mutable private value +- `PrivateImmutable`: Single immutable private value +- `PrivateSet`: Collection of private notes + +All private storage operates on note types rather than arbitrary data types. Learn how to implement custom notes and use them with Maps [here](./how_to_implement_custom_notes.md) + +### PrivateMutable + +PrivateMutable is a private state variable that is unique in a way. When a PrivateMutable is initialized, a note is created to represent its value. Updating the value means to destroy the current note, and to create a new one with the updated value. + +Like for public state, we define the struct to have context and a storage slot. You can view the implementation [here](https://github.com/AztecProtocol/aztec-packages/blob/v3.0.2/noir-projects/aztec-nr/aztec/src/state_vars/private_mutable.nr). + +An example of `PrivateMutable` usage in contracts is keeping track of important values. The `PrivateMutable` is added to the `Storage` struct as follows: + +```rust +// #[storage] +// ...etc +my_value: PrivateMutable, +``` + +#### `initialize` + +As mentioned, the PrivateMutable should be initialized to create the first note and value. When this function is called, a nullifier of the storage slot is created, preventing this PrivateMutable from being initialized again. + +Unlike public states, which have a default initial value of `0` (or many zeros, in the case of a struct, array or map), a private state (of type `PrivateMutable`, `PrivateImmutable` or `PrivateSet`) does not have a default initial value. The `initialize` method (or `insert`, in the case of a `PrivateSet`) must be called. + +#### `is_initialized` + +An unconstrained method to check whether the PrivateMutable has been initialized or not. It takes an optional owner and returns a boolean. You can view the implementation [here (GitHub link)](https://github.com/AztecProtocol/aztec-packages/blob/v3.0.2/noir-projects/aztec-nr/aztec/src/state_vars/private_mutable.nr). + +```rust +let is_initialized = my_value.is_initialized(); +``` + +#### `replace` + +To update the value of a `PrivateMutable`, we can use the `replace` method. The method takes a function (or closure) that transforms the current note into a new one. + +When called, the method will: + +- Nullify the old note +- Apply the transform function to produce a new note +- Insert the new note into the data tree + +An example of this is seen in an example card game, where an update function is passed in to transform the current note into a new one (in this example, updating a `CardNote` data): + +```rust +let new_note = MyNote::new(new_value, owner); +storage.my_value.replace(&mut new_note).deliver(encode_and_encrypt_note(&mut context, owner)); +``` + +:::info + +Calling `deliver(encode_and_encrypt_note())` on the `replace` method will encrypt the new note and post it to the data availability layer so that the note information is retrievable by the recipient. + +::: + +If two people are trying to modify the PrivateMutable at the same time, only one will succeed as we don't allow duplicate nullifiers! Developers should put in place appropriate access controls to avoid race conditions (unless a race is intended!). + +#### `get_note` + +This function allows us to get the note of a PrivateMutable, essentially reading the value. + +```rust +let note = my_value.get_note() +``` + +:::info + +To ensure that a user's private execution always uses the latest value of a PrivateMutable, the `get_note` function will nullify the note that it is reading. This means that if two people are trying to use this function with the same note, only one will succeed (no duplicate nullifiers allowed). + +This also makes read operations indistinguishable from write operations and allows the sequencer to verifying correct execution without learning anything about the value of the note. + +::: + +#### `view_note` + +Functionally similar to [`get_note`](#get_note), but executed in unconstrained functions and can be used by the wallet to fetch notes for use by front-ends etc. + +### PrivateImmutable + +`PrivateImmutable` represents a unique private state variable that, as the name suggests, is immutable. Once initialized, its value cannot be altered. You can view the implementation [here (GitHub link)](https://github.com/AztecProtocol/aztec-packages/blob/v3.0.2/noir-projects/aztec-nr/aztec/src/state_vars/private_immutable.nr). + +#### `initialize` + +When this function is invoked, it creates a nullifier for the storage slot, ensuring that the PrivateImmutable cannot be initialized again. + +Set the value of an PrivateImmutable by calling the `initialize` method: + +```rust +#[external("private")] +fn initialize_private_immutable(my_value: u8) { + let new_note = MyNote::new(my_value, context.msg_sender().unwrap()); + + storage.my_private_immutable.initialize(new_note).deliver(encode_and_encrypt_note( + &mut context, + context.msg_sender(), + )); +} +``` + +:::info + +Calling `deliver(encode_and_encrypt_note())` on `initialize` will encrypt the new note and post it to the data availability layer so that the note information is retrievable by the recipient. + +::: + +Once initialized, an PrivateImmutable's value remains unchangeable. This method can only be called once. + +#### `is_initialized` + +An unconstrained method to check if the PrivateImmutable has been initialized. Takes an optional owner and returns a boolean. You can find the implementation [here (GitHub link)](https://github.com/AztecProtocol/aztec-packages/blob/v3.0.2/noir-projects/aztec-nr/aztec/src/state_vars/private_immutable.nr). + +#### `get_note` + +Similar to the `PrivateMutable`, we can use the `get_note` method to read the value of an PrivateImmutable. + +Use this method to retrieve the value of an initialized PrivateImmutable. + +```rust +#[external("private")] +fn get_immutable_note() -> MyNote { + storage.my_private_immutable.get_note() +} +``` + +Unlike a `PrivateMutable`, the `get_note` function for an PrivateImmutable doesn't nullify the current note in the background. This means that multiple accounts can concurrently call this function to read the value. + +This function will throw if the `PrivateImmutable` hasn't been initialized. + +#### `view_note` + +Functionally similar to `get_note`, but executed unconstrained and can be used by the wallet to fetch notes for use by front-ends etc. + +### PrivateSet + +`PrivateSet` is used for managing a collection of notes. All notes in a `PrivateSet` are of the same `NoteType`. But whether these notes all belong to one entity, or are accessible and editable by different entities, is up to the developer. + +For example, adding a mapping of private items to storage, indexed by `AztecAddress`: + +```rust +private_items: Map, Context>, +``` + +#### `insert` + +Allows us to modify the storage by inserting a note into the `PrivateSet`. + +A hash of the note will be generated, and inserted into the note hash tree, allowing us to later use in contract interactions. Recall that the content of the note should be shared with the owner to allow them to use it, as mentioned this can be done via an encrypted log or offchain via web2, or completely offline. + +```rust +storage.set.at(aztec_address).insert(new_note).deliver(encode_and_encrypt_note(&mut context, aztec_address)); +``` + +:::info + +Calling `deliver(encode_and_encrypt_note())` on `insert` will encrypt the new note and post it to the data availability layer so that the note information is retrievable by the recipient. + +::: + +#### `pop_notes` + +This function pops (gets, removes and returns) the notes the account has access to based on the provided filter. + +The kernel circuits are constrained to a maximum number of notes this function can return at a time. Check [here (GitHub link)](https://github.com/AztecProtocol/aztec-packages/blob/v3.0.2/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr) and look for `MAX_NOTE_HASH_READ_REQUESTS_PER_CALL` for the up-to-date number. + +Because of this limit, we should always consider using the second argument `NoteGetterOptions` to limit the number of notes we need to read and constrain in our programs. This is quite important as every extra call increases the time used to prove the program and we don't want to spend more time than necessary. + +An example of such options is using the filter functions from the value note library (like `filter_notes_min_sum`) to get "enough" notes to cover a given value. Essentially, this function will return just enough notes to cover the amount specified such that we don't need to read all our notes. For users with a lot of notes, this becomes increasingly important. + +```rust +use value_note::filter::filter_notes_min_sum; + +// etc... +let options = NoteGetterOptions::with_filter(filter_notes_min_sum, subtrahend as Field); +let notes = self.set.pop_notes(options); +``` + +#### `get_notes` + +This function has the same behavior as `pop_notes` above but it does not delete the notes. + +#### `remove` + +Will remove a note from the `PrivateSet` if it previously has been read from storage, e.g. you have fetched it through a `get_notes` call. This is useful when you want to remove a note that you have previously read from storage and do not have to read it again. + +Note that if you obtained the note you are about to remove via `get_notes` it's much better to use `pop_notes` as `pop_notes` results in significantly fewer constraints since it doesn't need to check that the note has been previously read, as it reads and deletes at once. + +#### `view_notes` + +Functionally similar to [`get_notes`](#get_notes), but executed unconstrained and can be used by the wallet to fetch notes for use by front-ends etc. + +```rust +let mut options = NoteViewerOptions::new(); +let notes = set.view_notes(options.set_offset(offset)); +``` + +There's also a limit on the maximum number of notes that can be returned in one go. To find the current limit, refer to [this file (GitHub link)](https://github.com/AztecProtocol/aztec-packages/blob/v3.0.2/noir-projects/aztec-nr/aztec/src/note/constants.nr) and look for `MAX_NOTES_PER_PAGE`. + +The key distinction is that this method is unconstrained. It does not perform a check to verify if the notes actually exist, which is something the [`get_notes`](#get_notes) method does under the hood. Therefore, it should only be used in an unconstrained contract function. + +This function requires a `NoteViewerOptions`. The `NoteViewerOptions` is essentially similar to the [`NoteGetterOptions`](#notegetteroptions), except that it doesn't take a custom filter. + +## Use public storage types + +Aztec.nr provides two public state variable types that work similarly to Ethereum's storage model: + +- `PublicMutable`: Mutable public value that can be updated +- `PublicImmutable`: Immutable public value that can only be set once + +Both types are generic over any serializable type `T`, allowing you to store simple values like integers and booleans, as well as complex structs. Public storage is transparent - all values are visible to anyone observing the blockchain. + +### PublicMutable + +Store mutable public state using `PublicMutable` for values that need to be updated throughout the contract's lifecycle. + +:::info +An example using a larger struct can be found in the [lending example](https://github.com/AztecProtocol/aztec-packages/tree/v3.0.2/noir-projects/noir-contracts/contracts/app/lending_contract)'s use of an [`Asset`](https://github.com/AztecProtocol/aztec-packages/tree/v3.0.2/noir-projects/noir-contracts/contracts/app/lending_contract/src/asset.nr). +::: + +For example, to add `config_value` public state variable into our storage struct, we can define it as: + +```rust +config_value: PublicMutable, +``` + +To add a group of `authorized_users` that are able to perform actions in our contract, and we want them in public storage: + +```rust +authorized_users: Map, Context>, +``` + +#### `read` + +On the `PublicMutable` structs we have a `read` method to read the value at the location in storage. For our `config_value` example from earlier, this could be used as follows to check that the stored value matches the `msg_sender()`: + +```rust +let admin = storage.admin.read(); +assert(admin == context.msg_sender().unwrap(), "caller is not admin"); +``` + +#### `write` + +We have a `write` method on the `PublicMutable` struct that takes the value to write as an input and saves this in storage. It uses the serialization method to serialize the value which inserts (possibly multiple) values into storage: + +```rust +storage.admin.write(new_admin); +``` + +### PublicImmutable + +`PublicImmutable` is a type that is initialized from public once, typically during a contract deployment, but which can later be read from public, private and utility execution contexts. This state variable is useful for stuff that you would usually have in `immutable` values in Solidity, e.g. this can be the name of a contract or its version number. + +Just like the `PublicMutable` it is generic over the variable type `T`. The type must implement the `Serialize` and `Deserialize` traits. + +```rust +my_public_immutable: PublicImmutable, +``` + +You can find the details of `PublicImmutable` in the implementation [here (GitHub link)](https://github.com/AztecProtocol/aztec-packages/blob/v3.0.2/noir-projects/aztec-nr/aztec/src/state_vars/public_immutable.nr). + +#### `new` + +Is done exactly like the `PublicMutable` struct, but with the `PublicImmutable` struct. + +```rust +my_public_immutable: PublicImmutable, +``` + +#### `initialize` + +This function sets the immutable value. It can only be called once. + +```rust +storage.my_public_immutable.initialize(my_value); +``` + +:::warning +A `PublicImmutable`'s storage **must** only be set once via `initialize`. Attempting to override this by manually accessing the underlying storage slots breaks all properties of the data structure, rendering it useless. +::: + +```rust +#[external("public")] +fn initialize_public_immutable(my_value: u8) { + let mut new_struct = MyStruct { account: context.msg_sender().unwrap(), value: my_value }; + storage.my_public_immutable.initialize(new_struct); +} +``` + +#### `read` + +Returns the stored immutable value. This function is available in public, private and utility contexts. + +```rust +#[external("utility")] +unconstrained fn get_public_immutable() -> MyStruct { + storage.my_public_immutable.read() +} +``` + +## Use custom structs in public storage + +Both `PublicMutable` and `PublicImmutable` are generic over any serializable type, which means you can store custom structs in public storage. This is useful for storing configuration data, game state, or any other structured data that needs to be publicly visible. + +### Define a custom struct for storage + +To use a custom struct in public storage, it must implement the `Packable` trait. You can automatically derive this along with other useful traits: + +```rust +use dep::aztec::protocol_types::{ + address::AztecAddress, + traits::{Deserialize, Packable, Serialize} +}; + +// Required derives for public storage: +// - Packable: Required for all public storage +// - Serialize: Required for returning from functions +// - Deserialize: Required for receiving as parameters +#[derive(Deserialize, Packable, Serialize)] +pub struct Asset { + pub interest_accumulator: u128, + pub last_updated_ts: u64, + pub loan_to_value: u128, + pub oracle: AztecAddress, +} +``` + +Common optional derives include: + +- `Eq`: For equality comparisons between structs + +### Store custom structs + +Once defined, use your custom struct in storage declarations: + +```rust +#[storage] +struct Storage { + // Single custom struct + config: PublicMutable, + + // Map of custom structs + assets: Map, Context>, + + // Immutable custom struct (like contract config) + initial_config: PublicImmutable, +} +``` + +### Read and write custom structs + +Work with custom structs using the same `read()` and `write()` methods as built-in types: + +```rust +#[public] +fn update_asset(asset_id: Field, new_accumulator: u128) { + // Read the current struct + let mut asset = storage.assets.at(asset_id).read(); + + // Modify fields + asset.interest_accumulator = new_accumulator; + asset.last_updated_ts = context.timestamp(); + + // Write back the updated struct + storage.assets.at(asset_id).write(asset); +} + +#[public] +fn get_asset(asset_id: Field) -> Asset { + storage.assets.at(asset_id).read() +} +``` + +You can also create and store new struct instances: + +```rust +#[public] +fn initialize_asset( + interest_accumulator: u128, + loan_to_value: u128, + oracle: AztecAddress +) { + let last_updated_ts = context.timestamp() as u64; + + storage.assets.at(0).write( + Asset { + interest_accumulator, + last_updated_ts, + loan_to_value, + oracle, + } + ); +} +``` + +### Use custom structs in nested maps + +Custom structs work seamlessly with nested map structures: + +```rust +#[derive(Deserialize, Eq, Packable, Serialize)] +pub struct Game { + pub started: bool, + pub finished: bool, + pub current_round: u32, +} + +#[storage] +struct Storage { + // Map game_id -> player_address -> Game struct + games: Map, Context>, Context>, +} + +#[public] +fn start_game(game_id: Field, player: AztecAddress) { + let game = Game { + started: true, + finished: false, + current_round: 0, + }; + storage.games.at(game_id).at(player).write(game); +} +``` + +## Delayed Public Mutable + +This storage type is used if you want to use public values in private execution. + +A typical use case is some kind of system configuration, such as a protocol fee or access control permissions. These values are public (known by everyone) and mutable. Reading them in private however is tricky: private execution is always asynchronous and performed over _historical_ state, and hence one cannot easily prove that a given public value is current. + +:::note Alternative approaches + +A naive way to solve this is to enqueue a public call that will assert the current public value, but this leaks _which_ public value is being read, severely reducing privacy. Even if the value itself is already public, the fact that we're using it because we're interacting with some related contract is not. For example, we may leak that we're interacting with a certain DeFi protocol by reading its fee. + +An alternative approach is to create notes in public that are then nullified in private, but this introduces contention: only a single user may use the note and therefore read the state, since nullifying it will prevent all others from doing the same. In some schemes there's only one account that will read the state anyway, but this is not the general case. + +::: + +Delayed Public Mutable state works around this by introducing **delays**: + +- Instead, a value change is be scheduled ahead of time, and some minimum amount of time must pass between the scheduling and the new value taking effect. +- This means that we can privately prove that a historical public value cannot possibly change before some point in the future (due to the minimum delay), and therefore that our transaction will be valid **as long as it gets included before this future time**. +- In other words, we're saying "this value is public but can't change until \_\_\_". + +This results in the following key properties of `DelayedPublicMutable` state: + +- public values can only be changed after a certain delay has passed, never immediately +- the scheduling of value changes is itself public, including both the new value and the time at which the change will take effect +- transactions that read `DelayedPublicMutable` state become invalid after some time if not included in a block + +:::warning Privacy Consideration + +While `DelayedPublicMutable` state variables are much less leaky than the assertion in public approach, they do reveal some information to external observers by setting the `include_by_timestamp` property of the transaction request. The impact of this can be mitigated with proper selection of the delay value and schedule times. + +::: + +### Choosing Delays + +The `include_by_timestamp` transaction property will be set to a value close to the current timestamp plus the duration of the delay in seconds. The exact value depends on the anchor block over which the private proof is constructed. For example, if current timestamp is `X` and a `DelayedPublicMutable` state variable has a delay of 3000 seconds, then transactions that read this value privately will set `include_by_timestamp` to a value close to 'X + 3000' (clients building proofs on older state will select a lower `include_by_timestamp`). + +These delays can be changed during the contract lifetime as the application's needs evolve. + +:::tip Delay duration + +Applications using similar delays will therefore be part of the same privacy set. It is recommended to look for industry standards for these delays. For example: + +- 12 hours for time-sensitive operations, such as emergency mechanisms +- 5 days for middle-of-the-road operations +- 2 weeks for operations that require lengthy public scrutiny. + +Smaller delays are fine too. As a rule of thumb, the smaller the delay, the smaller the privacy set, so your mileage may vary. + +Additionally, you may choose to coordinate and constrain your transactions to set `include_by_timestamp` to a value lower than would be strictly needed by the applications you interact with (if any!) using some common delay, and by doing so prevent privacy leakage. + +Note that wallets can also warn users that a value change will soon take place and that sending a transaction at that time might result in reduced privacy, allowing them to choose to wait until after the epoch. + +::: + +:::info + +Even though only transactions that interact with `DelayedPublicMutable` state _need_ to set the `include_by_timestamp` property, there is no reason why transactions that do not wouldn't also set this value. + +If indeed most applications converge on a small set of delays, then wallets could opt to select any of those to populate the `include_by_timestamp` field, as if they were interacting with a `DelayedPublicMutable` state variable with that delay. + +This prevents the network-wide privacy set from being split between transactions that read `DelayedPublicMutable` state and those that don't, which is beneficial to everyone. + +::: + +### DelayedPublicMutable + +Unlike other state variables, `DelayedPublicMutable` receives not only a type parameter for the underlying datatype, but also a `DELAY` type parameter with the value change delay as a number of seconds. + +```rust +my_delayed_value: DelayedPublicMutable, +``` + +:::note +`DelayedPublicMutable` requires that the underlying type `T` implements both the `ToField` and `FromField` traits, meaning it must fit in a single `Field` value. There are plans to extend support by requiring instead an implementation of the `Serialize` and `Deserialize` traits, therefore allowing for multi-field variables, such as complex structs. +::: + +Since `DelayedPublicMutable` lives in public storage, by default its contents are zeroed-out. Intialization is performed by calling `schedule_value_change`, resulting in initialization itself being delayed. + +### `schedule_value_change` + +This is the means by which a `DelayedPublicMutable` variable mutates its contents. It schedules a value change for the variable at a future timestamp after the `DELAY` has elapsed from the current timestamp, at which point the scheduled value becomes the current value automatically and without any further action, both in public and in private. If a pending value change was scheduled but not yet effective (because insufficient time had elapsed), then the previous schedule value change is replaced with the new one and eliminated. There can only be one pending value change at a time. + +This function can only be called in public, typically after some access control check: + +```rust +#[external("public")] +fn set_my_value(new_value: MyType) { + assert_eq(storage.admin.read(), context.msg_sender().unwrap(), "caller is not admin"); + storage.my_delayed_value.schedule_value_change(new_value); +} +``` + +If one wishes to schedule a value change from private, simply enqueue a public call to a public `internal` contract function. Recall that **all scheduled value changes, including the new value and scheduled timestamp are public**. + +:::warning + +A `DelayedPublicMutable`'s storage **must** only be mutated via `schedule_value_change`. Attempting to override this by manually accessing the underlying storage slots breaks all properties of the data structure, rendering it useless. + +::: + +### `get_current_value` + +Returns the current value in a public, private or utility execution context. Once a value change is scheduled via `schedule_value_change` and the delay time passes, this automatically returns the new value. + +```rust +storage.my_delayed_value.get_current_value() +``` + +Also, calling in private will set the `include_by_timestamp` property of the transaction request, introducing a new validity condition to the entire transaction: it cannot be included in any block with a timestamp larger than `include_by_timestamp`. + +```rust +let current_value = storage.my_delayed_value.get_current_value(); +``` + +### `get_scheduled_value` + +Returns the last scheduled value change, along with the timestamp at which the scheduled value becomes the current value. This may either be a pending change, if the timestamp is in the future, or the last executed scheduled change if the timestamp is in the past (in which case there are no pending changes). + +```rust +storage.my_delayed_value.get_scheduled_value() +``` + +It is not possible to call this function in private: doing so would not be very useful at it cannot be asserted that a scheduled value change will not be immediately replaced if `shcedule_value_change` where to be called. diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/how_to_emit_event.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/how_to_emit_event.md new file mode 100644 index 000000000000..a63457dc8bf0 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/how_to_emit_event.md @@ -0,0 +1,93 @@ +--- +title: Emitting Events +tags: [contracts, events] +sidebar_position: 7 +description: Learn how to emit events from your Aztec smart contracts for offchain applications to consume. +--- + +This guide shows you how to emit events and logs from your Aztec contracts to communicate with offchain applications. + +## Prerequisites + +- An Aztec contract project set up with `aztec-nr` dependency +- Understanding of private vs public functions in Aztec +- Basic knowledge of event handling in blockchain applications + +## Emit private events + +### Emit encrypted events + +Use encrypted events to send private data to specific recipients: + +```rust +// Import from aztec.nr +use aztec::event::event_emission::emit_event_in_private; + +emit_event_in_private( + MyEvent { param1, param2, param3 }, + &mut context, + recipient, + MessageDelivery.UNCONSTRAINED_ONCHAIN, +); +``` + +:::note +Developer can choose whether to emit encrypted events or not. Emitting the events means that they will be posted to Ethereum, in blobs, and will inherit the availability guarantees of Ethereum. Developers may choose not to emit events and to share information with recipients offchain, or through alternative mechanisms that are to be developed (e.g. alternative, cheaper data availability solutions). +::: + +The `MessageDelivery` enum provides three modes: + +- `MessageDelivery.CONSTRAINED_ONCHAIN` (value: 1): Constrained encryption, guarantees correct recipient +- `MessageDelivery.UNCONSTRAINED_ONCHAIN` (value: 2): Faster but trusts sender, may lose events if tagged incorrectly +- `MessageDelivery.UNCONSTRAINED_OFFCHAIN` (value: 3): Lowest cost, requires custom offchain infrastructure + +### Event processing + +Events are automatically discovered and decrypted by the wallet when contract functions are invoked. + +## Emit public events + +Emit structured public events using the `emit` function: + +```rust +// Import from aztec.nr +use aztec::event::event_emission::emit_event_in_public; + +emit_event_in_public( + MyPublicEvent { field1: values[0], field2: values[1] }, + &mut context, +); +``` + +## Emit public logs + +### Emit unstructured data + +Emit unstructured public logs using `emit_public_log`: + +```rust +context.emit_public_log(my_value); +context.emit_public_log([1, 2, 3]); +context.emit_public_log("My message"); +``` + +### Query public events + +Query public events from offchain applications: + +```typescript +const fromBlock = await node.getBlockNumber(); +const logFilter = { + fromBlock, + toBlock: fromBlock + 1, +}; +const publicLogs = (await node.getPublicLogs(logFilter)).logs; +``` + +## Consider costs + +Event data is published to Ethereum as blobs, which incurs costs. Consider: + +- Encrypted events are optional - use alternative communication methods if needed +- Future alternatives for data availability may become available +- Balance event utility with cost implications diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/how_to_implement_custom_notes.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/how_to_implement_custom_notes.md new file mode 100644 index 000000000000..3f9309f8bba1 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/how_to_implement_custom_notes.md @@ -0,0 +1,469 @@ +--- +title: Implementing custom notes +description: Learn how to create and use custom note types for specialized private data storage in Aztec contracts +sidebar_position: 6 +tags: [smart contracts, notes, privacy] +keywords: [implementing note, note, custom note] +--- + +This guide shows you how to create custom note types for storing specialized private data in your Aztec contracts. Notes are the fundamental data structure in Aztec when working with private state. + +## Prerequisites + +- Basic understanding of [Aztec private state](../../foundational-topics/state_management.md) +- Familiarity with [notes and UTXOs](../../foundational-topics/state_management.md) +- Aztec development environment set up + +## Why create custom notes? + +You may want to create your own note type if you need to: + +- Use a specific type of private data or struct not already implemented in Aztec.nr +- Experiment with custom note hashing and nullifier schemes +- Store multiple pieces of related data together (e.g., a card in a game with multiple attributes) +- Optimize storage by combining data that's used together + +:::info Built-in Note Types +Aztec.nr provides pre-built note types for common use cases: + +**ValueNote** - For numeric values like token balances: + +```toml +# In Nargo.toml +value_note = { git="https://github.com/AztecProtocol/aztec-packages/", tag="v3.0.2", directory="noir-projects/smart-contracts/value-note" } +``` + +```rust +use value_note::value_note::ValueNote; +let note = ValueNote::new(100, owner); +``` + +**AddressNote** - For storing Aztec addresses: + +```toml +# In Nargo.toml +address_note = { git="https://github.com/AztecProtocol/aztec-packages/", tag="v3.0.2", directory="noir-projects/smart-contracts/address-note" } +``` + +```rust +use address_note::address_note::AddressNote; +let note = AddressNote::new(stored_address, owner); +``` + +If these don't meet your needs, continue reading to create your own custom note type. +::: + +## Standard note implementation + +### Creating a custom note struct + +Define your custom note with the `#[note]` macro: + +```rust +use aztec::{ + macros::notes::note, + oracle::random::random, + protocol_types::{address::AztecAddress, traits::Packable}, +}; + +// The #[note] macro marks this struct as a note type +// Required traits: +// - Eq: Allows equality comparisons between notes +// - Packable: Enables efficient packing/unpacking of the note's data +#[derive(Eq, Packable)] +#[note] +pub struct CustomNote { + // Application-specific data + value: Field, + data: u32, + // Required fields for all notes + owner: AztecAddress, // Used for access control and nullifier generation + randomness: Field, // Prevents brute-force attacks on note contents +} +``` + +The `#[note]` macro automatically implements other required traits for your note type (ex. the `NoteHash` trait). + +### Required fields + +Every custom note needs these essential fields: + +1. **Application data**: Your specific fields (e.g., `value`, `amount`, `token_id`) +2. **Owner**: Used for nullifier generation and access control (must be `AztecAddress` type) +3. **Randomness**: Prevents brute-force attacks on note contents (must be `Field` type) + +The order of fields doesn't matter, but convention is to put application data first, then owner, then randomness: + +```rust +#[derive(Eq, Packable)] +#[note] +pub struct MyNote { + // Application-specific data + data: Field, + amount: u128, + + // Required fields + owner: AztecAddress, + randomness: Field, +} +``` + +### Why randomness matters + +Without randomness, note contents can be guessed through brute force. For example, if you know someone's Aztec address, you could try hashing it with many potential values to find which note hash in the tree belongs to them. + +### Why owner is important + +The `owner` field provides two critical functions: + +1. **Access control**: Ensures only the owner can spend the note +2. **Privacy from sender**: Prevents the sender from tracking when a note is spent + +Without using the owner's nullifier key, a sender could derive the nullifier offchain and monitor when it appears in the nullifier tree, breaking privacy. + +### Implementing note methods + +A note is just a Struct, so you can add whatever methods you need. For example, you can add a constructor and helper methods: + +```rust +impl CustomNote { + pub fn new(value: Field, data: u32, owner: AztecAddress) -> Self { + // Safety: We use randomness to preserve privacy. The sender already knows + // the full note pre-image, so we trust them to cooperate in random generation + let randomness = unsafe { random() }; + + CustomNote { value, data, owner, randomness } + } + + pub fn get_value(self) -> Field { + self.value + } + + pub fn get_data(self) -> u32 { + self.data + } +} +``` + +## Custom note with custom hashing + +For complete control over note hashing and nullifier generation, use the `#[custom_note]` macro: + +```rust +use dep::aztec::{ + context::PrivateContext, + macros::notes::custom_note, + note::note_interface::NoteHash, + protocol_types::{ + constants::{GENERATOR_INDEX__NOTE_HASH, GENERATOR_INDEX__NOTE_NULLIFIER}, + hash::poseidon2_hash_with_separator, + traits::Packable, + }, +}; + +// TransparentNote for public-to-private transitions +// No owner field needed - security comes from secret knowledge +#[derive(Eq, Packable)] +#[custom_note] +pub struct TransparentNote { + amount: u128, + secret_hash: Field, // Hash of a secret that must be known to spend +} + +impl NoteHash for TransparentNote { + fn compute_note_hash(self, storage_slot: Field) -> Field { + let inputs = self.pack().concat([storage_slot]); + poseidon2_hash_with_separator(inputs, GENERATOR_INDEX__NOTE_HASH) + } + + // Custom nullifier that doesn't use owner's key + // Security is enforced by requiring the secret preimage + fn compute_nullifier( + self, + _context: &mut PrivateContext, + note_hash_for_nullification: Field, + ) -> Field { + poseidon2_hash_with_separator( + [note_hash_for_nullification], + GENERATOR_INDEX__NOTE_NULLIFIER as Field, + ) + } + + unconstrained fn compute_nullifier_unconstrained( + self, + note_hash_for_nullification: Field + ) -> Field { + self.compute_nullifier(zeroed(), note_hash_for_nullification) + } +} +``` + +This pattern is useful for "shielding" tokens - creating notes in public that can be redeemed in private by anyone who knows the secret. + +## Basic usage in storage + +Before diving into Maps, let's understand basic custom note usage. + +### Declare storage + +```rust +use dep::aztec::state_vars::{PrivateSet, PrivateImmutable}; + +#[storage] +struct Storage { + // Collection of notes for a single owner + balances: PrivateSet, + + // Single immutable configuration + config: PrivateImmutable, +} +``` + +### Insert notes + +```rust +use dep::aztec::messages::message_delivery::MessageDelivery; + +#[external("private")] +fn create_note(value: Field, data: u32) { + let owner = context.msg_sender().unwrap(); + let note = CustomNote::new(value, data, owner); + + storage.balances + .insert(note) + .emit(&mut context, owner, MessageDelivery.CONSTRAINED_ONCHAIN); +} +``` + +### Read notes + +```rust +use dep::aztec::note::note_getter_options::NoteGetterOptions; + +#[external("private")] +fn get_notes() -> BoundedVec { + storage.balances.get_notes(NoteGetterOptions::new()) +} + +#[external("private")] +fn find_note_by_value(target_value: Field) -> CustomNote { + let options = NoteGetterOptions::new() + .select(CustomNote::properties().value, target_value, Option::none()) + .set_limit(1); + + let notes = storage.balances.get_notes(options); + assert(notes.len() == 1, "Note not found"); + notes.get(0) +} +``` + +### Transfer notes + +```rust +#[external("private")] +fn transfer_note(to: AztecAddress, value: Field) { + // Find and remove from sender + let note = find_note_by_value(value); + storage.balances.remove(note); + + // Create new note for recipient + let new_note = CustomNote::new(note.value, note.data, to); + storage.balances.insert(new_note) + .emit(&mut context, to, MessageDelivery.CONSTRAINED_ONCHAIN); +} +``` + +## Using custom notes with Maps + +Maps are essential for organizing custom notes by key in private storage. They allow you to efficiently store and retrieve notes based on addresses, IDs, or other identifiers. + +### Common Map patterns + +```rust +use dep::aztec::{ + macros::notes::note, + oracle::random::random, + protocol_types::{address::AztecAddress, traits::Packable}, + state_vars::{Map, PrivateMutable, PrivateSet}, +}; + +#[derive(Eq, Packable)] +#[note] +pub struct CardNote { + points: u32, + strength: u32, + owner: AztecAddress, + randomness: Field, +} + +impl CardNote { + pub fn new(points: u32, strength: u32, owner: AztecAddress) -> Self { + let randomness = unsafe { random() }; + CardNote { points, strength, owner, randomness } + } +} + +#[storage] +struct Storage { + // Map from player address to their collection of cards + card_collections: Map, Context>, + + // Map from player address to their active card + active_cards: Map, Context>, + + // Nested maps: game_id -> player -> cards + game_cards: Map, Context>, Context>, +} +``` + +Common patterns: + +- `Map>` - Multiple notes per user (like token balances, card collections) +- `Map>` - Single note per user (like user profile, active state) +- `Map>>` - Nested organization (game sessions, channels) + +### Inserting into mapped PrivateSets + +To add notes to a mapped PrivateSet: + +```rust +use dep::aztec::messages::message_delivery::MessageDelivery; + +#[external("private")] +fn add_card_to_collection(player: AztecAddress, points: u32, strength: u32) { + let card = CardNote::new(points, strength, player); + + // Insert into the player's collection + storage.card_collections + .at(player) + .insert(card) + .emit(&mut context, player, MessageDelivery.CONSTRAINED_ONCHAIN); +} +``` + +### Using mapped PrivateMutable + +For PrivateMutable in a Map, handle both initialization and updates: + +```rust +use dep::aztec::messages::message_delivery::MessageDelivery; + +#[external("private")] +fn set_active_card(player: AztecAddress, points: u32, strength: u32) { + // Check if already initialized + let is_initialized = storage.active_cards.at(player).is_initialized(); + + if is_initialized { + // Replace existing card + storage.active_cards + .at(player) + .replace(|_old_card| CardNote::new(points, strength, player)) + .emit(&mut context, player, MessageDelivery.CONSTRAINED_ONCHAIN); + } else { + // Initialize for first time + let card = CardNote::new(points, strength, player); + storage.active_cards + .at(player) + .initialize(card) + .emit(&mut context, player, MessageDelivery.CONSTRAINED_ONCHAIN); + } +} +``` + +### Reading from mapped PrivateSets + +```rust +use dep::aztec::note::note_getter_options::NoteGetterOptions; + +#[external("private")] +fn get_player_cards(player: AztecAddress) -> BoundedVec { + // Get all cards for this player + storage.card_collections + .at(player) + .get_notes(NoteGetterOptions::new()) +} + +#[external("private")] +fn get_total_points(player: AztecAddress) -> u32 { + let options = NoteGetterOptions::new(); + let notes = storage.card_collections.at(player).get_notes(options); + + let mut total = 0; + for i in 0..notes.len() { + let card = notes.get(i); + total += card.points; + } + total +} +``` + +### Reading from mapped PrivateMutable + +```rust +#[external("private")] +fn get_active_card(player: AztecAddress) -> CardNote { + storage.active_cards.at(player).get_note() +} +``` + +### Filtering notes in Maps + +Filter notes by their fields when reading from maps: + +```rust +use dep::aztec::{note::note_getter_options::NoteGetterOptions, utils::comparison::Comparator}; + +#[external("private")] +fn find_strong_cards(player: AztecAddress, min_strength: u32) -> BoundedVec { + let options = NoteGetterOptions::new() + .select(CardNote::properties().strength, Comparator.GTE, min_strength) + .set_limit(10); + + storage.card_collections.at(player).get_notes(options) +} +``` + +### Working with nested Maps + +Navigate nested map structures to organize data hierarchically: + +```rust +use dep::aztec::messages::message_delivery::MessageDelivery; + +#[external("private")] +fn add_card_to_game( + game_id: Field, + player: AztecAddress, + points: u32, + strength: u32 +) { + let card = CardNote::new(points, strength, player); + + // Navigate nested maps: game_cards[game_id][player] + storage.game_cards + .at(game_id) + .at(player) + .insert(card) + .emit(&mut context, player, MessageDelivery.CONSTRAINED_ONCHAIN); +} + +#[external("private")] +fn get_game_cards( + game_id: Field, + player: AztecAddress +) -> BoundedVec { + storage.game_cards + .at(game_id) + .at(player) + .get_notes(NoteGetterOptions::new()) +} +``` + +## Further reading + +- [What the `#[note]` macro does](../../aztec-nr/framework-description/functions/attributes.md#implementing-notes) +- [Note lifecycle and nullifiers](../../foundational-topics/advanced/storage/indexed_merkle_tree.mdx) +- [Advanced note patterns](./advanced/how_to_retrieve_filter_notes.md) +- [Note portals for L1 communication](./how_to_communicate_cross_chain.md) +- [Macros reference](../../aztec-nr/framework-description/macros.md) +- [Keys, including npk_m_hash](../../foundational-topics/accounts/keys.md) diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/how_to_use_authwit.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/how_to_use_authwit.md new file mode 100644 index 000000000000..97468114f97c --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/how_to_use_authwit.md @@ -0,0 +1,95 @@ +--- +title: Enabling Authentication Witnesses +description: Enable contracts to execute actions on behalf of user accounts using authentication witnesses. +tags: [accounts, authwit] +sidebar_position: 11 +--- + +Authentication witnesses (authwit) allow other contracts to execute actions on behalf of your account. This guide shows you how to implement and use authwits in your Aztec smart contracts. + +## Prerequisites + +- An Aztec contract project set up with `aztec-nr` dependency +- Understanding of private and public functions in Aztec +- Access to the `authwit` library in your contract + +For conceptual background, see [Authentication Witnesses](../../foundational-topics/advanced/authwit.md). + +## Set up the authwit library + +Add the `authwit` library to your `Nargo.toml` file: + +```toml +[dependencies] +aztec = { git="https://github.com/AztecProtocol/aztec-packages/", tag="v3.0.2", directory="noir-projects/smart-contracts/aztec" } +``` + +Import the authwit library in your contract: + +```rust +use aztec::authwit::auth::compute_authwit_nullifier; +``` + +## Implement authwit in private functions + +### Validate authentication in a private function + +Check if the current call is authenticated using the `authorize_once` macro: + +```rust +#[authorize_once("from", "authwit_nonce")] +#[external("private")] +fn execute_private_action( + from: AztecAddress, + to: AztecAddress, + value: u128, + authwit_nonce: Field, +) { + storage.values.at(from).sub(from, value).deliver(encode_and_encrypt_note(&mut context, from)); + storage.values.at(to).add(to, value).deliver(encode_and_encrypt_note(&mut context, to)); +} +``` + +This allows anyone with a valid authwit (created by `from`) to execute an action on its behalf. + +## Set approval state from contracts + +Enable contracts to approve actions on their behalf by updating the public auth registry: + +1. Compute the message hash using `compute_authwit_message_hash_from_call` +2. Set the authorization using `set_authorized` + +This pattern is commonly used in bridge contracts (like the [uniswap example contract](https://github.com/AztecProtocol/aztec-packages/tree/next/noir-projects/noir-contracts/contracts/app/uniswap_contract)) where one contract needs to authorize another to perform actions on its behalf: + +```rust +#[external("public")] +#[only_self] +fn _approve_and_execute_action( + target_contract: AztecAddress, + bridge_contract: AztecAddress, + value: u128, +) { + // Since we will authorize and instantly execute the action, all in public, we can use the same nonce + // every interaction. In practice, the authwit should be squashed, so this is also cheap! + let authwit_nonce = 0xdeadbeef; + + let selector = FunctionSelector::from_signature("execute_action((Field),u128,Field)"); + let message_hash = compute_authwit_message_hash_from_call( + bridge_contract, + target_contract, + context.chain_id(), + context.version(), + selector, + [context.this_address().to_field(), value as Field, authwit_nonce], + ); + + // We need to make a call to update it. + set_authorized(&mut context, message_hash, true); + + let this_address = storage.my_address.read(); + // Execute the action! + OtherContract::at(bridge_contract) + .execute_external_action(this_address, value, this_address, authwit_nonce) + .call(&mut context) +} +``` diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/macros.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/macros.md new file mode 100644 index 000000000000..ca87fdc6aca2 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/framework-description/macros.md @@ -0,0 +1,25 @@ +--- +title: Aztec macros +description: Learn about macros available in Aztec.nr for code generation and abstraction. +sidebar_position: 8 +tags: [contracts, functions] +--- + +## All Aztec macros + +In addition to the function macros in Noir, Aztec also has its own macros for specific functions. An Aztec contract function can be annotated with more than 1 macro. +It is also worth mentioning Noir's `unconstrained` function type [here (Noir docs page)](https://noir-lang.org/docs/noir/concepts/unconstrained/). + +- `#[aztec]` - Defines a contract, placed above `contract ContractName{}` +- `#[external("...")]` - Whether the function is to be callable from outside the contract. There are 3 types of external functions: `#[external("public")]`, `#[external("private")]` or `#[external("utility")]` - The type of external defines whether the function is to be executed from a public, private or utility context (see Further Reading) +- `#[initializer]` - If one or more functions are marked as an initializer, then one of them must be called before any non-initializer functions +- `#[noinitcheck]` - The function is able to be called before an initializer (if one exists) +- `#[view]` - Makes calls to the function static +- `#[only_self]` - Available only for `external` functions - any external caller except the current contract is rejected. +- `#[internal]` - Function can only be called from within the contract and the call itself is inlined (e.g. akin to EVM's JUMP and not EVM's CALL) +- `#[note]` - Creates a custom note +- `#[storage]` - Defines contract storage + +## Further reading + +[How do Aztec macros work?](../../aztec-nr/framework-description/functions/function_transforms.md) diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/how_to_compile_contract.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/how_to_compile_contract.md new file mode 100644 index 000000000000..44d49be93aef --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/how_to_compile_contract.md @@ -0,0 +1,57 @@ +--- +title: Compiling Contracts +tags: [contracts] +sidebar_position: 2 +description: Compile your Aztec smart contracts into deployable artifacts using aztec command. +--- + +This guide shows you how to compile your Aztec contracts into artifacts ready for deployment and interaction. + +## Prerequisites + +- An Aztec contract written in Aztec.nr +- `aztec` installed +- Contract project with proper `Nargo.toml` configuration + +## Compile your contract + +Compile your Noir contracts to generate JSON artifacts: + +```bash +aztec compile +``` + +This outputs contract artifacts to the `target` folder. + +## Use generated interfaces + +The compiler automatically generates type-safe interfaces for contract interaction. + +### Import and use contract interfaces + +Use generated interfaces instead of manual function calls: + +```rust +contract FPC { + use dep::token::Token; + + #[external("private")] + fn fee_entrypoint_private(amount: Field, asset: AztecAddress, secret_hash: Field, nonce: Field) { + assert(asset == storage.other_asset.read()); + Token::at(asset).transfer_to_public(context.msg_sender(), context.this_address(), amount, nonce).call(&mut context); + FPC::at(context.this_address()).pay_fee_with_shielded_rebate(amount, asset, secret_hash).enqueue(&mut context); + } +} +``` + +:::warning +Do not import generated interfaces from the same project as the source contract to avoid circular references. +::: + +## Next steps + +After compilation, use the generated artifacts to: + +- Deploy contracts with the `Contract` class from `aztec.js` +- Interact with deployed contracts using type-safe interfaces +- Import contracts in other Aztec.nr projects diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/how_to_test_contracts.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/how_to_test_contracts.md new file mode 100644 index 000000000000..563d1f2d0eeb --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/how_to_test_contracts.md @@ -0,0 +1,340 @@ +--- +title: Testing Contracts +tags: [contracts, tests, testing, noir] +keywords: [tests, testing, noir] +sidebar_position: 3 +description: Write and run tests for your Aztec smart contracts using Noir's TestEnvironment. +--- + +This guide shows you how to test your Aztec smart contracts using Noir's `TestEnvironment` for fast, lightweight testing. + +## Prerequisites + +- An Aztec contract project with functions to test +- Basic understanding of Noir syntax + +:::tip +For complex cross-chain or integration testing, see the [TypeScript testing guide](../aztec-js/how_to_test.md). +::: + +## Write Aztec contract tests + +Use `TestEnvironment` from `aztec-nr` for contract unit testing: + +- **Fast**: Lightweight environment with mocked components +- **Convenient**: Similar to Foundry for simple contract tests +- **Limited**: No rollup circuits or cross-chain messaging + +For complex end-to-end tests, use [TypeScript testing](../aztec-js/how_to_test.md) with `aztec.js`. + +## Run your tests + +Execute Aztec Noir tests using: + +```bash +aztec test +``` + +### Test execution process + +1. Compile contracts +2. Run `aztec test` + +:::warning +Always use `aztec test` instead of `nargo test`. The `TestEnvironment` requires the TXE (Test eXecution Environment) oracle resolver. +::: + +## Basic test structure + +```rust +use crate::MyContract; +use aztec::{ + protocol_types::address::AztecAddress, + test::helpers::test_environment::TestEnvironment, +}; + +#[test] +unconstrained fn test_basic_flow() { + // 1. Create test environment + let mut env = TestEnvironment::new(); + + // 2. Create accounts + let owner = env.create_light_account(); +} +``` + +:::info Test execution notes + +- Tests run in parallel by default +- Use `unconstrained` functions for faster execution +- See all `TestEnvironment` methods [here](https://github.com/AztecProtocol/aztec-packages/blob/v3.0.2/noir-projects/aztec-nr/aztec/src/test/helpers/test_environment.nr) + +::: + +:::tip Organizing test files +You can organize tests in separate files: + +- Create `src/test.nr` with `mod utils;` to import helper functions +- Split tests into modules like `src/test/transfer_tests.nr`, `src/test/auth_tests.nr` +- Import the test module in `src/main.nr` with `mod test;` +- Share setup functions in `src/test/utils.nr` + ::: + +## Deploying contracts + +In order to test you'll most likely want to deploy a contract in your testing environment. First, instantiate a deployer: + +```rust +let deployer = env.deploy("ContractName"); + +// If on a different crate: +let deployer = env.deploy("../other_contract"); +``` + +:::warning +It is always necessary to deploy a contract in order to test it. **It is important to compile before testing**, as `aztec test` does not recompile them on changes. Think of it as regenerating the bytecode and ABI so it becomes accessible externally. +::: + +You can then choose whatever you need to initialize by interfacing with your initializer and calling it: + +```rust +let initializer = MyContract::interface().constructor(param1, param2); + +let contract_address = deployer.with_private_initializer(owner, initializer); +let contract_address = deployer.with_public_initializer(owner, initializer); +let contract_address = deployer.without_initializer(); +``` + +:::tip Reusable setup functions +Create a setup function to avoid repeating initialization code: + +```rust +pub unconstrained fn setup(initial_value: Field) -> (TestEnvironment, AztecAddress, AztecAddress) { + let mut env = TestEnvironment::new(); + let owner = env.create_light_account(); + let initializer = MyContract::interface().constructor(initial_value, owner); + let contract_address = env.deploy("MyContract").with_private_initializer(owner, initializer); + (env, contract_address, owner) +} + +#[test] +unconstrained fn test_something() { + let (env, contract_address, owner) = setup(42); + // Your test logic here +} +``` + +::: + +## Calling contract functions + +TestEnvironment provides methods for different function types: + +### Private functions + +```rust +// Call private function +env.call_private(caller, Token::at(token_address).transfer(recipient, 100)); + +// Returns the result +let result = env.call_private(owner, Contract::at(address).get_private_data()); +``` + +### Public functions + +```rust +// Call public function +env.call_public(caller, Token::at(token_address).mint_to_public(recipient, 100)); + +// View public state (read-only) +let balance = env.view_public(Token::at(token_address).balance_of_public(owner)); +``` + +### Utility/Unconstrained functions + +```rust +// Simulate utility/view functions (unconstrained) +let total = env.simulate_utility(Token::at(token_address).balance_of_private(owner)); +``` + +:::tip Helper function pattern +Create helper functions for common assertions: + +```rust +pub unconstrained fn check_balance( + env: TestEnvironment, + token_address: AztecAddress, + owner: AztecAddress, + expected: u128, +) { + assert_eq( + env.simulate_utility(Token::at(token_address).balance_of_private(owner)), + expected + ); +} +``` + +::: + +## Creating accounts + +Two types of accounts are available: + +```rust +// Light account - fast, limited features +let owner = env.create_light_account(); + +// Contract account - full features, slower +let owner = env.create_contract_account(); +``` + +:::info Account type comparison +**Light accounts:** + +- Fast to create +- Work for simple transfers and tests +- Cannot process authwits +- No account contract deployed + +**Contract accounts:** + +- Required for authwit testing +- Support account abstraction features +- Slower to create (deploys account contract) +- Needed for cross-contract authorization + ::: + +:::tip Choosing account types + +```rust +pub unconstrained fn setup(with_authwits: bool) -> (TestEnvironment, AztecAddress, AztecAddress) { + let mut env = TestEnvironment::new(); + let (owner, recipient) = if with_authwits { + (env.create_contract_account(), env.create_contract_account()) + } else { + (env.create_light_account(), env.create_light_account()) + }; + // ... deploy contracts ... + (env, owner, recipient) +} +``` + +::: + +## Testing with authwits + +[Authwits](./framework-description/how_to_use_authwit.md) allow one account to authorize another to act on its behalf. + +:::warning +Authwits require **contract accounts**, not light accounts. +::: + +### Import authwit helpers + +```rust +use aztec::test::helpers::authwit::{ + add_private_authwit_from_call_interface, + add_public_authwit_from_call_interface, +}; +``` + +### Private authwits + +```rust +#[test] +unconstrained fn test_private_authwit() { + // Setup with contract accounts (required for authwits) + let (env, token_address, owner, spender) = setup(true); + + // Create the call that needs authorization + let amount = 100; + let nonce = 7; // Non-zero nonce for authwit + let burn_call = Token::at(token_address).burn_private(owner, amount, nonce); + + // Grant authorization from owner to spender + add_private_authwit_from_call_interface(owner, spender, burn_call); + + // Spender can now execute the authorized action + env.call_private(spender, burn_call); +} +``` + +### Public authwits + +````rust +#[test] +unconstrained fn test_public_authwit() { + let (env, token_address, owner, spender) = setup(true); + + // Create public action that needs authorization + let transfer_call = Token::at(token_address).transfer_public(owner, recipient, 100, nonce); + + // Grant public authorization + add_public_authwit_from_call_interface(owner, spender, transfer_call); + + // Execute with authorization + env.call_public(spender, transfer_call); +} + +## Time traveling + +Contract calls do not advance the timestamp by default, despite each of them resulting in a block with a single transaction. Block timestamp can instead by manually manipulated by any of the following methods: + +```rust +// Sets the timestamp of the next block to be mined, i.e. of the next public execution. Does not affect private execution. +env.set_next_block_timestamp(block_timestamp); + +// Same as `set_next_block_timestamp`, but moving time forward by `duration` instead of advancing to a target timestamp. +env.advance_next_block_timestamp_by(duration); + +// Mines an empty block at a given timestamp, causing the next public execution to occur at this time (like `set_next_block_timestamp`), but also allowing for private execution to happen using this empty block as the anchor block. +env.mine_block_at(block_timestamp); +```` + +## Testing failure cases + +Test functions that should fail using annotations: + +### Generic failure + +```rust +#[test(should_fail)] +unconstrained fn test_unauthorized_access() { + let (env, contract, owner) = setup(false); + let attacker = env.create_light_account(); + + // This should fail because attacker is not authorized + env.call_private(attacker, Contract::at(contract).owner_only_function()); +} +``` + +### Specific error message + +```rust +#[test(should_fail_with = "Balance too low")] +unconstrained fn test_insufficient_balance() { + let (env, token, owner, recipient) = setup(false); + + // Try to transfer more than available + let balance = 100; + let transfer_amount = 101; + + env.call_private(owner, Token::at(token).transfer(recipient, transfer_amount)); +} +``` + +### Testing authwit failures + +```rust +#[test(should_fail_with = "Unknown auth witness for message hash")] +unconstrained fn test_missing_authwit() { + let (env, token, owner, spender) = setup(true); + + // Try to burn without authorization + let burn_call = Token::at(token).burn_private(owner, 100, 1); + + // No authwit granted - this should fail + env.call_private(spender, burn_call); +} + +``` diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/index.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/index.md new file mode 100644 index 000000000000..368b4870d80c --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/index.md @@ -0,0 +1,72 @@ +--- +title: Developing Smart Contracts +sidebar_position: 0 +tags: [aztec.nr, smart contracts] +description: Comprehensive guide to writing smart contracts for the Aztec network using Noir. +--- + +import DocCardList from "@theme/DocCardList"; + +Aztec.nr is the smart contract development framework for Aztec. It is a set of utilities that +help you write Noir programs to deploy on the Aztec network. + +## Contract Development + +### Prerequisites + +- Install [Aztec Local Network and Tooling](../../getting_started_on_local_network.md) +- Install the [Noir LSP](../aztec-nr/installation.md) for your editor. + +### Flow + +1. Write your contract and specify your contract dependencies. Every contract written for Aztec will have + aztec-nr as a dependency. Add it to your `Nargo.toml` with + +```toml +# Nargo.toml +[dependencies] +aztec = { git="https://github.com/AztecProtocol/aztec-packages/", tag="v3.0.2", directory="noir-projects/smart-contracts/aztec" } +``` + +Update your `main.nr` contract file to use the Aztec.nr macros for writing contracts. + +```rust title="setup" showLineNumbers +use dep::aztec::macros::aztec; + +#[aztec] +pub contract Counter { +``` +> Source code: docs/examples/contracts/counter_contract/src/main.nr#L1-L6 + + +and import dependencies from the Aztec.nr library. + +```rust title="imports" showLineNumbers +use aztec::{ + macros::{functions::{external, initializer}, storage::storage}, + messages::message_delivery::MessageDelivery, + oracle::debug_log::debug_log_format, + protocol_types::{address::AztecAddress, traits::ToField}, + state_vars::Owned, +}; +use balance_set::BalanceSet; +``` +> Source code: docs/examples/contracts/counter_contract/src/main.nr#L7-L16 + + +:::info + +You can see a complete example of a simple counter contract written with Aztec.nr [here](https://github.com/AztecProtocol/aztec-packages/blob/v3.0.2/docs/examples/contracts/counter_contract/src/main.nr). + +::: + +2. [Profile](./framework-description/advanced/how_to_profile_transactions.md) the private functions in your contract to get + a sense of how long generating client side proofs will take +3. Write unit tests [directly in Noir](how_to_test_contracts.md) and end-to-end + tests [with TypeScript](../aztec-js/how_to_test.md) +4. [Compile](how_to_compile_contract.md) your contract +5. [Deploy](../aztec-js/how_to_deploy_contract.md) your contract with Aztec.js + +## Section Contents + + diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/installation.md b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/installation.md new file mode 100644 index 000000000000..d054abc5d795 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/aztec-nr/installation.md @@ -0,0 +1,18 @@ +--- +title: Noir VSCode Extension +sidebar_position: 0 +tags: [local network, sandbox] +description: Learn how to install and configure the Noir Language Server for a better development experience. +--- + +Install the [Noir Language Support extension](https://marketplace.visualstudio.com/items?itemName=noir-lang.vscode-noir) to get syntax highlighting, syntax error detection and go-to definitions for your Aztec contracts. + +Once the extension is installed, check your nargo binary by hovering over Nargo in the status bar on the bottom right of the application window. Click to choose the path to `aztec` (or regular nargo, if you have that installed). + +You can print the path of your `aztec` executable by running: + +```bash +which aztec +``` + +To specify a custom nargo executable, go to the VSCode settings and search for "noir", or click extension settings on the `noir-lang` LSP plugin. Update the `Noir: Nargo Path` field to point to your desired `aztec` executable. diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/_category_.json b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/_category_.json new file mode 100644 index 000000000000..8ab61c7b48a2 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/_category_.json @@ -0,0 +1,6 @@ +{ + "label": "Foundational Topics", + "position": 0, + "collapsible": true, + "collapsed": true +} diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/accounts/_category_.json b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/accounts/_category_.json new file mode 100644 index 000000000000..1faf532854b7 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/accounts/_category_.json @@ -0,0 +1,6 @@ +{ + "label": "Accounts", + "position": 0, + "collapsible": true, + "collapsed": true +} diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/accounts/index.md b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/accounts/index.md new file mode 100644 index 000000000000..ee12f39365d5 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/accounts/index.md @@ -0,0 +1,358 @@ +--- +title: Accounts +tags: [accounts] +description: Deep dive into Aztec's native account abstraction system - understanding how smart contract accounts work, their architecture, key management, and authorization mechanisms in a privacy-preserving blockchain. +--- + +# Understanding Accounts in Aztec + +This page provides a comprehensive understanding of how accounts work in Aztec. We'll explore the architecture, implementation details, and the powerful features enabled by Aztec's native account abstraction. + +## What is Account Abstraction? + +Account abstraction fundamentally changes how we think about blockchain accounts. Instead of accounts being simple key pairs (like in Bitcoin or traditional Ethereum EOAs), accounts become programmable smart contracts that can define their own rules for authentication, authorization, and transaction execution. + +### Why Account Abstraction Matters + +Traditional blockchain accounts have significant limitations: +- **Rigid authentication**: You lose your private key, you lose everything +- **Limited authorization**: Can't easily implement multi-signature schemes or time-locked transactions +- **Fixed fee payment**: Must pay fees in the native token from the same account +- **No customization**: Can't adapt to different security requirements or use cases + +Account abstraction solves these problems by making accounts programmable. This enables: +- **Recovery mechanisms**: Social recovery, hardware wallet backups, time-delayed recovery +- **Flexible authentication**: Biometrics, passkeys, multi-factor authentication, custom signature schemes +- **Fee abstraction**: Pay fees in any token, or have someone else pay for you +- **Custom authorization**: Complex permission systems, spending limits, automated transactions + +## Aztec's Native Account Abstraction + +Unlike Ethereum where account abstraction is implemented at the application layer (ex. ERC-4337), Aztec has **native account abstraction** at the protocol level. This means: + +1. **Every account is a smart contract** - There are no externally owned accounts (EOAs) +2. **Unified experience** - All accounts have the same capabilities and flexibility +3. **Protocol-level support** - The entire network is designed around smart contract accounts +4. **Privacy-first design** - Account abstraction works seamlessly with Aztec's privacy features + +### Breaking the DoS Attack Problem + +One of the biggest challenges in account abstraction is preventing denial-of-service (DoS) attacks. If accounts can have arbitrary validation logic, malicious actors could flood the network with transactions that are expensive to validate but ultimately invalid. + +#### The Traditional Problem + +In traditional chains with account abstraction, the sequencer must execute all validation logic onchain: + +```mermaid +graph LR + A[Transaction] --> B[Sequencer validates] + B --> C[Run complex logic onchain] + C --> D[Check signatures] + C --> E[Verify conditions] +``` + +This creates a fundamental vulnerability: attackers can submit transactions with extremely complex validation logic that consumes significant computational resources, even if the transactions ultimately fail. The sequencer pays the computational cost for every check, making DoS attacks economically viable. + +#### Aztec's Solution + +Aztec solves this uniquely through zero-knowledge proofs. Instead of executing validation onchain, validation happens client-side: + +```mermaid +graph LR + A[Transaction] --> B[Client validates] + B --> C[Generate ZK proof] + C --> D[Sequencer verifies proof] +``` + +With this approach: +- **Client performs validation**: All complex logic runs on the user's device +- **Proof generation**: The client generates a succinct ZK proof that validation succeeded +- **Constant verification cost**: The sequencer only verifies the proof - a constant-time operation regardless of validation complexity + +This means we can have: + +- **Unlimited validation complexity** without affecting network performance +- **Free complex operations** like verifying 100 signatures or checking complex conditions +- **Better privacy** as validation logic isn't visible onchain + +## How Aztec Accounts Work + +### Account Architecture + +Every Aztec account is a smart contract with a specific structure. At its core, an account contract must: + +1. **Authenticate transactions** - Verify that the transaction is authorized by the account owner +2. **Execute calls** - Perform the requested operations (transfers, contract calls, etc.) +3. **Manage keys** - Handle the various keys used for privacy and authentication +4. **Handle fees** - Determine how transaction fees are paid + +### The Account Contract Structure + +Here's the essential structure of an Aztec account contract: + +```mermaid +graph TD + A[Transaction Request] --> B[Entrypoint Function] + B --> C{Authenticate} + C -->|Valid| D[Execute Fee Payments] + C -->|Invalid| E[Reject Transaction] + D --> F[Execute App Calls] + F --> G{Cancellable?} + G -->|Yes| H[Emit Cancellation Nullifier] + G -->|No| I[Complete] + H --> I + + style C fill:#f9f,stroke:#333 + style E fill:#f66,stroke:#333 + style I fill:#6f6,stroke:#333 +``` + +The entrypoint function follows this pattern: + +1. **Authentication** - Verify the transaction is authorized (signatures, multisig, etc.) +2. **Fee Payment** - Execute fee payment calls through the fee payload +3. **Application Execution** - Execute the actual application calls +4. **Cancellation Handling** - Optionally emit a nullifier for transaction cancellation + +### Address Derivation + +Aztec addresses are **deterministic** - they can be computed before deployment. An address is derived from: + +``` +Address = hash( + public_keys_hash, // All the account's public keys + partial_address // Contract deployment information +) +``` + +Where: + +- **public_keys_hash** = Combined hash of nullifier, incoming viewing, and other keys +- **partial_address** = Hash of the contract code and deployment parameters + +This deterministic addressing enables powerful features: + +- **Pre-funding**: Send funds to an address before the account is deployed +- **Counterfactual deployment**: Interact with an account as if it exists, deploy it later +- **Address recovery**: Recompute addresses from known keys + +#### Complete Address + +While an address alone is sufficient for receiving funds, spending notes requires a **complete address** which includes: + +- All the user's public keys (nullifier, incoming viewing, etc.) +- The partial address (contract deployment information) +- The contract address itself + +The complete address proves that the nullifier key inside the address is correct, enabling the user to spend their notes. + +## Keys and Privacy + +Aztec accounts use multiple specialized key pairs instead of a single key like traditional blockchains. This separation enables powerful privacy features: + +- Different keys for different purposes (spending, viewing, authorization) +- Per-application key isolation for damage limitation +- Flexible permission models without compromising security + +For detailed information about the four key types (nullifier, incoming viewing, address, and signing keys) and how they work together, see the [Keys documentation](./keys.md). + +## The Entrypoint Pattern + +The entrypoint is the gateway to your account. When someone wants to execute a transaction from your account, they call the entrypoint with a payload describing what to do. + +### Transaction Flow + +Here's how a transaction flows through an account: + +```mermaid +sequenceDiagram + participant User + participant Wallet + participant Account Contract + participant Target Contracts + + User->>Wallet: Request transaction (transfer, swap, etc.) + Wallet->>Wallet: Create payload & sign + Wallet->>Account Contract: Call entrypoint(payload, signature) + Account Contract->>Account Contract: Verify signature + Account Contract->>Target Contracts: Execute requested calls + Account Contract->>Account Contract: Pay fees + Account Contract->>Account Contract: Emit cancellation nullifier (if cancellable) + Account Contract-->>User: Transaction complete +``` + +### Non-Standard Entrypoints + +The beauty of account abstraction is that not every contract needs authentication. Some contracts can have **permissionless entrypoints**. + +For example, a lottery contract where anyone can trigger the payout: + +- No authentication required +- Anyone can call the function +- The contract itself handles the logic and constraints + +This pattern is useful for: + +- **Automated operations**: Keepers can trigger time-based actions +- **Public goods**: Anyone can advance the state of a protocol +- **Gasless transactions**: Users don't need to hold fee tokens + +:::info +**msg_sender behavior in different entrypoint contexts:** +- If no contract `entrypoint` is used: `msg_sender` is set to `Field.max` +- In a private to public `entrypoint`: `msg_sender` is the contract making the private to public call +- When calling the `entrypoint` on an account contract: `msg_sender` is set to the account contract address +::: + +## Account Lifecycle + +### 1. Pre-deployment (Counterfactual State) + +Before deployment, an account exists in a **counterfactual state**: +- The address can be computed deterministically +- Can receive funds (notes can be encrypted to the address) +- Cannot send transactions (no code deployed) + +### 2. Deployment + +Deploying an account involves: +1. Submitting the account contract code +2. Registering in the `ContractInstanceRegistry` +3. Paying deployment fees (either self-funded or sponsored) + +```typescript +// Deploy with own fees +await account.deploy().wait(); + +// Deploy with sponsored fees +await account.deploy({ + fee: { paymentMethod: sponsoredFeePayment } +}).wait(); +``` + +### 3. Initialization + +Accounts can be initialized for different purposes: + +- **Private-only**: Just needs initialization, no public deployment +- **Public interaction**: Requires both initialization and deployment + +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]`). + +:::note +Account deployment and initialization are not required to receive notes. The user address is deterministically derived, so funds can be sent to an account that hasn't been deployed yet. +::: + +### 4. Active Use + +Once deployed and initialized, accounts can: +- Send and receive private notes +- Interact with public and private functions +- Authorize actions via authentication witnesses +- Pay fees in various ways + +## Authentication Witnesses (AuthWit) + +Aztec replaces Ethereum's dangerous "infinite approval" pattern with **Authentication Witnesses** - a more secure authorization scheme where users sign specific actions rather than granting blanket permissions. + +Instead of approving unlimited token transfers, users authorize exact actions with precise parameters. This eliminates persistent security risks while enabling better UX through batched operations. + +For detailed information about how AuthWit works in both private and public contexts, see the [Authentication Witness documentation](../advanced/authwit.md). + +## Transaction Abstractions + +Aztec abstracts two critical components of transactions that are typically rigid in other blockchains: nonces and fees. + +### Nonce Abstraction + +Unlike Ethereum where nonces are sequential counters enforced by the protocol, Aztec lets account contracts implement their own replay protection. + +**Different nonce strategies possible:** + +| Strategy | How it Works | Benefits | +|----------|--------------|----------| +| **Sequential** (like Ethereum) | Must use nonces in order (1, 2, 3...) | Simple, predictable ordering | +| **Unordered** (like Bitcoin) | Any unused nonce is valid | Parallel transactions, no blocking | +| **Time-windowed** | Nonces valid only in specific time periods | Automatic expiration, batching | +| **Merkle-tree based** | Nonces from a pre-committed set | Privacy, batch pre-authorization | + +This enables: +- **Parallel transactions**: No need to wait for one tx to complete before sending another +- **Custom cancellation**: Define your own rules for replacing/cancelling transactions +- **Flexible ordering**: Implement priority queues, batching, or time-based ordering + +### Fee Abstraction + +Unlike traditional blockchains where users must pay fees in the native token, Aztec accounts can implement custom fee payment logic: + +- **Pay with any token** through integrated swaps +- **Sponsored transactions** where applications pay for users +- **Meta-transactions** with relayer networks +- **Custom payment models** like subscriptions or paymasters + +This flexibility is crucial for user onboarding and enables gasless experiences. For detailed information about fee mechanics and payment options, see the [Fees documentation](../fees.md). + +## Practical Implementation Patterns + +Here are conceptual patterns for different types of accounts: + +### Simple Signature Account + +**Pattern**: Single key controls the account +- Verify one signature against a stored public key +- Execute transaction if signature is valid +- Similar to traditional EOA but programmable + +### Multisig Account + +**Pattern**: Multiple keys with threshold requirement +- Store multiple owner public keys +- Require M-of-N signatures to authorize +- Count valid signatures and check threshold +- Useful for shared treasuries or high-security accounts + +### Social Recovery Account + +**Pattern**: Main key with backup recovery mechanism +- Primary key for normal operations +- Set of recovery keys held by trusted parties +- Recovery process with time delay for security +- Protects against key loss while preventing immediate takeover + +### Time-Locked Account + +**Pattern**: Transactions with mandatory delay +- Queue transactions with future execution time +- Allow cancellation during waiting period +- Useful for high-value operations or governance + +### Session Key Account + +**Pattern**: Temporary keys with limited permissions +- Main key delegates limited authority to session keys +- Restrictions on amount, time, or function calls +- Ideal for gaming or automated transactions + +## How-to Guides + +Ready to implement accounts in your application? Check out these guides: + +- [Create an account](../../aztec-js/how_to_create_account.md) - Step-by-step account creation +- [Deploy contracts](../../aztec-js/how_to_deploy_contract.md) - Using your account to deploy contracts +- [Use authentication witnesses](../../aztec-js/how_to_use_authwit.md) - Implement authorization patterns +- [Pay fees](../../aztec-js/how_to_pay_fees.md) - Different fee payment methods +- [Send transactions](../../aztec-js/how_to_send_transaction.md) - Execute transactions from your account + +## Summary + +Aztec's account abstraction represents a fundamental redesign of how blockchain accounts work: + +- **Every account is a smart contract** with customizable logic +- **Multiple specialized keys** provide privacy and security separation +- **Flexible authentication** supports any signature scheme or validation logic +- **Authentication witnesses** replace dangerous approval patterns +- **Abstracted nonces and fees** enable parallel transactions and flexible payment + +This creates a platform where users can have accounts that match their security needs, from simple single-signature accounts to complex multi-party governance structures, all while maintaining privacy through zero-knowledge proofs. + +The beauty of Aztec's approach is that complexity in validation doesn't increase network costs - whether you're checking one signature or one hundred, the network only verifies a single proof. This opens up possibilities that simply aren't practical on other blockchains. diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/accounts/keys.md b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/accounts/keys.md new file mode 100644 index 000000000000..a72bdf97ec0a --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/accounts/keys.md @@ -0,0 +1,320 @@ +--- +title: Keys +tags: [accounts, keys] +description: Understand the specialized key pairs used in Aztec accounts - nullifier keys, address keys, incoming viewing keys, and signing keys - and how they enable privacy, security, and flexible authentication. +--- + +import Image from "@theme/IdealImage"; + +## Account Keys in Aztec + +Unlike traditional blockchains where accounts use a single key pair, Aztec accounts use **multiple specialized key pairs**, each serving a distinct cryptographic purpose. This separation is fundamental to Aztec's privacy model and enables powerful security features that aren't possible with single-key systems. + +## Why Multiple Keys? + +The separation of keys in Aztec serves critical purposes: + +- **Privacy isolation**: Different keys for different operations prevent correlation attacks +- **Selective disclosure**: Share viewing access without compromising spending ability +- **Damage limitation**: If one key is compromised, others remain secure +- **Flexible authorization**: Choose any authentication method without affecting core protocol keys +- **Per-application security**: Keys can be scoped to specific contracts to minimize exposure + +This multi-key architecture is what enables Aztec to provide strong privacy guarantees while maintaining flexibility and security. + +## The Four Key Types + +Each Aztec account is backed by four distinct key pairs: + +| Key Type | Purpose | Protocol Managed | Rotatable | +|----------|---------|-----------------|-----------| +| **Nullifier Keys** | Spending notes (destroying private state) | Yes | No | +| **Incoming Viewing Keys** | Decrypting received notes | Yes | No | +| **Signing Keys** | Transaction authorization | No (app-defined) | Yes | +| **Address Keys** | Address derivation and note encryption setup | Yes | No | + +The first three key pairs are embedded into the protocol and cannot be changed once an account is created. The signing key is abstracted to the account contract developer, allowing complete flexibility in authentication methods. + +### Nullifier Keys + +**Purpose**: Spending notes (private state consumption) + +Nullifier keys enable spending private notes. When using a note (like spending a token), the spender must prove they have the right to nullify it - essentially marking it as "spent" without revealing which note is being spent. + +**How it works:** + +1. Each account has a master nullifier key pair (`Npk_m`, `nsk_m`) +2. For each application, an **app-siloed** key is derived: `nsk_app = hash(nsk_m, app_contract_address)` +3. To spend a note, compute its nullifier using the note hash and app-siloed key +4. The protocol verifies the app-siloed key comes from your master key and that your master public key is in your address + +This ensures only the rightful owner can spend notes, while the app-siloing provides additional security isolation between contracts. + +:::tip + +This last point could be confusing for most developers: how could a protocol verify a secret key is derived from another secret key without knowing it? Well, _you_ make that derivation, generating a ZK proof for it. The protocol just verifies that ZK proof! + +::: + +### Incoming Viewing Keys + +**Purpose**: Receiving and decrypting private notes + +Incoming viewing keys enable private information to be shared with recipients. The sender uses the recipient's public viewing key (`Ivpk`) to encrypt notes, and the recipient uses their secret viewing key (`ivsk`) to decrypt them. + +**The encryption flow:** + +```mermaid +graph TB + A[Sender generates
ephemeral key esk] --> B[Computes shared secret
S = esk × AddressPublicKey] + B --> C[Derives encryption key
key = hash S] + C --> D[Encrypts note
ciphertext = AES note, key] + D --> E[Sends: Epk, ciphertext] + + E -.->|transmitted| F[Recipient computes
S = Epk × address_sk] + F --> G[Derives same key
key = hash S] + G --> H[Decrypts note] +``` + +This uses elliptic curve Diffie-Hellman: both parties compute the same shared secret `S`, but only the recipient has the private key needed to decrypt. + +Like nullifier keys, incoming viewing keys are **app-siloed** for each contract, enabling per-application auditability - you can share a viewing key for one app without exposing your activity in others. + +### Signing Keys + +**Purpose**: Transaction authorization (optional, application-defined) + +Unlike the previous three key types which are protocol-mandated, signing keys are **completely abstracted** - thanks to [native account abstraction](./index.md), any authorization method can be implemented: + +- **Signature-based**: ECDSA, Schnorr, BLS, multi-signature +- **Biometric**: Face ID, fingerprint +- **Web2 credentials**: Google OAuth, passkeys +- **Custom logic**: Time locks, spending limits, multi-party authorization + +**Traditional signature approach:** + +When using signatures, the account contract validates the signature against a stored public key. Here's an example from the Schnorr account contract: + +```rust title="is_valid_impl" showLineNumbers +// Load public key from storage +let storage = Storage::init(context); +let public_key = storage.signing_public_key.get_note(); + +// Load auth witness +// Safety: The witness is only used as a "magical value" that makes the signature verification below pass. +// Hence it's safe. +let witness: [Field; 64] = unsafe { get_auth_witness(outer_hash) }; +let mut signature: [u8; 64] = [0; 64]; +for i in 0..64 { + signature[i] = witness[i] as u8; +} + +let pub_key = std::embedded_curve_ops::EmbeddedCurvePoint { + x: public_key.x, + y: public_key.y, + is_infinite: false, +}; +// Verify signature of the payload bytes +schnorr::verify_signature(pub_key, signature, outer_hash.to_be_bytes::<32>()) +``` +> Source code: noir-projects/noir-contracts/contracts/account/schnorr_account_contract/src/main.nr#L93-L114 + + +The flexibility of signing key storage and rotation is entirely up to your account contract implementation. + +### Address Keys + +**Purpose**: Address derivation and note encryption setup + +Address keys are the foundation for [deterministic address computation](./index.md#address-derivation). They enable a critical feature: anyone can encrypt notes to your address without needing additional keys, just your address. + +The address key pair consists of: + +- Private key: `address_sk = pre_address + ivsk` +- Public key: `AddressPublicKey = address_sk * G` (elliptic curve point) + +#### How Addresses are Computed + +The `pre_address` binds together your keys and account contract code, making each address unique and deterministic: + + + +``` +pre_address = hash(public_keys_hash, partial_address) + +where: + public_keys_hash = hash(Npk_m, Ivpk_m, Ovpk_m, Tpk_m) + partial_address = hash(contract_class_id, salted_initialization_hash) + contract_class_id = hash(artifact_hash, fn_tree_root, public_bytecode_commitment) + salted_initialization_hash = hash(deployer_address, salt, constructor_hash) +``` + +This derivation ensures: + +- Your address is deterministic (can be computed before deployment) +- Keys and contract code are cryptographically bound to the address +- The address proves ownership of the nullifier key needed to spend notes + +:::note +While the `Ovpk` (outgoing viewing key) exists in the protocol, it is not currently used. It's available for future protocol upgrades or custom implementations. +::: + +## Key Management + +### Key Generation and Derivation + +Protocol keys (nullifier, address, and incoming viewing keys) are automatically generated by the [Private Execution Environment (PXE)](../pxe/index.md) when creating an account. The PXE handles: + +- Initial key pair generation +- App-siloed key derivation +- Secure key storage and oracle access +- Key material never leaves the client + +All keys use elliptic curve cryptography on the Grumpkin curve: + +- Secret keys are scalars +- Public keys are elliptic curve points (secret × generator point) +- Exception: Address private key uses `address_sk = pre_address + ivsk` + +Signing keys are application-defined and managed by your account contract logic. + +### App-Siloed Keys + +Nullifier and incoming viewing keys are **app-siloed** - scoped to each contract that uses them. This provides crucial security isolation: + +**How it works:** +``` +nsk_app = hash(nsk_m, app_contract_address) +ivsk_app = hash(ivsk_m, app_contract_address) +``` + +**Security benefits:** + +1. **Damage containment**: If a key for one app leaks, other apps remain secure +2. **Selective auditability**: Share viewing access for one app without exposing entire activity +3. **Privacy preservation**: Activity in different apps cannot be correlated via keys + +For example, a block explorer could be given a viewing key for a DEX contract to display trades, while keeping activity in other contracts completely private. + +### Key Rotation + +**Protocol keys (nullifier, address, incoming viewing):** Cannot be rotated. They are embedded in the address, which is immutable. If compromised, a new account must be deployed. + +**Signing keys:** Fully rotatable, depending on the account contract implementation. Options include: + +- Change keys on a schedule +- Rotate after suspicious activity +- Implement time-delayed rotation for security +- Use different storage patterns that enable rotation (mutable notes, delayed public state, keystore contracts) + +## Signing Key Storage Patterns + +Since signing keys are application-defined, how the public key is stored is entirely up to the account contract design. Each approach has different trade-offs: + +### Immutable Private Note (Recommended for Most Cases) + +Stores the key in a private note that is never nullified, providing the best balance of security and cost. + +```rust title="public_key" showLineNumbers +signing_public_key: SinglePrivateImmutable, +``` +> Source code: noir-projects/noir-contracts/contracts/account/schnorr_account_contract/src/main.nr#L35-L37 + + +**Pros:** + +- No additional cost per transaction +- Key remains private +- Simple implementation + +**Cons:** + +- Cannot rotate the key +- If key is compromised, must deploy a new account + +:::note Wallet Responsibilities +Private note storage relies on wallet infrastructure: + +- Wallets must backup all notes for device restoration +- Notes can exist locally (PXE only) or be broadcast encrypted to yourself (exists onchain) +::: + +### Mutable Private Note + +Stores the key in a note that can be updated, enabling key rotation. + +**Pros:** + +- Supports key rotation +- Key remains private + +**Cons:** + +- Each transaction nullifies and recreates the note (expensive) +- Higher cost per transaction + +### Delayed Public Mutable State + +Stores the key in [delayed public mutable state](../../aztec-nr/framework-description/how_to_define_storage.md#delayed-public-mutable) - publicly accessible but privately readable with a delay window. + +**Pros:** + +- Supports key rotation +- No extra nullifiers/commitments per transaction + +**Cons:** + +- Transactions have time-to-live constraints (determined by delay window) +- Minimum delays restrict rotation frequency +- Key is public + +### Keystore Contract + +Stores keys in a separate contract that multiple accounts can reference. + +**Pros:** + +- One keystore serves multiple accounts +- Centralized key management +- No fee overhead (just proving time) + +**Cons:** + +- Higher proving time per transaction +- More complex architecture + +## Non-Account Contracts with Keys + +Typically, only account contracts have non-default public keys. However, some contracts like **escrow** or **custodial** contracts need keys even though they aren't accounts. + +**Example: Betting Escrow** + +A betting contract acts as the "owner" of escrowed funds: + +1. The escrow contract has a registered `Npk_m` +2. Both betting participants know the escrow's `nsk_m` +3. Only the winner (who provides proof of winning) can nullify the escrow's notes +4. The contract logic determines who can use the nullifier key + +This pattern enables trustless escrow while maintaining privacy - the funds are locked in notes that only the contract's logic can unlock. + +## Summary + +Aztec's multi-key architecture is fundamental to its privacy and security model: + +| Key Type | Purpose | App-Siloed | Rotatable | Managed By | +|----------|---------|------------|-----------|------------| +| **Nullifier** | Spend notes | Yes | No | Protocol (PXE) | +| **Address** | Address derivation | No | No | Protocol (PXE) | +| **Incoming Viewing** | Decrypt received notes | Yes | No | Protocol (PXE) | +| **Signing** | Transaction authorization | N/A | Yes | Application | + +**Key takeaways:** + +- **Separation enables privacy**: Different keys for different operations prevent correlation and limit damage from compromise +- **App-siloing adds security**: Per-contract keys isolate risk and enable selective disclosure +- **Flexibility in authorization**: Signing keys are completely abstracted - use any authentication method +- **Protocol keys are permanent**: Nullifier, address, and viewing keys are embedded in your address and cannot be changed +- **Client-side security**: All key material is generated and managed in the PXE, never exposed to the network + +This architecture allows Aztec to provide strong privacy guarantees while maintaining the flexibility needed for various security models and use cases. diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/_category_.json b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/_category_.json new file mode 100644 index 000000000000..a7eeb8fdaacc --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/_category_.json @@ -0,0 +1,6 @@ +{ + "label": "Advanced Topics", + "position": 9, + "collapsible": true, + "collapsed": true +} diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/authwit.md b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/authwit.md new file mode 100644 index 000000000000..6d07f20597d8 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/authwit.md @@ -0,0 +1,146 @@ +--- +title: Authentication Witness (Authwit) +tags: [accounts, authwit] +sidebar_position: 2 +keywords: [authwit, authentication witness, accounts] +description: Learn about Aztec's Authentication Witness scheme that enables secure third-party actions on behalf of users, providing a privacy-preserving alternative to traditional token approvals. +--- + + + +import Image from "@theme/IdealImage"; + +Authentication Witness is a scheme for authenticating actions on Aztec, so users can allow third-parties (eg protocols or other users) to execute an action on their behalf. + +## Background + +When building DeFi or other smart contracts, it is often desired to interact with other contracts to execute some action on behalf of the user. For example, when you want to deposit funds into a lending protocol, the protocol wants to perform a transfer of [ERC20](https://eips.ethereum.org/EIPS/eip-20) tokens from the user's account to the protocol's account. + +In the EVM world, this is often accomplished by having the user `approve` the protocol to transfer funds from their account, and then calling a `deposit` function on it afterwards. + + + +This flow makes it rather simple for the application developer to implement the deposit function, but does not come without its downsides. + +One main downside, which births a bunch of other issues, is that the user needs to send two transactions to make the deposit - first the `approve` and then the `deposit`. + +To limit the annoyance for return-users, some front-ends will use the `approve` function with an infinite amount, which means that the user will only have to sign the `approve` transaction once, and every future `deposit` will then use some of that "allowance" to transfer funds from the user's account to the protocol's account. + +This can lead to a series of issues though, eg: + +- The user is not aware of how much they have allowed the protocol to transfer. +- The protocol can transfer funds from the user's account at any time. This means that if the protocol is rugged or exploited, it can transfer funds from the user's account without the user having to sign any transaction. This is especially an issue if the protocol is upgradable, as it could be made to steal the user's approved funds at any time in the future. + +To avoid this, many protocols implement the `permit` flow, which uses a meta-transaction to let the user sign the approval offchain, and pass it as an input to the `deposit` function, that way the user only has to send one transaction to make the deposit. + + + +This is a great improvement to infinite approvals, but still has its own sets of issues. For example, if the user is using a smart-contract wallet (such as Argent or Gnosis Safe), they will not be able to sign the permit message since the usual signature validation does not work well with contracts. [EIP-1271](https://eips.ethereum.org/EIPS/eip-1271) was proposed to give contracts a way to emulate this, but it is not widely adopted. + +Separately, the message that the user signs can seem opaque to the user and they might not understand what they are signing. This is generally an issue with `approve` as well. + +All of these issues have been discussed in the community for a while, and there are many proposals to solve them. However, none of them have been widely adopted - ERC20 is so commonly used and changing a standard is hard. + +## In Aztec + +Adopting ERC20 for Aztec is not as simple as it might seem because of private state. + +If you recall from the [Hybrid State model](../state_management.md), private state is generally only known by its owner and those they have shared it with. Because it relies on secrets, private state might be "owned" by a contract, but it needs someone with knowledge of these secrets to actually spend it. You might see where this is going. + +If we were to implement the `approve` with an allowance in private, you might know the allowance, but unless you also know about the individual notes that make up the user's balances, it would be of no use to you! It is private after all. To spend the user's funds you would need to know the decryption key, see [keys for more](../accounts/keys.md). + +While this might sound limiting in what we can actually do, the main use of approvals have been for simplifying contract interactions that the user is doing. In the case of private transactions, this is executed on the user device, so it is not a blocker that the user need to tell the executor a secret - the user is the executor! + +### So what can we do? + +A few more things we need to remember about private execution: + +- To stay private, it all happens on the user device. +- Because it happens on the user device, additional user-provided information can be passed to the contract mid-execution via an oracle call. + +For example, when executing a private transfer, the wallet will be providing the notes that the user wants to transfer through one of these oracle calls instead of the function arguments. This allows us to keep the function signature simple, and have the user provide the notes they want to transfer through the oracle call. + +For a transfer, it could be the notes provided, but we could also use the oracle to provide any type of data to the contract. So we can borrow the idea from `permit` that the user can provide a signature (or witness) to the contract which allows it to perform some action on behalf of the user. + +:::info Witness or signature? +The doc refers to a witness instead of a signature because it is not necessarily a signature that is required to convince the account contract that we are allowed to perform the action. It depends on the contract implementation, and could also be a password or something similar. +::: + +Since the witness is used to authenticate that someone can execute an action on behalf of the user, we call it an Authentication Witness or `AuthWit` for short. An "action", in this meaning, is a blob of data that specifies what call is approved, what arguments it is approved with, and the actor that is authenticated to perform the call. + +In practice, this blob is currently outlined to be a hash of the content mentioned, but it might change over time to make ["simulating simulations"](https://discourse.aztec.network/t/simulating-simulations/2218) easier. + +Outlined more clearly, we have the following, where the `H` is a SNARK-friendly hash function and `argsHash` is the hash of function arguments: + +```rust +authentication_witness_action = H( + caller: AztecAddress, + contract: AztecAddress, + selector: Field, + argsHash: Field +); +``` + +To outline an example as mentioned earlier, let's say that we have a token that implements `AuthWit` such that transfer funds from A to B is valid if A is doing the transfer, or there is a witness that authenticates the caller to transfer funds from A's account. While this specifies the spending rules, one must also know of the notes to use them for anything. This means that a witness in itself is only half the information. + +Creating the authentication action for the transfer of funds to the Defi contract would look like this: + +```rust +action = H(defi, token, transfer_selector, H(alice_account, defi, 1000)); +``` + +This can be read as "defi is allowed to call token transfer function with the arguments (alice_account, defi, 1000)". + +With this out of the way, let's look at how this would work in the graph below. The exact contents of the witness will differ between implementations as mentioned before, but for the sake of simplicity you can think of it as a signature, which the account contract can then use to validate if it really should allow the action. + + + +:::info Static call for AuthWit checks +The call to the account contract for checking authentication should be a static call, meaning that it cannot change state or make calls that change state. If this call is not static, it could be used to re-enter the flow and change the state of the contract. +::: + +:::danger Re-entries +The above flow could be re-entered at token transfer. It is mainly for show to illustrate a logic outline. +::: + +### What about public + +As noted earlier, we could use the ERC20 standard for public. But this seems like a waste when we have the ability to try righting some wrongs. Instead, we can expand our AuthWit scheme to also work in public. This is actually quite simple, instead of asking an oracle (which we can't do as easily because not private execution) we can just store the AuthWit in a shared registry, and look it up when we need it. While this needs the storage to be updated ahead of time (can be same tx), we can quite easily do so by batching the AuthWit updates with the interaction - a benefit of Account Contracts. A shared registry is used such that execution from the sequencers point of view will be more straight forward and predictable. Furthermore, since we have the authorization data directly in public state, if they are both set and unset (authorized and then used) in the same transaction, there will be no state effect after the transaction for the authorization which saves gas ⛽. + + + +### Replays + +To ensure that the authentication witness can only be used once, we can emit the action itself as a nullifier. This way, the authentication witness can only be used once. This is similar to how notes are used, and we can use the same nullifier scheme for this. + +Note however, that it means that the same action cannot be authenticated twice, so if you want to allow the same action to be authenticated multiple times, we should include a nonce in the arguments, such that the action is different each time. + +For the transfer, this could be done simply by appending a nonce to the arguments. + +```rust +action = H(defi, token, transfer_selector, H(alice_account, defi, 1000, nonce)); +``` + +Beware that the account contract will be unable to emit the nullifier since it is checked with a static call, so the calling contract must do it. This is similar to nonces in ERC20 tokens today. We provide a small library that handles this. + +### Differences to approval + +The main difference is that we are not setting up an allowance, but allowing the execution of a specific action. We decided on this option as the default since it is more explicit and the user can agree exactly what they are signing. + +Also, most uses of the approvals are for contracts where the following interactions are called by the user themselves, so it is not a big issue that they are not as easily "transferrable" as the `permit`s. + +:::note + +Authwits only work for a single user to authorize actions on contracts that their account is calling. You cannot authorize other users to take actions on your behalf. + +::: + +In order for another user to be able to take actions on your behalf, they would need access to your nullifier secret key so that they could nullify notes for you, but they should not have access to your nullifier secret key. + +### Other use-cases + +We don't need to limit ourselves to the `transfer` function, we can use the same scheme for any function that requires authentication. For example, for authenticating to burn, transferring assets from public to private, or to vote in a governance contract or perform an operation on a lending protocol. + +### Next Steps + +Check out the [developer documentation](../../aztec-nr/framework-description/how_to_use_authwit.md) to see how to implement this in your own contracts. diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/circuits/_category_.json b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/circuits/_category_.json new file mode 100644 index 000000000000..611f5ed6919f --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/circuits/_category_.json @@ -0,0 +1,6 @@ +{ + "label": "Circuits", + "position": 3, + "collapsible": true, + "collapsed": true +} diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/circuits/index.md b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/circuits/index.md new file mode 100644 index 000000000000..ffd6a9e78d21 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/circuits/index.md @@ -0,0 +1,67 @@ +--- +title: Circuits +sidebar_position: 2 +tags: [protocol, circuits] +description: Explore Aztec's core protocol circuits that enforce privacy rules and transaction validity through zero-knowledge proofs, enabling private state and function execution. +--- + +Central to Aztec's operations are 'circuits' derived both from the core protocol and the developer-written Aztec.nr contracts. + +The core circuits enhance privacy by adding additional security checks and preserving transaction details - a characteristic Ethereum lacks. + +On this page, you’ll learn a bit more about these circuits and their integral role in promoting secure and efficient transactions within Aztec's privacy-centric framework. + +## Motivation + +In Aztec, circuits come from two sources: + +1. Core protocol circuits +2. User-written circuits (written as Aztec.nr Contracts and deployed to the network) + +This page focuses on the core protocol circuits. These circuits check that the rules of the protocol are being adhered to. + +When a function in an Ethereum smart contract is executed, the EVM performs checks to ensure that Ethereum's transaction rules are being adhered-to correctly. Stuff like: + +- "Does this tx have a valid signature?" +- "Does this contract address contain deployed code?" +- "Does this function exist in the requested contract?" +- "Is this function allowed to call this function?" +- "How much gas has been paid, and how much is left?" +- "Is this contract allowed to read/update this state variable?" +- "Perform the state read / state write" +- "Execute these opcodes" + +All of these checks have a computational cost, for which users are charged gas. + +Many existing L2s move this logic offchain, as a way of saving their users gas costs, and as a way of increasing tx throughput. + +zk-Rollups, in particular, move these checks offchain by encoding them in zk-S(N/T)ARK circuits. Rather than paying a committee of Ethereum validators to perform the above kinds of checks, L2 users instead pay a sequencer to execute these checks via the circuit(s) which encode them. The sequencer can then generate a zero-knowledge proof of having executed the circuit(s) correctly, which they can send to a rollup contract on Ethereum. The Ethereum validators then verify this zk-S(N/T)ARK. It often turns out to be much cheaper for users to pay the sequencer to do this, than to execute a smart contract on Ethereum directly. + +But there's a problem. + +Ethereum (and the EVM) doesn't have a notion of privacy. + +- There is no notion of a private state variable in the EVM. +- There is no notion of a private function in the EVM. + +So users cannot keep private state variables' values private from Ethereum validators, nor from existing (non-private) L2 sequencers. Nor can users keep the details of which function they've executed private from validators or sequencers. + +How does Aztec add privacy? + +Well, we just encode _extra_ checks in our zk-Rollup's zk-SNARK circuits! These extra checks introduce the notions of private state and private functions, and enforce privacy-preserving constraints on every transaction being sent to the network. + +In other words, since neither the EVM nor other rollups have rules for how to preserve privacy, we've written a new rollup which introduces such rules, and we've written circuits to enforce those rules! + +What kind of extra rules / checks does a rollup need, to enforce notions of private states and private functions? Stuff like: + +- "Perform state reads and writes using new tree structures which prevent tx linkability" (see [indexed merkle tree](../storage/indexed_merkle_tree.mdx). +- "Hide which function was just executed, by wrapping it in a zk-snark" +- "Hide all functions which were executed as part of this tx's stack trace, by wrapping the whole tx in a zk-snark" + +## Aztec core protocol circuits + +So what kinds of core protocol circuits does Aztec have? + +### Kernel, Rollup, and Squisher Circuits + +The specs of these have recently been updated. Eg for squisher circuits since Honk and Goblin Plonk schemes are still being improved! But we'll need some extra circuit(s) to squish a Honk proof (as produced by the Root Rollup Circuit) into a Standard Plonk or Fflonk proof, for cheap verification on Ethereum. diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/circuits/kernels/_category_.json b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/circuits/kernels/_category_.json new file mode 100644 index 000000000000..aa6ead3d71df --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/circuits/kernels/_category_.json @@ -0,0 +1,6 @@ +{ + "label": "Kernel Circuits", + "position": 0, + "collapsible": true, + "collapsed": true +} diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/circuits/kernels/private_kernel.md b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/circuits/kernels/private_kernel.md new file mode 100644 index 000000000000..092d331f072e --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/circuits/kernels/private_kernel.md @@ -0,0 +1,15 @@ +--- +title: Private Kernel Circuit +tags: [protocol, circuits] +description: Learn about the Private Kernel Circuit, the only zero-knowledge circuit in Aztec that handles private data and ensures transaction privacy by executing on user devices. +--- + +This circuit is executed by the user, on their own device. This is to ensure private inputs to the circuit remain private! + +:::note + +**This is the only core protocol circuit which actually needs to be "zk" (zero-knowledge)!!!** That's because this is the only core protocol circuit which handles private data, and hence the only circuit for which proofs must not leak any information about witnesses! (The private data being handled includes: details of the Aztec.nr Contract function which has been executed; the address of the user who executed the function; the intelligible inputs and outputs of that function). + +Most so-called "zk-Rollups" do not make use of this "zero-knowledge" property. Their snarks are "snarks"; with no need for zero-knowledge, because they don't seek privacy; they only seek the 'succinct' computation-compression properties of snarks. Aztec's "zk-Rollup" actually makes use of "zero-knowledge" snarks. That's why we sometimes call it a "zk-zk-Rollup", or "_actual_ zk-Rollup". + +::: diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/circuits/kernels/public_kernel.md b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/circuits/kernels/public_kernel.md new file mode 100644 index 000000000000..b8930d5010da --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/circuits/kernels/public_kernel.md @@ -0,0 +1,7 @@ +--- +title: Public Kernel Circuit +tags: [protocol, circuits] +description: Understand the Public Kernel Circuit executed by sequencers that manages public state transitions in Aztec. +--- + +This circuit is executed by a Sequencer, since only a Sequencer knows the current state of the [public data tree](../../../state_management.md#public-state) at any time. A Sequencer might choose to delegate proof generation to the Prover pool. diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/circuits/rollup_circuits/index.md b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/circuits/rollup_circuits/index.md new file mode 100644 index 000000000000..5040d5d18760 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/circuits/rollup_circuits/index.md @@ -0,0 +1,18 @@ +--- +title: Rollup Circuits +tags: [protocol, circuits] +description: Learn how Rollup Circuits compress thousands of transactions into a single SNARK proof using a binary tree topology for efficient verification on Ethereum. +--- + +The primary purpose of the Rollup Circuits is to 'squish' all of the many thousands of transactions in a rollup into a single SNARK, which can then be efficiently and verified on Ethereum. + +These circuits are executed by a Sequencer, since their primary role is to order transactions. A Sequencer might choose to delegate proof generation to the Prover pool. + +The way we 'squish' all this data is in a 'binary tree of proofs' topology. + +> Example: If there were 16 txs in a rollup, we'd arrange the 16 kernel proofs into 8 pairs and merge each pair into a single proof (using zk-snark recursion techniques), resulting in 8 output proofs. We'd then arrange those 8 proofs into pairs and again merge each pair into a single proof, resulting in 4 output proofs. And so on until we'd be left with a single proof, which represents the correctness of the original 16 txs. +> This 'binary tree of proofs' topology allows proof generation to be greatly parallelized across prover instances. Each layer of the tree can be computed in parallel. Or alternatively, subtrees can be coordinated to be computed in parallel. + +> Note: 'binary tree of proofs' is actually an oversimplification. The Rollup Circuits are designed so that a Sequencer can actually deviate from a neat, symmetrical tree, for the purposes of efficiency, and instead sometimes create wonky trees. + +Some of the Rollup Circuits also do some protocol checks and computations, for efficiency reasons. We might rearrange which circuit does what computation, as we discover opportunities for efficiency. diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/storage/_category_.json b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/storage/_category_.json new file mode 100644 index 000000000000..537ab73d1a05 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/storage/_category_.json @@ -0,0 +1,6 @@ +{ + "label": "Advanced Storage Concepts", + "position": 1, + "collapsible": true, + "collapsed": true +} diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/storage/indexed_merkle_tree.mdx b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/storage/indexed_merkle_tree.mdx new file mode 100644 index 000000000000..2667991aac0d --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/storage/indexed_merkle_tree.mdx @@ -0,0 +1,425 @@ +--- +title: Indexed Merkle Tree (Nullifier Tree) +tags: [storage, concepts, advanced] +sidebar_position: 2 +description: Learn about indexed merkle trees, an efficient data structure for nullifier trees that enables fast non-membership proofs and batch insertions in Aztec. +--- + +import Image from "@theme/IdealImage"; + +## Overview + +This article will introduce the concept of an indexed merkle tree, and how it can be used to improve the performance of nullifier trees in circuits. + +This page will answer: + +- Why we need nullifier trees at all +- How indexed merkle trees work +- How they can be used for membership exclusion proofs +- How they can leverage batch insertions +- Tradeoffs of using indexed merkle trees + +The content was also covered in a presentation for the [Privacy + Scaling Explorations team at the Ethereum Foundation](https://pse.dev/). + + + +## Primer on Nullifier Trees + +Currently the only feasible way to get privacy in public blockchains is via a UTXO model. In this model, state is stored in encrypted UTXO's in merkle trees. However, to maintain privacy, state cannot be updated. The very act of performing an update leaks information. In order to simulate "updating" the state, we "destroy" old UTXO's and create new ones for each state update. Resulting in a merkle tree that is append-only. + +A classic merkle tree: + + + +To destroy state, the concept of a "nullifier" tree is introduced. Typically represented as a sparse Merkle Tree, the structure is utilized to store notes deterministically linked to values in the append-only tree of encrypted notes. + +A sparse merkle tree (not every leaf stores a value): + + + +In order to spend / modify a note in the private state tree, one must create a nullifier for it, and prove that the nullifier does not already exist in the nullifier tree. As nullifier trees are modeled as sparse merkle trees, non membership checks are (conceptually) trivial. + +Data is stored at the leaf index corresponding to its value. E.g. if I have a sparse tree that can contain $2^{256}$ values and want to prove non membership of the value $2^{128}$. + +I can prove via a merkle membership proof that $tree\_values[2^{128}] = 0$, conversely if I can prove that $tree\_values[2^{128}] == 1$ I can prove that the item exists. + +## Problems introduced by using Sparse Merkle Trees for Nullifier Trees + +While sparse Merkle Trees offer a simple and elegant solution, their implementation comes with some drawbacks. A sparse nullifier tree must have an index for $e \in \mathbb{F}_p$, which for the bn254 curve means that the sparse tree will need to have a depth of 254. +If you're familiar with hashing in circuits the alarm bells have probably started ringing. A tree of depth 254 means 254 hashes per membership proof. +In routine nullifier insertions, a non membership check for a value is performed, then an insertion of said value. This amounts to two trips from leaf to root, hashing all the way up. This means that there are $254 \times 2$ hashes per tree insertion. As the tree is sparse, insertions are random and must be performed in sequence. This means the number of hashes performed in the circuit scales linearly with the number of nullifiers being inserted. As a consequence number of constraints in a rollup circuit (where these checks are performed) will sky rocket, leading to long rollup proving times. + +## Indexed Merkle Tree Constructions + +As it turns out, we can do better. [This paper](https://eprint.iacr.org/2021/1263.pdf) (page 6) introduces the idea of an indexed merkle tree. A Merkle Tree that allows us to perform efficient non-membership proofs. It achieves this by extending each node to include a specialized data structure. Each node not only stores some value $v \in \mathbb{F}_p$ but also some pointers to the leaf with the next higher value. The data structure is as follows: + +$$ +\textsf{leaf} = \{v, i_{\textsf{next}}, v_{\textsf{next}}\}. +$$ + +Based on the tree's insertion rules, we can assume that there are no leaves in the tree that exist between the range $(v, v_{\textsf{next}})$. + +More simply put, the merkle tree pretty much becomes a linked list of increasing size, where once inserted the pointers at a leaf can change, but the nullifier value cannot. + +Despite being a minor modification, the performance implications are massive. We no longer position leaves in place $(index == value)$ therefore we no longer need a deep tree, rather we can use an arbitrarily small tree (32 levels should suffice). + +Some quick back of the napkin maths can show that insertions can be improved by a factor of 8 $(256 / 32)$. + +_For the remainder of this article I will refer to the node that provides the non membership check as a "low nullifier"._ + +The insertion protocol is described below: + +1. Look for a nullifier's corresponding low_nullifier where: + + $$ + low\_nullifier_{\textsf{next\_value}} > new\_nullifier + $$ + + > if $new\_nullifier$ is the largest use the leaf: + + $$ + low\_nullifier_{\textsf{next\_value}} == 0 + $$ + +2. Perform membership check of the low nullifier. +3. Perform a range check on the low nullifier's value and next_value fields: + +$$ +\begin{aligned} +new\_nullifier &> low\_nullifier_{\textsf{value}} \: \&\& \\ +&( new\_nullifier < low\_nullifier_{\textsf{next\_value}} \: || \: low\_nullifier_{\textsf{next\_value}} == 0 ) +\end{aligned} +$$ + +4. Update the low nullifier pointers + + $$ + low\_nullifier_{\textsf{next\_index}} = new\_insertion\_index + $$ + + $$ + low\_nullifier_{\textsf{next\_value}} = new\_nullifier + $$ + +5. Perform insertion of new updated low nullifier (yields new root) +6. Update pointers on new leaf. Note: low_nullifier is from before update in step 4 + +$$ +new\_nullifier\_leaf_{\textsf{value}} = new\_nullifier +$$ + +$$ +new\_nullifier\_leaf_{\textsf{next\_value}} = low\_nullifier_{\textsf{next\_value}} +$$ + +$$ +new\_nullifier\_leaf_{\textsf{next\_index}} = low\_nullifier_{\textsf{next\_index}} +$$ + +7. Perform insertion of new leaf (yields new root) + +#### Number of insertion constraints, in total: + +- `3n` hashes of 2 field elements (where `n` is the height of the tree). +- `3` hashes of 3 field elements. +- `2` range checks. +- A handful of equality constraints. + +**Special cases** +You'll notice at step 3 the $low\_nullifier_{\textsf{next\_value}}$ can be 0. This is a special case as if a value is the max, it will not point to anything larger (as it does not exist). Instead it points to zero. By doing so we close the loop, so we are always inserting into a ring, if we could insert outside the ring we could cause a split. + +A visual aid for insertion is presented below: + +1. Initial state + + + +2. Add a new value $v=30$ + + + +3. Add a new value $v=10$ + + + +4. Add a new value $v=20$ + + + +5. Add a new value $v=50$ + + + +By studying the transitions between each diagram you can see how the pointers are updated between each insertion. + +A further implementation detail is that we assume the first 0 node is pre-populated. As a consequence, the first insertion into the tree will be made into the second index. + +### Non-membership proof + +Suppose we want to show that the value `20` doesn't exist in the tree. We just reveal the leaf which 'steps over' `20`. I.e. the leaf whose value is less than `20`, but whose next value is greater than `20`. Call this leaf the `low_nullifier`. + +- hash the low nullifier: $low\_nullifier = h(10, 1, 30)$. +- Prove the low leaf exists in the tree: `n` hashes. +- Check the new value 'would have' belonged in the range given by the low leaf: `2` range checks. + - If ($low\_nullifier_{\textsf{next\_index}} == 0$): + - Special case, the low leaf is at the very end, so the new_value must be higher than all values in the tree: + - $assert(low\_nullifier_{\textsf{value}} < new\_value_{\textsf{value}})$ + - Else: + - $assert(low\_nullifier_{\textsf{value}} < new\_value_{\textsf{value}})$ + - $assert(low\_nullifier_{\textsf{next\_value}} > new\_value_{\textsf{value}})$ + +This is already a massive performance improvement, however we can go further, as this tree is not sparse. We can perform batch insertions. + +## Batch insertions + +As our nullifiers will all be inserted deterministically (append only), we can insert entire subtrees into our tree rather than appending nodes one by one, this optimization is globally applied to append only merkle trees. I wish this was it, but for every node we insert, we must also update low nullifier pointers, this introduces a bit of complexity while performing subtree insertions, as the low nullifier itself may exist within the subtree we are inserting - we must be careful how we prove these sort of insertions are correct (addressed later). +We must update all of the impacted low nullifiers before. + +First we will go over batch insertions in an append only merkle tree. + +1. First we prove that the subtree we are inserting into consists of all empty values. +1. We work out the root of an empty subtree, and perform an inclusion proof for an empty root, which proves that there is nothing within our subtree. +1. We re-create our subtree within our circuit. +1. We then use the same sibling path the get the new root of the tree after we insert the subtree. + +In the following example we insert a subtree of size 4 into our tree at step 4. above. Our subtree is greyed out as it is "pending". + +**Legend**: + +- Green: New Inserted Value +- Orange: Low Nullifier + +**Example** + +1. Prepare to insert subtree $[35,50,60,15]$ + + + +2. Update low nullifier for new nullifier $35$. + + + +3. Update low nullifier for new nullifier $50$. (Notice how the low nullifier exists within our pending insertion subtree, this becomes important later). + + + +4. Update low nullifier for new nullifier $60$. + + + +5. Update low nullifier for new nullifier $15$. + + + +6. Update pointers for new nullifier $15$. + + + +7. Insert subtree. + + + +### Performance gains from subtree insertion + +Let's go back over the numbers: +Insertions into a sparse nullifier tree involve 1 non membership check (254 hashes) and 1 insertion (254 hashes). If we were performing insertion for 4 values that would entail 2032 hashes. +In the depth 32 indexed tree construction, each subtree insertion costs 1 non membership check (32 hashes), 1 pointer update (32 hashes) for each value as well as the cost of constructing and inserting a subtree (~67 hashes. Which is 327 hashes, an incredible efficiency increase.) + +_I am ignoring range check constraint costs as they a negligible compared to the costs of a hash_. + +## Performing subtree insertions in a circuit context + +Some fun engineering problems occur when we inserting a subtree in circuits when the low nullifier for a value exists within the subtree we are inserting. In this case we cannot perform a non membership check against the root of the tree, as our leaf that we would use for non membership has NOT yet been inserted into the tree. We need another protocol to handle such cases, we like to call these "pending" insertions. + +**Circuit Inputs** + +- `new_nullifiers`: `fr[]` +- `low_nullifier_leaf_preimages`: `tuple of {value: fr, next_index: fr, next_value: fr}` +- `low_nullifier_membership_witnesses`: A sibling path and a leaf index of low nullifier +- `current_nullifier_tree_root`: Current root of the nullifier tree +- `next_insertion_index`: fr, the tip our nullifier tree +- `subtree_insertion_sibling_path`: A sibling path to check our subtree against the root + +Protocol without batched insertion: +Before adding a nullifier to the pending insertion tree, we check for its non membership using the previously defined protocol by consuming the circuit inputs: +Pseudocode: + +```cpp + +auto empty_subtree_hash = SOME_CONSTANT_EMPTY_SUBTREE; +auto pending_insertion_subtree = []; +auto insertion_index = inputs.next_insertion_index; +auto root = inputs.current_nullifier_tree_root; + +// Check nothing exists where we would insert our subtree +assert(membership_check(root, empty_subtree_hash, insertion_index >> subtree_depth, inputs.subtree_insertion_sibling_path)); + +for (i in len(new_nullifiers)) { + auto new_nullifier = inputs.new_nullifiers[i]; + auto low_nullifier_leaf_preimage = inputs.low_nullifier_leaf_preimages[i]; + auto low_nullifier_membership_witness = inputs.low_nullifier_membership_witnesses[i]; + + // Membership check for low nullifier + assert(perform_membership_check(root, hash(low_nullifier_leaf_preimage), low_nullifier_membership_witness)); + + // Range check low nullifier against new nullifier + assert(new_nullifier < low_nullifier_leaf_preimage.next_value || low_nullifier_leaf.next_value == 0); + assert(new_nullifier > low_nullifier_leaf_preimage.value); + + // Update new nullifier pointers + auto new_nullifier_leaf = { + .value = new_nullifier, + .next_index = low_nullifier_preimage.next_index, + .next_value = low_nullifier_preimage.next_value + }; + + // Update low nullifier pointers + low_nullifier_preimage.next_index = next_insertion_index; + low_nullifier_preimage.next_value = new_nullifier; + + // Update state vals for next iteration + root = update_low_nullifier(low_nullifier, low_nullifier_membership_witness); + pending_insertion_subtree.push(new_nullifier_leaf); + next_insertion_index += 1; +} + +// insert subtree +root = insert_subtree(root, inputs.next_insertion_index >> subtree_depth, pending_insertion_subtree); + +``` + +From looking at the code above we can probably deduce why we need pending insertion. If the low nullifier does not yet exist in the tree, all of our membership checks will fail, we cannot produce a non membership proof. + +To perform batched insertions, our circuit must keep track of all values that are pending insertion. + +- If the `low_nullifier_membership_witness` is identified to be nonsense ( all zeros, or has a leaf index of -1 ) we will know that this is a pending low nullifier read request and we will have to look within our pending subtree for the nearest low nullifier. + - Loop back through all "pending_insertions" + - If the pending insertion value is lower than the nullifier we are trying to insert + - If the pending insertion value is NOT found, then out circuit is invalid and should self abort. + +The updated pseudocode is as follows: + +```cpp + +auto empty_subtree_hash = SOME_CONSTANT_EMPTY_SUBTREE; +auto pending_insertion_subtree = []; +auto insertion_index = inputs.next_insertion_index; +auto root = inputs.current_nullifier_tree_root; + +// Check nothing exists where we would insert our subtree +assert(membership_check(root, empty_subtree_hash, insertion_index >> subtree_depth, inputs.subtree_insertion_sibling_path)); + +for (i in len(new_nullifiers)) { + auto new_nullifier = inputs.new_nullifiers[i]; + auto low_nullifier_leaf_preimage = inputs.low_nullifier_leaf_preimages[i]; + auto low_nullifier_membership_witness = inputs.low_nullifier_membership_witnesses[i]; + + if (low_nullifier_membership_witness is garbage) { + bool matched = false; + + // Search for the low nullifier within our pending insertion subtree + for (j in range(0, i)) { + auto pending_nullifier = pending_insertion_subtree[j]; + + if (pending_nullifier.is_garbage()) continue; + if (pending_nullifier[j].value < new_nullifier && (pending_nullifier[j].next_value > new_nullifier || pending_nullifier[j].next_value == 0)) { + + // bingo + matched = true; + + // Update pointers + auto new_nullifier_leaf = { + .value = new_nullifier, + .next_index = pending_nullifier.next_index, + .next_value = pending_nullifier.next_value + } + + // Update pending subtree + pending_nullifier.next_index = insertion_index; + pending_nullifier.next_value = new_nullifier; + + pending_insertion_subtree.push(new_nullifier_leaf); + break; + } + } + + // could not find a matching low nullifier in the pending insertion subtree + assert(matched); + + } else { + // Membership check for low nullifier + assert(perform_membership_check(root, hash(low_nullifier_leaf_preimage), low_nullifier_membership_witness)); + + // Range check low nullifier against new nullifier + assert(new_nullifier < low_nullifier_leaf_preimage.next_value || low_nullifier_leaf.next_value == 0); + assert(new_nullifier > low_nullifier_leaf_preimage.value); + + // Update new nullifier pointers + auto new_nullifier_leaf = { + .value = new_nullifier, + .next_index = low_nullifier_preimage.next_index, + .next_value = low_nullifier_preimage.next_value + }; + + // Update low nullifier pointers + low_nullifier_preimage.next_index = next_insertion_index; + low_nullifier_preimage.next_value = new_nullifier; + + // Update state vals for next iteration + root = update_low_nullifier(low_nullifier, low_nullifier_membership_witness); + + pending_insertion_subtree.push(new_nullifier_leaf); + + } + + next_insertion_index += 1; +} + +// insert subtree +root = insert_subtree(root, inputs.next_insertion_index >> subtree_depth, pending_insertion_subtree); + +``` + +#### Drawbacks + +Despite offering large performance improvements within the circuits, these come at the expense of increased computation / storage performed by the node. To provide a non membership proof we must find the "low nullifier" for it. In a naive implementation this entails a brute force search against the existing nodes in the tree. This performance can be increased by the node maintaining a sorted data structure of existing nullifiers, increasing its storage footprint. + +#### Closing Notes + +We have been working with these new trees in order to reduce the proving time for our rollups in Aztec, however we think EVERY protocol leveraging nullifier trees should know about these trees as their performance benefit is considerable. diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/storage/note_discovery.md b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/storage/note_discovery.md new file mode 100644 index 000000000000..0982c4a47d4a --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/storage/note_discovery.md @@ -0,0 +1,42 @@ +--- +title: Note Discovery +tags: [storage, concepts, advanced, notes] +description: Understand how Aztec's note tagging system allows users to efficiently discover and decrypt notes that belong to them without relying on brute force or offchain communication. +sidebar_position: 3 +--- + +Note discovery refers to the process of a user identifying and decrypting the [encrypted notes](../../state_management.md) that belong to them. + +## Existing solutions + +### Brute force / trial-decrypt + +In some existing protocols, the user downloads all possible notes and tries to decrypt each one. If the decryption succeeds, the user knows they own that note. However, this approach becomes exponentially more expensive as the network grows and more notes are created. It also introduces a third-party server to gather and trial-decrypt notes, which is an additional point of failure. Note that this note discovery technique is not currently implemented for Aztec. + +### Offchain communication + +Another proposed solution is having the sender give the note content to the recipient via some offchain communication. While it solves the brute force issue, it introduces reliance on side channels which we don't want in a self-sufficient network. This option incurs lower transaction costs because fewer logs needs to be posted onchain. Aztec apps will be able to choose this method if they wish. + +## Aztec's solution: Note tagging + +Aztec introduces an approach that allows users to identify which notes are relevant to them by having the sender _tag_ the log in which the note is created. This is known as note tagging. The tag is generated in such a way that only the sender and recipient can identify it. + +### How it works + +#### Every log has a tag + +In Aztec, each emitted log is an array of fields, eg `[x, y, z]`. The first field (`x`) is a _tag_ field used to index and identify logs. The Aztec node exposes an API `getLogsByTags()` that can retrieve logs matching specific tags. + +#### Tag generation + +The sender and recipient share a predictable scheme for generating tags. The tag is derived from a shared secret and an index (a shared counter that increments each time the sender creates a note for the recipient). + +#### Discovering notes in Aztec contracts + +This note discovery scheme will be implemented by Aztec contracts rather than by the PXE. This means that users can update or use other types of note discovery to suit their needs. + +### Limitations + +- **You cannot receive notes from an unknown sender**. If you do not know the sender’s address, you cannot create the shared secret, and therefore cannot create the note tag. There are potential ways around this, such as senders adding themselves to a contract and then recipients searching for note tags from all the senders in the contract. However this is out of scope at this point in time. + +- **Index synchronization can be complicated**. If transactions are reverted or mined out of order, the recipient may stop searching after receiving a tag with the latest index they expect. This means they can miss notes that belong to them. We cannot redo a reverted a transaction with the same index, because then the tag will be the same and the notes will be linked, leaking privacy. We can solve this by widening the search window (not too much, or it becomes brute force) and implementing a few restrictions on sending notes. A user will not be able to send a large amount of notes from the same contract to the same recipient within a short time frame. diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/storage/storage_slots.md b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/storage/storage_slots.md new file mode 100644 index 000000000000..f269a68aec68 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/advanced/storage/storage_slots.md @@ -0,0 +1,119 @@ +--- +title: Storage Slots +tags: [storage, concepts, advanced] +sidebar_position: 1 +description: Understand how storage slots work in Aztec for both public and private state, including siloing mechanisms and note hash commitments. +--- + +## Public State Slots + +As mentioned in [State Model](../../state_management.md), Aztec public state behaves similarly to public state on Ethereum from the point of view of the developer. Behind the scenes however, the storage is managed differently. As mentioned, public state has just one large sparse tree in Aztec - so we silo slots of public data by hashing it together with its contract address. + +The mental model is that we have a key-value store, where the siloed slot is the key, and the value is the data stored in that slot. You can think of the `real_storage_slot` identifying its position in the tree, and the `logical_storage_slot` identifying the position in the contract storage. + +```rust +real_storage_slot = H(contract_address, logical_storage_slot) +``` + +The siloing is performed by the [Kernel circuits](../circuits/kernels/private_kernel.md). + +For structs and arrays, we are logically using a similar storage slot computation to ethereum, e.g., as a struct with 3 fields would be stored in 3 consecutive slots. However, because the "actual" storage slot is computed as a hash of the contract address and the logical storage slot, the actual storage slot is not consecutive. + +## Private State Slots + +Private storage is a different beast. As you might remember from [Hybrid State Model](../../state_management.md), private state is stored in encrypted logs and the corresponding private state commitments in append-only tree, called the note hash tree where each leaf is a commitment. Append-only means that leaves are never updated or deleted; instead a nullifier is emitted to signify that some note is no longer valid. A major reason we used this tree, is that updates at a specific storage slot would leak information in the context of private state, even if the value is encrypted. That is not good privacy. + +Following this, the storage slot as we know it doesn't really exist. The leaves of the note hashes tree are just commitments to content (think of it as a hash of its content). + +Nevertheless, the concept of a storage slot is very useful when writing applications, since it allows us to reason about distinct and disjoint pieces of data. For example we can say that the balance of an account is stored in a specific slot and that the balance of another account is stored in another slot with the total supply stored in some third slot. By making sure that these slots are disjoint, we can be sure that the balances are not mixed up and that someone cannot use the total supply as their balance. + +### Implementation + +If we include the storage slot, as part of the note whose commitment is stored in the note hashes tree, we can _logically link_ all the notes that make up the storage slot. For the case of a balance, we can say that the balance is the sum of all the notes that have the same storage slot - in the same way that your physical wallet balance is the sum of all the physical notes in your wallet. + +Similarly to how we siloed the public storage slots, we can silo our private storage by hashing the packed note together with the logical storage slot. + +```rust +note_hash = H([...packed_note, logical_storage_slot]); +``` + +Note hash siloing is done in the application circuit, since it is not necessary for security of the network (but only the application). +:::info +The private variable wrappers `PrivateSet` and `PrivateMutable` in Aztec.nr include the `logical_storage_slot` in the commitments they compute, to make it easier for developers to write contracts without having to think about how to correctly handle storage slots. +::: + +When reading the values for these notes, the application circuit can then constrain the values to only read notes with a specific logical storage slot. + +To ensure that contracts can only modify their own logical storage, we do a second siloing by hashing the `commitment` with the contract address. + +```rust +siloed_note_hash = H(contract_address, note_hash); +``` + +By doing this address-siloing at the kernel circuit we _force_ the inserted commitments to include and not lie about the `contract_address`. + +:::info +To ensure that nullifiers don't collide across contracts we also force this contract siloing at the kernel level. +::: + +## Example + +In this section we will go into more detail and walk through an entire example of how storage slots are computed for private state to improve our storage slot intuition. Recall, that storage slots in the private domain is just a logical construct, and are not "actually" used for lookups, but rather just as a value to constrain against. + +For the case of the example, we will look at what is inserted into the note hashes tree when adding a note in the Token contract. Specifically, we are looking at the last part of the `transfer` function: + +```rust title="increase_private_balance" showLineNumbers +self.storage.balances.at(from).sub(amount).deliver(MessageDelivery.CONSTRAINED_ONCHAIN); +``` +> Source code: noir-projects/noir-contracts/contracts/app/token_contract/src/main.nr#L308-L310 + + +This function is creating a new note and inserting it into the balance set of the recipient `to`. Recall that to ensure privacy, only the note hash is really inserted into the note hashes tree. To share the contents of the note with `to` the contract can emit an encrypted log (which this one does), or it can require an offchain data transfer sharing the information. Below, we will walk through the steps of how the note hash is computed and inserted into the tree. For this, we don't care about the encrypted log, so we are going to ignore that part of the function call for now. + +Outlining it in more detail below as a sequence diagram, we can see how the calls make their way down the stack. +In the end a siloed note hash is computed in the kernel. + +:::info +Some of the syntax below is a little butchered to make it easier to follow variables without the full code. +::: + +```mermaid +sequenceDiagram + alt Call + Token->>BalanceMap: Map::new(map_slot); + Token->>Token: to_bal = storage.balances.at(to) + Token->>BalanceMap: BalanceMap.at(to) + BalanceMap->>BalanceMap: derived_slot = H(map_slot, to) + BalanceMap->>BalanceSet: BalanceSet::new(to, derived_slot) + Token->>BalanceSet: to_bal.add(amount) + BalanceSet->>BalanceSet: note = UintNote::new(amount, to) + BalanceSet->>Set: insert(note) + Set->>LifeCycle: create_note(derived_slot, note) + LifeCycle->>LifeCycle: note.header = NoteHeader { contract_address,
storage_slot: derived_slot, nonce: 0, note_hash_counter } + UintPartialNotePrivateContent->>UintNote: note_hash = compute_partial_commitment(storage_slot).x + LifeCycle->>Context: push_note_hash(note_hash) + end + Context->>Kernel: unique_note_hash = H(nonce, note_hash) + Context->>Kernel: siloed_note_hash = H(contract_address, unique_note_hash) +``` + +Notice the `siloed_note_hash` at the very end. It's a hash that will be inserted into the note hashes tree. To clarify what this really is, we "unroll" the values to their simplest components. This gives us a better idea around what is actually inserted into the tree. + +```rust +siloed_note_hash = H(contract_address, unique_note_hash) +siloed_note_hash = H(contract_address, H(nonce, note_hash)) +siloed_note_hash = H(contract_address, H(H(tx_hash, note_index_in_tx), note_hash)) +siloed_note_hash = H(contract_address, H(H(tx_hash, note_index_in_tx), MSM([G_amt, G_to, G_rand, G_slot], [amount, to, randomness, derived_slot]).x)) +``` + +MSM is a multi scalar multiplication on a grumpkin curve and G\_\* values are generators. + +And `to` is the actor who receives the note, `amount` of the note and `randomness` is the randomness used to make the note hiding. Without the `randomness` the note could just as well be plaintext (computational cost of a preimage attack would be trivial in such a case). + +:::info +Beware that this hash computation is what the aztec.nr library is doing, and not strictly required by the network (only the kernel computation is). +::: + +With this note structure, the contract can require that only notes sitting at specific storage slots can be used by specific operations, e.g., if transferring funds from `from` to `to`, the notes to destroy should be linked to `H(map_slot, from)` and the new notes (except the change-note) should be linked to `H(map_slot, to)`. + +That way, we can have logical storage slots, without them really existing. This means that knowing the storage slot for a note is not enough to actually figure out what is in there (whereas it would be for looking up public state). diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/call_types.md b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/call_types.md new file mode 100644 index 000000000000..3ade802ac80e --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/call_types.md @@ -0,0 +1,276 @@ +--- +title: Call Types +sidebar_position: 6 +tags: [calls, contracts, execution] +description: Understand the different types of contract calls in Aztec, including private and public execution modes, and how they compare to Ethereum's call types. +--- + + + +## What is a Call + +We say that a smart contract is called when one of its functions is invoked and its code is run. This means there'll be: + +- a caller +- arguments +- return values +- a call status (successful or failed) + +There are multiple types of calls, and some of the naming can make things **very** confusing. This page lists the different call types and execution modes, pointing out key differences between them. + +## Ethereum Call Types + +Even though we're discussing Aztec, its design is heavily influenced by Ethereum and many of the APIs and concepts are quite similar. It is therefore worthwhile to briefly review how things work there and what naming conventions are used to provide context to the Aztec-specific concepts. + +Broadly speaking, Ethereum contracts can be thought of as executing as a result of three different things: running certain EVM opcodes, running Solidity code (which compiles to EVM opcodes), or via the node JSON-RPC interface (e.g. when executing transactions). + +### EVM + +Certain opcodes allow contracts to make calls to other contracts, each with different semantics. We're particularly interested in `CALL` and `STATICCALL`, and how those relate to contract programming languages and client APIs. + +#### `CALL` + +This is the most common and basic type of call. It grants execution control to the caller until it eventually returns. No special semantics are in play here. Most Ethereum transactions spend the majority of their time in `CALL` contexts. + +#### `STATICCALL` + +This behaves almost exactly the same as `CALL`, with one key difference: any state-changing operations are forbidden and will immediately cause the call to fail. This includes writing to storage, emitting logs, or deploying new contracts. This call is used to query state on an external contract, e.g. to get data from a price oracle, check for access control permissions, etc. + +#### Others + +The `CREATE` and `CREATE2` opcodes (for contract deployment) also result in something similar to a `CALL` context, but all that's special about them has to do with how deployments work. `DELEGATECALL` (and `CALLCODE`) are somewhat complicated to understand but don't have any Aztec equivalents, so they are not worth covering. + +### Solidity + +Solidity (and other contract programming languages such as Vyper) compile down to EVM opcodes, but it is useful to understand how they map language concepts to the different call types. + +#### Mutating External Functions + +These are functions marked `payable` (which can receive ETH, which is a state change) or with no mutability declaration (sometimes called `nonpayable`). When one of these functions is called on a contract, the `CALL` opcode is emitted, meaning the callee can perform state changes, make further `CALL`s, etc. + +It is also possible to call such a function with `STATICCALL` manually (e.g. using assembly), but the execution will fail as soon as a state-changing opcode is executed. + +#### `view` + +An external function marked `view` will not be able to mutate state (write to storage, etc.), it can only _view_ the state. Solidity will emit the `STATICCALL` opcode when calling these functions, since its restrictions provide added safety to the caller (e.g. no risk of reentrancy). + +Note that it is entirely possible to use `CALL` to call a `view` function, and the result will be the exact same as if `STATICCALL` had been used. The reason why `STATICCALL` exists is so that _untrusted or unknown_ contracts can be called while still being able to reason about correctness. From the [EIP](https://eips.ethereum.org/EIPS/eip-214): + +> '`STATICCALL` adds a way to call other contracts and restrict what they can do in the simplest way. It can be safely assumed that the state of all accounts is the same before and after a static call.' + +### JSON-RPC + +From outside the EVM, calls to contracts are made via [JSON-RPC](https://ethereum.org/en/developers/docs/apis/json-rpc/) methods, typically from some client library that is aware of contract ABIs, such as [ethers.js](https://docs.ethers.org/v5) or [viem](https://viem.sh/). + +#### `eth_sendTransaction` + +This method is how transactions are sent to a node to get them to be broadcast and eventually included in a block. The specified `to` address will be called in a `CALL` context, with some notable properties: + +- there are no return values, even if the contract function invoked does return some data +- there is no explicit caller: it is instead derived from a provided signature + +Some client libraries choose to automatically issue `eth_sendTransaction` when calling functions from a contract ABI that are not marked as `view` - [ethers is a good example](https://docs.ethers.org/v5/getting-started/#getting-started--writing). Notably, this means that any return value is lost and not available to the calling client - the library typically returns a transaction receipt instead. If the return value is required, then the only option is to simulate the call `eth_call`. + +Note that it is possible to call non state-changing functions (i.e. `view`) with `eth_sendTransaction` - this is always meaningless. What transactions do is change the blockchain state, so all calling such a function achieves is for the caller to lose funds by paying for gas fees. The sole purpose of a `view` function is to return data, and `eth_sendTransaction` does not make the return value available. + +#### `eth_call` + +This method is the largest culprit of confusion around calls, but unfortunately requires understanding of all previous concepts in order to be explained. Its name is also quite unhelpful. + +What `eth_call` does is simulate a transaction (a call to a contract) given the current blockchain state. The behavior will be the exact same as `eth_sendTransaction`, except: + +- no actual transaction will be created +- while gas _will_ be measured, there'll be no transaction fees of any kind +- no signature is required: the `from` address is passed directly, and can be set to any value (even if the private key is unknown, or if they are contract addresses!) +- the return value of the called contract is available + +`eth_call` is typically used for one of the following: + +- query blockchain data, e.g. read token balances +- preview the state changes produced by a transaction, e.g. the transaction cost, token balance changes, etc + +Because some libraries ([such as ethers](https://docs.ethers.org/v5/getting-started/#getting-started--reading)) automatically use `eth_call` for `view` functions (which when called via Solidity result in the `STATICCALL` opcode), these concepts can be hard to tell apart. The following bears repeating: **an `eth_call`'s call context is the same as `eth_sendTransaction`, and it is a `CALL` context, not `STATICCALL`.** + +## Aztec Call Types + +Large parts of the Aztec Network's design are still not finalized, and the nitty-gritty of contract calls is no exception. This section won't therefore contain a thorough review of these, but rather list some of the main ways contracts can currently be interacted with, with analogies to Ethereum call types when applicable. + +While Ethereum contracts are defined by bytecode that runs on the EVM, Aztec contracts have multiple modes of execution depending on the function that is invoked. + +### Private Execution + +Contract functions marked with `#[external("private")]` can only be called privately, and as such 'run' in the user's device. Since they're circuits, their 'execution' is actually the generation of a zk-SNARK proof that'll later be sent to the sequencer for verification. + +#### Private Calls + +Private functions from other contracts can be called either regularly or statically by using the `.call()` and `.static_call` functions. They will also be 'executed' (i.e. proved) in the user's device, and `static_call` will fail if any state changes are attempted (like the EVM's `STATICCALL`). + +```rust title="private_call" showLineNumbers +let _ = self.call(Token::at(stable_coin).burn_private(from, amount, authwit_nonce)); +``` +> Source code: noir-projects/noir-contracts/contracts/app/lending_contract/src/main.nr#L250-L252 + + +Unlike the EVM however, private execution doesn't revert in the traditional way: in case of error (e.g. a failed assertion, a state changing operation in a static context, etc.) the proof generation simply fails and no transaction request is generated, spending no network gas or user funds. + +#### Public Calls + +Since public execution can only be performed by the sequencer, public functions cannot be executed in a private context. It is possible however to _enqueue_ a public function call during private execution, requesting the sequencer to run it during inclusion of the transaction. It will be [executed in public](#public-execution) normally, including the possibility to enqueue static public calls. + +Since the public call is made asynchronously, any return values or side effects are not available during private execution. If the public function fails once executed, the entire transaction is reverted including state changes caused by the private part, such as new notes or nullifiers. Note that this does result in gas being spent, like in the case of the EVM. + +```rust title="enqueue_public" showLineNumbers +self.enqueue_self._deposit(AztecAddress::from_field(on_behalf_of), amount, collateral_asset); +``` +> Source code: noir-projects/noir-contracts/contracts/app/lending_contract/src/main.nr#L119-L121 + + +It is also possible to create public functions that can _only_ be invoked by privately enqueueing a call from the same contract, which can be very useful to update public state after private execution (e.g. update a token's supply after privately minting). This is achieved by annotating functions with `#[only_self]`. + +A common pattern is to enqueue public calls to check some validity condition on public state, e.g. that a deadline has not expired or that some public value is set. + +```rust title="enqueueing" showLineNumbers +Router::at(ROUTER_ADDRESS).check_block_number(operation, value).enqueue_view_incognito(context); +``` +> Source code: noir-projects/noir-contracts/contracts/protocol/router_contract/src/utils.nr#L17-L19 + + +Note that this reveals what public function is being called on what contract, and perhaps more importantly which contract enqueued the call during private execution. +For this reason we've created a canonical router contract which implements some of the checks commonly performed: this conceals the calling contract, as the `context.msg_sender()` in the public function will be the router itself (since it is the router that enqueues the public call). + +An example of how a deadline can be checked using the router contract follows: + +```rust title="call-check-deadline" showLineNumbers +privately_check_timestamp(Comparator.LT, config.deadline, self.context); +``` +> Source code: noir-projects/noir-contracts/contracts/app/crowdfunding_contract/src/main.nr#L51-L53 + + +`privately_check_timestamp` and `privately_check_block_number` are helper functions around the call to the router contract: + +```rust title="helper_router_functions" showLineNumbers +/// Asserts that the current timestamp in the enqueued public call enqueued by `check_timestamp` satisfies +/// the `operation` with respect to the `value. Preserves privacy by performing the check via the router contract. +/// This conceals an address of the calling contract by setting `context.msg_sender` to the router contract address. +pub fn privately_check_timestamp(operation: u8, value: u64, context: &mut PrivateContext) { + Router::at(ROUTER_ADDRESS).check_timestamp(operation, value).enqueue_view_incognito(context); +} + +/// Asserts that the current block number in the enqueued public call enqueued by `check_block_number` satisfies +/// the `operation` with respect to the `value. Preserves privacy by performing the check via the router contract. +/// This conceals an address of the calling contract by setting `context.msg_sender` to the router contract address. +pub fn privately_check_block_number(operation: u8, value: u32, context: &mut PrivateContext) { + Router::at(ROUTER_ADDRESS).check_block_number(operation, value).enqueue_view_incognito(context); +} +``` +> Source code: noir-projects/noir-contracts/contracts/protocol/router_contract/src/utils.nr#L5-L21 + + +This is what the implementation of the check timestamp functionality looks like: + +```rust title="check_timestamp" showLineNumbers +/// Asserts that the current timestamp satisfies the `operation` with respect +/// to the `value. +#[external("public")] +#[view] +fn check_timestamp(operation: u8, value: u64) { + let lhs_field = self.context.timestamp() as Field; + let rhs_field = value as Field; + assert(compare(lhs_field, operation, rhs_field), "Timestamp mismatch."); +} +``` +> Source code: noir-projects/noir-contracts/contracts/protocol/router_contract/src/main.nr#L12-L22 + + +:::note +Note that the router contract is not currently part of the [aztec-nr repository](https://github.com/AztecProtocol/aztec-nr). +To add it as a dependency point to the aztec-packages repository instead: + +```toml +[dependencies] +aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v3.0.2", directory = "noir-projects/noir-contracts/contracts/protocol/router_contract/src" } +``` + +::: + +Even with the router contract achieving good privacy is hard. +For example, if the value being checked against is unique and stored in the contract's public storage, it's then simple to find private transactions that are using that value in the enqueued public reads, and therefore link them to this contract. +For this reason it is encouraged to try to avoid public function calls and instead privately read [Shared State](../aztec-nr/framework-description/how_to_define_storage.md#delayed-public-mutable) when possible. + +### Public Execution + +Contract functions marked with `#[external("public")]` can only be called publicly, and are executed by the sequencer. The computation model is very similar to the EVM: all state, parameters, etc. are known to the entire network, and no data is private. Static execution like the EVM's `STATICCALL` is possible too, with similar semantics (state can be accessed but not modified, etc.). + +Since private calls are always run in a user's device, it is not possible to perform any private execution from a public context. A reasonably good mental model for public execution is that of an EVM in which some work has already been done privately, and all that is know about it is its correctness and side-effects (new notes and nullifiers, enqueued public calls, etc.). A reverted public execution will also revert the private side-effects. + +Public functions in other contracts can be called both regularly and statically, just like on the EVM. + +```rust title="public_call" showLineNumbers +self.enqueue(Token::at(config.accepted_asset).transfer_in_public( + self.msg_sender().unwrap(), + self.address, + max_fee, + authwit_nonce, +)); +``` +> Source code: noir-projects/noir-contracts/contracts/fees/fpc_contract/src/main.nr#L162-L169 + + +:::note +This is the same function that was called by privately enqueuing a call to it! Public functions can be called either directly in a public context, or asynchronously by enqueuing in a private context. +::: + +### Utility + +Contract functions marked with `#[external("utility")]` cannot be called as part of a transaction, and are only invoked by applications that interact with contracts to perform state queries from an offchain client (from both private and public state!) or to modify local contract-related PXE state (e.g. when processing logs in Aztec.nr). No guarantees are made on the correctness of the result since the entire execution is unconstrained and heavily reliant on oracle calls. It is possible however to verify that the bytecode being executed is the correct one, since a contract's address includes a commitment to all of its utility functions. + +### aztec.js + +There are three different ways to execute an Aztec contract function using the `aztec.js` library, with close similarities to their [JSON-RPC counterparts](#json-rpc). + +#### `simulate` + +This is used to get a result out of an execution, either private or public. It creates no transaction and spends no gas. The mental model is fairly close to that of [`eth_call`](#eth_call), in that it can be used to call any type of function, simulate its execution and get a result out of it. `simulate` is also the only way to run [utility functions](#utility). + +```rust title="public_getter" showLineNumbers +#[external("public")] +#[view] +fn get_authorized() -> AztecAddress { + self.storage.authorized.get_current_value() +} +``` +> Source code: noir-projects/noir-contracts/contracts/app/auth_contract/src/main.nr#L38-L44 + + +```typescript title="simulate_function" showLineNumbers +const balance = await contract.methods.balance_of_public(newAccountAddress).simulate({ from: newAccountAddress }); +expect(balance).toEqual(1n); +``` +> Source code: yarn-project/end-to-end/src/composed/docs_examples.test.ts#L50-L53 + + +:::warning +No correctness is guaranteed on the result of `simulate`! Correct execution is entirely optional and left up to the client that handles this request. +::: + +#### `prove` + +This creates and returns a transaction request, which includes proof of correct private execution and side-effects. The request is not broadcast however, and no gas is spent. It is typically used in testing contexts to inspect transaction parameters or to check for execution failure. + +```typescript title="local-tx-fails" showLineNumbers +await expect( + claimContract.methods.claim(anotherDonationNote, donorAddress).send({ from: unrelatedAddress }).wait(), +).rejects.toThrow('proof_retrieved_note.owner == self.msg_sender().unwrap()'); +``` +> Source code: yarn-project/end-to-end/src/e2e_crowdfunding_and_claim.test.ts#L207-L211 + + +#### `send` + +This is the same as [`prove`](#prove) except it also broadcasts the transaction and returns a receipt. This is how transactions are sent, getting them to be included in blocks and spending gas. It is similar to [`eth_sendTransaction`](#eth_sendtransaction), except it also performs some work on the user's device, namely the production of the proof for the private part of the transaction. + +```typescript title="send_tx" showLineNumbers +await contract.methods.buy_pack(seed).send({ from: firstPlayer }).wait(); +``` +> Source code: yarn-project/end-to-end/src/e2e_card_game.test.ts#L113-L115 + diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/contract_creation.md b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/contract_creation.md new file mode 100644 index 000000000000..711080501131 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/contract_creation.md @@ -0,0 +1,87 @@ +--- +title: Contract Deployment +sidebar_position: 1 +tags: [contracts, protocol] +description: Learn how contract classes and instances are created and deployed on the Aztec network. +--- + +In the Aztec protocol, contracts are created as _instances_ of contract _classes_. The deployment process consists of two main steps: first publishing the contract _class_ (if not already published), and then creating a contract _instance_ that references this class. + +## Contract Classes + +A contract class is a collection of state variable declarations, and related private, public and utility functions. Contract classes don't have state, they just define code (storage structure and function logic). A contract class cannot be called; only a contract instance can be called. + +### Key Benefits of Contract Classes + +Contract classes simplify code reuse by making implementations a first-class citizen in the protocol. With a single class registration, multiple contract instances can be deployed that reference it, reducing deployment costs. Classes also facilitate upgradability by decoupling state from code, making it easier for an instance to switch to different code while retaining its state. + +### Structure of a Contract Class + +A contract class includes: + +- `artifact_hash`: Hash of the contract artifact +- `private_functions`: List of individual private functions, including constructors +- `packed_public_bytecode`: Packed bytecode representation of the AVM bytecode for all public functions + +The specification of the artifact hash is not enforced by the protocol. It should include commitments to utility functions code and compilation metadata. It is intended to be used by clients to verify that an offchain fetched artifact matches a registered class. + +### Contract Class Registration + +A contract class is published by calling a private `publish` function in a canonical `ContractClassRegistry` contract, which emits a Registration Nullifier. This process guarantees that the public bytecode for a contract class is publicly available, which is required for deploying contract instances. + +Contract class registration can be skipped if there are no public functions in the contract class, and the contract will still be usable privately. However, the contract class must be registered if it contains public functions, as these functions need to be publicly verifiable. + +If you have a contract with public functions, you must either register the contract class to deploy or a contract, or skip the public deployment step, in which case only the private functions will be callable. + +## Contract Instances + +A deployed contract is effectively an instance of a contract class. It always references a contract class, which determines what code it executes when called. A contract instance has both private and public state, as well as an address that serves as its identifier. + +### Structure of a Contract Instance + +A contract instance includes: + +- `version`: Version identifier, initially one +- `salt`: User-generated pseudorandom value for uniqueness +- `deployer`: Optional address of the contract deployer. Zero for universal deployment +- `contract_class_id`: Identifier of the contract class for this instance +- `initialization_hash`: Hash of the selector and arguments to the constructor +- `public_keys_hash`: Optional hash of public keys used for encryption and nullifying + +### Instance Address + +The address of a contract instance is computed as the hash of the elements in its structure. This computation is deterministic, allowing users to precompute the expected deployment address of their contract, including account contracts. + +### Contract Initialization vs. Public Deployment + +Aztec makes an important distinction between initialization and public deployment: + +1. **Initialization**: A contract instance is considered Initialized once it emits an initialization nullifier, meaning it can only be initialized once. The default state for any address is to be uninitialized. A user who knows the preimage of the address can still issue a private call into a function in the contract, as long as that function doesn't assert that the contract has been initialized. +2. **Public Deployment**: A Contract Instance is considered to be publicly deployed when it has been broadcast to the network via a canonical `ContractInstanceRegistry` contract, which also emits a deployment nullifier. All public function calls to an undeployed address must fail, since the contract class for it is not known to the network. + +### Initialization + +Contract constructors are not enshrined in the protocol, but handled at the application circuit level. Constructors are methods used for initializing a contract, either private or public, and contract classes may declare more than a single constructor. They can be declared by the `#[initializer]` macro. You can read more about how to use them on the [Defining Initializer Functions](../aztec-nr/framework-description/functions/how_to_define_functions.md#initializer-functions) page. + +A contract must ensure: + +- It is initialized at most once +- It is initialized using the method and arguments defined in its address preimage +- It is initialized by its deployer (if non-zero) +- Functions dependent on initialization cannot be invoked until the contract is initialized + +Functions in a contract may skip the initialization check. + +## Verification of Executed Code + +The protocol circuits, both private and public, are responsible for verifying that the code loaded for a given function execution matches the expected one. This includes checking that the `contract_class_id` of the called address is the expected one and that the function selector being executed is part of the `contract_class_id`. + +## Genesis Contracts + +The `ContractInstanceRegistry` and `ContractClassRegistry` contracts exist from the genesis of the Aztec Network, as they are necessary for deploying other contracts to the network. Their nullifiers are pre-inserted into the genesis nullifier tree. + +This modular approach to contract deployment creates a flexible system that supports diverse use cases, from public applications to private contract interactions, while maintaining the security and integrity of the Aztec protocol. + +## Further reading + +To see how to deploy a contract in practice, check out the [dapp development tutorial](../tutorials/js_tutorials/aztecjs-getting-started.md). diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/fees.md b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/fees.md new file mode 100644 index 000000000000..c1a47c39b5ba --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/fees.md @@ -0,0 +1,98 @@ +--- +title: Fees +sidebar_position: 4 +tags: [fees] +description: Understand Aztec's fee system including mana-based transaction pricing, fee-juice payments, and how L1 and L2 costs are transparently calculated for users. +--- + +import { Why_Fees } from '@site/src/components/Snippets/general_snippets'; + + + +In a nutshell, the pricing of transactions transparently accounts for: + +- L1 costs, including L1 execution of a block, and data availability via blobs, +- L2 node operating costs, including proving + +This is done via multiple variables and calculations explained in detail in the protocol specifications. + +## Terminology and factors + +Familiar terms from Ethereum mainnet as referred to on the Aztec network: + +| Ethereum Mainnet | Aztec | Description | +| ---------------- | ------------------ | ---------------------------------------------- | +| gas | mana | indication of effort in transaction operations | +| fee per gas | fee-juice per mana | cost per unit of effort | +| fee (wei) | fee-juice | amount to be paid | + +An oracle informs the price of fee-juice per wei, which can be used to calculate a transaction's fee-juice in the units of wei. + +Also Aztec borrows ideas from EIP-1559 including: congestion multipliers, and the ability to specify base and priority fee per mana. + +### Aztec-specific fields + +There are many other fields used in mana and fee calculations, and below shows the ways these fields are determined: + +- hard-coded constants (eg congestion update fraction) +- values assumed constant (eg L1 gas cost of publishing a block, blobs per block) +- informed from previous block header and/or L1 rollup contract (eg base_fee_juice_per_mana) +- informed via an oracle (eg wei per mana) + +Most of the constants are defined by the protocol, several others are part of the rollup contract on L1. + +More information about the design/choices can be found in the fees section of the protocol specification. + +### User selected factors + +As part of a transaction the follow gas settings are available to be defined by the user. + +import { Gas_Settings_Components, Gas_Settings, Tx_Teardown_Phase } from '@site/src/components/Snippets/general_snippets'; + + + +These are: + +```javascript title="gas_settings_vars" showLineNumbers +/** Gas usage and fees limits set by the transaction sender for different dimensions and phases. */ +export class GasSettings { + constructor( + public readonly gasLimits: Gas, + public readonly teardownGasLimits: Gas, + public readonly maxFeesPerGas: GasFees, + public readonly maxPriorityFeesPerGas: GasFees, + ) {} +``` +> Source code: yarn-project/stdlib/src/gas/gas_settings.ts#L17-L26 + + + + +## Fee payment + +A fee payer will have bridged fee-juice from L1. On Aztec this fee asset is non-transferrable, and only deducted by the protocol to pay for fees. A user can claim bridged fee juice and use it to pay for transaction fees in the same transaction. + +The mechanisms for bridging is the same as any other token. For more on this concept see the start of the [Token Bridge Tutorial](../tutorials/js_tutorials/token_bridge.md) where it describes the components and how bridging works (under the hood this makes use of [portals](https://docs.aztec.network/developers/docs/foundational-topics/communication/cross_chain_calls)). + +### Payment methods + +An account with fee-juice can pay for its transactions, including deployment of a new account, if fee juice has been bridged the that address at which the account will be deployed. + +An account making a transaction can also refer to "fee-paying contracts" (FPCs) to pay for its transactions. FPCs are contracts that accept a token and pay for transactions in fee juice. This means a user doesn't need to hold fee juice, they only need the token that the FPC accepts. FPCs can contain arbitrary logic to determine how they want to authorize transaction fee payments. They can be used for paying transaction fees privately or publicly. + +### Teardown phase + + + +### Operator rewards + +The calculated fee-juice of a transaction is deducted from the fee payer (nominated account or fee-paying contract), then pooled together each transaction, block, and epoch. +Once the epoch is proven, the total fee-juice (minus any burnt congestion amount), is distributed to provers and block sequencers that contributed to the epoch. + +The fees section of the protocol specification explains this distribution of fee-juice between proposers and provers. + +## Next steps + +More comprehensive technical details for implementers will be available from the updated protocol specifications soon. + +For a guide showing ways to pay fees programmatically, see [here](../aztec-js/how_to_pay_fees). diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/index.md b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/index.md new file mode 100644 index 000000000000..a64fc03315b8 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/index.md @@ -0,0 +1,80 @@ +--- +title: Aztec Overview +sidebar_position: 0 +tags: [protocol] +description: Overview of Aztec, a privacy-first Layer 2 on Ethereum supporting smart contracts with private and public state and execution. +--- + +import Image from "@theme/IdealImage"; + +This page outlines Aztec's fundamental technical concepts. It is recommended to read this before diving into building on Aztec. + +## What is Aztec? + +Aztec is a privacy-first Layer 2 on Ethereum. It supports smart contracts with both private & public state and private & public execution. + + + +## High level view + + + +1. A user interacts with Aztec through Aztec.js (like web3js or ethersjs) +2. Private functions are executed in the PXE, which is client-side +3. Proofs and tree updates are sent to the Public VM (running on an Aztec node) +4. Public functions are executed in the Public VM +5. The Public VM rolls up the transactions that include private and public state updates into blocks +6. The block data and proof of a correct state transition are submitted to Ethereum for verification + +## Private and public execution + +Private functions are executed client side, on user devices to maintain maximum privacy. Public functions are executed by a remote network of nodes, similar to other blockchains. These distinct execution environments create a directional execution flow for a single transaction--a transaction begins in the private context on the user's device then moves to the public network. This means that private functions executed by a transaction can enqueue public functions to be executed later in the transaction life cycle, but public functions cannot call private functions. + +### Private Execution Environment (PXE) + +Private functions are executed on the user's device in the Private Execution Environment (PXE, pronounced 'pixie'), then it generates proofs for onchain verification. It is a client-side library for execution and proof-generation of private operations. It holds keys, notes, and generates proofs. It is included in aztec.js, a TypeScript library, and can be run within Node or the browser. + +Note: It is easy for private functions to be written in a detrimentally unoptimized way, because many intuitions of regular program execution do not apply to proving. For more about writing performant private functions in Noir, see [this page](https://noir-lang.org/docs/explainers/explainer-writing-noir) of the Noir documentation. + +### Aztec Virtual Machine (AVM) + +Public functions are executed by the Aztec Virtual Machine (AVM), which is conceptually similar to the Ethereum Virtual Machine (EVM). As such, writing efficient public functions follow the same intuition as gas-efficient solidity contracts. + +The PXE is unaware of the Public VM. And the Public VM is unaware of the PXE. They are completely separate execution environments. This means: + +- The PXE and the Public VM cannot directly communicate with each other +- Private transactions in the PXE are executed first, followed by public transactions + +## Private and public state + +Private state works with UTXOs, which are chunks of data that we call notes. To keep things private, notes are stored in an [append-only UTXO tree](./advanced/storage/indexed_merkle_tree.mdx), and a nullifier is created when notes are invalidated (aka deleted). Nullifiers are stored in their own [nullifier tree](./advanced/storage/indexed_merkle_tree.mdx). + +Public state works similarly to other chains like Ethereum, behaving like a public ledger. Public data is stored in a public data tree. + +![Public vs private state](@site/static/img/public-and-private-state-diagram.png) + +Aztec [smart contract](../aztec-nr/framework-description/contract_structure.md) developers should keep in mind that different data types are used when manipulating private or public state. Working with private state is creating commitments and nullifiers to state, whereas working with public state is directly updating state. + +## Accounts and keys + +### Account abstraction + +Every account in Aztec is a smart contract (account abstraction). This allows implementing different schemes for authorizing transactions, nonce management, and fee payments. + +Developers can write their own account contract to define the rules by which user transactions are authorized and paid for, as well as how user keys are managed. + +Learn more about account contracts [here](./accounts/index.md). + +### Key pairs + +Each account in Aztec is backed by 3 key pairs: + +- A **nullifier key pair** used for note nullifier computation +- A **incoming viewing key pair** used to encrypt a note for the recipient +- A **outgoing viewing key pair** used to encrypt a note for the sender + +As Aztec has native account abstraction, accounts do not automatically have a signing key pair to authenticate transactions. This is up to the account contract developer to implement. + +## Noir + +Noir is a zero-knowledge domain specific language used for writing smart contracts for the Aztec network. It is also possible to write circuits with Noir that can be verified on or offchain. For more in-depth docs into the features of Noir, go to the [Noir documentation](https://noir-lang.org/). diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/pxe/acir_simulator.md b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/pxe/acir_simulator.md new file mode 100644 index 000000000000..e650b232d8dd --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/pxe/acir_simulator.md @@ -0,0 +1,38 @@ +--- +title: ACIR Simulator +description: Learn about the ACIR Simulator that handles the execution and simulation of Aztec smart contract functions, including private, public, and utility functions. +--- + + + +The ACIR Simulator is responsible for simulation Aztec smart contract function execution. This component helps with correct execution of Aztec transactions. + +Simulating a function implies generating the partial witness and the public inputs of the function, as well as collecting all the data (such as created notes or nullifiers, or state changes) that are necessary for components upstream. + +## Simulating functions + +It simulates all [three types of contract functions](../call_types.md#aztec-call-types): + +### Private Functions + +Private functions are simulated and proved client-side, and verified client-side in the private kernel circuit. + +They are run with the assistance of a DB oracle that provides any private data requested by the function. You can read more about oracle functions in the smart contract section [here](../../aztec-nr/framework-description/advanced/protocol_oracles.md). + +Private functions can call other private functions and can request to call a public function. The public function execution will be performed by the sequencer asynchronously, so private functions don't have direct access to the return values of public functions. + +### Public Functions + +Public functions are simulated and proved on the sequencer side, and verified by the [public kernel circuit](../advanced/circuits/kernels/public_kernel.md). + +They are run with the assistance of an oracle that provides any value read from the public state tree. + +Public functions can call other public functions as well as private functions. Public function composability can happen atomically, but public to private function calls happen asynchronously (the private function call must happen in a future block). + +### Utility Functions + +Utility functions are used to extract useful data for users, such as the user balance. They are not proven, and are simulated client-side. + +They are run with the assistance of an [oracle resolver](https://noir-lang.org/docs/explainers/explainer-oracle) that provides any private data requested by the function. + +At the moment, utility functions cannot call any other function. It is not possible for them to call private or public functions, but it is on the roadmap to allow them to call other utility functions. diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/pxe/index.md b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/pxe/index.md new file mode 100644 index 000000000000..63db06362128 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/pxe/index.md @@ -0,0 +1,111 @@ +--- +title: Private Execution Environment (PXE) +sidebar_position: 8 +tags: [PXE] +description: Explore the PXE, a client-side library that handles private function execution, proof generation, secret management, and transaction orchestration in Aztec. +keywords: [pxe, private execution environment] +importance: 1 +--- + + + +import Image from "@theme/IdealImage"; + +This page describes the Private Execution Environment (PXE, pronounced "pixie"), a client-side library for the execution of private operations. It is a TypeScript library that can be run within Node.js, inside wallet software or a browser. + +The PXE generates proofs of private function execution, and sends these proofs along with public function execution requests to the sequencer. Private inputs never leave the client-side PXE. + +The PXE is responsible for: + +- storing secrets (e.g. encryption keys, notes, tagging secrets for note discovery) and exposing an interface for safely accessing them +- orchestrating private function (circuit) execution and proof generation, including implementing [oracles](../../aztec-nr/framework-description/advanced/protocol_oracles.md) needed for transaction execution +- syncing users' relevant network state, obtained from an Aztec node +- safely handling multiple accounts with siloed data and permissions + +One PXE can handle data and secrets for multiple accounts, while also providing isolation between them as required. + +## System architecture + +```mermaid +flowchart TB + User --Interacts with--> Wallet + Wallet --Prompts--> User + subgraph Browser + Dapp + end + Dapp --Calls (requires auth)--> Wallet + subgraph Client-side + Wallet --Scoped--> PXE + PXE --Execute/Prove--> Circuits + Circuits --Oracle--> PXE + end + PXE --Queries world-state (causes privacy leaks)--> Node + Wallet --Track tx state (may be handled via PXE)--> Node +``` + +## Components + +### Transaction Simulator + +An application will prompt the users PXE to execute a transaction (e.g. execute X function, with Y arguments, from Z account). The application or the wallet may handle gas estimation. + +The ACIR (Abstract Circuit Intermediate Representation) simulator handles the execution of smart contract functions by simulating transactions. It generates the required data and inputs for these functions. You can find more details about how it works [here](./acir_simulator.md). + +Until there are simulated simulations ([#9133](https://github.com/AztecProtocol/aztec-packages/issues/9133)), authwits are required for simulation, before attempting to prove. + +### Proof Generation + +After simulation, the wallet calls `proveTx` on the PXE with all of the data generated during simulation and any [authentication witnesses](../advanced/authwit.md) (for allowing contracts to act on behalf of the users' account contract). + +Once proven, the wallet sends the transaction to the network and sends the transaction hash back to the application. + +### Database + +The database stores transactional data and notes within the user's PXE. + +The database stores various types of data, including: + +- **Notes**: Data representing users' private state. These are often stored onchain, encrypted to a user. A contract will parse onchain data to find notes relevant for users' accounts and they are stored in the PXE. +- **Authentication Witnesses**: Data used to approve others for executing transactions on your behalf. The PXE provides this data to transactions on-demand during transaction simulation via oracles. +- **Capsules**: External data or data injected into the system via [oracles](#oracles). +- **Address Book**: A list of expected addresses that a PXE may encrypt notes for, or received encrypted notes from. This list helps the PXE reduce the amount of work required to find notes relevant to it's registered accounts. + +The PXE is not in charge of note discovery, ie finding the notes that are owned by the user. This is handled by Aztec contracts, and you can learn more [here](../advanced/storage/note_discovery.md) + +### Authorization + +The PXE handles access rights by: + +1. action +2. domain +3. contract +4. account + +For example, uniswap.com (**domain**) can query (**action**, involves execution that has access to an accounts' private state) on these five token **contracts** for these two **accounts** of mine, that are registered in the PXE. + +Available actions include: + +- Seeing that the accounts exist in the PXE +- Running queries, simulations, accessing logs, registering contracts, etc at a given a contract address +- Manually adding notes + +Providing an application with an empty scopes array (e.g. `scopes: []`) to the PXE means that no information can be accessed, but no scopes (e.g. `scopes: undefined`) defaults to _all_ scopes being available. + +### Contract management + +Applications can add contract code required for a user to interact with the application to the users PXE. The PXE will check whether the required contracts have already been registered in users PXE. There are no getters to check whether the contract has been registered, as this could leak privacy (e.g. a dapp could check whether specific contracts have been registered in a users PXE and infer information about their interaction history). + +### Keystore + +The keystore is a secure storage for private and public keys. + +### Oracles + +Oracles are pieces of data that are injected into a smart contract function from the client side. You can read more about why and how they work in the [smart contracts section](../../aztec-nr/framework-description/advanced/protocol_oracles.md). + +## For developers + +To learn how to develop on top of the PXE, refer to these guides: + +- [Run more than one PXE on your local machine](../../tutorials/local_network.md#running-multiple-pxes-in-the-local-network) +- [Use in-built oracles including oracles for arbitrary data](../../aztec-nr/framework-description/advanced/how_to_use_capsules.md) diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/state_management.md b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/state_management.md new file mode 100644 index 000000000000..26f3c39a071e --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/state_management.md @@ -0,0 +1,215 @@ +--- +title: State Management +description: How are storage slots derived for public and private state +sidebar_position: 0 +tags: [protocol, storage] +--- + +import Image from "@theme/IdealImage"; + + + +In Aztec, private data and public data are stored in two trees; a public data tree and a note hashes tree. + +These trees have in common that they store state for _all_ accounts on the Aztec network directly as leaves. This is different from Ethereum, where a state trie contains smaller tries that hold the individual accounts' storage. + +It also means that we need to be careful about how we allocate storage to ensure that they don't collide! We say that storage should be _siloed_ to its contract. The exact way of siloing differs a little for public and private storage. Which we will see in the following sections. + +Aztec has a hybrid public/private state model. Aztec contract developers can specify which data is public and which data is private, as well as the functions that can operate on that data. + +## Public State + +Aztec has public state that will be familiar to developers coming that have worked on other blockchains. Public state is transparent and is managed by the associated smart contract logic. + +Internal to the Aztec network, public state is stored and updated by the sequencer. The sequencer executes state transitions, generates proofs of correct execution (or delegates proof generation to the prover network), and publishes the associated data to Ethereum. + +## Private State + +Private state must be treated differently from public state. Private state is encrypted and therefore is "owned" by a user or a set of users (via shared secrets) that are able to decrypt the state. + +Private state is represented in an append-only database since updating a record would leak information about the transaction graph. + +The act of "deleting" a private state variable can be represented by adding an associated nullifier to a nullifier set. The nullifier is generated such that, without knowing the decryption key of the owner, an observer cannot link a state record with a nullifier. + +Modification of state variables can be emulated by nullifying the state record and creating a new record to represent the variable. Private state has an intrinsic UTXO structure. + +## Notes + +As explained above, there is a difference between public and private state. Private state uses UTXOs (unspent transaction outputs), also known as notes. This section introduces the concept of UTXOs and how notes are abstracted on Aztec. + +## What are notes? + +In an account-based model such as Ethereum, each account is typically associated with a specific location in the data tree. In a UTXO model, each note specifies its owner and there is no relationship between an account and data's location in the data tree. Notes are encrypted pieces of data that can only be decrypted by their owner. + +Rather than storing entire notes in a data tree, note commitments (hashes of the notes) are stored in a merkle tree, aptly named the note hash tree. Users will prove that they have the note pre-image information when they update private state in a contract. + +When a note is updated, Aztec nullifies the original commitment in the note hash tree by creating a nullifier from the note data, and may create a new note with the updated information, encrypted to a new owner if necessary. This helps to decouple actions of creating, updating and deleting private state. + + + +Notes are comparable to cash, with some slight differences. When you want to spend \$3.50 USD in real life, you give your \$5 note to a cashier who will keep \$3.50 and give you separate notes that add up to \$1.50. Using private notes on Aztec, when you want to spend a \$5 note, you nullify it and create a \$1.5 note with yourself as the owner and a \$3.5 note with the recipient as the owner. Only you and the recipient are aware of \$3.5 transaction, they are not aware that you "split" the \$5 note. + +## Sending notes + +When creating notes for a recipient, you need a way to send the note to them. There are a few ways to do this: + +### Onchain (encrypted logs): + +This is the common method and works well for most use cases. You can emit an encrypted log as part of a transaction. The encrypted note data will be posted onchain, allowing the recipient to find the note through [note discovery](./advanced/storage/note_discovery.md). + +### Offchain: + +In some cases, if you know the recipient offchain, you might choose to share the note data directly with them. The recipient can store that note in their PXE and later spend it. + +### Self-created notes (not emitted): + +If you create a note for yourself, you don’t need to broadcast it to the network or share anything. You will only need to keep the note somewhere, such as in your PXE, so you can prove ownership and spend it in future transactions. + +## Abstracting notes from apps & users + +When using the Aztec protocol, users may not be aware of the specific notes that they own. Their experience should be similar to Ethereum, and should instead see the amount of their assets inside their account. + +This is accomplished through the smart contract library, Aztec.nr, which abstracts notes by allowing developers to specify custom note types. This means they can specify how notes are interacted with, nullified, transferred, and displayed. Aztec.nr also helps users discover all of the notes that have been encrypted to their account and posted to the chain, known as [note discovery](./advanced/storage/note_discovery.md). + +## Technical details + +### Some context + +- Public functions and storage work much like other blockchains in terms of having dedicated storage slots and being publicly visible +- Private functions are executed locally with proofs generated for sound execution, and commitments to private variable updates are stored using append-only trees +- "Note" types are part of Aztec.nr, a framework that facilitates use of Aztec's different storage trees to achieve things such as private variables + +This page will focus on how private variables are implemented with Notes and storage trees. + +#### Side-note about execution + +Under the hood, the Aztec protocol handles some important details around public and private function calls. Calls between them are asynchronous due to different execution contexts (local execution vs. node execution). +A detailed explanation of the transaction lifecycle can be found [here](./transactions.md#simple-example-of-the-private-transaction-lifecycle). + +## Private state variables in Aztec + +State variables in an Aztec contract are defined inside a struct specifically named `Storage`, and must satisfy the [Note Interface (GitHub link)](https://github.com/AztecProtocol/aztec-packages/tree/v3.0.2/noir-projects/aztec-nr/aztec/src/note/note_interface.nr) and contain a [Note header (GitHub link)](https://github.com/AztecProtocol/aztec-packages/tree/v3.0.2/noir-projects/aztec-nr/aztec/src/note/note_header.nr). + +The Note header struct contains the contract address which the value is effectively siloed to, a nonce to ensure unique Note hashes, and a storage "slot" (or ID) to associate multiple notes. + +A couple of things to unpack here: + +#### Storage "slot" + +Storage slots are more literal for public storage, a place where a value is stored. For private storage, a storage slot is logical (more [here](./advanced/storage/storage_slots.md)). + +#### Silos + +The address of the contract is included in a Note's data to ensure that different contracts don't arrive at the same hash with an identical variable. This is handled in the protocol's execution. + +### Note types + +There is more than one Note type, such as the `PrivateSet` type is used for private variables. There are also `PrivateMutable` and `PrivateImmutable` types. + +Furthermore, notes can be completely custom types, storing any value or set of values that are desired by an application. + +### Initialization + +Private state variables are stored locally when the contract is created. Depending on the application, values may be privately shared by the creator with others via encrypted logs onchain. +A hash of a note is stored in the append-only note hash tree on the network so as to prove existence of the current state of the note in a privacy preserving way. + +#### Note Hash Tree + +By virtue of being append only, notes are not edited. If two transactions amend a private value, multiple notes will be inserted into the tree to the note hash tree and the nullifier tree. The header will contain the same logical storage slot. + +### Reading Notes + +:::info + +Only those with appropriate keys/information will be able to successfully read private values that they have permission to. Notes can be read outside of a transaction or "offchain" with no changes to data structures onchain. + +::: + +When a note is read in a transaction, a subsequent read from another transaction of the same note would reveal a link between the two. So to preserve privacy, notes that are read in a transaction are said to be "consumed" (defined below), and new note(s) are then created with a unique hash. + +With type `PrviateSet`, a private variable's value is interpreted as the sum of values of notes with the same logical storage slot. + +Consuming, deleting, or otherwise "nullifying" a note is NOT done by deleting the Note hash; this would leak information. Rather a nullifier is created deterministically linked to the value. This nullifier is inserted into another the nullifier storage tree. + +When reading a value, the local private execution checks that its notes (of the corresponding storage slot/ID) have not been nullified. + +### Updating + +:::note +Only those with appropriate keys/information will be able to successfully nullify a value that they have permission to. +::: + +To update a value, its previous note hash(es) are nullified. The new note value is updated in the user's private execution environment (PXE), and the updated note hash inserted into the note hash tree. + +## Supplementary components + +Some optional background resources on notes can be found here: + +- [High level network architecture](./index.md), specifically the Private Execution Environment +- [Transaction lifecycle (simple diagram)](./transactions.md#simple-example-of-the-private-transaction-lifecycle) +- [Public State](#public-state) and [Private State](#private-state) + +Notes touch several core components of the protocol, but we will focus on a the essentials first. + +### Some code context + +The way Aztec benefits from the Noir language is via three important components: + +- `Aztec.nr` - a Noir framework enabling contracts on Aztec, written in Noir. Includes useful Note implementations +- `noir contracts` - example Aztec contracts +- `noir-protocol-circuits` - a crate containing essential circuits for the protocol (public circuits and private wrappers) + +A lot of what we will look at will be in [aztec-nr/aztec/src/note (GitHub link)](https://github.com/AztecProtocol/aztec-packages/tree/v3.0.2/noir-projects/aztec-nr/aztec/src/note), specifically the lifecycle and note interface. + +Looking at the noir circuits in these components, you will see references to the distinction between public/private execution and state. + +### Lifecycle functions + +Inside the [lifecycle (GitHub link)](https://github.com/AztecProtocol/aztec-packages/tree/v3.0.2/noir-projects/aztec-nr/aztec/src/note/lifecycle.nr) circuits we see the functions to create and destroy a note, implemented as insertions of note hashes and nullifiers respectively. This is helpful for regular private variables. + +We also see a function to create a note hash from the public context, a way of creating a private variable from a public call (run in the sequencer). This could be used in application contracts to give private digital assets to users. + +### Note Interface functions + +To see a [note_interface (GitHub link)](https://github.com/AztecProtocol/aztec-packages/tree/v3.0.2/noir-projects/aztec-nr/aztec/src/note/note_interface.nr) implementation, we will look at a simple [ValueNote GitHub link](https://github.com/AztecProtocol/aztec-packages/tree/v3.0.2/noir-projects/aztec-nr/value-note/src/value_note.nr). + +The interface is required to work within an Aztec contract's storage, and a ValueNote is a specific type of note to hold a number (as a `Field`). + +#### Computing hashes and nullifiers + +A few key functions in the note interface are around computing the note hash and nullifier, with logic to get/use secret keys from the private context. + +In the ValueNote implementation you'll notice that it uses the `pedersen_hash` function. This is currently required by the protocol, but may be updated to another hashing function, like poseidon. + +As a convenience, the outer [note/utils.nr (GitHub link)](https://github.com/AztecProtocol/aztec-packages/tree/v3.0.2/noir-projects/aztec-nr/aztec/src/note/utils.nr) contains implementations of functions that may be needed in Aztec contracts, for example computing note hashes. + +#### Serialization and deserialization + +Serialization/deserialization of content is used to convert between the Note's variables and a generic array of Field elements. The Field type is understood and used by lower level crypographic libraries. +This is analogous to the encoding/decoding between variables and bytes in solidity. + +For example in ValueNote, the `serialize_content` function simply returns: the value, nullifying public key hash (as a field) and the note randomness; as an array of Field elements. + +### Value as a sum of Notes + +We recall that multiple notes are associated with a "slot" (or ID), and so the value of a numerical note (like ValueNote) is the sum of each note's value. +The helper function in [balance_utils (GitHub link)](https://github.com/AztecProtocol/aztec-packages/blob/#include_/noir-projects/aztec-nr/value-note/src/balance_utils.nr) implements this logic taking a `PrivateSet` of `ValueNotes`. + +A couple of things worth clarifying: + +- A `PrivateSet` takes a Generic type, specified here as `ValueNote`, but can be any `Note` type (for all notes in the set) +- A `PrivateSet` of notes also specifies _the_ slot of all Notes that it holds + +### Example - Notes in action + +The Aztec.nr framework includes examples of high-level states [easy_private_uint (GitHub link)](https://github.com/AztecProtocol/aztec-packages/tree/v3.0.2/noir-projects/aztec-nr/easy-private-state/src/easy_private_uint.nr) for use in contracts. + +The struct (`EasyPrivateUint`) contains a Context, Set of ValueNotes, and storage_slot (used when setting the Set). + +Notice how the `add` function shows the simplicity of appending a new note to all existing ones. On the other hand, `sub` (subtraction), needs to first add up all existing values (consuming them in the process), and then insert a single new value of the difference between the sum and parameter. + +--- + +### References + +- ["Stable" state variable (GitHub link)](https://github.com/AztecProtocol/aztec-packages/issues/4130) diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/transactions.md b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/transactions.md new file mode 100644 index 000000000000..1f5cb2100fea --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/transactions.md @@ -0,0 +1,167 @@ +--- +title: Transactions +sidebar_position: 3 +tags: [protocol] +description: Comprehensive guide to the Aztec transaction lifecycle, covering private execution, PXE interactions, kernel circuits, and the step-by-step process from user request to L1 settlement. +--- + +import Image from '@theme/IdealImage'; + +On this page you'll learn: + +- The step-by-step process of sending a transaction on Aztec +- The role of components like PXE, Aztec Node, ACIR simulator, and the sequencer +- The Aztec Kernel and its two circuits: private and public, and how they execute function calls +- The call stacks for private & public functions and how they determine a transaction's completion + +## Simple Example of the (Private) Transaction Lifecycle + +The transaction lifecycle for an Aztec transaction is fundamentally different from the lifecycle of an Ethereum transaction. + +The introduction of the Private eXecution Environment (PXE) provides a safe environment for the execution of sensitive operations, ensuring that decrypted data are not accessible to unauthorized applications. However, the PXE exists client-side on user devices, which creates a different model for imagining what the lifecycle of a typical transaction might look like. The existence of a sequencing network also introduces some key differences between the Aztec transaction model and the transaction model used for other networks. + +The accompanying diagram illustrates the flow of interactions between a user, their wallet, the PXE, the node operators (sequencers / provers), and the L1 chain. + + + +1. **The user initiates a transaction** – In this example, the user decides to privately send 10 DAI to gudcause.eth. After inputting the amount and the receiving address, the user clicks the confirmation button on their wallet. + +_The transaction has not been broadcasted to the sequencer network yet. For now, the transaction exists solely within the context of the PXE._ + +2. **The PXE executes transfer locally** – The PXE, running locally on the user's device, executes the transfer method on the DAI token contract on Aztec and computes the state difference based on the user’s intention. + +_The transaction has still not been broadcasted to the sequencer network yet and continues to live solely within the context of the PXE._ + +3. **The PXE proves correct execution** – At this point, the PXE proves correct execution (via zero-knowledge proofs) of the authorization and of the private transfer method. Once the proofs have been generated, the PXE sends the proofs and required inputs (inputs are new note commitments, stored in the note hash tree and nullifiers stored in the nullifiers tree) to the sequencer. Nullifiers are data that invalidate old commitments, ensuring that commitments can only be used once. + +_The sequencer has received the transaction proof and can begin to process the transaction - verifying proofs and applying updates to the relevant data trees - alongside other public and private transactions._ + +4. **The sequencer has the necessary information to act** – the randomly-selected sequencer (based on the Fernet sequencer selection protocol) validates the transaction proofs along with required inputs (e.g. the note commitments and nullifiers) for this private transfer. The sequencer also executes public functions and requests proofs of public execution from a prover network. The sequencer updates the corresponding data trees and does the same for other private transactions. When the sequencer receives proofs from the prover network, the proofs will be bundled into a final rollup proof. + +_The sequencer has passed the transaction information – proofs of correct execution and authorization, or public function execution information – to the prover, who will submit the new state root to Ethereum._ + +5. **The transaction settles to L1** – the verifier contract on Ethereum can now validate the rollup proof and record a new state root. The state root is submitted to the rollup smart contract. Once the state root is verified in an Ethereum transaction, the private transfer has settled and the transaction is considered final. + +### Detailed Diagram + +Transactions on Aztec start with a call from Aztec.js, which creates a request containing transaction details. This request moves to the Private Execution Environment (PXE) which simulates and processes it. Then the PXE interacts with the Aztec Node which uses the sequencer to ensure that all the transaction details are enqueued properly. The sequencer then submits the block to the rollup contract, and the transaction is successfully mined. + + + +See [this diagram](https://raw.githubusercontent.com/AztecProtocol/aztec-packages/2fa143e4d88b3089ebbe2a9e53645edf66157dc8/docs/static/img/local_network_sending_a_tx.svg) for a more detailed overview of the transaction execution process. It highlights 3 different types of transaction execution: contract deployments, private transactions and public transactions. + +See the page on [contract communication](../aztec-nr/framework-description/functions/public_private_calls.md) for more context on transaction execution. + +### Transaction Requests + +Transaction requests are how transactions are constructed and sent to the network. + +In Aztec.js: + +```javascript title="constructor" showLineNumbers +constructor( + /** Sender. */ + public origin: AztecAddress, + /** Pedersen hash of function arguments. */ + public argsHash: Fr, + /** Transaction context. */ + public txContext: TxContext, + /** Function data representing the function to call. */ + public functionData: FunctionData, + /** A salt to make the hash difficult to predict. The hash is used as the first nullifier if there is no nullifier emitted throughout the tx. */ + public salt: Fr, +) {} +``` +> Source code: yarn-project/stdlib/src/tx/tx_request.ts#L15-L28 + + +Where: + +- `origin` is the account contract where the transaction is initiated from. +- `functionData` contains the function selector and indicates whether the function is private or public. +- `argsHash` is the hash of the arguments of all of the calls to be executed. The complete set of arguments is passed to the PXE as part of the [TxExecutionRequest](https://github.com/AztecProtocol/aztec-packages/blob/v3.0.2/yarn-project/stdlib/src/tx/tx_execution_request.ts) and checked against this hash. +- `txContext` contains the chain id, version, and gas settings. + +The `functionData` includes an `AppPayload`, which includes information about the application functions and arguments, and a `FeePayload`, which includes info about how to pay for the transaction. + +An account contract validates that the transaction request has been authorized via its specified authorization mechanism, via the `is_valid_impl` function (e.g. [an ECDSA signature](https://github.com/AztecProtocol/aztec-packages/blob/v3.0.2/noir-projects/noir-contracts/contracts/account/ecdsa_k_account_contract/src/main.nr#L56-L57), generated [in JS](https://github.com/AztecProtocol/aztec-packages/blob/v3.0.2/yarn-project/accounts/src/ecdsa/ecdsa_k/account_contract.ts#L30)). + +Transaction requests are simulated in the PXE in order to generate the necessary inputs for generating proofs. Once transactions are proven, a [transaction object](https://github.com/AztecProtocol/aztec-packages/blob/v3.0.2/yarn-project/stdlib/src/tx/tx.ts#L26) is created and can be sent to the network to be included in a block. + +#### Contract Interaction Methods + +Most transaction requests are created as interactions with specific contracts. The exception is transactions that deploy contracts. Here are the main methods for interacting with contracts related to transactions. + +1. [`simulate`](#simulate) +2. [`send`](#send) + +##### `simulate` + +```javascript title="simulate" showLineNumbers +/** + * Simulate a transaction and get information from its execution. + * Differs from prove in a few important ways: + * 1. It returns the values of the function execution, plus additional metadata if requested + * 2. It supports `utility`, `private` and `public` functions + * + * @param options - An optional object containing additional configuration for the simulation. + * @returns Depending on the simulation options, this method directly returns the result value of the executed + * function or a rich object containing extra metadata, such as estimated gas costs (if requested via options), + * execution statistics and emitted offchain effects + */ +public async simulate( + options: T, +): Promise['estimateGas']>>; +// eslint-disable-next-line jsdoc/require-jsdoc +public async simulate( + options: T, +): Promise>; +// eslint-disable-next-line jsdoc/require-jsdoc +public async simulate( + options: SimulateInteractionOptions, +): Promise> { +``` +> Source code: yarn-project/aztec.js/src/contract/contract_function_interaction.ts#L81-L104 + + +##### `send` + +```javascript title="send" showLineNumbers +/** + * Sends a transaction to the contract function with the specified options. + * This function throws an error if called on a utility function. + * It creates and signs the transaction if necessary, and returns a SentTx instance, + * which can be used to track the transaction status, receipt, and events. + * @param options - An object containing 'from' property representing + * the AztecAddress of the sender and optional fee configuration + * @returns A SentTx instance for tracking the transaction status and information. + */ +public send(options: SendInteractionOptions): SentTx { +``` +> Source code: yarn-project/aztec.js/src/contract/base_contract_interaction.ts#L30-L41 + + +### Batch Transactions + +Batched transactions are a way to send multiple transactions in a single call. They are created by the [`BatchCall` class in Aztec.js](https://github.com/AztecProtocol/aztec-packages/blob/v3.0.2/yarn-project/aztec.js/src/contract/batch_call.ts). This allows a batch of function calls from a single wallet to be sent as a single transaction through a wallet. + +### Enabling Transaction Semantics + +There are two kernel circuits in Aztec, the private kernel and the public kernel. Each circuit validates the correct execution of a particular function call. + +A transaction is built up by generating proofs for multiple recursive iterations of kernel circuits. Each call in the call stack is modeled as new iteration of the kernel circuit and are managed by a [FIFO]() queue containing pending function calls. There are two call stacks, one for private calls and one for public calls. + +One iteration of a kernel circuit will pop a call off of the stack and execute the call. If the call triggers subsequent contract calls, these are pushed onto the stack. + +Private kernel proofs are generated first. The transaction is ready to move to the next phase when the private call stack is empty. + +The public kernel circuit takes in proof of a public/private kernel circuit with an empty private call stack, and operates recursively until the public call stack is also empty. + +A transaction is considered complete when both call stacks are empty. + +The only information leaked about the transaction is: + +1. The number of private state updates triggered +2. The set of public calls generated + +The addresses of all private calls are hidden from observers. diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/wallets.md b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/wallets.md new file mode 100644 index 000000000000..40c41ebbf24d --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/foundational-topics/wallets.md @@ -0,0 +1,113 @@ +--- +title: Wallets +sidebar_position: 2 +tags: [accounts] +description: Overview of wallet responsibilities in Aztec including account management, private state tracking, transaction execution, key management, and authorization handling. +--- + +On this page we will cover the main responsibilities of a wallet in the Aztec network. + +Go to [wallet architecture](./index.md) for an overview of its architecture and a reference on the interface a wallet must implement. + +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 + +The first step for any wallet is to let the user set up their [accounts](./accounts/index.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/AztecProtocol/aztec-packages/blob/v3.0.2/yarn-project/aztec.js/src/account/interface.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](./accounts/keys.md#address-keys) 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 a privacy key. 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 + +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/AztecProtocol/aztec-packages/blob/master/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 of 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 +Since private functions rely on a UTXO model, the private execution trace of a transaction is determined exclusively by the notes used as inputs. Since these notes are immutable, the trace of a transaction is always the same, so any effects observed during simulation will be exactly the same when the transaction is mined. However, the transaction may be dropped if it attempts to consume a private note that another transaction nullified before it gets mined. Note that this applies only to private function execution. Public functions rely on an account model, similar to Ethereum, so their execution trace depends on the chain's public state at the point they are included in a block, which may have changed since the transaction was simulated locally. +::: + +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. + +:::warning +There are no proofs generated as of the Local Network release. This will be included in a future release before testnet. +::: + +## Authorizing actions + +Account contracts in Aztec expose an interface for other contracts to validate [whether an action is authorized by the account or not](./accounts/index.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. + +## 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 [two sets of keys](./accounts/keys.md): privacy keys and authentication keys. Privacy keys are mandated by the protocol and used for encryption and nullification, whereas authentication 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 authentication keys. + +:::info +Due to limitations in the current architecture, privacy keys need to be available in the wallet software itself and cannot be punted to an external keystore. This restriction may be lifted in a future release. +::: + +## Recipient encryption keys + +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](./accounts/keys.md#address-keys). 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 + +Last but not least, wallets also store the user's private state. Wallets currently rely on brute force decryption, where every new block is downloaded and its encrypted data blobs are attempted to be decrypted with the user decryption keys. Whenever a blob is decrypted properly, it is added to the corresponding account's private state. Note that wallets must also scan for private state in blocks prior to the deployment of a user's account contract, since users may have received private state before deployment. + +:::info +At the time of this writing, all private state is encrypted and broadcasted through the network, and eventually committed to L1. This means that a wallet can reconstruct its entire private state out of its encryption keys in the event of local data loss. +::: + +Encrypted data blobs do not carry any public information as to whom their recipient is. Therefore, it is not possible for a remote node to identify the notes that belong to a user, and it is not possible for a wallet to query a remote node for its private state. As such, wallets need to keep a local database of their accounts private state, in order to be able to answer any queries on their private state. + +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 responsibility of the wallet to require authorization from the user before disclosing private state to a dapp. + +## Wallet Architecture + +Wallets expose to dapps an interface that allows them to act on behalf of the user, such as querying private state or sending transactions. Bear in mind that, as in Ethereum, wallets should require user confirmation whenever carrying out a potentially sensitive action requested by a dapp. + +Architecture-wise, a wallet is an instance of an **Private Execution Environment (PXE)** which manages user keys and private state. +The PXE also communicates with an **Aztec Node** for retrieving public information or broadcasting transactions. +Note that the PXE requires a local database for keeping private state, and is also expected to be continuously syncing new blocks for trial-decryption of user notes. + +Additionally, a wallet must be able to handle one or more account contract implementation. When a user creates a new account, the account is represented onchain by an account contract. The wallet is responsible for deploying and interacting with this contract. A wallet may support multiple flavours of accounts, such as an account that uses ECDSA signatures, or one that relies on WebAuthn, or one that requires multi-factor authentication. For a user, the choice of what account implementation to use is then determined by the wallet they interact with. + +In code, this translates to a wallet implementing an **AccountInterface** interface that defines [how to create an _execution request_ out of an array of _function calls_](#transaction-lifecycle) for the specific implementation of an account contract and [how to generate an _auth witness_](#authorizing-actions) for authorizing actions on behalf of the user. Think of this interface as the Javascript counterpart of an account contract, or the piece of code that knows how to format a transaction and authenticate an action based on the rules defined by the user's account contract implementation. + +## 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. + +```typescript title="account-interface" showLineNumbers + +/** + * Handler for interfacing with an account. Knows how to create transaction execution + * requests and authorize actions for its corresponding account. + */ +export interface AccountInterface extends EntrypointInterface, AuthWitnessProvider { + /** Returns the complete address for this account. */ + getCompleteAddress(): CompleteAddress; + + /** Returns the address for this account. */ + getAddress(): AztecAddress; + + /** Returns the chain id for this account */ + getChainId(): Fr; + + /** Returns the rollup version for this account */ + getVersion(): Fr; +} +``` +> Source code: yarn-project/aztec.js/src/account/interface.ts#L6-L25 + diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/resources/_category_.json b/docs/developer_versioned_docs/version-v3.0.2/docs/resources/_category_.json new file mode 100644 index 000000000000..4c53f1c2248a --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/resources/_category_.json @@ -0,0 +1,6 @@ +{ + "label": "Resources", + "position": 6, + "collapsible": true, + "collapsed": true +} diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/resources/considerations/_category_.json b/docs/developer_versioned_docs/version-v3.0.2/docs/resources/considerations/_category_.json new file mode 100644 index 000000000000..3d16e4d09376 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/resources/considerations/_category_.json @@ -0,0 +1,6 @@ +{ + "label": "Considerations and Limitations", + "position": 4, + "collapsible": true, + "collapsed": true +} diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/resources/considerations/limitations.md b/docs/developer_versioned_docs/version-v3.0.2/docs/resources/considerations/limitations.md new file mode 100644 index 000000000000..7ad47b094f01 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/resources/considerations/limitations.md @@ -0,0 +1,222 @@ +--- +title: Limitations +description: Understand the current limitations of the Aztec network and its implications for developers. +sidebar_position: 6 +--- + +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? + +- Regular Breaking Changes; +- Missing features; +- Bugs; +- An 'unpolished' UX; +- Missing information. + +## 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 + +- It is a testing environment, it is insecure, and unaudited. It is only for testing purposes. +- `msg_sender` is currently leaking when doing private -> public calls + - The `msg_sender` will always be set, if you call a public function from the private world, the `msg_sender` will be set to the private caller's address. + - There are patterns that can mitigate this. +- The initial `msg_sender` is `-1`, which can be problematic for some contracts. +- The number of side-effects attached to a tx (when sending the tx to the mempool) is leaky. At this stage of development, this is _intentional_, so that we can gauge appropriate choices for privacy sets. We have always had clear plans to implement privacy sets so that side effects are much less leaky, and these will be in place come mainnet. +- A transaction can only emit a limited number of side-effects (notes, nullifiers, logs, l2->l1 messages), see [circuit limitations](#circuit-limitations). + - We haven't settled on the final constants, since we're still in a testing phase. But users could find that certain compositions of nested private function calls (e.g. call stacks that are dynamic in size, based on runtime data) could accumulate so many side-effects as to exceed tx limits. Such txs would then be unprovable. We would love for you to open an issue if you encounter this, as it will help us decide on adequate sizes for our constants. +- There are lots of features that we still want to implement. Checkout github and the forum for details. If you would like a feature, please open an issue on github! + +## WARNING + +Do not use real, meaningful secrets in Aztec's testnets. Some privacy features are still being worked on, including ensuring a secure "zk" property. Since the Aztec stack is still being worked on, there are no guarantees that real secrets will remain secret. + +## Limitations + +There are plans to resolve all of the below. + +### It is not audited + +None of the Aztec stack is audited. It's being iterated-on every day. It will not be audited for quite some time. + +### Under-constrained + +Some of our more-complex circuits are still being worked on, so they will still be be underconstrained. + +#### What are the consequences? + +Sound proofs are really only needed as a protection against malicious behavior, which we're not testing for at this stage. + +### Keys and Addresses are subject to change + +The way in which keypairs and addresses are derived is still being iterated on as we receive feedback. + +#### What are the consequences? + +This will impact the kinds of apps that you can build with the Local Network, as it is today: + +Please open new discussions on [discourse](http://discourse.aztec.network) or open issues on [github](http://github.com/AztecProtocol/aztec-packages), if you have requirements that aren't-yet being met by the local network's current key derivation scheme. + +### 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 don't wish to run full nodes, so rely on 3rd-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's a problem: privacy. If a privacy-seeking user makes a query to a 3rd-party 'full node', that user might leak data about who they are, or about their historical network activity, or about their future intentions. One solution to this problem is "always run a full node", but pragmatically, not everyone will. To protect less-advanced users' privacy, research is underway to explore how a privacy-seeking user may request and receive data from a 3rd-party node without revealing what that data is, nor who is making the request. + +### No private data authentication + +Private data should not be returned to an app, unless the user authorizes such access to the app. An authorization layer is not-yet in place. + +#### What are the consequences? + +Any app can request and receive any private user data relating to any other private app. Obviously this sounds bad. But the local network is a sandbox, and no meaningful value or credentials should be stored there; only test values and test credentials. + +An auth layer will be added in due course. + +### No bytecode validation + +For safety reasons, bytecode should not be executed unless the PXE/Wallet has validated that the user's intentions (the function signature and contract address) match the bytecode. + +#### What are the consequences? + +Without such 'bytecode validation', if the incorrect bytecode is executed, and that bytecode is malicious, it could read private data from some other contract and emit that private data to the world. Obviously this would be bad in production. But the local network is a sandbox, and no meaningful value or credentials should be stored there; only test values and test credentials. + +There are plans to add bytecode validation soon. + +### Insecure hashes + +We are planning a full assessment of the protocol's hashes, including rigorous domain separation. + +#### What are the consequences? + +Collisions and other hash-related attacks might be possible in the local network. Obviously that would be bad in production. But it's unlikely to cause problems at this early stage of testing. + +### `msg_sender` is leaked when making a private -> public call + +There are ongoing discussions [here](https://forum.aztec.network/t/what-is-msg-sender-when-calling-private-public-plus-a-big-foray-into-stealth-addresses/7527 (and some more recent discussions that need to be documented) around how to address this. + +### New Privacy Standards are required + +There are many [patterns](../../resources/considerations/privacy_considerations.md) which can leak privacy, even on Aztec. Standards haven't been developed yet, to encourage best practices when designing private smart contracts. + +#### What are the consequences? + +For example, until community standards are developed to reduce the uniqueness of ['Tx Fingerprints'](../../resources/considerations/privacy_considerations.md#function-fingerprints-and-tx-fingerprints) app developers might accidentally forfeit some function privacy. + +## Smart Contract limitations + +We will never be done with all the yummy features we want to add to aztec.nr. We have lots of features that we still want to implement. Please check out github, and please open new issues with any feature requests you might have. + +## Circuit limitations + +### Upper limits on function outputs and tx outputs + +Due to the rigidity of zk-SNARK circuits, there are upper bounds on the amount of computation a circuit can perform, and on the amount of data that can be passed into and out of a function. + +> Blockchain developers are no stranger to restrictive computational environments. Ethereum has gas limits, local variable stack limits, call stack limits, contract deployment size limits, log size limits, etc. + +Here are the current constants: + +```rust title="constants" showLineNumbers +// TREES RELATED CONSTANTS +pub global ARCHIVE_HEIGHT: u32 = 30; // 4-second blocks for 100 years. +pub global VK_TREE_HEIGHT: u32 = 7; +pub global FUNCTION_TREE_HEIGHT: u32 = 7; // The number of private functions in a contract. +pub global NOTE_HASH_TREE_HEIGHT: u32 = 42; // 64 notes/tx (static because of base rollup insertion), 15tps, for 100 years. +pub global PUBLIC_DATA_TREE_HEIGHT: u32 = 40; // Average of 16 updates/tx (guess), 15tps, 100 years. +pub global NULLIFIER_TREE_HEIGHT: u32 = NOTE_HASH_TREE_HEIGHT; +pub global L1_TO_L2_MSG_TREE_HEIGHT: u32 = 36; // 1024 messages per checkpoint, with 72 seconds per checkpoint, for 100 years. +pub global ARTIFACT_FUNCTION_TREE_MAX_HEIGHT: u32 = FUNCTION_TREE_HEIGHT; // The number of unconstrained functions in a contract. Set to equal the number of private functions in a contract. + +pub global NULLIFIER_TREE_ID: Field = 0; +pub global NOTE_HASH_TREE_ID: Field = 1; +pub global PUBLIC_DATA_TREE_ID: Field = 2; +pub global L1_TO_L2_MESSAGE_TREE_ID: Field = 3; +pub global ARCHIVE_TREE_ID: Field = 4; +pub global NOTE_HASH_TREE_LEAF_COUNT: u64 = 1 << (NOTE_HASH_TREE_HEIGHT as u64); +pub global L1_TO_L2_MSG_TREE_LEAF_COUNT: u64 = 1 << (L1_TO_L2_MSG_TREE_HEIGHT as u64); + +// SUB-TREES RELATED CONSTANTS +pub global NOTE_HASH_SUBTREE_HEIGHT: u32 = 6; +pub global NULLIFIER_SUBTREE_HEIGHT: u32 = 6; +pub global PUBLIC_DATA_SUBTREE_HEIGHT: u32 = 6; +pub global L1_TO_L2_MSG_SUBTREE_HEIGHT: u32 = 10; +pub global NOTE_HASH_SUBTREE_ROOT_SIBLING_PATH_LENGTH: u32 = + NOTE_HASH_TREE_HEIGHT - NOTE_HASH_SUBTREE_HEIGHT; +pub global NULLIFIER_SUBTREE_ROOT_SIBLING_PATH_LENGTH: u32 = + NULLIFIER_TREE_HEIGHT - NULLIFIER_SUBTREE_HEIGHT; +pub global L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH: u32 = + L1_TO_L2_MSG_TREE_HEIGHT - L1_TO_L2_MSG_SUBTREE_HEIGHT; +// Maximum number of subtrees a L2ToL1Msg wonky tree can have. Used when calculating the out hash of a tx. +pub global MAX_L2_TO_L1_MSG_SUBTREES_PER_TX: u32 = 3; // ceil(log2(MAX_L2_TO_L1_MSGS_PER_TX)) + +// "PER TRANSACTION" CONSTANTS +pub global MAX_NOTE_HASHES_PER_TX: u32 = 1 << NOTE_HASH_SUBTREE_HEIGHT; +pub global MAX_NULLIFIERS_PER_TX: u32 = 1 << NULLIFIER_SUBTREE_HEIGHT; +pub global MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX: u32 = 16; +pub global MAX_ENQUEUED_CALLS_PER_TX: u32 = 32; +pub global PROTOCOL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX: u32 = 1; // This is the fee_payer's fee juice balance. +pub global MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX: u32 = + (1 as u8 << PUBLIC_DATA_SUBTREE_HEIGHT as u8) as u32; +pub global MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX: u32 = + MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX - PROTOCOL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX; +pub global MAX_PUBLIC_DATA_READS_PER_TX: u32 = 64; +pub global MAX_L2_TO_L1_MSGS_PER_TX: u32 = 8; // Leave at 8, because it results in sha256 hashing in the Tx Base Rollup +pub global MAX_NOTE_HASH_READ_REQUESTS_PER_TX: u32 = 64; +pub global MAX_NULLIFIER_READ_REQUESTS_PER_TX: u32 = 64; +pub global MAX_KEY_VALIDATION_REQUESTS_PER_TX: u32 = 64; +pub global MAX_PRIVATE_LOGS_PER_TX: u32 = 64; +pub global MAX_CONTRACT_CLASS_LOGS_PER_TX: u32 = 1; + +// "PER CALL" CONSTANTS +pub global MAX_NOTE_HASHES_PER_CALL: u32 = 16; +pub global MAX_NULLIFIERS_PER_CALL: u32 = 16; +pub global MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL: u32 = 8; +pub global MAX_ENQUEUED_CALLS_PER_CALL: u32 = MAX_ENQUEUED_CALLS_PER_TX; +pub global MAX_L2_TO_L1_MSGS_PER_CALL: u32 = MAX_L2_TO_L1_MSGS_PER_TX; +pub global MAX_NOTE_HASH_READ_REQUESTS_PER_CALL: u32 = 16; +pub global MAX_NULLIFIER_READ_REQUESTS_PER_CALL: u32 = 16; +pub global MAX_KEY_VALIDATION_REQUESTS_PER_CALL: u32 = 16; +pub global MAX_PRIVATE_LOGS_PER_CALL: u32 = 16; +pub global MAX_CONTRACT_CLASS_LOGS_PER_CALL: u32 = 1; +``` +> Source code: noir-projects/noir-protocol-circuits/crates/types/src/constants.nr#L31-L93 + + +#### What are the consequences? + +When you write an Aztec.nr function, there will be upper bounds on the following: + +- The number of public state reads and writes; +- The number of note reads and nullifications; +- The number of new notes that may be created; +- The number of encrypted logs that may be emitted; +- The number of unencrypted logs that may be emitted; +- The number of L1->L2 messages that may be consumed; +- The number of L2->L1 messages that may be submitted to L1; +- The number of private function calls; +- The number of public function calls that may be enqueued; + +Not only are there limits on a _per function_ basis, there are also limits on a _per transaction_ basis. + +**In particular, these _per-transaction_ limits will limit transaction call stack depths**. That means if a function call results in a cascade of nested function calls, and each of those function calls outputs lots of state reads and writes, or logs (etc.), then all of that accumulated output data might exceed the per-transaction limits that we currently have. This would cause such transactions to fail. + +There are plans to relax some of this rigidity, by providing many 'sizes' of circuit. + +> **In the mean time**, if you encounter a per-transaction limit when testing, please do open an issue to explain what you were trying to do; we'd love to hear about it. And if you're feeling adventurous, you could 'hack' the PXE to increase the limits. **However**, the limits cannot be increased indefinitely. So although we do anticipate that we'll be able to increase them a little bit, don't go mad and provide yourself with 1 million state transitions per transaction. That would be as unrealistic as artificially increasing Ethereum gas limits to 1 trillion. + +## There's more + +See the [GitHub issues (GitHub link)](https://github.com/AztecProtocol/aztec-packages/issues) for all known bugs fixes and features currently being worked on. diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/resources/considerations/privacy_considerations.md b/docs/developer_versioned_docs/version-v3.0.2/docs/resources/considerations/privacy_considerations.md new file mode 100644 index 000000000000..e35d386ab5df --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/resources/considerations/privacy_considerations.md @@ -0,0 +1,140 @@ +--- +title: Privacy Considerations +description: Learn about key privacy considerations when building applications on Aztec. +sidebar_position: 5 +tags: [protocol, PXE] +--- + +Privacy is important. + +Keeping information private is difficult. + +Once information is leaked, it cannot be unleaked. + +--- + +## What can Aztec keep private? + +Aztec provides a set of tools to enable developers to build private smart contracts. The following can be kept private: + +**Private persistent state** + +Store state variables in an encrypted form, so that no one can see what those variables are, except those with the decryption key. + +**Private events and messages** + +Emit encrypted events, or encrypted messages from a private smart contract function. Only those with the decryption key will learn the message. + +**Private function execution** + +Execute a private function without the world knowing which function you've executed. + +**Private bytecode** + +The bytecode of private functions does not need to be distributed to the world; much like real-world contracts. + +:::danger +Privacy is not guaranteed without care. +Although Aztec provides the tools for private smart contracts, information can still be leaked unless the dapp developer is careful. +Aztec is still under development, so real-world, meaningful, valuable secrets _should not_ be entrusted to the system. +This page outlines some best practices to aid dapp developers. +::: + +--- + +## Leaky practices + +There are many caveats to the above. Since Aztec also enables interaction with the _public_ world (public L2 functions and L1 functions), private information can be accidentally leaked if developers aren't careful. + +### Crossing the private -> public boundary + +Any time a private function makes a call to a public function, information is leaked. Now, that might be perfectly fine in some use cases (it's up to the smart contract developer). Indeed, most interesting apps will require some public state. But let's have a look at some leaky patterns: + +- Calling a public function from a private function. The public function execution will be publicly visible. +- Calling a public function from a private function, without revealing the `msg_sender` of that call. (Otherwise the `msg_sender` will be publicly visible). +- Passing arguments to a public function from a private function. All of those arguments will be publicly visible. +- Calling an internal public function from a private function. The fact that the call originated from a private function of that same contract will be trivially known. +- Emitting unencrypted events from a private function. The unencrypted event name and arguments will be publicly visible. +- Sending L2->L1 messages from a private function. The entire message, and the resulting L1 function execution will all be publicly visible. + +### Crossing the public -> private boundary + +If a public function sends a message to be consumed by a private function, the act of consuming that message might be leaked if not following recommended patterns. + +### Timing of transactions + +Information about the nature of a transaction can be leaked based on the timing of that transaction. + +If a transaction is executed at 8am GMT, it's much less likely to have been made by someone in the USA. + +If there's a spike in transactions on the last day of every month, those might be salaries. + +These minor details are information that can disclose much more information about a user than the user might otherwise expect. + +Suppose that every time Alice sends Bob a private token, 1 minute later a transaction is always submitted to the tx pool with the same kind of 'fingerprint'. Alice might deduce that these transactions are automated reactions by Bob. (Here, 'fingerprint' is an intentionally vague term. It could be a public function call, or a private tx proof with a particular number of nonzero public inputs, or some other discernible pattern that Alice sees). + +TL;DR: app developers should think about the _timing_ of user transactions, and how this might leak information. + +### Function Fingerprints and Tx Fingerprints + +A 'Function Fingerprint' is any data which is exposed by a function to the outside world. A 'Tx Fingerprint' is any data which is exposed by a tx to the outside world. We're interested in minimizing leakages of information from private txs. The leakiness of a Tx Fingerprint depends on the leakiness of its constituent functions' Function Fingerprints _and_ on the appearance of the tx's Tx Fingerprint as a whole. For a private function (and by extension, for a private tx), the following information _could_ be leaked (depending on the function, of course): + +- All calls to public functions. + - The contract address of the private function (if it calls an internal public function). + - This could be the address of the transactor themselves, if the calling contract is an account contract. + - All arguments which are passed to public functions. +- All calls to L1 functions (in the form of L2 -> L1 messages). + - The contents of L2 -> L1 messages. +- All public logs (topics and arguments). +- The roots of all trees which have been read from. +- The _number_ of ['side effects'](https://en.wikipedia.org/wiki/Side_effect_(computer_science)): + - \# new note hashes + - \# new nullifiers + - \# bytes of encrypted logs + - \# public function calls + - \# L2->L1 messages + - \# nonzero roots[^1] + +> Note: many of these were mentioned in the ["Crossing the private -> public boundary"](#crossing-the-private---public-boundary) section. + +> Note: the transaction effects submitted to L1 is [encoded (GitHub link)](https://github.com/AztecProtocol/aztec-packages/blob/master/l1-contracts/src/core/libraries/Decoder.sol) but not garbled with other transactions: the distinct Tx Fingerprint of each tx can is publicly visible when a tx is submitted to the L2 tx pool. + +#### Standardizing Fingerprints + +If each private function were to have a unique Fingerprint, then all private functions would be distinguishable from each-other, and all of the efforts of the Aztec protocol to enable 'private function execution' would have been pointless. Standards need to be developed, to encourage smart contract developers to adhere to a restricted set of Tx Fingerprints. For example, a standard might propose that the number of new note hashes, nullifiers, logs, etc. must always be equal, and must always equal a power of two. Such a standard would effectively group private functions/txs into 'privacy sets', where all functions/txs in a particular 'privacy set' would look indistinguishable from each-other, when executed. + +### Data queries + +It's not just the broadcasting of transactions to the network that can leak data. + +Ethereum has a notion of a 'full node' which keeps-up with the blockchain and stores the full chain state. Many users don't wish to run full nodes, so rely on 3rd-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's a problem: privacy. If a privacy-seeking user makes a query to a 3rd-party 'full node', that user might leak data about who they are; about their historical network activity; or about their future intentions. One solution to this problem is "always run a full node", but pragmatically, not everyone will. To protect less-advanced users' privacy, research is underway to explore how a privacy-seeking user may request and receive data from a 3rd-party node without revealing what that data is, nor who is making the request. + +App developers should be aware of this avenue for private data leakage. **Whenever an app requests information from a node, the entity running that node is unlikely to be your user!** + +#### What kind of queries can be leaky? + +##### Querying for up-to-date note sibling paths + +To read a private state is to read a note from the note hash tree. To read a note is to prove existence of that note in the note hash tree. And to prove existence is to re-compute the root of the note hash tree using the leaf value, the leaf index, and the sibling path of that leaf. This computed root is then exposed to the world, as a way of saying "This note exists", or more precisely "This note has existed at least since this historical snapshot time". + +If an old historical snapshot is used, then that old historical root will be exposed, and this leaks some information about the nature of your transaction: it leaks that your note was created before the snapshot date. It shrinks the 'privacy set' of the transaction to a smaller window of time than the entire history of the network. + +So for maximal privacy, it's in a user's best interest to read from the very-latest snapshot of the data tree. + +Naturally, the note hash tree is continuously changing as new transactions take place and their new notes are appended. Most notably, the sibling path for every leaf in the tree changes every time a new leaf is appended. + +If a user runs their own node, there's no problem: they can query the latest sibling path for their note(s) from their own machine without leaking any information to the outside world. + +But if a user is not running their own node, they would need to query the very-latest sibling path of their note(s) from some 3rd-party node. In order to query the sibling path of a leaf, the leaf's index needs to be provided as an argument. Revealing the leaf's index to a 3rd-party trivially reveals exactly the note(s) you're about to read. And since those notes were created in some prior transaction, the 3rd-party will be able to link you with that prior transaction. Suppose then that the 3rd-party also serviced the creator of said prior transaction: the 3rd-party will slowly be able to link more and more transactions, and gain more and more insight into a network which is meant to be private! + +We're researching cryptographic ways to enable users to retrieve sibling paths from 3rd-parties without revealing leaf indices. + +> \* Note: due to the non-uniformity of Aztec transactions, the 'privacy set' of a transaction might not be the entire set of transactions that came before. + +##### Any query + +Any query to a node leaks information to that node. + +We're researching cryptographic ways to enable users to query any data privately. diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/resources/glossary.md b/docs/developer_versioned_docs/version-v3.0.2/docs/resources/glossary.md new file mode 100644 index 000000000000..01984535eb64 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/resources/glossary.md @@ -0,0 +1,191 @@ +--- +title: Glossary +tags: [protocol, glossary] +description: Comprehensive glossary of terms used throughout the Aztec documentation and protocol. +--- + +### ACIR (Abstract Circuit Intermediate Representation) + +ACIR bytecode is the compilation target of private functions. ACIR expresses arithmetic circuits and has no control flow: any control flow in functions is either unrolled (for loops) or flattened (by inlining and adding predicates). ACIR contains different types of opcodes including arithmetic operations, BlackBoxFuncCall (for efficient operations like hashing), Brillig opcodes (for unconstrained hints), and MemoryOp (for dynamic array access). Private functions compiled to ACIR are executed by the ACVM (Abstract Circuit Virtual Machine) and proved using Barretenberg. + +### AVM (Aztec Virtual Machine) + +The Aztec Virtual Machine (AVM) executes the public section of a transaction. It is conceptually similar to the Ethereum Virtual Machine (EVM) but designed specifically for Aztec's needs. Public functions are compiled to AVM bytecode and executed by sequencers in the AVM. The AVM uses a flat memory model with tagged memory indexes to track maximum potential values and bit sizes. It supports control flow (if/else) and includes specific opcodes for blockchain operations like timestamp and address access, but doesn't allow arbitrary oracles for security reasons. + +### Aztec + +Aztec is a privacy-first Layer 2 rollup on Ethereum. It supports smart contracts with both private & public state and private & public execution. + +`aztec` is a CLI tool (with an extensive set of parameters) that enables users to perform a wide range of tasks. It can: compile and test contracts, run a node, run a local network, execute tests, generate contract interfaces for javascript and more. + +Full reference [here](../aztec-cli/cli_reference). + +### Aztec Wallet + +The Aztec Wallet is a CLI wallet, `aztec-wallet`, that allows a user to manage accounts and interact with an Aztec network. It includes a PXE. + +Full reference [here](../wallet-cli/cli_wallet_reference). + +### `aztec-up` + +`aztec-up` updates the local aztec executables to the latest version (default behavior) or to a specified version. + +### Aztec.js + +A [Node package](https://www.npmjs.com/package/@aztec/aztec.js) to help make Aztec dApps. + +Read more and review the source code [here](https://github.com/AztecProtocol/aztec-packages/blob/v3.0.2/yarn-project/aztec.js). + +### Aztec.nr + +[Aztec.nr](https://github.com/AztecProtocol/aztec-packages/tree/next/noir-projects/aztec-nr) is a framework for writing Aztec smart contracts with Noir that abstracts away state management. It handles things like note generation, state trees etc. It's essentially a giant Noir library which abstracts the complexities of interacting with Aztec. + +Read more and review the source code [here](https://aztec.nr). + +### Barretenberg + +Aztec's cryptography back-end. Refer to the graphic at the top of [this page](https://medium.com/aztec-protocol/explaining-the-network-in-aztec-network-166862b3ef7d) to see how it fits in the Aztec architecture. + +Barretenberg's source code can be found [here](https://github.com/AztecProtocol/barretenberg). + +### bb / bb.js + +`bb` (CLI) and its corresponding `bb.js` (node module) are tools that prove and verify circuits. It also has helpful functions such as: writing solidity verifier contracts, checking a witness, and viewing a circuit's gate count. + +### Commitment + +A cryptographic commitment is a hash of some data (plus randomness) that hides the original value but allows you to later prove you committed to that specific value, by proving knowledge of a valid preimage, without being able to change it. + +In Aztec, a commitment refers to a cryptographic hash of a note. Rather than storing entire notes in a data tree, note commitments (hashes of the notes) are stored in a merkle tree called the note hash tree. Users prove that they have the note pre-image information when they update private state in a contract. This allows the network to verify the existence of private data without revealing its contents. + +### Merkle Tree + +A Merkle tree is a binary tree data structure where adjacent nodes are hashed together recursively to produce a single node called the root hash. + +Merkle trees in Aztec are used to store cryptographic commitments. They are used across five Aztec Merkle trees: the note hash tree (stores commitments to private notes), the nullifier tree (stores nullifiers for spent notes), the public data tree (stores public state), the contract tree and the archive tree. All trees use domain-separated Poseidon2 hashing with specific tree identifiers and layer separation to ensure security and prevent cross-tree attacks. + +### `nargo` + +With `nargo`, you can start new projects, compile, execute, and test your Noir programs. + +You can find more information in the nargo installation docs [here](https://noir-lang.org/docs/getting_started/installation/) and the nargo command reference [here](https://noir-lang.org/docs/reference/nargo_commands). + +### Noir + +Noir is a Domain Specific Language (DSL) for SNARK proving systems. It is used for writing smart contracts in Aztec because private functions on Aztec are implemented as SNARKs to support privacy-preserving operations. + +### Noir Language Server + +The Noir Language Server can be used in vscode to facilitate writing programs in Noir by providing syntax highlighting, circuit introspection and an execution interface. The Noir LSP addon allows the dev to choose their tool, nargo or `aztec`, when writing a pure Noir program or an Aztec smart contract. + +You can find more info about the LSP [in the Noir docs](https://noir-lang.org/docs/tooling/language_server). + +### Node + +A node is a computer running Aztec software that participates in the Aztec network. A specific type of node is a sequencer. Nodes run the public execution environment (AVM), validate proofs, and maintain the 5 state Merkle trees (note hash, nullifier, public state, contract and archive trees). + +The Aztec testnet rolls up to Ethereum Sepolia. + +To run your own node see [here](/network/). + +### Note + +In Aztec, a Note is like an envelope containing private data. A commitment (hash) of this note is stored in an append-only Merkle tree and stored by all the nodes in the network. Notes can be encrypted to be shared with other users. Data in a note may represent some variable's state at a point in time. + +### Note Discovery + +Note discovery refers to the process of a user identifying and decrypting the encrypted notes that belong to them. Aztec uses a note tagging system where senders tag encrypted onchain logs containing notes in a way that only the sender and recipient can identify. The tag is derived from a shared secret and an index (a shared counter that increments each time the sender creates a note for the recipient). This allows users to efficiently find their notes without brute force decryption or relying on offchain communication. + +### Nullifier + +A nullifier is a unique value that, once posted publicly, proves something has been used or consumed without revealing what that thing was. + +In the context of Aztec, a nullifier is derived from a note and signifies the note has been "spent" or consumed without revealing which specific note was spent. When a note is updated or spent in Aztec, the protocol creates a nullifier from the note data using the note owner's nullifier key. This nullifier is inserted into the nullifier Merkle tree. The nullifier mechanism prevents double-spending while maintaining privacy by not requiring deletion of the original note commitment, which would leak information. + +### Partial Notes + +Partial notes are a concept that allows users to commit to an encrypted value, and allows a counterparty to update that value without knowing the specific details of the encrypted value. They are notes that are created in a private function with values that are not yet considered finalized (e.g., `amount` in a `UintNote`). The partial note commitment is computed using multi scalar multiplication on an elliptic curve, then passed to a public function where another party can add value to the note without knowing its private contents. This enables use cases like private fee payments, DEX swaps, and lending protocols. + +### Programmable Privacy + +Aztec achieves programmable privacy through its hybrid architecture that supports both private and public smart contract execution. Private functions run client-side with zero-knowledge proofs, while public functions run onchain. This allows developers to program custom privacy logic, choosing what data remains private and what becomes public, with composability between private and public state and execution contexts. + +### Provers + +The Prover in a ZK system is the entity proving they have knowledge of a valid witness that satisfies a statement. In the context of Aztec, this is the entity that creates the proof that some computation was executed correctly. Here, the statement would be "I know the inputs and outputs that satisfy the requirements for the computation, and I did the computation correctly." + +Aztec will be launched with a fully permissionless proving network (pieces of code that produce the proofs for valid rollup state transitions) that anyone can participate in. + +How this works will be discussed via a future RFP process on Discourse, similarly to the Sequencer RFP. + +### Proving Key + +A key that is used to generate a proof. In the case of Aztec, these are compiled from Noir smart contracts. + +### Private Execution Environment (PXE) + +The private execution environment is where private computation occurs. This is local such as your device or browser. + + +Read more [here](../foundational-topics/pxe/index.md). + +### Local Network + +The local network is a development Aztec network that runs on your machine and interacts with a development Ethereum node. It allows you to develop and deploy Noir smart contracts but without having to interact with testnet or mainnet (when the time comes). + +Included in the local network: + +- Local Ethereum network (Anvil) +- Deployed Aztec protocol contracts (for L1 and L2) +- A set of test accounts with some test tokens to pay fees +- Development tools to compile contracts and interact with the network (aztec command and aztec-wallet) +- All of this comes packaged in a Docker container to make it easy to install and run. + +### Sequencer + +A sequencer is a specialized node that is generally responsible for: + +- Selecting pending transactions from the mempool +- Ordering transactions into a block +- Verifying all private transaction proofs and execute all public transactions to check their validity +- Computing the ROLLUP_BLOCK_REQUEST_DATA +- Computing state updates for messages between L2 & L1 +- Broadcasting the ROLLUP_BLOCK_REQUEST_DATA to the prover network via the proof pool for parallelizable computation. +- Building a rollup proof from completed proofs in the proof pool +- Tagging the pending block with an upgrade signal to facilitate forks +- Publishing completed block with proofs to Ethereum as an ETH transaction + + +Aztec will be launched with a fully permissionless sequencer network that anyone can participate in. + +How this works is being discussed actively in the [Discourse forum](https://discourse.aztec.network/t/request-for-proposals-decentralized-sequencer-selection/350/). Once this discussion process is completed, we will update the glossary and documentation with specifications and instructions for how to run. + +Previously in [Aztec Connect](https://medium.com/aztec-protocol/sunsetting-aztec-connect-a786edce5cae) there was a single sequencer, and you can find the Typescript reference implementation called Falafel [here](https://github.com/AztecProtocol/aztec-connect/tree/master/yarn-project/falafel). + +### Smart Contracts + +Programs that run on the Aztec network are called smart contracts, similar to [programs](https://ethereum.org/en/developers/docs/smart-contracts/) that run on Ethereum. + +However, these will be written in the [Noir](https://noir-lang.org/index.html) programming language, and may optionally include private state and private functions. + +### Statement + +A statement in Aztec's zero-knowledge context refers to the public assertion being proved about a private computation. For example, a statement might be "I know the inputs and outputs that satisfy the requirements for this computation, and I executed the computation correctly." The statement defines what is being proven without revealing the private details (the witness) that prove it. In Aztec, statements typically involve proving correct execution of private functions, valid note ownership, or proper state transitions. + +### Verifier + +The entity responsible for verifying the validity of a ZK proof. In the context of Aztec, this is: +- **The sequencers**: verify that private functions were executed correctly. +- **The Ethereum L1 smart contract**: verifies batches of transactions were executed correctly. + +### Verification Key + +A key that is used to verify the validity of a proof generated from a proving key from the same smart contract. + +### Witness + +In the context of Aztec's zero-knowledge proofs, a witness refers to the private inputs and intermediate values that satisfy the constraints of a circuit. When executing a private function, the ACVM generates the witness of the execution - the complete set of values that prove the computation was performed correctly. The witness includes both the secret inputs provided by the user and all intermediate computational steps, but is never revealed publicly. Only a cryptographic proof of the witness's validity is shared. + +### Zero-knowledge (ZK) proof + +Zero-knowledge proofs in Aztec are cryptographic proofs that allow someone to prove they know certain information or have performed a computation correctly without revealing the underlying data. Aztec uses various ZK-SNARK protocols including UltraPlonk and Honk. These proofs enable private execution where users can prove they executed a private function correctly and that they own certain notes, without revealing the function inputs, note contents, or internal computation details. The proofs are verified onchain to ensure the integrity of private state transitions. diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/resources/migration_notes.md b/docs/developer_versioned_docs/version-v3.0.2/docs/resources/migration_notes.md new file mode 100644 index 000000000000..9cca9819700b --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/resources/migration_notes.md @@ -0,0 +1,4896 @@ +--- +title: Migration notes +description: Read about migration notes from previous versions, which could solve problems while updating +keywords: [local network, sandbox, aztec, notes, migration, updating, upgrading] +tags: [migration, updating, sandbox, local network] +--- + +Aztec is in full-speed development. Literally every version breaks compatibility with the previous ones. This page attempts to target errors and difficulties you might encounter when upgrading, and how to resolve them. + +## TBD + +### [Aztec node, archiver] Deprecated `getPrivateLogs` + +Aztec node no longer offers a `getPrivateLogs` method. If you need to process the logs of a block, you can instead use `getBlock` and call `getPrivateLogs` on an `L2BlockNew` instance. See the diff below for before/after equivalent code samples. + +```diff +- const logs = await aztecNode.getPrivateLogs(blockNumber, 1); ++ const logs = (await aztecNode.getBlock(blockNumber))?.toL2Block().getPrivateLogs(); +``` + +### [Aztec.nr] Private event emission API changes + +Private events are still emitted via the `emit` function, but this now returns an `EventMessage` type that must have `deliver_to` called on it in order to deliver the event message to the intended recipients. This allows for multiple recipients to receive the same event. + +```diff +- self.emit(event, recipient, delivery_method) ++ self.emit(event).delivery(recipient, delivery_method) +``` + +### [Aztec.nr] History proof functions no longer require `storage_slot` parameter + +The `RetrievedNote` struct now includes a `storage_slot` field, making it self-contained for proving note inclusion and validity. As a result, the history proof functions in the `aztec::history` module no longer require a separate `storage_slot` parameter. + +**Affected functions:** + +- `BlockHeader::prove_note_inclusion` - removed `storage_slot: Field` parameter +- `BlockHeader::prove_note_validity` - removed `storage_slot: Field` parameter +- `BlockHeader::prove_note_is_nullified` - removed `storage_slot: Field` parameter +- `BlockHeader::prove_note_not_nullified` - removed `storage_slot: Field` parameter + +**Migration:** + +The `storage_slot` is now read from `retrieved_note.storage_slot` internally. Simply remove the `storage_slot` argument from all calls to these functions: + +```diff + let header = context.get_anchor_block_header(); +- header.prove_note_inclusion(retrieved_note, storage_slot); ++ header.prove_note_inclusion(retrieved_note); + + let header = context.get_anchor_block_header(); +- header.prove_note_validity(retrieved_note, storage_slot, context); ++ header.prove_note_validity(retrieved_note, context); + + let header = context.get_anchor_block_header(); +- header.prove_note_is_nullified(retrieved_note, storage_slot, context); ++ header.prove_note_is_nullified(retrieved_note, context); + + let header = context.get_anchor_block_header(); +- header.prove_note_not_nullified(retrieved_note, storage_slot, context); ++ header.prove_note_not_nullified(retrieved_note, context); +``` + +### [Aztec.nr] Note fields are now public + +All note struct fields are now public, and the `new()` constructor methods and getter methods have been removed. Notes should be instantiated using struct literal syntax, and fields should be accessed directly. + +The motivation for this change has been enshrining of randomness which lead to the `new` method being unnecessary boilerplate. + +**Affected notes:** + +- `UintNote` - `value` is now public, `new()` and `get_value()` removed +- `AddressNote` - `address` is now public, `new()` and `get_address()` removed +- `FieldNote` - `value` is now public, `new()` and `value()` removed + +**Migration:** + +```diff +- let note = UintNote::new(100); ++ let note = UintNote { value: 100 }; + +- let value = note.get_value(); ++ let value = note.value; + +- let address_note = AddressNote::new(owner); ++ let address_note = AddressNote { address: owner }; + +- let address = address_note.get_address(); ++ let address = address_note.address; + +- let field_note = FieldNote::new(42); ++ let field_note = FieldNote { value: 42 }; + +- let value = field_note.value(); ++ let value = field_note.value; +``` + +### [Aztec.nr] `emit` renamed to `deliver` + +Private state variable functions that created notes and returned their messages no longer return a `NoteEmission` but instead a `NoteMessage`. These messages are delivered to their owner via `deliver` instead of `emit`. The verb 'emit' remains for things like emitting events. + +```diff +- self.storage.balances.at(owner).add(5).emit(owner); ++ self.storage.balances.at(owner).add(5).deliver(); +``` + +To deliver a message to a different recipient, use `deliver_to`: + +```diff +- self.storage.balances.at(owner).add(5).emit(other); ++ self.storage.balances.at(owner).add(5).deliver_to(other); +``` + +### [Aztec.nr] `ValueNote` renamed to `FieldNote` and `value-note` crate renamed to `field-note` + +The `ValueNote` struct has been renamed to `FieldNote` to better reflect that it stores a `Field` value. The crate has also been renamed from `value-note` to `field-note`. + +**Migration:** + +- Update your `Nargo.toml` dependencies: `value_note = { path = "..." }` → `field_note = { path = "..." }` +- Update imports: `use value_note::value_note::ValueNote` → `use field_note::field_note::FieldNote` +- Update type references: `ValueNote` → `FieldNote` +- Update generic parameters: `PrivateSet` → `PrivateSet` + +### [Aztec.nr] New `balance-set` library for managing token balances + +A new `balance-set` library has been created that provides `BalanceSet` for managing u128 token balances with `UintNote`. This consolidates balance management functionality that was previously duplicated across contracts. + +**Features:** + +- `add(amount: u128)` - Add to balance +- `sub(amount: u128)` - Subtract from balance (with change note) +- `try_sub(amount: u128, max_notes: u32)` - Attempt to subtract with configurable note limit +- `balance_of()` - Get total balance (unconstrained) + +**Usage:** + +```rust +use balance_set::BalanceSet; + +#[storage] +struct Storage { + balances: Owned, Context>, +} + +// In a private function: +self.storage.balances.at(owner).add(amount).deliver(owner, MessageDelivery.CONSTRAINED_ONCHAIN); +self.storage.balances.at(owner).sub(amount).deliver(owner, MessageDelivery.CONSTRAINED_ONCHAIN); + +// In an unconstrained function: +let balance = self.storage.balances.at(owner).balance_of(); +``` + +### [Aztec.nr] `EasyPrivateUint` deprecated and removed + +The `EasyPrivateUint` type and `easy-private-state` crate have been deprecated and removed. Use `BalanceSet` from the `balance-set` crate instead. + +**Migration:** + +- Remove `easy_private_state` dependency from `Nargo.toml` +- Add `balance_set = { path = "../../../../aztec-nr/balance-set" }` to `Nargo.toml` +- Update storage: `EasyPrivateUint` → `Owned, Context>` +- Update method calls: + - `add(amount, owner)` → `at(owner).add(amount).deliver(owner, MessageDelivery.CONSTRAINED_ONCHAIN)` + - `sub(amount, owner)` → `at(owner).sub(amount).deliver(owner, MessageDelivery.CONSTRAINED_ONCHAIN)` + - `get_value(owner)` → `at(owner).balance_of()` (returns `u128` instead of `Field`) + +### [Aztec.nr] `balance_utils` removed from `value-note` (now `field-note`) + +The `balance_utils` module has been removed from the `field-note` crate (formerly `value-note`). If you need similar functionality, implement it locally in your contract or use `BalanceSet` for u128 balances. + +### [Aztec.nr] `filter_notes_min_sum` removed from `value-note` (now `field-note`) + +The `filter_notes_min_sum` function has been removed from the `field-note` crate (formerly in `value-note`). If you need this functionality, copy it to your contract locally. This function was only used in specific test contracts and doesn't belong in the general-purpose note library. + +### [Aztec.nr] `derive_ecdh_shared_secret_using_aztec_address` removed + +This function made it annoying to deal with invalid addresses in circuits. If you were using it, replace it with `derive_ecdh_shared_secret` instead: + +```diff +-let shared_secret = derive_ecdh_shared_secret_using_aztec_address(secret, address).unwrap(); ++let shared_secret = derive_ecdh_shared_secret(secret, address.to_address_point().unwrap().inner); +``` + +### [Aztec.nr] Note owner is now enshrined + +It turns out that in all the cases a note always have a logical owner. +For this reason we have decided to enshrine the concept of a note owner and you should drop the field from your note: + +```diff +#[derive(Deserialize, Eq, Packable, Serialize)] +#[note] +pub struct ValueNote { + value: Field, +- owner: AztecAddress, +} +``` + +The owner being enshrined means that our API explicitly expects it on the input. +The `NoteHash` trait got modified as follows: + +```diff +pub trait NoteHash { + fn compute_note_hash( + self, ++ owner: AztecAddress, + storage_slot: Field, + randomness: Field, + ) -> Field; + + fn compute_nullifier( + self, + context: &mut PrivateContext, ++ owner: AztecAddress, + note_hash_for_nullification: Field, + ) -> Field; + + unconstrained fn compute_nullifier_unconstrained( + self, ++ owner: AztecAddress, + note_hash_for_nullification: Field, + ) -> Field; +} +``` + +Our low-level note utilities now also accept owner as a parameter: + +```diff +pub fn create_note( + context: &mut PrivateContext, ++ owner: AztecAddress, + storage_slot: Field, + note: Note, +) -> NoteEmission +where + Note: NoteType + NoteHash + Packable, +{ +... +} +``` + +Signature of some functions like `destroy_note_unsafe` is unchanged: + +```diff +pub fn destroy_note_unsafe( + context: &mut PrivateContext, + retrieved_note: RetrievedNote, + note_hash_read: NoteHashRead, +) +where + Note: NoteHash, +{ +... +} +``` + +because `RetrievedNote` now contains owner. + +`PrivateImmutable`, `PrivateMutable` and `PrivateSet` got modified to directly contain the owner instead of implicitly "containing it" by including it in the storage slot via a `Map`. +These state variables now implement a newly introduced `OwnedStateVariable` trait (see docs of `OwnedStateVariable` for explanation of what it is). +These changes make the state variables incompatible with `Map` and now instead these should be wrapped in new `Owned` state variable: + +```diff +#[storage] +struct Storage { +- private_nfts: Map, Context>, ++ private_nfts: Owned, Context>, +} +``` + +Note that even though the types of your state variables are changing from `Map` to `Owned`, usage remains unchanged: + +``` +let nft_notes = self.storage.private_nfts.at(from).pop_notes(NoteGetterOptions::new().select(NFTNote::properties().token_id, Comparator.EQ, token_id).set_limit(1)); +``` + +With this change the underlying notes will inherit the storage slot of the `Owned` state variable. +This is unlike `Map` where the nested state variable got the storage slot computed as `hash([map_storage_slot, key])`. + +if you had `PrivateImmutable` or `PrivateMutable` defined out of a `Map`, e.g.: + +```rust +#[storage] +struct Storage { + signing_public_key: PrivateImmutable, +} +``` + +you were most likely dealing with some kind of admin flow where only the admin can modify the state variable. +Now, unfortunately, there is a bit of a regression and you will need to wrap the state variable in `Owned` and call `at` on the state var: + +```diff ++ use aztec::state_vars::Owned; + +#[storage] +struct Storage { +- signing_public_key: PrivateImmutable, ++ signing_public_key: Owned, Context>, +} + +#[external("private")] +fn my_external_function() { +- self.storage.signing_public_key.initialize(pub_key_note) ++ self.storage.signing_public_key.at(self.address).initialize(pub_key_note) + .emit(self.address, MessageDelivery.CONSTRAINED_ONCHAIN); +} +``` + +We are likely to come up with a concept of admin state variables in the future. + +None of the reference notes now contain the owner so if you manually construct `AddressNote`, `UintNote` or `ValueNote` you need to update the call to `new` method: + +```diff +- let note = UintNote::new(156, owner); ++ let note = UintNote::new(156); +``` + +### [Aztec.nr] Note randomness is now handled internally + +In order to prevent pre-image attacks, it is necessary to inject randomness to notes. Aztec.nr users were previously expected to add said randomness to their custom note types. From now on, Aztec.nr takes care of handling randomness as built-in note metadata, making it impossible to miss for library users. This change breaks backwards compatibility as we'll discuss below. + +#### Changes to Aztec.nr note types + +If you're using any of the following note types, please be aware that `randomness` no longer is an explicit attribute in them. + +- ValueNote +- UintNote +- NFTNote +- AddressNote + +#### Migrating your custom note types: refer to UintNote as an example of how to migrate + +We show the changes to `UintNote` below since it serves as a good example of the adjustments you will need to make to your own custom note types, including those that need to support partial notes. + +##### Remove `randomness` from note struct + +```diff +pub struct UintNote { + /// The owner of the note, i.e. the account whose nullifier secret key is required to compute the nullifier. + owner: AztecAddress, +- /// Random value, protects against note hash preimage attacks. +- randomness: Field, + /// The number stored in the note. + value: u128, +} + +impl UintNote { + pub fn new(value: u128, owner: AztecAddress) -> Self { +- let randomness = unsafe { random() }; +- Self { value, owner, randomness } ++ Self { value, owner } + } +``` + +##### Add `randomness` to `compute_note_hash` implementation + +The `NoteHash` trait now requires `compute_note_hash` to receive a `randomness` field. This impacts + +```diff +pub trait NoteHash { + /// ... +- fn compute_note_hash(self, storage_slot: Field) -> Field; ++ fn compute_note_hash(self, storage_slot: Field, randomness: Field) -> Field; +``` + +Then in trait implementations: + +```diff +impl NoteHash for UintNote { +- fn compute_note_hash(self, storage_slot: Field) -> Field { ++ fn compute_note_hash(self, storage_slot: Field, randomness: Field) -> Field { + /// ... +- let private_content = +- UintPartialNotePrivateContent { owner: self.owner, randomness: self.randomness }; +- let partial_note = PartialUintNote { +- commitment: private_content.compute_partial_commitment(storage_slot), +- }; + ++ let private_content = ++ UintPartialNotePrivateContent { owner: self.owner }; ++ let partial_note = PartialUintNote { ++ commitment: private_content.compute_partial_commitment(storage_slot, randomness), ++ }; +``` + +It's worth noting that this change also affects how partial notes are structured and handled. + +```diff +pub fn partial( + owner: AztecAddress, + storage_slot: Field, + randomness: Field, + context: &mut PrivateContext, + recipient: AztecAddress, + completer: AztecAddress, + ) -> PartialUintNote { +- let commitment = UintPartialNotePrivateContent { owner, randomness } +- .compute_partial_commitment(storage_slot); ++ let commitment = UintPartialNotePrivateContent { owner } ++ .compute_partial_commitment(storage_slot, randomness); + + let private_log_content = +- UintPartialNotePrivateLogContent { owner, randomness, public_log_tag: commitment }; ++ UintPartialNotePrivateLogContent { owner, public_log_tag: commitment }; + let encrypted_log = note::compute_partial_note_private_content_log( + private_log_content, + storage_slot, ++ randomness, + recipient, + ); + /// ... +} + +struct UintPartialNotePrivateContent { + owner: AztecAddress, +- randomness: Field, +} + +impl UintPartialNotePrivateContent { +- fn compute_partial_commitment(self, storage_slot: Field) -> Field { ++ fn compute_partial_commitment(self, storage_slot: Field, randomness: Field) -> Field { + poseidon2_hash_with_separator( +- self.pack().concat([storage_slot]), ++ self.pack().concat([storage_slot, randomness]), + GENERATOR_INDEX__NOTE_HASH, + ) + } +} + +struct UintPartialNotePrivateLogContent { + public_log_tag: Field, + owner: AztecAddress, +- randomness: Field, +} +``` + +##### Note size + +As a result of this change, the maximum packed length of the content of a note is 11 fields, down from 12. This is a direct consequence of moving the randomness field from the note content structure to the note's metadata. + +#### RetrievedNote now includes randomness field + +```diff +pub struct RetrievedNote { + pub note: Note, + pub contract_address: AztecAddress, ++ pub randomness: Field, + pub metadata: NoteMetadata, +} +``` + +### [L1 Contracts] `Block` is now `Checkpoint` + +A `checkpoint` is now the primary unit handled by the L1 contracts. + +A checkpoint may contain one or more L2 blocks. The protocol circuits already support producing multiple blocks per checkpoint. Updating the L1 contracts to operate on checkpoints allow L2 blockchain to advance faster. + +Below are the API and event renames reflecting this change: + +```diff +- event L2BlockProposed ++ event CheckpointProposed +``` + +```diff +- event BlockInvalidated ++ event CheckpointInvalidated +``` + +```diff +- function getEpochForBlock(uint256 _blockNumber) external view returns (Epoch); ++ function getEpochForCheckpoint(uint256 _checkpointNumber) external view returns (Epoch); +``` + +```diff +- function getProvenBlockNumber() external view returns (uint256); ++ function getProvenCheckpointNumber() external view returns (uint256); +``` + +```diff +- function getPendingBlockNumber() external view returns (uint256); ++ function getPendingCheckpointNumber() external view returns (uint256); +``` + +```diff +- function getBlock(uint256 _blockNumber) external view returns (BlockLog memory); ++ function getCheckpoint(uint256 _checkpointNumber) external view returns (CheckpointLog memory); +``` + +```diff +- function getBlockReward() external view returns (uint256); ++ function getCheckpointReward() external view returns (uint256); +``` + +Additionally, any function or struct that previously referenced an L2 block number now uses a checkpoint number instead: + +```diff +- function status(uint256 _blockNumber) external view returns ( ++ function status(uint256 _checkpointNumber) external view returns ( +- uint256 provenBlockNumber, ++ uint256 provenCheckpointNumber, + bytes32 provenArchive, +- uint256 pendingBlockNumber, ++ uint256 pendingCheckpointNumber, + bytes32 pendingArchive, + bytes32 archiveOfMyBlock, + Epoch provenEpochNumber +); +``` + +Note: current node softwares still produce exactly one L2 block per checkpoint, so for now checkpoint numbers and L2 block numbers remain equal. This may change once multi-block checkpoints are enabled. + +### [Aztec.js] Wallet interface changes + +#### `simulateTx` is now batchable + +The `simulateTx` method on the `Wallet` interface is now batchable, meaning it can be called as part of a batch operation using `wallet.batch()`. This allows you to batch simulations together with other wallet operations like `registerContract`, `sendTx`, and `registerSender`. + +```diff +- // Could not batch simulations +- const simulationResult = await wallet.simulateTx(executionPayload, options); ++ // Can now batch simulations with other operations ++ const results = await wallet.batch([ ++ { name: 'registerContract', args: [instance, artifact] }, ++ { name: 'simulateTx', args: [executionPayload, options] }, ++ { name: 'sendTx', args: [anotherPayload, sendOptions] }, ++ ]); +``` + +#### `ExecutionPayload` moved to `@aztec/stdlib/tx` + +The `ExecutionPayload` type has been moved from `@aztec/aztec.js` to `@aztec/stdlib/tx`. Update your imports accordingly. + +```diff +- import { ExecutionPayload } from '@aztec/aztec.js'; ++ import { ExecutionPayload } from '@aztec/stdlib/tx'; ++ // Or import from the re-export in aztec.js/tx: ++ import { ExecutionPayload } from '@aztec/aztec.js/tx'; +``` + +#### `ExecutionPayload` now includes `feePayer` property + +The `ExecutionPayload` class now includes an optional `feePayer` property that specifies which address is paying for the fee in the execution payload (if any) + +```diff + const payload = new ExecutionPayload( + calls, + authWitnesses, + capsules, + extraHashedArgs, ++ feePayer // optional AztecAddress + ); +``` + +This was previously provided as part of the `SendOptions` (and others) in the wallet interface, which could cause problems if a payload was assembled with a payment method and the parameter was later omitted. This means `SendOptions` now loses `embeddedPaymentMethodFeePayer` + +```diff +-wallet.simulateTx(executionPayload, { from: address, embeddedFeePaymentMethodFeePayer: feePayer }); ++wallet.simulateTx(executionPayload, { from: address }); +``` + +#### `simulateUtility` signature and return type changed + +The `simulateUtility` method signature has changed to accept a `FunctionCall` object instead of separate `functionName`, `args`, and `to` parameters. Additionally, the return type has changed from `AbiDecoded` to `Fr[]`. + +```diff +- const result: AbiDecoded = await wallet.simulateUtility(functionName, args, to, authWitnesses); ++ const result: UtilitySimulationResult = await wallet.simulateUtility(functionCall, authWitnesses?); ++ // result.result is now Fr[] instead of AbiDecoded +``` + +The new signature takes: + +- `functionCall`: A `FunctionCall` object containing `name`, `args`, `to`, `selector`, `type`, `isStatic`, `hideMsgSender`, and `returnTypes` +- `authWitnesses` (optional): An array of `AuthWitness` objects + +The first argument is exactly the same as what goes into `ExecutionPayload.calls`. As such, the data is already encoded. The return value is now `UtilitySimulationResult` with `result: Fr[]` instead of returning an `AbiDecoded` value directly. You'll need to decode the `Fr[]` array yourself if you need typed results. + +#### `Contract.at()` is now synchronous and no longer calls `registerContract` + +The `Contract.at()` method (and generated contract `.at()` methods) is now synchronous and no longer automatically registers the contract with the wallet. This reduces unnecessary artifact storage and RPC calls. + +```diff +- const contract = await TokenContract.at(address, wallet); ++ const contract = TokenContract.at(address, wallet); +``` + +**Important:** You now need to explicitly call `registerContract` if you want the wallet to store the contract instance and artifact. This is only necessary when: + +- An app first registers a contract +- An app tries to update a contract's artifact + +If you need to register the contract, do so explicitly: + +```typescript +// Get the instance from deployment +const { contract, instance } = await TokenContract.deploy(wallet, ...args) + .send({ from: address }) + .wait(); + +// wallet already has it registered, since the deploy method does it by default +// to avoid it, set skipContractRegistration: true in the send options. + +// Register it with another wallet +await otherWallet.registerContract(instance, TokenContract.artifact); + +// Now you can use the contract +const otherContract = TokenContract.at(instance.address, otherWallet); +``` + +Publicly deployed contract instances can be retrieved via `node.getContract(address)`. Otherwise and if deployment parameters are known, an instance can be computed via the `getContractInstanceFromInstantiationParams` from `@aztec/aztec.js/contracts` + +#### `registerContract` signature simplified + +The `registerContract` method now takes a `ContractInstanceWithAddress` instead of a `Contract` object, and the `artifact` parameter is now optional. If the artifact is not provided, the wallet will attempt to look it up from its contract class storage. + +```diff +- await wallet.registerContract(contract); ++ await wallet.registerContract(instance, artifact?); +``` + +The method now only accepts: + +- `instance`: A `ContractInstanceWithAddress` object +- `artifact` (optional): A `ContractArtifact` object +- `secretKey` (optional): A secret key for privacy keys registration + +#### Return value of `getNotes` no longer contains a recipient and it contains some other additional info + +Return value of `getNotes` used to be defined as `Promise` and now it's defined as `Promise`. +`NoteDao` is mostly a super-set of `UniqueNote` but it doesn't contain a `recipient`. +Having the recipient in the return value has been redundant as the same outcome can be achieved by populating the `scopes` array in `NoteFilter` with the `recipient` value. + +#### Changes to `getPrivateEvents` + +The signature of `getPrivateEvents` has changed for two reasons: + +1. To align it with how other query methods that include filtering by block range work (for example, `AztecNode#getPublicLogs`) +2. To enrich the returned private events with metadata. + +```diff +getPrivateEvents( +- contractAddress: AztecAddress, +- eventMetadata: EventMetadataDefinition, +- from: number, +- numBlocks: number, +- recipients: AztecAddress[], +- ): Promise; ++ eventFilter: PrivateEventFilter, ++ ): Promise[]>; +``` + +`PrivateEvent` bundles together an ABI decoded event of type `T`, with `metadata` of type `InTx`: + +```ts +export type InBlock = { + l2BlockNumber: BlockNumber; + l2BlockHash: L2BlockHash; +}; + +export type InTx = InBlock & { + txHash: TxHash; +}; + +export type PrivateEvent = { + event: T; + metadata: InTx; +}; +``` + +You will need to update any calls to `Wallet#getPrivateEvents` accordingly. See below for before/after comparison which conserves +semantics. + +Pay special attention to the fact that the old method expects a `numBlocks` parameter that instructs it to +return `numBlocks` blocks after `fromBlock`, whereas the new version expects an (exclusive) `toBlock` block number. + +Also note we're replacing _recipient_ terminology with _scope_. While underlying data types are equivalent (they are Aztec addresses), they have different semantics. Messages have a recipient who will be able to receive and process them. As a result of processing messages for a given recipient address, PXE might discover events. Those events are then said to be _in scope_ for that address. + +```diff +- const events = await context.client.getPrivateEvents(contractAddress, eventMetadata, 42, 10, [recipient]); +- doSomethingWithAnEvent(events[0]); + ++ const events = await context.client.getPrivateEvents(eventMetadata, { ++ contractAddress, ++ fromBlock: BlockNumber(42), ++ toBlock: BlockNumber(42 + 10), ++ scopes: [scope], ++ }); ++ doSomethingWithAnEvent(events[0].event); +``` + +Please refer to the wallet interface js-docs for further details. + +### [CLI] Command refactor + +The sandbox command has been renamed and remapped to "local network". We believe this conveys better what is actually being spun up when running it. + +**REMOVED/RENAMED**: + +- `aztec start --sandbox`: now `aztec start --local-network` + +### [Aztec.nr] - Contract API redesign + +In this release we decided to largely redesign our contract API. Most of the changes here are not a breaking change +(only renaming of original `#[internal]` to `#[only_self]` and `storage` now being available on the newly introduced +`self` struct are a breaking change). + +#### 1. Renaming of original #[internal] as #[only_self] + +We want for internal to mean the same as in Solidity where internal function can be called only from the same contract +and is also inlined (EVM JUMP opcode and not EVM CALL). The original implementation of our `#[internal]` macro also +results in the function being callable only from the same contract but it results in a different call (hence it doesn't +map to EVM JUMP). This is very confusing for people that know Solidity hence we are doing the rename. A true +`#[internal]` will be introduced in the future. + +To migrate your contracts simply rename all the occurrences of `#[internal]` with `#[only_self]` and update the imports: + +```diff +- use aztec::macros::functions::internal; ++ use aztec::macros::functions::only_self; +``` + +```diff +#[external("public")] +- #[internal] ++ #[only_self] +fn _deduct_public_balance(owner: AztecAddress, amount: u64) { + ... +} +``` + +#### 2. Introducing of new #[internal] + +Same as in Solidity internal functions are functions that are callable from inside the contract. Unlike #[only_self] +functions, internal functions are inlined (e.g. akin to EVM's JUMP and not EVM's CALL). + +Internal function can be called using the following API which leverages the new `self` struct (see change 3 below for +details): + +```noir +self.internal.my_internal_function(...) +``` + +Private internal functions can only be called from other private external or internal functions. +Public internal functions can only be called from other public external or internal functions. + +#### 3. Introducing `self` in contracts and a new call interface + +Aztec contracts now automatically inject a `self` parameter into every contract function, providing a unified interface +for accessing the contract's address, storage, calling of function and an execution context. + +##### What is `self`? + +`self` is an instance of `ContractSelf` that provides: + +- `self.address` - The contract's own address +- `self.storage` - Access to your contract's storage +- `self.context` - The execution context (private, public, or utility) +- `self.msg_sender()` - Get the address of the caller +- `self.emit(...)` - Emit events +- `self.call(...)` - Call an external function +- `self.view(...)` - Call an external function statically +- `self.enqueue(...)` - Enqueue a call to an external function +- `self.enqueue_view(...)` - Enqueue a call to an external function +- `self.enqueue_incognito(...)` - Enqueue a call to an external function but hides the `msg_sender` +- `self.enqueue_view_incognito(...)` - Enqueue a static call to an external function but hides the `msg_sender` +- `self.set_as_teardown(...)` - Enqueue a call to an external public function and sets the call as teardown +- `self.set_as_teardown_incognito(...)` - Enqueue a call to an external public function and sets the call as teardown + and hides the `msg_sender` +- `self.internal.my_internal_fn(...)` - Call an internal function + +`self` also provides you with convenience API to call and enqueue calls to external functions from within the same +contract (this is just a convenience API as `self.call(MyContract::at(self.address).my_external_fn(...))` would also +work): + +- `self.call_self.my_external_fn(...)` - Call external function from within the same contract +- `self.enqueue_self.my_public_external_fn(...)` +- `self.call_self_static.my_static_external_fn(...)` +- `self.enqueue_self_static.my_static_external_public_fn(...)` + +##### How it works + +The `#[external(...)]` macro automatically injects `self` into your function. When you write: + +```noir +#[external("private")] +fn transfer(amount: u128, recipient: AztecAddress) { + let sender = self.msg_sender().unwrap(); + self.storage.balances.at(sender).sub(amount); + self.storage.balances.at(recipient).add(amount); +} +``` + +The macro transforms it to initialize `self` with the context and storage before your code executes. + +##### Migration guide + +**Before:** Access context and storage as separate parameters + +```noir +#[external("private")] +fn old_transfer(amount: u128, recipient: AztecAddress) { + let storage = Storage::init(context); + let sender = context.msg_sender().unwrap(); + storage.balances.at(sender).sub(amount); +} +``` + +**After:** Use `self` to access everything + +```noir +#[external("private")] +fn new_transfer(amount: u128, recipient: AztecAddress) { + let sender = self.msg_sender().unwrap(); + self.storage.balances.at(sender).sub(amount); +} +``` + +##### Key changes + +1. **Storage and context access:** + +Storage and context are no longer injected into the function as standalone variables and instead you need to access them via `self`: + +```diff +- let balance = storage.balances.at(owner).read(); ++ let balance = self.storage.balances.at(owner).read(); +``` + +```diff +- context.push_nullifier(nullifier); ++ self.context.push_nullifier(nullifier); +``` + +Note that `context` is expected to be use only when needing to access a low-level API (like directly emitting a nullifier). + +2. **Getting caller address:** Use `self.msg_sender()` instead of `context.msg_sender()` + + ```diff + - let caller = context.msg_sender().unwrap(); + + let caller = self.msg_sender().unwrap(); + ``` + +3. **Getting contract address:** Use `self.address` instead of `context.this_address()` + + ```diff + - let this_contract = context.this_address(); + + let this_contract = self.address; + ``` + +4. **Emitting events:** + + In private functions: + + ```diff + - emit_event_in_private(event, context, recipient, delivery_mode); + + self.emit(event, recipient, delivery_mode); + ``` + + In public functions: + + ```diff + - emit_event_in_public(event, context); + + self.emit(event); + ``` + +5. **Calling functions:** + + In private functions: + + ```diff + - Token::at(stable_coin).mint_to_public(to, amount).call(&mut context); + + self.call(Token::at(stable_coin).mint_to_public(to, amount)); + ``` + +##### Example: Full contract migration + +**Before:** + +```noir +#[external("private")] +fn withdraw(amount: u128, recipient: AztecAddress) { + let storage = Storage::init(context); + let sender = context.msg_sender().unwrap(); + let token = storage.donation_token.get_note().get_address(); + + // ... withdrawal logic + + emit_event_in_private(Withdraw { withdrawer, amount }, context, withdrawer, MessageDelivery.UNCONSTRAINED_ONCHAIN); +} +``` + +**After:** + +```noir +#[external("private")] +fn withdraw(amount: u128, recipient: AztecAddress) { + let sender = self.msg_sender().unwrap(); + let token = self.storage.donation_token.get_note().get_address(); + + // ... withdrawal logic + + self.emit(Withdraw { withdrawer, amount }, withdrawer, MessageDelivery.UNCONSTRAINED_ONCHAIN); +} +``` + +#### No-longer allowing calling of non-view function statically via the old higher-level API + +We used to allow calling of non-view function statically as follows: + +```noir +MyContract::at(address).my_non_view_function(...).view(context); +MyContract::at(address).my_non_view_function(...).enqueue_view(context); +``` + +This is no-longer allowed and if you will want to call a function statically you will need to mark the function with +`#[view]`. + +### Phase checks + +Now private external functions check by default that no phase change from non revertible to revertible happens during the execution of the function or any of its nested calls. If you're developing a function +that handles phase change (you call `context.end_setup()` or call a function that you expect will change phase) you need to opt out of the phase check using the `#[nophasecheck]` macro. Also, now it's possible to know if you're in the revertible phase of the transaction at any point using `self.context.in_revertible_phase()`. + +### [`aztec` command] Moving functionality of `aztec-nargo` to `aztec` command + +`aztec-nargo` has been deprecated and all workflows should now migrate to the `aztec` command that fully replaces `aztec-nargo`: + +- **For contract initialization:** + + ```bash + aztec init + ``` + + (Behaves like `nargo init`, but defaults to a contract project.) + +- **For testing:** + + ```bash + aztec test + ``` + + (Starts the Aztec TXE and runs your tests.) + +- **For compiling contracts:** + ```bash + aztec compile + ``` + (Transpiles your contracts and generates verification keys.) + +## 3.0.0-devnet.4 + +## [aztec.js] Removal of barrel export + +`aztec.js` is now divided into granular exports, which improves loading performance in node.js and also makes the job of web bundlers easier: + +```diff +-import { AztecAddress, Fr, getContractInstanceFromInstantiationParams, type Wallet } from '@aztec/aztec.js'; ++import { AztecAddress } from '@aztec/aztec.js/addresses'; ++import { getContractInstanceFromInstantiationParams } from '@aztec/aztec.js/contracts'; ++import { Fr } from '@aztec/aztec.js/fields'; ++import type { Wallet } from '@aztec/aztec.js/wallet'; +``` + +Additionally, some general utilities reexported from `foundation` have been removed: + +```diff +-export { toBigIntBE } from '@aztec/foundation/bigint-buffer'; +-export { sha256, Grumpkin, Schnorr } from '@aztec/foundation/crypto'; +-export { makeFetch } from '@aztec/foundation/json-rpc/client'; +-export { retry, retryUntil } from '@aztec/foundation/retry'; +-export { to2Fields, toBigInt } from '@aztec/foundation/serialize'; +-export { sleep } from '@aztec/foundation/sleep'; +-export { elapsed } from '@aztec/foundation/timer'; +-export { type FieldsOf } from '@aztec/foundation/types'; +-export { fileURLToPath } from '@aztec/foundation/url'; +``` + +### `getSenders` renamed to `getAddressBook` in wallet interface + +An app could request "contacts" from the wallet, which don't necessarily have to be senders in the wallet's PXE. This method has been renamed to reflect that fact: + +```diff +-wallet.getSenders(); ++wallet.getAddressBook(); +``` + +### Removal of `proveTx` from `Wallet` interface + +Exposing this method on the interface opened the door for certain types of attacks, were an app could route proven transactions through malicious nodes (that stored them for later decryption, or collected user IPs for example). It also made transactions difficult to track for the wallet, since they could be sent without their knowledge at any time. This change also affects `ContractFunctionInteraction` and `DeployMethod`, which no longer expose a `prove()` method. + +### `msg_sender` is now an `Option` type. + +Because Aztec has native account abstraction, the very first function call of a tx has no `msg_sender`. (Recall, the first function call of an Aztec transaction is always a _private_ function call). + +Previously (before this change) we'd been silently setting this first `msg_sender` to be `AztecAddress::from_field(-1);`, and enforcing this value in the protocol's kernel circuits. Now we're passing explicitness to smart contract developers by wrapping `msg_sender` in an `Option` type. We'll explain the syntax shortly. + +We've also added a new protocol feature. Previously (before this change) whenever a public function call was enqueued by a private function (a so-called private->public call), the called public function (and hence the whole world) would be able to see `msg_sender`. For some use cases, visibility of `msg_sender` is important, to ensure the caller executed certain checks in private-land. For `#[only_self]` public functions, visibility of `msg_sender` is unavoidable (the caller of an `#[only_self]` function must be the same contract address by definition). But for _some_ use cases, a visible `msg_sender` is an unnecessary privacy leakage. +We therefore have added a feature where `msg_sender` can be optionally set to `Option::none()` for enqueued public function calls (aka private->public calls). We've been colloquially referring to this as "setting msg_sender to null". + +#### Aztec.nr diffs + +> Note: we'll be doing another pass at this aztec.nr syntax in the near future. + +Given the above, the syntax for accessing `msg_sender` in Aztec.nr is slightly different: + +For most public and private functions, to adjust to this change, you can make this change to your code: + +```diff +- let sender: AztecAddress = context.msg_sender(); ++ let sender: AztecAddress = context.msg_sender().unwrap(); +``` + +Recall that `Option::unwrap()` will throw if the Option is "none". + +Indeed, most smart contract functions will require access to a proper contract address (instead of a "null" value), in order to do bookkeeping (allocation of state variables against user addresses), and so in such cases throwing is sensible behaviour. + +If you want to output a useful error message when unwrapping fails, you can use `Option::expect`: + +```diff +- let sender: AztecAddress = context.msg_sender(); ++ let sender: AztecAddress = context.msg_sender().expect(f"Sender must not be none!"); +``` + +For a minority of functions, a "null" msg_sender will be acceptable: + +- A private entrypoint function. +- A public function which doesn't seek to do bookkeeping against `msg_sender`. + +Some apps might even want to _assert_ that the `msg_sender` is "null" to force their users into strong privacy practices: + +```rust +let sender: Option = context.msg_sender(); +assert(sender.is_none()); +``` + +##### Enqueueing public function calls + +###### Auto-generated contract interfaces + +When you use the `#[aztec]` macro, it will generate a noir contract interface for your contract, behind the scenes. + +This provides pretty syntax when you come to call functions of that contract. E.g.: + +```rust +Token::at(context.this_address())._increase_public_balance(to, amount).enqueue(&mut context); +``` + +In keeping with this new feature of being able to enqueue public function calls with a hidden `msg_sender`, there are some new methods that can be chained instead of `.enqueue(...)`: + +- `enqueue_incognito` -- akin to `enqueue`, but `msg_sender` is set "null". +- `enqueue_view_incognito` -- akin to `enqueue_view`, but `msg_sender` is "null". +- `set_as_teardown_incognito` -- akin to `set_as_teardown`, but `msg_sender` is "null". + +> The name "incognito" has been chosen to imply "msg_sender will not be visible to observers". + +These new functions enable the _calling_ contract to specify that it wants its address to not be visible to the called public function. This is worth re-iterating: it is the _caller's_ choice. A smart contract developer who uses these functions must be sure that the target public function will accept a "null" `msg_sender`. It would not be good (for example) if the called public function did `context.msg_sender().unwrap()`, because then a public function that is called via `enqueue_incognito` would _always fail_! Hopefully smart contract developers will write sufficient tests to catch such problems during development! + +###### Making lower-level public function calls from the private context + +This is discouraged vs using the auto-generated contract interfaces described directly above. + +If you do use any of these low-level methods of the `PrivateContext` in your contract: + +- `call_public_function` +- `static_call_public_function` +- `call_public_function_no_args` +- `static_call_public_function_no_args` +- `call_public_function_with_calldata_hash` +- `set_public_teardown_function` +- `set_public_teardown_function_with_calldata_hash` + +... there is a new `hide_msg_sender: bool` parameter that you will need to specify. + +#### Aztec.js diffs + +> Note: we'll be doing another pass at this aztec.js syntax in the near future. + +When lining up a new tx, the `FunctionCall` struct has been extended to include a `hide_msg_sender: bool` field. + +- `is_public & hide_msg_sender` -- will make a public call with `msg_sender` set to "null". +- `is_public & !hide_msg_sender` -- will make a public call with a visible `msg_sender`, as was the case before this new feature. +- `!is_public & hide_msg_sender` -- Incompatible flags. +- `!is_public & !hide_msg_sender` -- will make a private call with a visible `msg_sender` (noting that since it's a private function call, the `msg_sender` will only be visible to the called private function, but not to the rest of the world). + +## [cli-wallet] + +The `deploy-account` command now requires the address (or alias) of the account to deploy as an argument, not a parameter + +```diff ++aztec-wallet deploy-account main +-aztec-wallet deploy-account -f main +``` + +This release includes a major architectural change to the system. +The PXE JSON RPC Server has been removed, and PXE is now available only as a library to be used by wallets. + +## [Aztec node] + +Network config. The node now pulls default configuration from the public repository [AztecProtocol/networks](https://github.com/AztecProtocol/networks) after it applies the configuration it takes from the running environment and the configuration values baked into the source code. See associated [Design document](https://github.com/AztecProtocol/engineering-designs/blob/15415a62a7c8e901acb8e523625e91fc6f71dce4/docs/network-config/dd.md) + +## [Aztec.js] + +### Removing Aztec cheatcodes + +The Aztec cheatcodes class has been removed. Its functionality can be replaced by using the `getNotes(...)` function directly available on our `TestWallet`, along with the relevant functions available on the Aztec Node interface (note that the cheatcodes were generally just a thin wrapper around the Aztec Node interface). + +### CLI Wallet commands dropped from `aztec` command + +The following commands used to be exposed by both the `aztec` and the `aztec-wallet` commands: + +- import-test-accounts +- create-account +- deploy-account +- deploy +- send +- simulate +- profile +- bridge-fee-juice +- create-authwit +- authorize-action +- get-tx +- cancel-tx +- register-sender +- register-contract + +These were dropped from `aztec` and now are exposed only by the `cli-wallet` command exposed by the `@aztec/cli-wallet` package. + +### PXE commands dropped from `aztec` command + +The following commands were dropped from the `aztec` command: + +- `add-contract`: use can be replaced with `register-contract` on our `cli-wallet` +- `get-contract-data`: debug-only and not considered important enough to need a replacement +- `get-accounts`: debug-only and can be replaced by loading aliases from `cli-wallet` +- `get-account`: debug-only and can be replaced by loading aliases from `cli-wallet` +- `get-pxe-info`: debug-only and not considered important enough to need a replacement + +## [Aztec.nr] + +### Replacing #[private], #[public], #[utility] with #[external(...)] macro + +The original naming was not great in that it did not sufficiently communicate what the given macro did. +We decided to rename `#[private]` as `#[external("private")]`, `#[public]` as `#[external("public")]`, and `#[utility]` as `#[external("utility")]` to better communicate that these functions are externally callable and to specify their execution context. In this sense, `external` now means the exact same thing as in Solidity, i.e. a function that can be called from other contracts, and that can only be invoked via a contract call (i.e. the `CALL` opcode in the EVM, and a kernel call/AVM `CALL` opcode in Aztec). + +You have to do the following changes in your contracts: + +Update import: + +```diff +- use aztec::macros::functions::private; +- use aztec::macros::functions::public; +- use aztec::macros::functions::utility; ++ use aztec::macros::functions::external; +``` + +Update attributes of your functions: + +```diff +- #[private] ++ #[external("private")] + fn my_private_func() { +``` + +```diff +- #[public] ++ #[external("public")] + fn my_public_func() { +``` + +```diff +- #[utility] ++ #[external("utility")] + fn my_utility_func() { +``` + +### Dropping remote mutable references to public context + +`PrivateContext` generally needs to be passed as a mutable reference to functions because it does actually hold state +we're mutating. This is not the case for `PublicContext`, or `UtilityContext` - these are just marker objects that +indicate the current execution mode and make available the correct subset of the API. For this reason we have dropped +the mutable reference from the API. + +If you've passed the context as an argument to custom functions you will need to do the following migration (example +from our token contract): + +```diff +#[contract_library_method] +fn _finalize_transfer_to_private( + from_and_completer: AztecAddress, + amount: u128, + partial_note: PartialUintNote, +- context: &mut PublicContext, +- storage: Storage<&mut PublicContext>, ++ context: PublicContext, ++ storage: Storage, +) { + ... +} +``` + +### Authwit Test Helper now takes `env` + +The `add_private_authwit_from_call_interface` test helper available in `test::helpers::authwit` now takes a `TestEnvironment` parameter, mirroring `add_public_authwit_from_call_interface`. This adds some unfortunate verbosity, but there are bigger plans to improve authwit usage in Noir tests in the near future. + +```diff +add_private_authwit_from_call_interface( ++ env, + on_behalf_of, + caller, + call_interface, +); +``` + +### Historical block renamed as anchor block + +A historical block term has been used as a term that denotes the block against which a private part of a tx has been executed. +This name is ambiguous and for this reason we've introduce "anchor block". +This naming change resulted in quite a few changes and if you've access private context's or utility context's block header you will need to update your code: + +```diff +- let header = context.get_block_header(); ++ let header = context.get_anchor_block_header(); +``` + +### Removed ValueNote utils + +The `value_note::utils` module has been removed because it was incorrect to have those in the value note package. + +For the increment function you can easily just insert the note: + +```diff +- use value_note::utils; +- utils::increment(storage.notes.at(owner), value, owner, sender); ++ let note = ValueNote::new(value, owner); ++ storage.notes.at(owner).insert(note).emit(&mut context, owner, MessageDelivery.CONSTRAINED_ONCHAIN); +``` + +### PrivateMutable: replace / initialize_or_replace behaviour change + +**Motivation:** +Updating a note used to require reading it first (via `get_note`, which nullifies and recreates it) and then calling `replace` — effectively proving a note twice. Now, `replace` accepts a callback that transforms the current note directly, and `initialize_or_replace` simply uses this updated `replace` internally. This reduces circuit cost while maintaining exactly one current note. + +**Key points:** + +1. `replace(self, new_note)` (old) → `replace(self, f)` (new), where `f` takes the current note and returns a transformed note. +2. `initialize_or_replace(self, note)` (old) → `initialize_or_replace(self, f)` (new), where `f` takes an `Option` with the current none, or `none` if uninitialized. +3. Previous note is automatically nullified before the new note is inserted. +4. `NoteEmission` still requires `.emit()` or `.discard()`. + +**Example Migration:** + +```diff +- let current_note = storage.my_var.get_note(); +- let new_note = f(current_note); +- storage.my_var.replace(new_note); ++ storage.my_var.replace(|current_note| f(current_note)); +``` + +```diff +- storage.my_var.initialize_or_replace(new_note); ++ storage.my_var.initialize_or_replace(|_| new_note); +``` + +This makes it easy and efficient to handle both initialization and current value mutation via `initialize_or_replace`, e.g. if implementing a note that simply counts how many times it has been read: + +```diff ++ storage.my_var.initialize_or_replace(|opt_current: Option| opt_current.unwrap_or(0 /* initial value */) + 1); +``` + +- The callback can be a closure (inline) or a named function. +- Any previous assumptions that replace simply inserts a new_note directly must be updated. + +### Unified oracles into single get_utility_context oracle + +The following oracles: + +1. get_contract_address, +2. get_block_number, +3. get_timestamp, +4. get_chain_id, +5. get_version + +were replaced with a single `get_utility_context` oracle whose return value contains all the values returned from the removed oracles. + +If you have used one of these removed oracles before, update the import, e.g.: + +```diff +- aztec::oracle::execution::get_chain_id; ++ aztec::oracle::execution::get_utility_context +``` + +and get the value out of the returned utility context: + +```diff +- let chain_id = get_chain_id(); ++ let chain_id = get_utility_context().chain_id(); +``` + +### Note emission API changes + +The note emission API has been significantly reworked to provide clearer semantics around message delivery guarantees. The key changes are: + +1. `encode_and_encrypt_note` has been removed in favor of calling `emit` directly with `MessageDelivery.CONSTRAINED_ONCHAIN` +2. `encode_and_encrypt_note_unconstrained` has been removed in favor of calling `emit` directly with `MessageDelivery.UNCONSTRAINED_ONCHAIN` +3. `encode_and_encrypt_note_and_emit_as_offchain_message` has been removed in favor of using `emit` with `MessageDelivery.UNCONSTRAINED_OFFCHAIN` +4. Note emission now takes a `delivery_mode` parameter with the following values: + - `CONSTRAINED_ONCHAIN`: For onchain delivery with cryptographic guarantees that recipients can discover and decrypt messages. Uses constrained encryption but is slower to prove. Best for critical messages that contracts need to verify. + - `UNCONSTRAINED_ONCHAIN`: For onchain delivery without encryption constraints. Faster proving but trusts the sender. Good when the sender is incentivized to perform encryption correctly (e.g. they are buying something and will only get it if the recipient sees the note). No guarantees that recipients will be able to find or decrypt messages. + - `UNCONSTRAINED_OFFCHAIN`: For offchain delivery (e.g. cloud storage) without constraints. Lowest cost since no onchain storage needed. Requires custom infrastructure for delivery. No guarantees that messages will be delivered or that recipients will ever find them. +5. The `context` object no longer needs to be passed to these functions + +Example migration: + +First you need to update imports in your contract: + +```diff +- aztec::messages::logs::note::encode_and_encrypt_note; +- aztec::messages::logs::note::encode_and_encrypt_note_unconstrained; +- aztec::messages::logs::note::encode_and_encrypt_note_and_emit_as_offchain_message; ++ aztec::messages::message_delivery::MessageDelivery; +``` + +Then update the emissions: + +```diff +- storage.balances.at(from).sub(from, amount).emit(encode_and_encrypt_note(&mut context, from)); ++ storage.balances.at(from).sub(from, amount).emit(&mut context, from, MessageDelivery.CONSTRAINED_ONCHAIN); +``` + +```diff +- storage.balances.at(from).add(from, change).emit(encode_and_encrypt_note_unconstrained(&mut context, from)); ++ storage.balances.at(from).add(from, change).emit(&mut context, from, MessageDelivery.UNCONSTRAINED_ONCHAIN); +``` + +```diff +- storage.balances.at(owner).insert(note).emit(encode_and_encrypt_note_and_emit_as_offchain_message(&mut context, context.msg_sender()); ++ storage.balances.at(owner).insert(note).emit(&mut context, context.msg_sender(), MessageDelivery.UNCONSTRAINED_OFFCHAIN); +``` + +## 2.0.2 + +## [Public functions] + +The L2 gas cost of the different AVM opcodes have been updated to reflect more realistic proving costs. Developers should review the L2 gas costs of executing public functions and reevaluate any hardcoded L2 gas limits. + +## [Aztec Tools] + +### Contract compilation now requires two steps + +The `aztec-nargo` command is now a direct pass-through to vanilla nargo, without any special compilation flags or postprocessing. Contract compilation for Aztec now requires two explicit steps: + +1. Compile your contracts with `aztec-nargo compile` +2. Run postprocessing with the new `aztec-postprocess-contract` command + +The postprocessing step includes: + +- Transpiling functions for the Aztec VM +- Generating verification keys for private functions +- Caching verification keys for faster subsequent compilations + +Update your build scripts accordingly: + +```diff +- aztec-nargo compile ++ aztec-nargo compile ++ aztec-postprocess-contract +``` + +If you're using the `aztec-up` installer, the `aztec-postprocess-contract` command will be automatically installed alongside `aztec-nargo`. + +## [Aztec.js] Mandatory `from` + +As we prepare for a bigger `Wallet` interface refactor and the upcoming `WalletSDK`, a new parameter has been added to contract interactions, which now should indicate _explicitly_ the address of the entrypoint (usually the account contract) that will be used to authenticate the request. This will be checked in runtime against the current `this.wallet.getAddress()` value, to ensure consistent behavior while the rest of the API is reworked. + +```diff +- await contract.methods.my_func(arg).send().wait(); ++ await contract.methods.my_func(arg).send({ from: account1Address }).wait(); +``` + +## [Aztec.nr] + +### `emit_event_in_public_log` function renamed as `emit_event_in_public` + +This change was done to make the naming consistent with the private counterpart (`emit_event_in_private`). + +### Private event emission API changes + +The private event emission API has been significantly reworked to provide clearer semantics around message delivery guarantees. The key changes are: + +1. `emit_event_in_private_log` has been renamed to `emit_event_in_private` and now takes a `delivery_mode` parameter instead of `constraints` +2. `emit_event_as_offchain_message` has been removed in favor of using `emit_event_in_private` with `MessageDelivery.UNCONSTRAINED_OFFCHAIN` +3. `PrivateLogContent` enum has been replaced with `MessageDelivery` enum with the following values: + - `CONSTRAINED_ONCHAIN`: For onchain delivery with cryptographic guarantees that recipients can discover and decrypt messages. Uses constrained encryption but is slower to prove. Best for critical messages that contracts need to verify. + - `UNCONSTRAINED_ONCHAIN`: For onchain delivery without encryption constraints. Faster proving but trusts the sender. Good when the sender is incentivized to perform encryption correctly (e.g. they are buying something and will only get it if the recipient sees the note). No guarantees that recipients will be able to find or decrypt messages. + - `UNCONSTRAINED_OFFCHAIN`: For offchain delivery (e.g. cloud storage) without constraints. Lowest cost since no onchain storage needed. Requires custom infrastructure for delivery. No guarantees that messages will be delivered or that recipients will ever find them. + +### Contract functions can no longer be `pub` or `pub(crate)` + +With the latest changes to `TestEnvironment`, making contract functions have public visibility is no longer required given the new `call_public` and `simulate_utility` functions. To avoid accidental direct invocation, and to reduce confusion with the autogenerated interfaces, we're forbidding them being public. + +```diff +- pub(crate) fn balance_of_private(account: AztecAddress) -> 128 { ++ fn balance_of_private(account: AztecAddress) -> 128 { +``` + +### Notes require you to manually implement or derive Packable + +We have decided to drop auto-derivation of `Packable` from the `#[note]` macro because we want to make the macros less magical. +With this change you will be forced to either apply `#[derive(Packable)` on your notes: + +```diff ++use aztec::protocol_types::traits::Packable; + ++#[derive(Packable)] +#[note] +pub struct UintNote { + owner: AztecAddress, + randomness: Field, + value: u128, +} +``` + +or to implement it manually yourself: + +```rust +impl Packable for UintNote { + let N: u32 = 3; + + fn pack(self) -> [Field; Self::N] { + [self.owner.to_field(), randomness, value as Field] + } + + fn unpack(fields: [Field; Self::N]) -> Self { + let owner = AztecAddress::from_field(fields[0]); + let randomness = fields[1]; + let value = fields[2] as u128; + UintNote { owner, randomness, value } + } +} +``` + +### Tagging sender now managed via oracle functions + +Now, instead of manually needing to pass a tagging sender as an argument to log emission functions (e.g. `encode_and_encrypt_note`, `encode_and_encrypt_note_unconstrained`, `emit_event_in_private_log`, ...) we automatically load the sender via the `get_sender_for_tags()` oracle. +This value is expected to be populated by account contracts that should call `set_sender_for_tags()` in their entry point functions. + +The changes you need to do in your contracts are quite straightforward. +You simply need to drop the `sender` arg from the callsites of the log emission functions. +E.g. note emission: + +```diff +storage.balances.at(from).sub(from, amount).emit(encode_and_encrypt_note( + &mut context, + from, +- tagging_sender, +)); +``` + +E.g. private event emission: + +```diff +emit_event_in_private_log( + Transfer { from, to, amount }, + &mut context, +- tagging_sender, + to, + PrivateLogContent.NO_CONSTRAINTS, +); +``` + +This change affected arguments `prepare_private_balance_increase` and `mint_to_private` functions on the `Token` contract. +Drop the `from` argument when calling these. + +Example n TypeScript test: + +```diff +- await token.methods.mint_to_private(fundedWallet.getAddress(), alice, mintAmount).send().wait(); ++ await token.methods.mint_to_private(alice, mintAmount).send().wait(); +``` + +Example when + +```diff +let token_out_partial_note = Token::at(token_out).prepare_private_balance_increase( + sender, +- tagging_sender +).call(&mut context); +``` + +### SharedMutable -> DelayedPublicMutable + +The `SharedMutable` state variable has been renamed to `DelayedPublicMutable`. It is a public mutable with a delay before state changes take effect. It can be read in private during the delay period. The name "shared" confuses developers who actually wish to work with so-called "shared private state". Also, we're working on a `DelayedPrivateMutable` which will have similar properties, except writes will be scheduled from private instead. With this new state variable in mind, the new name works nicely. + +## [TXE] - Testing Aztec Contracts using Noir + +### Full `TestEnvironment` API overhaul + +As part of a broader effort to make Noir tests that leverage TXE easier to use and reason about, large parts of it were changed or adapted, resulting in the API now being quite different. No functionality was lost, so it should be possible to migrate any older Noir test to use the new API. + +#### Network State Manipulation + +- `committed_timestamp` removed: this function did not work correctly +- `private_at_timestamp`: this function was not really meaningful: private contexts are built from block numbers, not timestamps +- `pending_block_number` was renamed to `next_block_number`. `pending_timestamp` was removed since it was confusing and not useful +- `committed_block_number` was renamed to `last_block_number` +- `advance_timestamp_to` and `advance_timestamp_by` were renamed to `set_next_block_timestamp` and `advance_next_block_timestamp_by` respectively +- `advance_block_to` was renamed to `mine_block_at`, which takes a timestamp instead of a target block number +- `advance_block_by` was renamed to `mine_block`, which now mines a single block + +#### Account Management + +- `create_account` was renamed to `create_light_account` +- `create_account_contract` was renamed to `create_contract_account` + +#### Contract Deployment + +- `deploy_self` removed: merged into `deploy` +- `deploy` now accepts both local and external contracts + +#### Contract Interactions + +The old way of calling contract functions is gone. Contract functions are now invoked via the `call_private`, `view_private`, `call_public`, `view_public` and `simulate_utility` `TestEnvironment` methods. These take a `CallInterface`, like their old counterparts, but now also take an explicit `from` parameter (for the `call` variants - this is left out of the `view` and `simulate` methods for simplicity). + +#### Raw Context Access + +The `private` and `public` methods are gone. Private, public and utility contexts can now be crated with the `private_context`, `public_context` and `utility_context` functions, all of which takes a callback function that is called with the corresponding context. This functions are expected to be defined in-line as lambdas, and contain the user-defined test logic. This helps delineate where contexts begin and end. Contexts automatically mine blocks on closing, when appropriate. + +#### Error-expecting Functions + +`assert_public_call_revert` and variants have been removed. Use `#[test(should_fail_with = "message")]` instead. + +#### Example Migration + +The following are two tests using the older version of `TestEnvironment`: + +```rust +#[test] +unconstrained fn initial_empty_value() { + let mut env = TestEnvironment::new(); + + // Setup without account contracts. We are not using authwits here, so dummy accounts are enough + let admin = env.create_account(1); + + let initializer_call_interface = Auth::interface().constructor(admin); + + let auth_contract = + env.deploy_self("Auth").with_public_void_initializer(admin, initializer_call_interface); + let auth_contract_address = auth_contract.to_address(); + + env.impersonate(admin); + let authorized = Auth::at(auth_contract_address).get_authorized().view(&mut env.public()); + assert_eq(authorized, AztecAddress::from_field(0)); +} + +#[test] +unconstrained fn non_admin_cannot_set_authorized() { + let mut env = TestEnvironment::new(); + + // Setup without account contracts. We are not using authwits here, so dummy accounts are enough + let admin = env.create_account(1); + let other = env.create_account(2); + + let initializer_call_interface = Auth::interface().constructor(admin); + + let auth_contract = + env.deploy_self("Auth").with_public_void_initializer(admin, initializer_call_interface); + let auth_contract_address = auth_contract.to_address(); + + env.impersonate(other); + env.assert_public_call_fails(Auth::at(auth_contract_address).set_authorized(to_authorize)); +} +``` + +These now look like this: + +```rust +#[test] +unconstrained fn authorized_initially_unset() { + let mut env = TestEnvironment::new(); + + let admin = env.create_light_account(); // Manual secret management gone + + let auth_contract_address = + env.deploy("Auth").with_public_initializer(admin, Auth::interface().constructor(admin)); // deploy_self replaced + let auth = Auth::at(auth_contract_address); + + assert_eq(env.view_public(auth.get_authorized()), AztecAddress::zero()); // .view_public() instead of .public() +} + +#[test(should_fail_with = "caller is not admin")] +unconstrained fn non_admin_cannot_set_unauthorized() { + let mut env = TestEnvironment::new(); + + let admin = env.create_light_account(); + let other = env.create_light_account(); + + let auth_contract_address = + env.deploy("Auth").with_public_initializer(admin, Auth::interface().constructor(admin)); // deploy_self replaced + let auth = Auth::at(auth_contract_address); + + env.call_public(other, auth.set_authorized(other)); // .call_public(), should_fail_with +} +``` + +## [Aztec.js] + +### Cheatcodes + +Cheatcodes where moved out of the `@aztec/aztec.js` package to `@aztec/ethereum` and `@aztec/aztec` packages. +While all of the cheatcodes can be imported from the `@aztec/aztec` package `EthCheatCodes` and `RollupCheatCodes` reside in `@aztec/ethereum` package and if you need only those importing only that package should result in a lighter build. + +### Note exports dropped from artifact + +Notes are no longer exported in the contract artifact. +Exporting notes was technical debt from when we needed to interpret notes in TypeScript. + +The following code will no longer work since `notes` is no longer available on the artifact: + +```rust +const valueNoteTypeId = StatefulTestContractArtifact.notes['ValueNote'].id; +``` + +## [core protocol, Aztec.nr, Aztec.js] Max block number property changed to be seconds based + +### `max_block_number` -> `include_by_timestamp` + +The transaction expiration mechanism has been updated to use seconds rather than number of blocks. +As part of this change, the transaction property `max_block_number` has been renamed to `include_by_timestamp`. + +This change significantly impacts the `SharedMutable` state variable in `Aztec.nr`, which now operates on a seconds instead of number of blocks. +If your contract uses `SharedMutable`, you'll need to: + +1. Update the `INITIAL_DELAY` numeric generic to use seconds instead of blocks +2. Modify any related logic to account for timestamp-based timing +3. Note that timestamps use `u64` values while block numbers use `u32` + +### Removed `prelude`, so your `dep::aztec::prelude::...` imports will need to be amended. + +Instead of importing common types from `dep::aztec::prelude...`, you'll now need to import them from their lower-level locations. +The Noir Language Server vscode extension is now capable of autocompleting imports: just type some of the import and press 'tab' when it pops up with the correct item, and the import will be inserted at the top of the file. + +As a quick reference, here are the paths to the types that were previously in the `prelude`. +So, for example, if you were previously using `dep::aztec::prelude::AztecAddress`, you'll need to replace it with `dep::aztec::protocol_types::address::AztecAddress`. +Apologies for any pain this brings. The reasoning is that these types were somewhat arbitrary, and it was unclear which types were worthy enough to be included here. + +```rust +use dep::aztec::{ + context::{PrivateCallInterface, PrivateContext, PublicContext, UtilityContext, ReturnsHash}, + note::{ + note_getter_options::NoteGetterOptions, + note_interface::{NoteHash, NoteType}, + note_viewer_options::NoteViewerOptions, + retrieved_note::RetrievedNote, + }, + state_vars::{ + map::Map, private_immutable::PrivateImmutable, private_mutable::PrivateMutable, + private_set::PrivateSet, public_immutable::PublicImmutable, public_mutable::PublicMutable, + shared_mutable::SharedMutable, + }, +}; + +use dep::aztec::protocol_types::{ + abis::function_selector::FunctionSelector, + address::{AztecAddress, EthAddress}, + point::Point, + traits::{Deserialize, Serialize}, +}; +``` + +### `include_by_timestamp` is now mandatory + +Each transaction must now include a valid `include_by_timestamp` that satisfies the following conditions: + +- It must be greater than the historical block’s timestamp. +- The duration between the `include_by_timestamp` and the historical block’s timestamp must not exceed the maximum allowed (currently 24 hours). +- It must be greater than or equal to the timestamp of the block in which the transaction is included. + +The protocol circuits compute the `include_by_timestamp` for contract updates during each private function iteration. If a contract does not explicitly specify a value, the default will be the maximum allowed duration. This ensures that `include_by_timestamp` is never left unset. + +No client-side changes are required. However, please note that transactions now have a maximum lifespan of 24 hours and will be removed from the transaction pool once expired. + +## 0.88.0 + +## [Aztec.nr] Deprecation of the `authwit` library + +It is now included in `aztec-nr`, so imports must be updated: + +```diff +-dep::authwit::... ++dep::aztec::authwit... +``` + +and stale dependencies removed from `Nargo.toml` + +```diff +-authwit = { path = "../../../../aztec-nr/authwit" } +``` + +## 0.87.0 + +## [Aztec.js/TS libraries] + +We've bumped our minimum supported node version to v20, as v18 is now EOL. As a consequence, the deprecated type assertion syntax has been replaced with modern import attributes whenever contract artifact JSONs are loaded: + +```diff +-import ArtifactJson from '../artifacts/contract-Contract.json' assert { type: 'json' }; ++import ArtifactJson from '../artifacts/contract-Contract.json' with { type: 'json' }; +``` + +## [Aztec.js/PXE] `simulateUtility` return type + +`pxe.simulateUtility()` now returns a complex object (much like `.simulateTx()`) so extra information can be provided such as simulation timings. + +This information can be accessed setting the `includeMetadata` flag in `SimulateMethodOptions` to `true`, but not providing it (which is the default) will NOT change the behavior of the current code. + +```diff +-const result = await pxe.simulateUtility(...); ++const { meta, result } = await pxe.simulateUtility(...); + +const result = await Contract.methods.myFunction(...).simulate(); +const { result, meta} = await Contract.methods.myFunction(...).simulate({ includeMetadata: true }); + +``` + +## [Aztec.js] Removed mandatory simulation before proving in contract interfaces + +Previously, our autogenerated contract classes would perform a simulation when calling `.prove` or `.send` on them. This could potentially catch errors earlier, but took away control from the app/wallets on how to handle network interactions. Now this process has to be triggered manually, which means just proving an interaction (or proving and sending it to the network in one go via `.send`) is much faster. + +_WARNING:_ This means users can incurr in network fees if a transaction that would otherwise be invalid is sent without sanity checks. To ensure this, it is recommended to do: + +```diff ++await Contract.method.simulate(); +await Contract.method.send().wait(); +``` + +## 0.86.0 + +### [PXE] Removed PXE_L2_STARTING_BLOCK environment variable + +PXE now fast-syncs by skipping finalized blocks and never downloads all blocks, so there is no longer a need to specify a starting block. + +### [Aztec.nr] Logs and messages renaming + +The following renamings have taken place: + +- `encrypted_logs` to `messages`: this module now handles much more than just encrypted logs (including unconstrained message delivery, message encoding, etc.) +- `log_assembly_strategies` to `logs` +- `discovery` moved to `messages`: given that what is discovered are messages +- `default_aes128` removed + +Most contracts barely used these modules, the only frequent imports are the `encode_and_encrypt` functions: + +```diff +- use dep::aztec::messages::logs::note::encode_and_encrypt_note; ++ use dep::aztec::messages::logs::note::encode_and_encrypt_note; +``` + +### [noir-contracts] Reference Noir contracts directory structure change + +`noir-projects/noir-contracts/contracts` directory became too cluttered so we grouped contracts into `account`, `app`, `docs`, `fees`, `libs`, `protocol` and `test` dirs. +If you import contract from the directory make sure to update the paths accordingly. +E.g. for a token contract: + +```diff +#[dependencies] +-token = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v0.83.0", directory = "noir-projects/noir-contracts/contracts/src/token_contract" } ++token = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v0.83.0", directory = "noir-projects/noir-contracts/contracts/app/src/token_contract" } +``` + +### [Aztec.nr] #[utility] contract functions + +Aztec contracts have three kinds of functions: `#[private]`, `#[public]` and what was sometimes called 'top-level unconstrained': an unmarked unconstrained function in the contract module. These are now called `[#utility]` functions, and must be explicitly marked as such: + +```diff ++ #[utility] + unconstrained fn balance_of_private(owner: AztecAddress) -> u128 { + storage.balances.at(owner).balance_of() + } +``` + +Utility functions are standalone unconstrained functions that cannot be called from private or public functions: they are meant to be called by _applications_ to perform auxiliary tasks: query contract state (e.g. a token balance), process messages received offchain, etc. + +All functions in a `contract` block must now be marked as one of either `#[private]`, `#[public]`, `#[utility]`, `#[contract_library_method]`, or `#[test]`. + +Additionally, the `UnconstrainedContext` type has been renamed to `UtilityContext`. This led us to rename the `unkonstrained` method on `TestEnvironment` to `utility`, so any tests using it also need updating: + +```diff +- SharedMutable::new(env.unkonstrained(), storage_slot) ++ SharedMutable::new(env.utility(), storage_slot) +``` + +### [AuthRegistry] function name change + +As part of the broader transition from "top-level unconstrained" to "utility" name (detailed in the note above), the `unconstrained_is_consumable` function in AuthRegistry has been renamed to `utility_is_consumable`. The function's signature and behavior remain unchanged - only the name has been updated to align with the new convention. If you're currently using this function, a simple rename in your code will suffice. + +## 0.83.0 + +### [aztec.js] AztecNode.getPrivateEvents API change + +The `getPrivateEvents` method signature has changed to require an address of a contract that emitted the event and use recipient addresses instead of viewing public keys: + +```diff +- const events = await wallet.getPrivateEvents(TokenContract.events.Transfer, 1, 1, [recipient.getCompleteAddress().publicKeys.masterIncomingViewingPublicKey()]); ++ const events = await wallet.getPrivateEvents(token.address, TokenContract.events.Transfer, 1, 1, [recipient.getAddress()]); +``` + +### [portal contracts] Versions and Non-following message boxes + +The version number is no longer hard-coded to be `1` across all deployments (it not depends on where it is deployed to and with what genesis and logic). +This means that if your portal were hard-coding `1` it will now fail when inserting into the `inbox` or consuming from the `outbox` because of a version mismatch. +Instead you can get the real version (which don't change for a deployment) by reading the `VERSION` on inbox and outbox, or using `getVersion()` on the rollup. + +New Deployments of the protocol do not preserve former state/across each other. +This means that after a new deployment, any "portal" following the registry would try to send messages into this empty rollup to non-existant contracts. +To solve, the portal should be linked to a specific deployment, e.g., a specific inbox. +This can be done by storing the inbox/outbox/version at the time of deployment or initialize and not update them. + +Both of these issues were in the token portal and the uniswap portal, so if you used them as a template it is very likely that you will also have it. + +## 0.82.0 + +### [aztec.js] AztecNode.findLeavesIndexes returns indexes with block metadata + +It's common that we need block metadata of a block in which leaves where inserted when querying indexes of these tree leaves. +For this reason we now return that information along with the indexes. +This allows us to reduce the number of individual AztecNode queries. + +Along this change `findNullifiersIndexesWithBlock` and `findBlockNumbersForIndexes` functions wer removed as all its uses can now be replaced with the newly modified `findLeavesIndexes` function. + +### [aztec.js] AztecNode.getPublicDataTreeWitness renamed as AztecNode.getPublicDataWitness + +This change was done to have consistent naming across codebase. + +### [aztec.js] Wallet interface and Authwit management + +The `Wallet` interface in `aztec.js` is undergoing transformations, trying to be friendlier to wallet builders and reducing the surface of its API. This means `Wallet` no longer extends `PXE`, and instead just implements a subset of the methods of the former. This is NOT going to be its final form, but paves the way towards better interfaces and starts to clarify what the responsibilities of the wallet are: + +```typescript +/** + * The wallet interface. + */ +export type Wallet = AccountInterface & + Pick< + PXE, + // Simulation + | "simulateTx" + | "simulateUnconstrained" + | "profileTx" + // Sending + | "sendTx" + // Contract management (will probably be collapsed in the future to avoid instance and class versions) + | "getContractClassMetadata" + | "getContractMetadata" + | "registerContract" + | "registerContractClass" + // Likely to be removed + | "proveTx" + // Will probably be collapsed + | "getNodeInfo" + | "getPXEInfo" + // Fee info + | "getCurrentBaseFees" + // Still undecided, kept for the time being + | "updateContract" + // Sender management + | "registerSender" + | "getSenders" + | "removeSender" + // Tx status + | "getTxReceipt" + // Events. Kept since events are going to be reworked and changes will come when that's done + | "getPrivateEvents" + | "getPublicEvents" + > & { + createAuthWit(intent: IntentInnerHash | IntentAction): Promise; + }; +``` + +As a side effect, a few debug only features have been removed + +```diff +// Obtain tx effects +const { txHash, debugInfo } = await contract.methods + .set_constant(value) + .send() +-- .wait({ interval: 0.1, debug: true }); +++ .wait({ interval: 0.1 }) + +-- // check that 1 note hash was created +-- expect(debugInfo!.noteHashes.length).toBe(1); +++ const txEffect = await aztecNode.getTxEffect(txHash); +++ const noteHashes = txEffect?.data.noteHashes; +++ // check that 1 note hash was created +++ expect(noteHashes?.length).toBe(1); + +// Wait for a tx to be proven +-- tx.wait({ timeout: 300, interval: 10, proven: true, provenTimeout: 3000 }))); +++ const receipt = await tx.wait({ timeout: 300, interval: 10 }); +++ await waitForProven(aztecNode, receipt, { provenTimeout: 3000 }); +``` + +Authwit management has changed, and PXE no longer stores them. This is unnecessary because now they can be externally provided to simulations and transactions, making sure no stale authorizations are kept inside PXE's db. + +```diff +const witness = await wallet.createAuthWit({ caller, action }); +--await callerWallet.addAuthWitness(witness); +--await action.send().wait(); +++await action.send({ authWitnesses: [witness] }).wait(); +``` + +Another side effect of this is that the interface of the `lookupValidity` method has changed, and now the authwitness has to be provided: + +```diff +const witness = await wallet.createAuthWit({ caller, action }); +--await callerWallet.addAuthWitness(witness); +--await wallet.lookupValidity(wallet.getAddress(), { caller, action }); +++await wallet.lookupValidity(wallet.getAddress(), { caller, action }, witness); +``` + +## 0.80.0 + +### [PXE] Concurrent contract function simulation disabled + +PXE is no longer be able to execute contract functions concurrently (e.g. by collecting calls to `simulateTx` and then using `await Promise.all`). They will instead be put in a job queue and executed sequentially in order of arrival. + +## 0.79.0 + +### [aztec.js] Changes to `BatchCall` and `BaseContractInteraction` + +The constructor arguments of `BatchCall` have been updated to improve usability. Previously, it accepted an array of `FunctionCall`, requiring users to manually set additional data such as `authwit` and `capsules`. Now, `BatchCall` takes an array of `BaseContractInteraction`, which encapsulates all necessary information. + +```diff +class BatchCall extends BaseContractInteraction { +- constructor(wallet: Wallet, protected calls: FunctionCall[]) { ++ constructor(wallet: Wallet, protected calls: BaseContractInteraction[]) { + ... + } +``` + +The `request` method of `BaseContractInteraction` now returns `ExecutionPayload`. This object includes all the necessary data to execute one or more functions. `BatchCall` invokes this method on all interactions to aggregate the required information. It is also used internally in simulations for fee estimation. + +Declaring a `BatchCall`: + +```diff +new BatchCall(wallet, [ +- await token.methods.transfer(alice, amount).request(), +- await token.methods.transfer_to_private(bob, amount).request(), ++ token.methods.transfer(alice, amount), ++ token.methods.transfer_to_private(bob, amount), +]) +``` + +## 0.77.0 + +### [aztec-nr] `TestEnvironment::block_number()` refactored + +The `block_number` function from `TestEnvironment` has been expanded upon with two extra functions, the first being `pending_block_number`, and the second being `committed_block_number`. `pending_block_number` now returns what `block_number` does. In other words, it returns the block number of the block we are currently building. `committed_block_number` returns the block number of the last committed block, i.e. the block number that gets used to execute the private part of transactions when your PXE is successfully synced to the tip of the chain. + +```diff ++ `TestEnvironment::pending_block_number()` ++ `TestEnvironment::committed_block_number()` +``` + +### [aztec-nr] `compute_nullifier_without_context` renamed + +The `compute_nullifier_without_context` function from `NoteHash` (ex `NoteInterface`) is now called `compute_nullifier_unconstrained`, and instead of taking storage slot, contract address and nonce it takes a note hash for nullification (same as `compute_note_hash`). This makes writing this +function simpler: + +```diff +- unconstrained fn compute_nullifier_without_context(self, storage_slot: Field, contract_address: AztecAddress, nonce: Field) -> Field { +- let note_hash_for_nullify = ...; ++ unconstrained fn compute_nullifier_unconstrained(self, note_hash_for_nullify: Field) -> Field { + ... + } +``` + +### `U128` type replaced with native `u128` + +The `U128` type has been replaced with the native `u128` type. This means that you can no longer use the `U128` type in your code. Instead, you should use the `u128` type. +Doing the changes is as straightforward as: + +```diff + #[public] + #[view] +- fn balance_of_public(owner: AztecAddress) -> U128 { ++ fn balance_of_public(owner: AztecAddress) -> u128 { + storage.public_balances.at(owner).read() + } +``` + +`UintNote` has also been updated to use the native `u128` type. + +### [aztec-nr] Removed `compute_note_hash_and_optionally_a_nullifer` + +This function is no longer mandatory for contracts, and the `#[aztec]` macro no longer injects it. + +### [PXE] Removed `addNote` and `addNullifiedNote` + +These functions have been removed from PXE and the base `Wallet` interface. If you need to deliver a note manually because its creation is not being broadcast in an encrypted log, then create an unconstrained contract function to process it and simulate execution of it. The `aztec::discovery::private_logs::do_process_log` function can be used to perform note discovery and add to it to PXE. + +See an example of how to handle a `TransparentNote`: + +```rust + unconstrained fn deliver_transparent_note( + contract_address: AztecAddress, + amount: Field, + secret_hash: Field, + tx_hash: Field, + unique_note_hashes_in_tx: BoundedVec, + first_nullifier_in_tx: Field, + recipient: AztecAddress, + ) { + // do_process_log expects a standard aztec-nr encoded note, which has the following shape: + // [ storage_slot, note_type_id, ...packed_note ] + let note = TransparentNote::new(amount, secret_hash); + let log_plaintext = BoundedVec::from_array(array_concat( + [ + MyContract::storage_layout().my_state_variable.slot, + TransparentNote::get_note_type_id(), + ], + note.pack(), + )); + + do_process_log( + contract_address, + log_plaintext, + tx_hash, + unique_note_hashes_in_tx, + first_nullifier_in_tx, + recipient, + _compute_note_hash_and_nullifier, + ); + } +``` + +The note is then processed by calling this function: + +```typescript +const txEffects = await wallet.getTxEffect(txHash); +await contract.methods + .deliver_transparent_note( + contract.address, + new Fr(amount), + secretHash, + txHash.hash, + toBoundedVec(txEffects!.data.noteHashes, MAX_NOTE_HASHES_PER_TX), + txEffects!.data.nullifiers[0], + wallet.getAddress() + ) + .simulate(); +``` + +### Fee is mandatory + +All transactions must now pay fees. Previously, the default payment method was `NoFeePaymentMethod`; It has been changed to `FeeJuicePaymentMethod`, with the wallet owner as the fee payer. + +For example, the following code will still work: + +``` +await TokenContract.at(address, wallet).methods.transfer(recipient, 100n).send().wait(); +``` + +However, the wallet owner must have enough fee juice to cover the transaction fee. Otherwise, the transaction will be rejected. + +The 3 test accounts deployed in the sandbox are pre-funded with 10 ^ 22 fee juice, allowing them to send transactions right away. + +In addition to the native fee juice, users can pay the transaction fees using tokens that have a corresponding FPC contract. The sandbox now includes `BananaCoin` and `BananaFPC`. Users can use a funded test account to mint banana coin for a new account. The new account can then start sending transactions and pay fees with banana coin. + +```typescript +import { getDeployedTestAccountsWallets } from "@aztec/accounts/testing"; +import { + getDeployedBananaCoinAddress, + getDeployedBananaFPCAddress, +} from "@aztec/aztec"; + +// Fetch the funded test accounts. +const [fundedWallet] = await getDeployedTestAccountsWallets(pxe); + +// Create a new account. +const secret = Fr.random(); +const signingKey = GrumpkinScalar.random(); +const alice = await getSchnorrAccount(pxe, secret, signingKey); +const aliceWallet = await alice.getWallet(); +const aliceAddress = alice.getAddress(); + +// Deploy the new account using the pre-funded test account. +await alice.deploy({ deployWallet: fundedWallet }).wait(); + +// Mint banana coin for the new account. +const bananaCoinAddress = await getDeployedBananaCoinAddress(pxe); +const bananaCoin = await TokenContract.at(bananaCoinAddress, fundedWallet); +const mintAmount = 10n ** 20n; +await bananaCoin.methods + .mint_to_private(fundedWallet.getAddress(), aliceAddress, mintAmount) + .send() + .wait(); + +// Use the new account to send a tx and pay with banana coin. +const transferAmount = 100n; +const bananaFPCAddress = await getDeployedBananaFPCAddress(pxe); +const paymentMethod = new PrivateFeePaymentMethod( + bananaFPCAddress, + aliceWallet +); +const receipt = await bananaCoin + .withWallet(aliceWallet) + .methods.transfer(recipient, transferAmount) + .send({ fee: { paymentMethod } }) + .wait(); +const transactionFee = receipt.transactionFee!; + +// Check the new account's balance. +const aliceBalance = await bananaCoin.methods + .balance_of_private(aliceAddress) + .simulate(); +expect(aliceBalance).toEqual(mintAmount - transferAmount - transactionFee); +``` + +### The tree of protocol contract addresses is now an indexed tree + +This is to allow for non-membership proofs for non-protocol contract addresses. As before, the canonical protocol contract addresses point to the index of the leaf of the 'real' computed protocol address. + +For example, the canonical `DEPLOYER_CONTRACT_ADDRESS` is a constant `= 2`. This is used in the kernels as the `contract_address`. We calculate the `computed_address` (currently `0x1665c5fbc1e58ba19c82f64c0402d29e8bbf94b1fde1a056280d081c15b0dac1`) and check that this value exists in the indexed tree at index `2`. This check already existed and ensures that the call cannot do 'special' protocol contract things unless it is a real protocol contract. + +The new check an indexed tree allows is non-membership of addresses of non protocol contracts. This ensures that if a call is from a protocol contract, it must use the canonical address. For example, before this check a call could be from the deployer contract and use `0x1665c5fbc1e58ba19c82f64c0402d29e8bbf94b1fde1a056280d081c15b0dac1` as the `contract_address`, but be incorrectly treated as a 'normal' call. + +```diff +- let computed_protocol_contract_tree_root = if is_protocol_contract { +- 0 +- } else { +- root_from_sibling_path( +- computed_address.to_field(), +- protocol_contract_index, +- private_call_data.protocol_contract_sibling_path, +- ) +- }; + ++ conditionally_assert_check_membership( ++ computed_address.to_field(), ++ is_protocol_contract, ++ private_call_data.protocol_contract_leaf, ++ private_call_data.protocol_contract_membership_witness, ++ protocol_contract_tree_root, ++ ); +``` + +### [Aztec.nr] Changes to note interfaces and note macros + +In this releases we decided to do a large refactor of notes which resulted in the following changes: + +1. We removed `NoteHeader` and we've introduced a `RetrievedNote` struct that contains a note and the information originally stored in the `NoteHeader`. +2. We removed the `pack_content` and `unpack_content` functions from the `NoteInterface`and made notes implement the standard `Packable` trait. +3. We renamed the `NullifiableNote` trait to `NoteHash` and we've moved the `compute_note_hash` function to this trait from the `NoteInterface` trait. +4. We renamed `NoteInterface` trait as `NoteType` and `get_note_type_id` function as `get_id`. +5. The `#[note]` and `#[partial_note]` macros now generate both the `NoteType` and `NoteHash` traits. +6. `#[custom_note_interface]` macro has been renamed to `#[custom_note]` and it now implements the `NoteInterface` trait. + +This led us to do the following changes to the interfaces: + +```diff +-pub trait NoteInterface { ++pub trait NoteType { + fn get_id() -> Field; +- fn pack_content(self) -> [Field; N]; +- fn unpack_content(fields: [Field; N]) -> Self; +- fn get_header(self) -> NoteHeader; +- fn set_header(&mut self, header: NoteHeader) -> (); +- fn compute_note_hash(self) -> Field; +} + +pub trait NoteHash { ++ fn compute_note_hash(self, storage_slot: Field) -> Field; + + fn compute_nullifier(self, context: &mut PrivateContext, note_hash_for_nullify: Field) -> Field; + +- unconstrained fn compute_nullifier_without_context(self) -> Field; ++ unconstrained fn fn compute_nullifier_without_context(self, storage_slot: Field, contract_address: AztecAddress, note_nonce: Field) -> Field; +} +``` + +If you are using `#[note]` or `#[partial_note(...)]` macros you will need to delete the implementations of the `NullifiableNote` (now `NoteHash`) trait as it now gets auto-generated. +Your note will also need to have an `owner` (a note struct field called owner) as its used in the auto-generated nullifier functions. + +If you need a custom implementation of the `NoteHash` interface use the `#[custom_note]` macro. + +If you used `#[note_custom_interface]` macro before you will need to update your notes by using the `#[custom_note]` macro and implementing the `compute_note_hash` function. +If you have no need for a custom implementation of the `compute_note_hash` function copy the default one: + +``` +fn compute_note_hash(self, storage_slot: Field) -> Field { + let inputs = aztec::protocol_types::utils::arrays::array_concat(self.pack(), [storage_slot]); + aztec::protocol_types::hash::poseidon2_hash_with_separator(inputs, aztec::protocol_types::constants::GENERATOR_INDEX__NOTE_HASH) +} +``` + +If you need to keep the custom implementation of the packing functionality, manually implement the `Packable` trait: + +```diff ++ use dep::aztec::protocol_types::traits::Packable; + ++impl Packable for YourNote { ++ fn pack(self) -> [Field; N] { ++ ... ++ } ++ ++ fn unpack(fields: [Field; N]) -> Self { ++ ... ++ } ++} +``` + +If you don't provide a custom implementation of the `Packable` trait, a default one will be generated. + +### [Aztec.nr] Changes to state variables + +Since we've removed `NoteHeader` from notes we no longer need to modify the header in the notes when working with state variables. +This means that we no longer need to be passing a mutable note reference which led to the following changes in the API. + +#### PrivateImmutable + +For `PrivateImmutable` the changes are fairly straightforward. +Instead of passing in a mutable reference `&mut note` just pass in `note`. + +```diff +impl PrivateImmutable { +- pub fn initialize(self, note: &mut Note) -> NoteEmission ++ pub fn initialize(self, note: Note) -> NoteEmission + where + Note: NoteInterface + NullifiableNote, + { + ... + } +} +``` + +#### PrivateSet + +For `PrivateSet` the changes are a bit more involved than the changes in `PrivateImmutable`. +Instead of passing in a mutable reference `&mut note` to the `insert` function just pass in `note`. +The `remove` function now takes in a `RetrievedNote` instead of a `Note` and the `get_notes` function +now returns a vector `RetrievedNote`s instead of a vector `Note`s. +Note getters now generally return `RetrievedNote`s so getting a hold of the `RetrievedNote` for removal should be straightforward. + +```diff +impl PrivateSet +where + Note: NoteInterface + NullifiableNote + Eq, +{ +- pub fn insert(self, note: &mut Note) -> NoteEmission { ++ pub fn insert(self, note: Note) -> NoteEmission { + ... + } + +- pub fn remove(self, note: Note) { ++ pub fn remove(self, retrieved_note: RetrievedNote) { + ... + } + + pub fn get_notes( + self, + options: NoteGetterOptions, +- ) -> BoundedVec { ++ ) -> BoundedVec, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL> { + ... + } +} + +- impl PrivateSet +- where +- Note: NoteInterface + NullifiableNote, +- { +- pub fn insert_from_public(self, note: &mut Note) { +- create_note_hash_from_public(self.context, self.storage_slot, note); +- } +- } +``` + +#### PrivateMutable + +For `PrivateMutable` the changes are similar to the changes in `PrivateImmutable`. + +```diff +impl PrivateMutable +where + Note: NoteInterface + NullifiableNote, +{ +- pub fn initialize(self, note: &mut Note) -> NoteEmission { ++ pub fn initialize(self, note: Note) -> NoteEmission { + ... + } + +- pub fn replace(self, new_note: &mut Note) -> NoteEmission { ++ pub fn replace(self, new_note: Note) -> NoteEmission { + ... + } + +- pub fn initialize_or_replace(self, note: &mut Note) -> NoteEmission { ++ pub fn initialize_or_replace(self, note: Note) -> NoteEmission { + ... + } +} +``` + +## 0.75.0 + +### Changes to `TokenBridge` interface + +`get_token` and `get_portal_address` functions got merged into a single `get_config` function that returns a struct containing both the token and portal addresses. + +### [Aztec.nr] `SharedMutable` can store size of packed length larger than 1 + +`SharedMutable` has been modified such that now it can store type `T` which packs to a length larger than 1. +This is a breaking change because now `SharedMutable` requires `T` to implement `Packable` trait instead of `ToField` and `FromField` traits. + +To implement the `Packable` trait for your type you can use the derive macro: + +```diff ++ use std::meta::derive; + ++ #[derive(Packable)] +pub struct YourType { + ... +} +``` + +### [Aztec.nr] Introduction of `WithHash` + +`WithHash` is a struct that allows for efficient reading of value `T` from public storage in private. +This is achieved by storing the value with its hash, then obtaining the values via an oracle and verifying them against the hash. +This results in in a fewer tree inclusion proofs for values `T` that are packed into more than a single field. + +`WithHash` is leveraged by state variables like `PublicImmutable`. +This is a breaking change because now we require values stored in `PublicImmutable` and `SharedMutable` to implement the `Eq` trait. + +To implement the `Eq` trait you can use the `#[derive(Eq)]` macro: + +```diff ++ use std::meta::derive; + ++ #[derive(Eq)] +pub struct YourType { + ... +} +``` + +## 0.73.0 + +### [Token, FPC] Moving fee-related complexity from the Token to the FPC + +There was a complexity leak of fee-related functionality in the token contract. +We've came up with a way how to achieve the same objective with the general functionality of the Token contract. +This lead to the removal of `setup_refund` and `complete_refund` functions from the Token contract and addition of `complete_refund` function to the FPC. + +### [Aztec.nr] Improved storage slot allocation + +State variables are no longer assumed to be generic over a type that implements the `Serialize` trait: instead, they must implement the `Storage` trait with an `N` value equal to the number of slots they need to reserve. + +For the vast majority of state variables, this simply means binding the serialization length to this trait: + +```diff ++ impl Storage for MyStateVar where T: Serialize { }; +``` + +### [Aztec.nr] Introduction of `Packable` trait + +We have introduced a `Packable` trait that allows types to be serialized and deserialized with a focus on minimizing the size of the resulting Field array. +This is in contrast to the `Serialize` and `Deserialize` traits, which follows Noir's intrinsic serialization format. +This is a breaking change because we now require `Packable` trait implementation for any type that is to be stored in contract storage. + +Example implementation of Packable trait for `U128` type from `noir::std`: + +```rust +use crate::traits::{Packable, ToField}; + +let U128_PACKED_LEN: u32 = 1; + +impl Packable for U128 { + fn pack(self) -> [Field; U128_PACKED_LEN] { + [self.to_field()] + } + + fn unpack(fields: [Field; U128_PACKED_LEN]) -> Self { + U128::from_integer(fields[0]) + } +} +``` + +### Logs for notes, partial notes, and events have been refactored. + +We're preparing to make log assembly more customisable. These paths have changed. + +```diff +- use dep::aztec::encrypted_logs::encrypted_note_emission::encode_and_encrypt_note, ++ use dep::aztec::messages::logs::note::encode_and_encrypt_note, +``` + +And similar paths for `encode_and_encrypt_note_unconstrained`, and for events and partial notes. + +The way in which logs are assembled in this "default_aes128" strategy is has also changed. I repeat: **Encrypted log layouts have changed**. The corresponding typescript for note discovery has also been changed, but if you've rolled your own functions for parsing and decrypting logs, those will be broken by this change. + +### `NoteInferface` and `EventInterface` no-longer have a `to_be_bytes` method. + +You can remove this method from any custom notes or events that you've implemented. + +### [Aztec.nr] Packing notes resulting in changes in `NoteInterface` + +Note interface implementation generated by our macros now packs note content instead of serializing it +With this change notes are being less costly DA-wise to emit when some of the note struct members implements the `Packable` trait (this is typically the `UintNote` which represents `value` as `U128` that gets serialized as 2 fields but packed as 1). +This results in the following changes in the `NoteInterface`: + +```diff +pub trait NoteInterface { +- fn serialize_content(self) -> [Field; N]; ++ fn pack_content(self) -> [Field; N]; + +- fn deserialize_content(fields: [Field; N]) -> Self; ++ fn unpack_content(fields: [Field; N]) -> Self; + + fn get_header(self) -> NoteHeader; + fn set_header(&mut self, header: NoteHeader) -> (); + fn get_note_type_id() -> Field; + fn compute_note_hash(self) -> Field; +} +``` + +### [PXE] Cleanup of Contract and ContractClass information getters + +```diff +- pxe.isContractInitialized +- pxe.getContractInstance +- pxe.isContractPubliclyDeployed ++ pxe.getContractMetadata +``` + +have been merged into getContractMetadata + +```diff +- pxe.getContractClass +- pxe.isContractClassPubliclyRegistered +- pxe.getContractArtifact ++ pxe.getContractClassMetadata +``` + +These functions have been merged into `pxe.getContractMetadata` and `pxe.getContractClassMetadata`. + +## 0.72.0 + +### Some functions in `aztec.js` and `@aztec/accounts` are now async + +In our efforts to make libraries more browser-friendly and providing with more bundling options for `bb.js` (like a non top-level-await version), some functions are being made async, in particular those that access our cryptographic functions. + +```diff +- AztecAddress.random(); ++ await AztecAddress.random(); + +- getSchnorrAccount(); ++ await getSchnorrAccount(); +``` + +### Public logs replace unencrypted logs + +Any log emitted from public is now known as a public log, rather than an unencrypted log. This means methods relating to these logs have been renamed e.g. in the pxe, archiver, txe: + +```diff +- getUnencryptedLogs(filter: LogFilter): Promise +- getUnencryptedEvents(eventMetadata: EventMetadataDefinition, from: number, limit: number): Promise ++ getPublicLogs(filter: LogFilter): Promise ++ getPublicEvents(eventMetadata: EventMetadataDefinition, from: number, limit: number): Promise +``` + +The context method in aztec.nr is now: + +```diff +- context.emit_unencrypted_log(log) ++ context.emit_public_log(log) +``` + +These logs were treated as bytes in the node and as hashes in the protocol circuits. Now, public logs are treated as fields everywhere: + +```diff +- unencryptedLogs: UnencryptedTxL2Logs +- unencrypted_logs_hashes: [ScopedLogHash; MAX_UNENCRYPTED_LOGS_PER_TX] ++ publicLogs: PublicLog[] ++ public_logs: [PublicLog; MAX_PUBLIC_LOGS_PER_TX] +``` + +A `PublicLog` contains the log (as an array of fields) and the app address. + +This PR also renamed encrypted events to private events: + +```diff +- getEncryptedEvents(eventMetadata: EventMetadataDefinition, from: number, limit: number, vpks: Point[]): Promise ++ getPrivateEvents(eventMetadata: EventMetadataDefinition, from: number, limit: number, vpks: Point[]): Promise +``` + +## 0.70.0 + +### [Aztec.nr] Removal of `getSiblingPath` oracle + +Use `getMembershipWitness` oracle instead that returns both the sibling path and index. + +## 0.68.0 + +### [archiver, node, pxe] Remove contract artifacts in node and archiver and store function names instead + +Contract artifacts were only in the archiver for debugging purposes. Instead function names are now (optionally) emitted +when registering contract classes + +Function changes in the Node interface and Contract Data source interface: + +```diff +- addContractArtifact(address: AztecAddress, artifact: ContractArtifact): Promise; ++ registerContractFunctionNames(address: AztecAddress, names: Record): Promise; +``` + +So now the PXE registers this when calling `registerContract()` + +``` +await this.node.registerContractFunctionNames(instance.address, functionNames); +``` + +Function changes in the Archiver + +```diff +- addContractArtifact(address: AztecAddress, artifact: ContractArtifact) +- getContractArtifact(address: AztecAddress) ++ registerContractFunctionNames(address: AztecAddress, names: Record): Promise +``` + +### [fees, fpc] Changes in setting up FPC as fee payer on AztecJS and method names in FPC + +On AztecJS, setting up `PrivateFeePaymentMethod` and `PublicFeePaymentMethod` are now the same. The don't need to specify a sequencer address or which coin to pay in. The coins are set up in the FPC contract! + +```diff +- paymentMethod: new PrivateFeePaymentMethod(bananaCoin.address,bananaFPC.address,aliceWallet,sequencerAddress), ++ paymentMethod: new PrivateFeePaymentMethod(bananaFPC.address, aliceWallet), + +- paymentMethod: new PublicFeePaymentMethod(bananaCoin.address, bananaFPC.address, aliceWallet), ++ paymentMethod: new PublicFeePaymentMethod(bananaFPC.address, aliceWallet), +``` + +Changes in `FeePaymentMethod` class in AztecJS + +```diff +- getAsset(): AztecAddress; ++ getAsset(): Promise; +``` + +Changes in the token contract: +FPC specific methods, `setup_refund()` and `complete_refund()` have minor args rename. + +Changes in FPC contract: +Rename of args in all of FPC functions as FPC now stores the accepted token address and admin and making it clearer the amounts are corresponding to the accepted token and not fee juice. +Also created a public function `pull_funds()` for admin to clawback any money in the FPC + +Expect more changes in FPC in the coming releases! + +### Name change from `contact` to `sender` in PXE API + +`contact` has been deemed confusing because the name is too similar to `contract`. +For this reason we've decided to rename it: + +```diff +- await pxe.registerContact(address); ++ await pxe.registerSender(address); +- await pxe.getContacts(); ++ await pxe.getSenders(); +- await pxe.removeContact(address); ++ await pxe.removeSender(address); +``` + +## 0.67.1 + +### Noir contracts package no longer exposes artifacts as default export + +To reduce loading times, the package `@aztec/noir-contracts.js` no longer exposes all artifacts as its default export. Instead, it exposes a `ContractNames` variable with the list of all contract names available. To import a given artifact, use the corresponding export, such as `@aztec/noir-contracts.js/FPC`. + +### Blobs + +We now publish the majority of DA in L1 blobs rather than calldata, with only contract class logs remaining as calldata. This replaces all code that touched the `txsEffectsHash`. +In the rollup circuits, instead of hashing each child circuit's `txsEffectsHash` to form a tree, we track tx effects by absorbing them into a sponge for blob data (hence the name: `spongeBlob`). This sponge is treated like the state trees in that we check each rollup circuit 'follows' the next: + +```diff +- let txs_effects_hash = sha256_to_field(left.txs_effects_hash, right.txs_effects_hash); ++ assert(left.end_sponge_blob.eq(right.start_sponge_blob)); ++ let start_sponge_blob = left.start_sponge_blob; ++ let end_sponge_blob = right.end_sponge_blob; +``` + +This sponge is used in the block root circuit to confirm that an injected array of all `txEffects` does match those rolled up so far in the `spongeBlob`. Then, the `txEffects` array is used to construct and prove opening of the polynomial representing the blob commitment on L1 (this is done efficiently thanks to the Barycentric formula). +On L1, we publish the array as a blob and verify the above proof of opening. This confirms that the tx effects in the rollup circuit match the data in the blob: + +```diff +- bytes32 txsEffectsHash = TxsDecoder.decode(_body); ++ bytes32 blobHash = _validateBlob(blobInput); +``` + +Where `blobInput` contains the proof of opening and evaluation calculated in the block root rollup circuit. It is then stored and used as a public input to verifying the epoch proof. + +## 0.67.0 + +### L2 Gas limit of 6M enforced for public portion of TX + +A 12M limit was previously enforced per-enqueued-public-call. The protocol now enforces a stricter limit that the entire public portion of a transaction consumes at most 6,000,000 L2 gas. + +### [aztec.nr] Renamed `Header` and associated helpers + +The `Header` struct has been renamed to `BlockHeader`, and the `get_header()` family of functions have been similarly renamed to `get_block_header()`. + +```diff +- let header = context.get_header_at(block_number); ++ let header = context.get_block_header_at(block_number); +``` + +### Outgoing Events removed + +Previously, every event which was emitted included: + +- Incoming Header (to convey the app contract address to the recipient) +- Incoming Ciphertext (to convey the note contents to the recipient) +- Outgoing Header (served as a backup, to convey the app contract address to the "outgoing viewer" - most likely the sender) +- Outgoing Ciphertext (served as a backup, encrypting the symmetric key of the incoming ciphertext to the "outgoing viewer" - most likely the sender) + +The latter two have been removed from the `.emit()` functions, so now only an Incoming Header and Incoming Ciphertext will be emitted. + +The interface for emitting a note has therefore changed, slightly. No more ovpk's need to be derived and passed into `.emit()` functions. + +```diff +- nfts.at(to).insert(&mut new_note).emit(encode_and_encrypt_note(&mut context, from_ovpk_m, to, from)); ++ nfts.at(to).insert(&mut new_note).emit(encode_and_encrypt_note(&mut context, to, from)); +``` + +The `getOutgoingNotes` function is removed from the PXE interface. + +Some aztec.nr library methods' arguments are simplified to remove an `outgoing_viewer` parameter. E.g. `ValueNote::increment`, `ValueNote::decrement`, `ValueNote::decrement_by_at_most`, `EasyPrivateUint::add`, `EasyPrivateUint::sub`. + +Further changes are planned, so that: + +- Outgoing ciphertexts (or any kind of abstract ciphertext) can be emitted by a contract, and on the other side discovered and then processed by the contract. +- Headers will be removed, due to the new tagging scheme. + +## 0.66 + +### DEBUG env var is removed + +The `DEBUG` variable is no longer used. Use `LOG_LEVEL` with one of `silent`, `fatal`, `error`, `warn`, `info`, `verbose`, `debug`, or `trace`. To tweak log levels per module, add a list of module prefixes with their overridden level. For example, LOG_LEVEL="info; verbose: aztec:sequencer, aztec:archiver; debug: aztec:kv-store" sets `info` as the default log level, `verbose` for the sequencer and archiver, and `debug` for the kv-store. Module name match is done by prefix. + +### `tty` resolve fallback required for browser bundling + +When bundling `aztec.js` for web, the `tty` package now needs to be specified as an empty fallback: + +```diff +resolve: { + plugins: [new ResolveTypeScriptPlugin()], + alias: { './node/index.js': false }, + fallback: { + crypto: false, + os: false, + fs: false, + path: false, + url: false, ++ tty: false, + worker_threads: false, + buffer: require.resolve('buffer/'), + util: require.resolve('util/'), + stream: require.resolve('stream-browserify'), + }, +}, +``` + +## 0.65 + +### [aztec.nr] Removed SharedImmutable + +The `SharedImmutable` state variable has been removed, since it was essentially the exact same as `PublicImmutable`, which now contains functions for reading from private: + +```diff +- foo: SharedImmutable. ++ foo: PublicImmutable. +``` + +### [aztec.nr] SharedImmutable renamings + +`SharedImmutable::read_private` and `SharedImmutable::read_public` were renamed to simply `read`, since only one of these versions is ever available depending on the current context. + +```diff +// In private +- let value = storage.my_var.read_private(); ++ let value = storage.my_var.read(); + +// In public +- let value = storage.my_var.read_public(); ++ let value = storage.my_var.read(); +``` + +### [aztec.nr] SharedMutable renamings + +`SharedMutable` getters (`get_current_value_in_public`, etc.) were renamed by dropping the `_in` suffix, since only one of these versions is ever available depending on the current context. + +```diff +// In private +- let value = storage.my_var.get_current_value_in_private(); ++ let value = storage.my_var.get_current_value(); + +// In public +- let value = storage.my_var.get_current_value_in_public(); ++ let value = storage.my_var.get_current_value(); +``` + +### [aztec.js] Random addresses are now valid + +The `AztecAddress.random()` function now returns valid addresses, i.e. addresses that can receive encrypted messages and therefore have notes be sent to them. `AztecAddress.isValid()` was also added to check for validity of an address. + +## 0.63.0 + +### [PXE] Note tagging and discovery + +PXE's trial decryption of notes has been replaced in favor of a tagging and discovery approach. It is much more efficient and should scale a lot better as the network size increases, since +notes can now be discovered on-demand. For the time being, this means that accounts residing _on different PXE instances_ should add senders to their contact list, so notes can be discovered +(accounts created on the same PXE instance will be added as senders for each other by default) + +```diff ++pxe.registerContact(senderAddress) +``` + +The note discovery process is triggered automatically whenever a contract invokes the `get_notes` oracle, meaning no contract changes are expected. Just in case, every contract has now a utility method +`sync_notes` that can trigger the process manually if necessary. This can be useful since now the `DebugInfo` object that can be obtained when sending a tx with the `debug` flag set to true +no longer contains the notes that were generated in the transaction: + +```diff +const receipt = await inclusionsProofsContract.methods.create_note(owner, 5n).send().wait({ debug: true }); +-const { visibleIncomingNotes } = receipt.debugInfo!; +-expect(visibleIncomingNotes.length).toEqual(1); ++await inclusionsProofsContract.methods.sync_notes().simulate(); ++const incomingNotes = await wallet.getIncomingNotes({ txHash: receipt.txHash }); ++expect(incomingNotes.length).toEqual(1); +``` + +### [Token contract] Partial notes related refactor + +We've decided to replace the old "shield" flow with one leveraging partial notes. +This led to a removal of `shield` and `redeem_shield` functions and an introduction of `transfer_to_private`. +An advantage of the new approach is that only 1 tx is required and the API of partial notes is generally nicer. +For more information on partial notes refer to docs. + +### [Token contract] Function naming changes + +There have been a few naming changes done for improved consistency. +These are the renamings: +`transfer_public` --> `transfer_in_public` +`transfer_from` --> `transfer_in_private` +`mint_public` --> `mint_to_public` +`burn` --> `burn_private` + +## 0.62.0 + +### [TXE] Single execution environment + +Thanks to recent advancements in Brillig TXE performs every single call as if it was a nested call, spawning a new ACVM or AVM simulator without performance loss. +This ensures every single test runs in a consistent environment and allows for clearer test syntax: + +```diff +-let my_call_interface = MyContract::at(address).my_function(args); +-env.call_private(my_contract_interface) ++MyContract::at(address).my_function(args).call(&mut env.private()); +``` + +This implies every contract has to be deployed before it can be tested (via `env.deploy` or `env.deploy_self`) and of course it has to be recompiled if its code was changed before TXE can use the modified bytecode. + +### Uniqueness of L1 to L2 messages + +L1 to L2 messages have been updated to guarantee their uniqueness. This means that the hash of an L1 to L2 message cannot be precomputed, and must be obtained from the `MessageSent` event emitted by the `Inbox` contract, found in the L1 transaction receipt that inserted the message: + +```solidity +event MessageSent(uint256 indexed l2BlockNumber, uint256 index, bytes32 indexed hash); +``` + +This event now also includes an `index`. This index was previously required to consume an L1 to L2 message in a public function, and now it is also required for doing so in a private function, since it is part of the message hash preimage. The `PrivateContext` in aztec-nr has been updated to reflect this: + +```diff +pub fn consume_l1_to_l2_message( + &mut self, + content: Field, + secret: Field, + sender: EthAddress, ++ leaf_index: Field, +) { +``` + +This change has also modified the internal structure of the archiver database, making it incompatible with previous ones. Last, the API for obtaining an L1 to L2 message membership witness has been simplified to leverage message uniqueness: + +```diff +getL1ToL2MessageMembershipWitness( + blockNumber: L2BlockNumber, + l1ToL2Message: Fr, +- startIndex: bigint, +): Promise<[bigint, SiblingPath] | undefined>; +``` + +### Address is now a point + +The address now serves as someone's public key to encrypt incoming notes. An address point has a corresponding address secret, which is used to decrypt the notes encrypted with the address point. + +### Notes no longer store a hash of the nullifier public keys, and now store addresses + +Because of removing key rotation, we can now store addresses as the owner of a note. Because of this and the above change, we can and have removed the process of registering a recipient, because now we do not need any keys of the recipient. + +example_note.nr + +```diff +-npk_m_hash: Field ++owner: AztecAddress +``` + +PXE Interface + +```diff +-registerRecipient(completeAddress: CompleteAddress) +``` + +## 0.58.0 + +### [l1-contracts] Inbox's MessageSent event emits global tree index + +Earlier `MessageSent` event in Inbox emitted a subtree index (index of the message in the subtree of the l2Block). But the nodes and Aztec.nr expects the index in the global L1_TO_L2_MESSAGES_TREE. So to make it easier to parse this, Inbox now emits this global index. + +## 0.57.0 + +### Changes to PXE API and `ContractFunctionInteraction`` + +PXE APIs have been refactored to better reflect the lifecycle of a Tx (`execute private -> simulate kernels -> simulate public (estimate gas) -> prove -> send`) + +- `.simulateTx`: Now returns a `TxSimulationResult`, containing the output of private execution, kernel simulation and public simulation (optional). +- `.proveTx`: Now accepts the result of executing the private part of a transaction, so simulation doesn't have to happen again. + +Thanks to this refactor, `ContractFunctionInteraction` has been updated to remove its internal cache and avoid bugs due to its mutable nature. As a result our type-safe interfaces now have to be used as follows: + +```diff +-const action = MyContract.at(address).method(args); +-await action.prove(); +-await action.send().wait(); ++const action = MyContract.at(address).method(args); ++const provenTx = await action.prove(); ++await provenTx.send().wait(); +``` + +It's still possible to use `.send()` as before, which will perform proving under the hood. + +More changes are coming to these APIs to better support gas estimation mechanisms and advanced features. + +### Changes to public calling convention + +Contracts that include public functions (that is, marked with `#[public]`), are required to have a function `public_dispatch(selector: Field)` which acts as an entry point. This will be soon the only public function registered/deployed in contracts. The calling convention is updated so that external calls are made to this function. + +If you are writing your contracts using Aztec-nr, there is nothing you need to change. The `public_dispatch` function is automatically generated by the `#[aztec]` macro. + +### [Aztec.nr] Renamed `unsafe_rand` to `random` + +Since this is an `unconstrained` function, callers are already supposed to include an `unsafe` block, so this function has been renamed for reduced verbosity. + +```diff +-use aztec::oracle::unsafe_rand::unsafe_rand; ++use aztec::oracle::random::random; + +-let random_value = unsafe { unsafe_rand() }; ++let random_value = unsafe { random() }; +``` + +### [Aztec.js] Removed `L2Block.fromFields` + +`L2Block.fromFields` was a syntactic sugar which is causing [issues](https://github.com/AztecProtocol/aztec-packages/issues/8340) so we've removed it. + +```diff +-const l2Block = L2Block.fromFields({ header, archive, body }); ++const l2Block = new L2Block(archive, header, body); +``` + +### [Aztec.nr] Removed `SharedMutablePrivateGetter` + +This state variable was deleted due to it being difficult to use safely. + +### [Aztec.nr] Changes to `NullifiableNote` + +The `compute_nullifier_without_context` function is now `unconstrained`. It had always been meant to be called in unconstrained contexts (which is why it did not receive the `context` object), but now that Noir supports trait functions being `unconstrained` this can be implemented properly. Users must add the `unconstrained` keyword to their implementations of the trait: + +```diff +impl NullifiableNote for MyCustomNote { +- fn compute_nullifier_without_context(self) -> Field { ++ unconstrained fn compute_nullifier_without_context(self) -> Field { +``` + +### [Aztec.nr] Make `TestEnvironment` unconstrained + +All of `TestEnvironment`'s functions are now `unconstrained`, preventing accidentally calling them in a constrained circuit, among other kinds of user error. Becuase they work with mutable references, and these are not allowed to cross the constrained/unconstrained barrier, tests that use `TestEnvironment` must also become `unconstrained`. The recommended practice is to make _all_ Noir tests and test helper functions be `unconstrained: + +```diff +#[test] +-fn test_my_function() { ++unconstrained fn test_my_function() { + let env = TestEnvironment::new(); +``` + +### [Aztec.nr] removed `encode_and_encrypt_note` and renamed `encode_and_encrypt_note_with_keys` to `encode_and_encrypt_note` + +```diff +contract XYZ { +- use dep::aztec::encrypted_logs::encrypted_note_emission::encode_and_encrypt_note_with_keys; ++ use dep::aztec::encrypted_logs::encrypted_note_emission::encode_and_encrypt_note; +... + +- numbers.at(owner).initialize(&mut new_number).emit(encode_and_encrypt_note_with_keys(&mut context, owner_ovpk_m, owner_ivpk_m, owner)); ++ numbers.at(owner).initialize(&mut new_number).emit(encode_and_encrypt_note(&mut context, owner_ovpk_m, owner_ivpk_m, owner)); +} +``` + +## 0.56.0 + +### [Aztec.nr] Changes to contract definition + +We've migrated the Aztec macros to use the newly introduce meta programming Noir feature. Due to being Noir-based, the new macros are less obscure and can be more easily modified. + +As part of this transition, some changes need to be applied to Aztec contracts: + +- The top level `contract` block needs to have the `#[aztec]` macro applied to it. +- All `#[aztec(name)]` macros are renamed to `#[name]`. +- The storage struct (the one that gets the `#[storage]` macro applied) but be generic over a `Context` type, and all state variables receive this type as their last generic type parameter. + +```diff ++ use dep::aztec::macros::aztec; + +#[aztec] +contract Token { ++ use dep::aztec::macros::{storage::storage, events::event, functions::{initializer, private, view, public}}; + +- #[aztec(storage)] +- struct Storage { ++ #[storage] ++ struct Storage { +- admin: PublicMutable, ++ admin: PublicMutable, +- minters: Map>, ++ minters: Map, Context>, + } + +- #[aztec(public)] +- #[aztec(initializer)] ++ #[public] ++ #[initializer] + fn constructor(admin: AztecAddress, name: str<31>, symbol: str<31>, decimals: u8) { + ... + } + +- #[aztec(public)] +- #[aztec(view)] +- fn public_get_name() -> FieldCompressedString { ++ #[public] ++ #[view] + fn public_get_name() -> FieldCompressedString { + ... + } +``` + +### [Aztec.nr] Changes to `NoteInterface` + +The new macro model prevents partial trait auto-implementation: they either implement the entire trait or none of it. This means users can no longer implement part of `NoteInterface` and have the rest be auto-implemented. + +For this reason we've separated the methods which are auto-implemented and those which needs to be implemented manually into two separate traits: the auto-implemented ones stay in the `NoteInterface` trace and the manually implemented ones were moved to `NullifiableNote` (name likely to change): + +```diff +-#[aztec(note)] ++#[note] +struct AddressNote { + ... +} + +-impl NoteInterface for AddressNote { ++impl NullifiableNote for AddressNote { + fn compute_nullifier(self, context: &mut PrivateContext, note_hash_for_nullify: Field) -> Field { + ... + } + + fn compute_nullifier_without_context(self) -> Field { + ... + } +} +``` + +### [Aztec.nr] Changes to contract interface + +The `Contract::storage()` static method has been renamed to `Contract::storage_layout()`. + +```diff +- let fee_payer_balances_slot = derive_storage_slot_in_map(Token::storage().balances.slot, fee_payer); +- let user_balances_slot = derive_storage_slot_in_map(Token::storage().balances.slot, user); ++ let fee_payer_balances_slot = derive_storage_slot_in_map(Token::storage_layout().balances.slot, fee_payer); ++ let user_balances_slot = derive_storage_slot_in_map(Token::storage_layout().balances.slot, user); +``` + +### Key rotation removed + +The ability to rotate incoming, outgoing, nullifying and tagging keys has been removed - this feature was easy to misuse and not worth the complexity and gate count cost. As part of this, the Key Registry contract has also been deleted. The API for fetching public keys has been adjusted accordingly: + +```diff +- let keys = get_current_public_keys(&mut context, account); ++ let keys = get_public_keys(account); +``` + +### [Aztec.nr] Rework `NoteGetterOptions::select` + +The `select` function in both `NoteGetterOptions` and `NoteViewerOptions` no longer takes an `Option` of a comparator, but instead requires an explicit comparator to be passed. Additionally, the order of the parameters has been changed so that they are `(lhs, operator, rhs)`. These two changes should make invocations of the function easier to read: + +```diff +- options.select(ValueNote::properties().value, amount, Option::none()) ++ options.select(ValueNote::properties().value, Comparator.EQ, amount) +``` + +## 0.53.0 + +### [Aztec.nr] Remove `OwnedNote` and create `UintNote` + +`OwnedNote` allowed having a U128 `value` in the custom note while `ValueNote` restricted to just a Field. + +We have removed `OwnedNote` but are introducing a more genric `UintNote` within aztec.nr + +``` +#[aztec(note)] +struct UintNote { + // The integer stored by the note + value: U128, + // The nullifying public key hash is used with the nsk_app to ensure that the note can be privately spent. + npk_m_hash: Field, + // Randomness of the note to hide its contents + randomness: Field, +} +``` + +### [TXE] logging + +You can now use `debug_log()` within your contract to print logs when using the TXE + +Remember to set the following environment variables to activate debug logging: + +```bash +export DEBUG="aztec:*" +export LOG_LEVEL="debug" +``` + +### [Account] no assert in is_valid_impl + +`is_valid_impl` method in account contract asserted if signature was true. Instead now we will return the verification to give flexibility to developers to handle it as they please. + +```diff +- let verification = std::ecdsa_secp256k1::verify_signature(public_key.x, public_key.y, signature, hashed_message); +- assert(verification == true); +- true ++ std::ecdsa_secp256k1::verify_signature(public_key.x, public_key.y, signature, hashed_message) +``` + +## 0.49.0 + +### Key Rotation API overhaul + +Public keys (ivpk, ovpk, npk, tpk) should no longer be fetched using the old `get_[x]pk_m` methods on the `Header` struct, but rather by calling `get_current_public_keys`, which returns a `PublicKeys` struct with all four keys at once: + +```diff ++use dep::aztec::keys::getters::get_current_public_keys; + +-let header = context.header(); +-let owner_ivpk_m = header.get_ivpk_m(&mut context, owner); +-let owner_ovpk_m = header.get_ovpk_m(&mut context, owner); ++let owner_keys = get_current_public_keys(&mut context, owner); ++let owner_ivpk_m = owner_keys.ivpk_m; ++let owner_ovpk_m = owner_keys.ovpk_m; +``` + +If using more than one key per account, this will result in very large circuit gate count reductions. + +Additionally, `get_historical_public_keys` was added to support reading historical keys using a historical header: + +```diff ++use dep::aztec::keys::getters::get_historical_public_keys; + +let historical_header = context.header_at(some_block_number); +-let owner_ivpk_m = header.get_ivpk_m(&mut context, owner); +-let owner_ovpk_m = header.get_ovpk_m(&mut context, owner); ++let owner_keys = get_historical_public_keys(historical_header, owner); ++let owner_ivpk_m = owner_keys.ivpk_m; ++let owner_ovpk_m = owner_keys.ovpk_m; +``` + +## 0.48.0 + +### NoteInterface changes + +`compute_note_hash_and_nullifier*` functions were renamed as `compute_nullifier*` and the `compute_nullifier` function now takes `note_hash_for_nullify` as an argument (this allowed us to reduce gate counts and the hash was typically computed before). Also `compute_note_hash_for_consumption` function was renamed as `compute_note_hash_for_nullification`. + +```diff +impl NoteInterface for ValueNote { +- fn compute_note_hash_and_nullifier(self, context: &mut PrivateContext) -> (Field, Field) { +- let note_hash_for_nullify = compute_note_hash_for_consumption(self); +- let secret = context.request_nsk_app(self.npk_m_hash); +- let nullifier = poseidon2_hash_with_separator([ +- note_hash_for_nullify, +- secret, +- ], +- GENERATOR_INDEX__NOTE_NULLIFIER as Field, +- ); +- (note_hash_for_nullify, nullifier) +- } +- fn compute_note_hash_and_nullifier_without_context(self) -> (Field, Field) { +- let note_hash_for_nullify = compute_note_hash_for_consumption(self); +- let secret = get_nsk_app(self.npk_m_hash); +- let nullifier = poseidon2_hash_with_separator([ +- note_hash_for_nullify, +- secret, +- ], +- GENERATOR_INDEX__NOTE_NULLIFIER as Field, +- ); +- (note_hash_for_nullify, nullifier) +- } + ++ fn compute_nullifier(self, context: &mut PrivateContext, note_hash_for_nullify: Field) -> Field { ++ let secret = context.request_nsk_app(self.npk_m_hash); ++ poseidon2_hash_with_separator([ ++ note_hash_for_nullify, ++ secret ++ ], ++ GENERATOR_INDEX__NOTE_NULLIFIER as Field, ++ ) ++ } ++ fn compute_nullifier_without_context(self) -> Field { ++ let note_hash_for_nullify = compute_note_hash_for_nullification(self); ++ let secret = get_nsk_app(self.npk_m_hash); ++ poseidon2_hash_with_separator([ ++ note_hash_for_nullify, ++ secret, ++ ], ++ GENERATOR_INDEX__NOTE_NULLIFIER as Field, ++ ) ++ } +} +``` + +### Fee Juice rename + +The name of the canonical Gas contract has changed to Fee Juice. Update noir code: + +```diff +-GasToken::at(contract_address) ++FeeJuice::at(contract_address) +``` + +Additionally, `NativePaymentMethod` and `NativePaymentMethodWithClaim` have been renamed to `FeeJuicePaymentMethod` and `FeeJuicePaymentMethodWithClaim`. + +### PrivateSet::pop_notes(...) + +The most common flow when working with notes is obtaining them from a `PrivateSet` via `get_notes(...)` and then removing them via `PrivateSet::remove(...)`. +This is cumbersome and it results in unnecessary constraints due to a redundant note read request checks in the remove function. + +For this reason we've implemented `pop_notes(...)` which gets the notes, removes them from the set and returns them. +This tight coupling of getting notes and removing them allowed us to safely remove the redundant read request check. + +Token contract diff: + +```diff +-let options = NoteGetterOptions::with_filter(filter_notes_min_sum, target_amount).set_limit(max_notes); +-let notes = self.map.at(owner).get_notes(options); +-let mut subtracted = U128::from_integer(0); +-for i in 0..options.limit { +- if i < notes.len() { +- let note = notes.get_unchecked(i); +- self.map.at(owner).remove(note); +- subtracted = subtracted + note.get_amount(); +- } +-} +-assert(minuend >= subtrahend, "Balance too low"); ++let options = NoteGetterOptions::with_filter(filter_notes_min_sum, target_amount).set_limit(max_notes); ++let notes = self.map.at(owner).pop_notes(options); ++let mut subtracted = U128::from_integer(0); ++for i in 0..options.limit { ++ if i < notes.len() { ++ let note = notes.get_unchecked(i); ++ subtracted = subtracted + note.get_amount(); ++ } ++} ++assert(minuend >= subtrahend, "Balance too low"); +``` + +Note that `pop_notes` may not have obtained and removed any notes! The caller must place checks on the returned notes, e.g. in the example above by checking a sum of balances, or by checking the number of returned notes (`assert_eq(notes.len(), expected_num_notes)`). + +## 0.47.0 + +# [Aztec sandbox] TXE deployment changes + +The way simulated deployments are done in TXE tests has changed to avoid relying on TS interfaces. It is now possible to do it by directly pointing to a Noir standalone contract or workspace: + +```diff +-let deployer = env.deploy("path_to_contract_ts_interface"); ++let deployer = env.deploy("path_to_contract_root_folder_where_nargo_toml_is", "ContractName"); +``` + +Extended syntax for more use cases: + +```rust +// The contract we're testing +env.deploy_self("ContractName"); // We have to provide ContractName since nargo it's ready to support multi-contract files + +// A contract in a workspace +env.deploy("../path/to/workspace@package_name", "ContractName"); // This format allows locating the artifact in the root workspace target folder, regardless of internal code organization +``` + +The deploy function returns a `Deployer`, which requires performing a subsequent call to `without_initializer()`, `with_private_initializer()` or `with_public_initializer()` just like before in order to **actually** deploy the contract. + +### [CLI] Command refactor and unification + `aztec test` + +Sandbox commands have been cleaned up and simplified. Doing `aztec-up` now gets you the following top-level commands: + +`aztec`: All the previous commands + all the CLI ones without having to prefix them with cli. Run `aztec` for help! +`aztec-nargo`: No changes + +**REMOVED/RENAMED**: + +- `aztec-sandbox` and `aztec sandbox`: now `aztec start --sandbox` +- `aztec-builder`: now `aztec codegen` and `aztec update` + +**ADDED**: + +- `aztec test [options]`: runs `aztec start --txe && aztec-nargo test --oracle-resolver http://aztec:8081 --silence-warnings [options]` via docker-compose allowing users to easily run contract tests using TXE + +## 0.45.0 + +### [Aztec.nr] Remove unencrypted logs from private + +They leak privacy so is a footgun! + +## 0.44.0 + +### [Aztec.nr] Autogenerate Serialize methods for events + +```diff +#[aztec(event)] +struct WithdrawalProcessed { + who: Field, + amount: Field, +} + +-impl Serialize<2> for WithdrawalProcessed { +- fn serialize(self: Self) -> [Field; 2] { +- [self.who.to_field(), self.amount as Field] +- } +} +``` + +### [Aztec.nr] rename `encode_and_encrypt_with_keys` to `encode_and_encrypt_note_with_keys` + +```diff +contract XYZ { +- use dep::aztec::encrypted_logs::encrypted_note_emission::encode_and_encrypt_with_keys; ++ use dep::aztec::encrypted_logs::encrypted_note_emission::encode_and_encrypt_note_with_keys; +.... + +- numbers.at(owner).initialize(&mut new_number).emit(encode_and_encrypt_with_keys(&mut context, owner_ovpk_m, owner_ivpk_m)); ++ numbers.at(owner).initialize(&mut new_number).emit(encode_and_encrypt_note_with_keys(&mut context, owner_ovpk_m, owner_ivpk_m)); +} +``` + +### [Aztec.nr] changes to `NoteInterface` + +`compute_nullifier` function was renamed to `compute_note_hash_and_nullifier` and now the function has to return not only the nullifier but also the note hash used to compute the nullifier. +The same change was done to `compute_nullifier_without_context` function. +These changes were done because having the note hash exposed allowed us to not having to re-compute it again in `destroy_note` function of Aztec.nr which led to significant decrease in gate counts (see the [optimization PR](https://github.com/AztecProtocol/aztec-packages/pull/7103) for more details). + +```diff +- impl NoteInterface for ValueNote { +- fn compute_nullifier(self, context: &mut PrivateContext) -> Field { +- let note_hash_for_nullify = compute_note_hash_for_consumption(self); +- let secret = context.request_nsk_app(self.npk_m_hash); +- poseidon2_hash([ +- note_hash_for_nullify, +- secret, +- GENERATOR_INDEX__NOTE_NULLIFIER as Field, +- ]) +- } +- +- fn compute_nullifier_without_context(self) -> Field { +- let note_hash_for_nullify = compute_note_hash_for_consumption(self); +- let secret = get_nsk_app(self.npk_m_hash); +- poseidon2_hash([ +- note_hash_for_nullify, +- secret, +- GENERATOR_INDEX__NOTE_NULLIFIER as Field, +- ]) +- } +- } ++ impl NoteInterface for ValueNote { ++ fn compute_note_hash_and_nullifier(self, context: &mut PrivateContext) -> (Field, Field) { ++ let note_hash_for_nullify = compute_note_hash_for_consumption(self); ++ let secret = context.request_nsk_app(self.npk_m_hash); ++ let nullifier = poseidon2_hash([ ++ note_hash_for_nullify, ++ secret, ++ GENERATOR_INDEX__NOTE_NULLIFIER as Field, ++ ]); ++ (note_hash_for_nullify, nullifier) ++ } ++ ++ fn compute_note_hash_and_nullifier_without_context(self) -> (Field, Field) { ++ let note_hash_for_nullify = compute_note_hash_for_consumption(self); ++ let secret = get_nsk_app(self.npk_m_hash); ++ let nullifier = poseidon2_hash([ ++ note_hash_for_nullify, ++ secret, ++ GENERATOR_INDEX__NOTE_NULLIFIER as Field, ++ ]); ++ (note_hash_for_nullify, nullifier) ++ } ++ } +``` + +### [Aztec.nr] `note_getter` returns `BoundedVec` + +The `get_notes` and `view_notes` function no longer return an array of options (i.e. `[Option, N_NOTES]`) but instead a `BoundedVec`. This better conveys the useful property the old array had of having all notes collapsed at the beginning of the array, which allows for powerful optimizations and gate count reduction when setting the `options.limit` value. + +A `BoundedVec` has a `max_len()`, which equals the number of elements it can hold, and a `len()`, which equals the number of elements it currently holds. Since `len()` is typically not knwon at compile time, iterating over a `BoundedVec` looks slightly different than iterating over an array of options: + +```diff +- let option_notes = get_notes(options); +- for i in 0..option_notes.len() { +- if option_notes[i].is_some() { +- let note = option_notes[i].unwrap_unchecked(); +- } +- } ++ let notes = get_notes(options); ++ for i in 0..notes.max_len() { ++ if i < notes.len() { ++ let note = notes.get_unchecked(i); ++ } ++ } +``` + +To further reduce gate count, you can iterate over `options.limit` instead of `max_len()`, since `options.limit` is guaranteed to be larger or equal to `len()`, and smaller or equal to `max_len()`: + +```diff +- for i in 0..notes.max_len() { ++ for i in 0..options.limit { +``` + +### [Aztec.nr] static private authwit + +The private authwit validation is now making a static call to the account contract instead of passing over control flow. This is to ensure that it cannot be used for re-entry. + +To make this change however, we cannot allow emitting a nullifier from the account contract, since that would break the static call. Instead, we will be changing the `spend_private_authwit` to a `verify_private_authwit` and in the `auth` library emit the nullifier. This means that the "calling" contract will now be emitting the nullifier, and not the account. For example, for a token contract, the nullifier is now emitted by the token contract. However, as this is done inside the `auth` library, the token contract doesn't need to change much. + +The biggest difference is related to "cancelling" an authwit. Since it is no longer in the account contract, you cannot just emit a nullifier from it anymore. Instead it must rely on the token contract providing functionality for cancelling. + +There are also a few general changes to how authwits are generated, namely to more easily support the data required for a validity lookup now. Previously we could lookup the `message_hash` directly at the account contract, now we instead need to use the `inner_hash` and the contract of the consumer to figure out if it have already been emitted. + +A minor extension have been made to the authwit creations to make it easier to sign a specific a hash with a specific caller, e.g., the `inner_hash` can be provided as `{consumer, inner_hash}` to the `createAuthWit` where it previously needed to do a couple of manual steps to compute the outer hash. The `computeOuterAuthWitHash` have been made internal and the `computeAuthWitMessageHash` can instead be used to compute the values similarly to other authwit computations. + +```diff +const innerHash = computeInnerAuthWitHash([Fr.ZERO, functionSelector.toField(), entrypointPackedArgs.hash]); +-const outerHash = computeOuterAuthWitHash( +- this.dappEntrypointAddress, +- new Fr(this.chainId), +- new Fr(this.version), +- innerHash, +-); ++const messageHash = computeAuthWitMessageHash( ++ { consumer: this.dappEntrypointAddress, innerHash }, ++ { chainId: new Fr(this.chainId), version: new Fr(this.version) }, ++); +``` + +If the wallet is used to compute the authwit, it will populate the chain id and version instead of requiring it to be provided by tha actor. + +```diff +const innerHash = computeInnerAuthWitHash([Fr.fromString('0xdead')]); +-const outerHash = computeOuterAuthWitHash(wallets[1].getAddress(), chainId, version, innerHash); +-const witness = await wallets[0].createAuthWit(outerHash); ++ const witness = await wallets[0].createAuthWit({ comsumer: accounts[1].address, inner_hash }); +``` + +## 0.43.0 + +### [Aztec.nr] break `token.transfer()` into `transfer` and `transferFrom` + +Earlier we had just one function - `transfer()` which used authwits to handle the case where a contract/user wants to transfer funds on behalf of another user. +To reduce circuit sizes and proof times, we are breaking up `transfer` and introducing a dedicated `transferFrom()` function like in the ERC20 standard. + +### [Aztec.nr] `options.limit` has to be constant + +The `limit` parameter in `NoteGetterOptions` and `NoteViewerOptions` is now required to be a compile-time constant. This allows performing loops over this value, which leads to reduced circuit gate counts when setting a `limit` value. + +### [Aztec.nr] canonical public authwit registry + +The public authwits are moved into a shared registry (auth registry) to make it easier for sequencers to approve for their non-revertible (setup phase) whitelist. Previously, it was possible to DOS a sequencer by having a very expensive authwit validation that fails at the end, now the whitelist simply need the registry. + +Notable, this means that consuming a public authwit will no longer emit a nullifier in the account contract but instead update STORAGE in the public domain. This means that there is a larger difference between private and public again. However, it also means that if contracts need to approve, and use the approval in the same tx, it is transient and don't need to go to DA (saving 96 bytes). + +For the typescript wallets this is handled so the APIs don't change, but account contracts should get rid of their current setup with `approved_actions`. + +```diff +- let actions = AccountActions::init(&mut context, ACCOUNT_ACTIONS_STORAGE_SLOT, is_valid_impl); ++ let actions = AccountActions::init(&mut context, is_valid_impl); +``` + +For contracts we have added a `set_authorized` function in the auth library that can be used to set values in the registry. + +```diff +- storage.approved_action.at(message_hash).write(true); ++ set_authorized(&mut context, message_hash, true); +``` + +### [Aztec.nr] emit encrypted logs + +Emitting or broadcasting encrypted notes are no longer done as part of the note creation, but must explicitly be either emitted or discarded instead. + +```diff ++ use dep::aztec::encrypted_logs::encrypted_note_emission::{encode_and_encrypt, encode_and_encrypt_with_keys}; + +- storage.balances.sub(from, amount); ++ storage.balances.sub(from, amount).emit(encode_and_encrypt_with_keys(&mut context, from, from)); ++ storage.balances.sub(from, amount).emit(encode_and_encrypt_with_keys(&mut context, from_ovpk, from_ivpk)); ++ storage.balances.sub(from, amount).discard(); +``` + +## 0.42.0 + +### [Aztec.nr] Unconstrained Context + +Top-level unconstrained execution is now marked by the new `UnconstrainedContext`, which provides access to the block number and contract address being used in the simulation. Any custom state variables that provided unconstrained functions should update their specialization parameter: + +```diff ++ use dep::aztec::context::UnconstrainedContext; + +- impl MyStateVariable<()> { ++ impl MyStateVariable { +``` + +### [Aztec.nr] Filtering is now constrained + +The `filter` argument of `NoteGetterOptions` (typically passed via the `with_filter()` function) is now applied in a constraining environment, meaning any assertions made during the filtering are guaranteed to hold. This mirrors the behavior of the `select()` function. + +### [Aztec.nr] Emitting encrypted notes and logs + +The `emit_encrypted_log` context function is now `encrypt_and_emit_log` or `encrypt_and_emit_note`. + +```diff +- context.emit_encrypted_log(log1); ++ context.encrypt_and_emit_log(log1); ++ context.encrypt_and_emit_note(note1); +``` + +Broadcasting a note will call `encrypt_and_emit_note` in the background. To broadcast a generic event, use `encrypt_and_emit_log` +with the same encryption parameters as notes require. Currently, only fields and arrays of fields are supported as events. + +By default, logs emitted via `encrypt_and_emit_log` will be siloed with a _masked_ contract address. To force the contract address to be revealed, so everyone can check it rather than just the log recipient, provide `randomness = 0`. + +## Public execution migrated to the Aztec Virtual Machine + +**What does this mean for me?** + +It should be mostly transparent, with a few caveats: + +- Not all Noir blackbox functions are supported by the AVM. Only `Sha256`, `PedersenHash`, `Poseidon2Permutation`, `Keccak256`, and `ToRadix` are supported. +- For public functions, `context.nullifier_exists(...)` will now also consider pending nullifiers. +- The following methods of `PublicContext` are not supported anymore: `fee_recipient`, `fee_per_da_gas`, `fee_per_l2_gas`, `call_public_function_no_args`, `static_call_public_function_no_args`, `delegate_call_public_function_no_args`, `call_public_function_with_packed_args`, `set_return_hash`, `finish`. However, in terms of functionality, the new context's interface should be equivalent (unless otherwise specified in this list). +- Delegate calls are not yet supported in the AVM. +- If you have types with custom serialization that you use across external contracts calls, you might need to modify its serialization to match how Noir would serialize it. This is a known problem unrelated to the AVM, but triggered more often when using it. +- A few error messages might change format, so you might need to change your test assertions. + +**Internal details** + +Before this change, public bytecode was executed using the same simulator as in private: the ACIR simulator (and internally, the Brillig VM). On the Aztec.nr side, public functions accessed the context through `PublicContext`. + +After this change, public bytecode will be run using the AVM simulator (the simulator for our upcoming zkVM). This bytecode is generated from Noir contracts in two steps: First, `nargo compile` produces an artifact which has Brillig bytecode for public functions, just as it did before. Second: the `avm-transpiler` takes that artifact, and it transpiles Brillig bytecode to AVM bytecode. This final artifact can now be deployed and used with the new public runtime. + +On the Aztec.nr side, public functions keep accessing the context using `PublicContext` but the underlying implementation is switch with what formerly was the `AvmContext`. + +## 0.41.0 + +### [Aztec.nr] State variable rework + +Aztec.nr state variables have been reworked so that calling private functions in public and vice versa is detected as an error during compilation instead of at runtime. This affects users in a number of ways: + +#### New compile time errors + +It used to be that calling a state variable method only available in public from a private function resulted in obscure runtime errors in the form of a failed `_is_some` assertion. + +Incorrect usage of the state variable methods now results in compile time errors. For example, given the following function: + +```rust +#[aztec(public)] +fn get_decimals() -> pub u8 { + storage.decimals.read_private() +} +``` + +The compiler will now error out with + +``` +Expected type SharedImmutable<_, &mut PrivateContext>, found type SharedImmutable +``` + +The key component is the second generic parameter: the compiler expects a `PrivateContext` (becuse `read_private` is only available during private execution), but a `PublicContext` is being used instead (because of the `#[aztec(public)]` attribute). + +#### Generic parameters in `Storage` + +The `Storage` struct (the one marked with `#[aztec(storage)]`) should now be generic over a `Context` type, which matches the new generic parameter of all Aztec.nr libraries. This parameter is always the last generic parameter. + +This means that, without any additional features, we'd end up with some extra boilerplate when declaring this struct: + +```diff +#[aztec(storage)] +- struct Storage { ++ struct Storage { +- nonce_for_burn_approval: PublicMutable, ++ nonce_for_burn_approval: PublicMutable, +- portal_address: SharedImmutable, ++ portal_address: SharedImmutable, +- approved_action: Map>, ++ approved_action: Map, Context>, +} +``` + +Because of this, the `#[aztec(storage)]` macro has been updated to **automatically inject** this `Context` generic parameter. The storage declaration does not require any changes. + +#### Removal of `Context` + +The `Context` type no longer exists. End users typically didn't use it, but if imported it needs to be deleted. + +### [Aztec.nr] View functions and interface navigation + +It is now possible to explicitly state a function doesn't perform any state alterations (including storage, logs, nullifiers and/or messages from L2 to L1) with the `#[aztec(view)]` attribute, similarly to solidity's `view` function modifier. + +```diff + #[aztec(public)] ++ #[aztec(view)] + fn get_price(asset_id: Field) -> Asset { + storage.assets.at(asset_id).read() + } +``` + +View functions only generate a `StaticCallInterface` that doesn't include `.call` or `.enqueue` methods. Also, the denomination `static` has been completely removed from the interfaces, in favor of the more familiar `view` + +```diff +- let price = PriceFeed::at(asset.oracle).get_price(0).static_call(&mut context).price; ++ let price = PriceFeed::at(asset.oracle).get_price(0).view(&mut context).price; +``` + +```diff +#[aztec(private)] +fn enqueue_public_get_value_from_child(target_contract: AztecAddress, value: Field) { +- StaticChild::at(target_contract).pub_get_value(value).static_enqueue(&mut context); ++ StaticChild::at(target_contract).pub_get_value(value).enqueue_view(&mut context); +} +``` + +Additionally, the Noir LSP will now honor "go to definitions" requests for contract interfaces (Ctrl+click), taking the user to the original function implementation. + +### [Aztec.js] Simulate changes + +- `.simulate()` now tracks closer the process performed by `.send().wait()`, specifically going through the account contract entrypoint instead of directly calling the intended function. +- `wallet.viewTx(...)` has been renamed to `wallet.simulateUnconstrained(...)` to better clarify what it does. + +### [Aztec.nr] Keys: Token note now stores an owner master nullifying public key hash instead of an owner address + +i.e. + +```diff +struct TokenNote { + amount: U128, +- owner: AztecAddress, ++ npk_m_hash: Field, + randomness: Field, +} +``` + +Creating a token note and adding it to storage now looks like this: + +```diff +- let mut note = ValueNote::new(new_value, owner); +- storage.a_private_value.insert(&mut note, true); ++ let owner_npk_m_hash = get_npk_m_hash(&mut context, owner); ++ let owner_ivpk_m = get_ivpk_m(&mut context, owner); ++ let mut note = ValueNote::new(new_value, owner_npk_m_hash); ++ storage.a_private_value.insert(&mut note, true, owner_ivpk_m); +``` + +Computing the nullifier similarly changes to use this master nullifying public key hash. + +## 0.40.0 + +### [Aztec.nr] Debug logging + +The function `debug_log_array_with_prefix` has been removed. Use `debug_log_format` with `{}` instead. The special sequence `{}` will be replaced with the whole array. You can also use `{0}`, `{1}`, ... as usual with `debug_log_format`. + +```diff +- debug_log_array_with_prefix("Prefix", my_array); ++ debug_log_format("Prefix {}", my_array); +``` + +## 0.39.0 + +### [Aztec.nr] Mutable delays in `SharedMutable` + +The type signature for `SharedMutable` changed from `SharedMutable` to `SharedMutable`. The behavior is the same as before, except the delay can now be changed after deployment by calling `schedule_delay_change`. + +### [Aztec.nr] get_public_key oracle replaced with get_ivpk_m + +When implementing changes according to a new key scheme we had to change oracles. +What used to be called encryption public key is now master incoming viewing public key. + +```diff +- use dep::aztec::oracles::get_public_key::get_public_key; ++ use dep::aztec::keys::getters::get_ivpk_m; + +- let encryption_pub_key = get_public_key(self.owner); ++ let ivpk_m = get_ivpk_m(context, self.owner); +``` + +## 0.38.0 + +### [Aztec.nr] Emitting encrypted logs + +The `emit_encrypted_log` function is now a context method. + +```diff +- use dep::aztec::log::emit_encrypted_log; +- use dep::aztec::logs::emit_encrypted_log; + +- emit_encrypted_log(context, log1); ++ context.emit_encrypted_log(log1); +``` + +## 0.36.0 + +### `FieldNote` removed + +`FieldNote` only existed for testing purposes, and was not a note type that should be used in any real application. Its name unfortunately led users to think that it was a note type suitable to store a `Field` value, which it wasn't. + +If using `FieldNote`, you most likely want to use `ValueNote` instead, which has both randomness for privacy and an owner for proper nullification. + +### `SlowUpdatesTree` replaced for `SharedMutable` + +The old `SlowUpdatesTree` contract and libraries have been removed from the codebase, use the new `SharedMutable` library instead. This will require that you add a global variable specifying a delay in blocks for updates, and replace the slow updates tree state variable with `SharedMutable` variables. + +```diff ++ global CHANGE_ROLES_DELAY_BLOCKS = 5; + +struct Storage { +- slow_update: SharedImmutable, ++ roles: Map>, +} +``` + +Reading from `SharedMutable` is much simpler, all that's required is to call `get_current_value_in_public` or `get_current_value_in_private`, depending on the domain. + +```diff +- let caller_roles = UserFlags::new(U128::from_integer(slow.read_at_pub(context.msg_sender().to_field()).call(&mut context))); ++ let caller_roles = storage.roles.at(context.msg_sender()).get_current_value_in_public(); +``` + +Finally, you can remove all capsule usage on the client code or tests, since those are no longer required when working with `SharedMutable`. + +### [Aztec.nr & js] Portal addresses + +Deployments have been modified. No longer are portal addresses treated as a special class, being immutably set on creation of a contract. They are no longer passed in differently compared to the other variables and instead should be implemented using usual storage by those who require it. One should use the storage that matches the usecase - likely shared storage to support private and public. + +This means that you will likely add the portal as a constructor argument + +```diff +- fn constructor(token: AztecAddress) { +- storage.token.write(token); +- } ++ struct Storage { + ... ++ portal_address: SharedImmutable, ++ } ++ fn constructor(token: AztecAddress, portal_address: EthAddress) { ++ storage.token.write(token); ++ storage.portal_address.initialize(portal_address); ++ } +``` + +And read it from storage whenever needed instead of from the context. + +```diff +- context.this_portal_address(), ++ storage.portal_address.read_public(), +``` + +### [Aztec.nr] Oracles + +Oracle `get_nullifier_secret_key` was renamed to `get_app_nullifier_secret_key` and `request_nullifier_secret_key` function on PrivateContext was renamed as `request_app_nullifier_secret_key`. + +```diff +- let secret = get_nullifier_secret_key(self.owner); ++ let secret = get_app_nullifier_secret_key(self.owner); +``` + +```diff +- let secret = context.request_nullifier_secret_key(self.owner); ++ let secret = context.request_app_nullifier_secret_key(self.owner); +``` + +### [Aztec.nr] Contract interfaces + +It is now possible to import contracts on another contracts and use their automatic interfaces to perform calls. The interfaces have the same name as the contract, and are automatically exported. Parameters are automatically serialized (using the `Serialize` trait) and return values are automatically deserialized (using the `Deserialize` trait). Serialize and Deserialize methods have to conform to the standard ACVM serialization schema for the interface to work! + +1. Only fixed length types are supported +2. All numeric types become Fields +3. Strings become arrays of Fields, one per char +4. Arrays become arrays of Fields following rules 2 and 3 +5. Structs become arrays of Fields, with every item defined in the same order as they are in Noir code, following rules 2, 3, 4 and 5 (recursive) + +```diff +- context.call_public_function( +- storage.gas_token_address.read_private(), +- FunctionSelector::from_signature("pay_fee(Field)"), +- [42] +- ); +- +- context.call_public_function( +- storage.gas_token_address.read_private(), +- FunctionSelector::from_signature("pay_fee(Field)"), +- [42] +- ); +- +- let _ = context.call_private_function( +- storage.subscription_token_address.read_private(), +- FunctionSelector::from_signature("transfer((Field),(Field),Field,Field)"), +- [ +- context.msg_sender().to_field(), +- storage.subscription_recipient_address.read_private().to_field(), +- storage.subscription_price.read_private(), +- nonce +- ] +- ); ++ use dep::gas_token::GasToken; ++ use dep::token::Token; ++ ++ ... ++ // Public call from public land ++ GasToken::at(storage.gas_token_address.read_private()).pay_fee(42).call(&mut context); ++ // Public call from private land ++ GasToken::at(storage.gas_token_address.read_private()).pay_fee(42).enqueue(&mut context); ++ // Private call from private land ++ Token::at(asset).transfer(context.msg_sender(), storage.subscription_recipient_address.read_private(), amount, nonce).call(&mut context); +``` + +It is also possible to use these automatic interfaces from the local contract, and thus enqueue public calls from private without having to rely on low level `context` calls. + +### [Aztec.nr] Rename max block number setter + +The `request_max_block_number` function has been renamed to `set_tx_max_block_number` to better reflect that it is not a getter, and that the setting is transaction-wide. + +```diff +- context.request_max_block_number(value); ++ context.set_tx_max_block_number(value); +``` + +### [Aztec.nr] Get portal address + +The `get_portal_address` oracle was removed. If you need to get the portal address of SomeContract, add the following methods to it + +``` +#[aztec(private)] +fn get_portal_address() -> EthAddress { + context.this_portal_address() +} + +#[aztec(public)] +fn get_portal_address_public() -> EthAddress { + context.this_portal_address() +} +``` + +and change the call to `get_portal_address` + +```diff +- let portal_address = get_portal_address(contract_address); ++ let portal_address = SomeContract::at(contract_address).get_portal_address().call(&mut context); +``` + +### [Aztec.nr] Required gas limits for public-to-public calls + +When calling a public function from another public function using the `call_public_function` method, you must now specify how much gas you're allocating to the nested call. This will later allow you to limit the amount of gas consumed by the nested call, and handle any out of gas errors. + +Note that gas limits are not yet enforced. For now, it is suggested you use `dep::aztec::context::gas::GasOpts::default()` which will forward all available gas. + +```diff ++ use dep::aztec::context::gas::GasOpts; + +- context.call_public_function(target_contract, target_selector, args); ++ context.call_public_function(target_contract, target_selector, args, GasOpts::default()); +``` + +Note that this is not required when enqueuing a public function from a private one, since top-level enqueued public functions will always consume all gas available for the transaction, as it is not possible to handle any out-of-gas errors. + +### [Aztec.nr] Emitting unencrypted logs + +The `emit_unencrypted_logs` function is now a context method. + +```diff +- use dep::aztec::log::emit_unencrypted_log; +- use dep::aztec::log::emit_unencrypted_log_from_private; + +- emit_unencrypted_log(context, log1); +- emit_unencrypted_log_from_private(context, log2); ++ context.emit_unencrypted_log(log1); ++ context.emit_unencrypted_log(log2); +``` + +## 0.33 + +### [Aztec.nr] Storage struct annotation + +The storage struct now identified by the annotation `#[aztec(storage)]`, instead of having to rely on it being called `Storage`. + +```diff +- struct Storage { +- ... +- } ++ #[aztec(storage)] ++ struct MyStorageStruct { ++ ... ++ } +``` + +### [Aztec.js] Storage layout and note info + +Storage layout and note information are now exposed in the TS contract artifact + +```diff +- const note = new Note([new Fr(mintAmount), secretHash]); +- const pendingShieldStorageSlot = new Fr(5n); // storage slot for pending_shields +- const noteTypeId = new Fr(84114971101151129711410111011678111116101n); // note type id for TransparentNote +- const extendedNote = new ExtendedNote( +- note, +- admin.address, +- token.address, +- pendingShieldStorageSlot, +- noteTypeId, +- receipt.txHash, +- ); +- await pxe.addNote(extendedNote); ++ const note = new Note([new Fr(mintAmount), secretHash]); ++ const extendedNote = new ExtendedNote( ++ note, ++ admin.address, ++ token.address, ++ TokenContract.storage.pending_shields.slot, ++ TokenContract.notes.TransparentNote.id, ++ receipt.txHash, ++ ); ++ await pxe.addNote(extendedNote); +``` + +### [Aztec.nr] rand oracle is now called unsafe_rand + +`oracle::rand::rand` has been renamed to `oracle::unsafe_rand::unsafe_rand`. +This change was made to communicate that we do not constrain the value in circuit and instead we just trust our PXE. + +```diff +- let random_value = rand(); ++ let random_value = unsafe_rand(); +``` + +### [AztecJS] Simulate and get return values for ANY call and introducing `prove()` + +Historically it have been possible to "view" `unconstrained` functions to simulate them and get the return values, but not for `public` nor `private` functions. +This has lead to a lot of bad code where we have the same function implemented thrice, once in `private`, once in `public` and once in `unconstrained`. +It is not possible to call `simulate` on any call to get the return values! +However, beware that it currently always returns a Field array of size 4 for private and public. +This will change to become similar to the return values of the `unconstrained` functions with proper return types. + +```diff +- #[aztec(private)] +- fn get_shared_immutable_constrained_private() -> pub Leader { +- storage.shared_immutable.read_private() +- } +- +- unconstrained fn get_shared_immutable() -> pub Leader { +- storage.shared_immutable.read_public() +- } + ++ #[aztec(private)] ++ fn get_shared_immutable_private() -> pub Leader { ++ storage.shared_immutable.read_private() ++ } + +- const returnValues = await contract.methods.get_shared_immutable().view(); ++ const returnValues = await contract.methods.get_shared_immutable_private().simulate(); +``` + +```diff +await expect( +- asset.withWallet(wallets[1]).methods.update_admin(newAdminAddress).simulate()).rejects.toThrow( ++ asset.withWallet(wallets[1]).methods.update_admin(newAdminAddress).prove()).rejects.toThrow( + "Assertion failed: caller is not admin 'caller_roles.is_admin'", +); +``` + +## 0.31.0 + +### [Aztec.nr] Public storage historical read API improvement + +`history::public_value_inclusion::prove_public_value_inclusion` has been renamed to `history::public_storage::public_storage_historical_read`, and its API changed slightly. Instead of receiving a `value` parameter it now returns the historical value stored at that slot. + +If you were using an oracle to get the value to pass to `prove_public_value_inclusion`, drop the oracle and use the return value from `public_storage_historical_read` instead: + +```diff +- let value = read_storage(); +- prove_public_value_inclusion(value, storage_slot, contract_address, context); ++ let value = public_storage_historical_read(storage_slot, contract_address, context); +``` + +If you were proving historical existence of a value you got via some other constrained means, perform an assertion against the return value of `public_storage_historical_read` instead: + +```diff +- prove_public_value_inclusion(value, storage_slot, contract_address, context); ++ assert(public_storage_historical_read(storage_slot, contract_address, context) == value); +``` + +## 0.30.0 + +### [AztecJS] Simplify authwit syntax + +```diff +- const messageHash = computeAuthWitMessageHash(accounts[1].address, action.request()); +- await wallets[0].setPublicAuth(messageHash, true).send().wait(); ++ await wallets[0].setPublicAuthWit({ caller: accounts[1].address, action }, true).send().wait(); +``` + +```diff +const action = asset + .withWallet(wallets[1]) + .methods.unshield(accounts[0].address, accounts[1].address, amount, nonce); +-const messageHash = computeAuthWitMessageHash(accounts[1].address, action.request()); +-const witness = await wallets[0].createAuthWitness(messageHash); ++const witness = await wallets[0].createAuthWit({ caller: accounts[1].address, action }); +await wallets[1].addAuthWitness(witness); +``` + +Also note some of the naming changes: +`setPublicAuth` -> `setPublicAuthWit` +`createAuthWitness` -> `createAuthWit` + +### [Aztec.nr] Automatic NoteInterface implementation and selector changes + +Implementing a note required a fair amount of boilerplate code, which has been substituted by the `#[aztec(note)]` attribute. + +```diff ++ #[aztec(note)] +struct AddressNote { + address: AztecAddress, + owner: AztecAddress, + randomness: Field, + header: NoteHeader +} + +impl NoteInterface for AddressNote { +- fn serialize_content(self) -> [Field; ADDRESS_NOTE_LEN]{ +- [self.address.to_field(), self.owner.to_field(), self.randomness] +- } +- +- fn deserialize_content(serialized_note: [Field; ADDRESS_NOTE_LEN]) -> Self { +- AddressNote { +- address: AztecAddress::from_field(serialized_note[0]), +- owner: AztecAddress::from_field(serialized_note[1]), +- randomness: serialized_note[2], +- header: NoteHeader::empty(), +- } +- } +- +- fn compute_note_content_hash(self) -> Field { +- pedersen_hash(self.serialize_content(), 0) +- } +- + fn compute_nullifier(self, context: &mut PrivateContext) -> Field { + let note_hash_for_nullify = compute_note_hash_for_consumption(self); + let secret = context.request_nullifier_secret_key(self.owner); + pedersen_hash([ + note_hash_for_nullify, + secret.low, + secret.high, + ],0) + } + + fn compute_nullifier_without_context(self) -> Field { + let note_hash_for_nullify = compute_note_hash_for_consumption(self); + let secret = get_nullifier_secret_key(self.owner); + pedersen_hash([ + note_hash_for_nullify, + secret.low, + secret.high, + ],0) + } + +- fn set_header(&mut self, header: NoteHeader) { +- self.header = header; +- } +- +- fn get_header(note: Self) -> NoteHeader { +- note.header +- } + + fn broadcast(self, context: &mut PrivateContext, slot: Field) { + let encryption_pub_key = get_public_key(self.owner); + emit_encrypted_log( + context, + (*context).this_address(), + slot, + Self::get_note_type_id(), + encryption_pub_key, + self.serialize_content(), + ); + } + +- fn get_note_type_id() -> Field { +- 6510010011410111511578111116101 +- } +} +``` + +Automatic note (de)serialization implementation also means it is now easier to filter notes using `NoteGetterOptions.select` via the `::properties()` helper: + +Before: + +```rust +let options = NoteGetterOptions::new().select(0, amount, Option::none()).select(1, owner.to_field(), Option::none()).set_limit(1); +``` + +After: + +```rust +let options = NoteGetterOptions::new().select(ValueNote::properties().value, amount, Option::none()).select(ValueNote::properties().owner, owner.to_field(), Option::none()).set_limit(1); +``` + +The helper returns a metadata struct that looks like this (if autogenerated) + +```rust +ValueNoteProperties { + value: PropertySelector { index: 0, offset: 0, length: 32 }, + owner: PropertySelector { index: 1, offset: 0, length: 32 }, + randomness: PropertySelector { index: 2, offset: 0, length: 32 }, +} +``` + +It can also be used for the `.sort` method. + +## 0.27.0 + +### `initializer` macro replaces `constructor` + +Before this version, every contract was required to have exactly one `constructor` private function, that was used for deployment. We have now removed this requirement, and made `constructor` a function like any other. + +To signal that a function can be used to **initialize** a contract, you must now decorate it with the `#[aztec(initializer)]` attribute. Initializers are regular functions that set an "initialized" flag (a nullifier) for the contract. A contract can only be initialized once, and contract functions can only be called after the contract has been initialized, much like a constructor. However, if a contract defines no initializers, it can be called at any time. Additionally, you can define as many initializer functions in a contract as you want, both private and public. + +To migrate from current code, simply add an initializer attribute to your constructor functions. + +```diff ++ #[aztec(initializer)] +#[aztec(private)] +fn constructor() { ... } +``` + +If your private constructor was used to just call a public internal initializer, then remove the private constructor and flag the public function as initializer. And if your private constructor was an empty one, just remove it. + +## 0.25.0 + +### [Aztec.nr] Static calls + +It is now possible to perform static calls from both public and private functions. Static calls forbid any modification to the state, including L2->L1 messages or log generation. Once a static context is set through a static all, every subsequent call will also be treated as static via context propagation. + +```rust +context.static_call_private_function(targetContractAddress, targetSelector, args); + +context.static_call_public_function(targetContractAddress, targetSelector, args); +``` + +### [Aztec.nr] Introduction to `prelude` + +A new `prelude` module to include common Aztec modules and types. +This simplifies dependency syntax. For example: + +```rust +use dep::aztec::protocol_types::address::AztecAddress; +use dep::aztec::{ + context::{PrivateContext, Context}, note::{note_header::NoteHeader, utils as note_utils}, + state_vars::Map +}; +``` + +Becomes: + +```rust +use dep::aztec::prelude::{AztecAddress, NoteHeader, PrivateContext, Map}; +use dep::aztec::context::Context; +use dep::aztec::notes::utils as note_utils; +``` + +This will be further simplified in future versions (See [4496](https://github.com/AztecProtocol/aztec-packages/pull/4496) for further details). + +The prelude consists of + +\[Edit: removed because the prelude no-longer exists\] + +### `internal` is now a macro + +The `internal` keyword is now removed from Noir, and is replaced by an `aztec(internal)` attribute in the function. The resulting behavior is exactly the same: these functions will only be callable from within the same contract. + +Before: + +```rust +#[aztec(private)] +internal fn double(input: Field) -> Field { + input * 2 +} +``` + +After: + +```rust +#[aztec(private)] +#[aztec(internal)] +fn double(input: Field) -> Field { + input * 2 +} +``` + +### [Aztec.nr] No SafeU120 anymore! + +Noir now have overflow checks by default. So we don't need SafeU120 like libraries anymore. + +You can replace it with `U128` instead + +Before: + +``` +SafeU120::new(0) +``` + +Now: + +``` +U128::from_integer(0) +``` + +### [Aztec.nr] `compute_note_hash_and_nullifier` is now autogenerated + +Historically developers have been required to include a `compute_note_hash_and_nullifier` function in each of their contracts. This function is now automatically generated, and all instances of it in contract code can be safely removed. + +It is possible to provide a user-defined implementation, in which case auto-generation will be skipped (though there are no known use cases for this). + +### [Aztec.nr] Updated naming of state variable wrappers + +We have decided to change the naming of our state variable wrappers because the naming was not clear. +The changes are as follows: + +1. `Singleton` -> `PrivateMutable` +2. `ImmutableSingleton` -> `PrivateImmutable` +3. `StablePublicState` -> `SharedImmutable` +4. `PublicState` -> `PublicMutable` + +This is the meaning of "private", "public" and "shared": +Private: read (R) and write (W) from private, not accessible from public +Public: not accessible from private, R/W from public +Shared: R from private, R/W from public + +Note: `SlowUpdates` will be renamed to `SharedMutable` once the implementation is ready. + +### [Aztec.nr] Authwit updates + +Authentication Witnesses have been updates such that they are now cancellable and scoped to a specific consumer. +This means that the `authwit` nullifier must be emitted from the account contract, which require changes to the interface. +Namely, the `assert_current_call_valid_authwit_public` and `assert_current_call_valid_authwit` in `auth.nr` will **NO LONGER** emit a nullifier. +Instead it will call a `spend_*_authwit` function in the account contract - which will emit the nullifier and perform a few checks. +This means that the `is_valid` functions have been removed to not confuse it for a non-mutating function (static). +Furthermore, the `caller` parameter of the "authwits" have been moved "further out" such that the account contract can use it in validation, allowing scoped approvals from the account POV. +For most contracts, this won't be changing much, but for the account contract, it will require a few changes. + +Before: + +```rust +#[aztec(public)] +fn is_valid_public(message_hash: Field) -> Field { + let actions = AccountActions::public(&mut context, ACCOUNT_ACTIONS_STORAGE_SLOT, is_valid_impl); + actions.is_valid_public(message_hash) +} + +#[aztec(private)] +fn is_valid(message_hash: Field) -> Field { + let actions = AccountActions::private(&mut context, ACCOUNT_ACTIONS_STORAGE_SLOT, is_valid_impl); + actions.is_valid(message_hash) +} +``` + +After: + +```rust +#[aztec(private)] +fn verify_private_authwit(inner_hash: Field) -> Field { + let actions = AccountActions::private(&mut context, ACCOUNT_ACTIONS_STORAGE_SLOT, is_valid_impl); + actions.verify_private_authwit(inner_hash) +} + +#[aztec(public)] +fn spend_public_authwit(inner_hash: Field) -> Field { + let actions = AccountActions::public(&mut context, ACCOUNT_ACTIONS_STORAGE_SLOT, is_valid_impl); + actions.spend_public_authwit(inner_hash) +} +``` + +## 0.24.0 + +### Introduce Note Type IDs + +Note Type IDs are a new feature which enable contracts to have multiple `Map`s with different underlying note types, something that was not possible before. This is done almost without any user intervention, though some minor changes are required. + +The mandatory `compute_note_hash_and_nullifier` now has a fifth parameter `note_type_id`. Use this instead of `storage_slot` to determine which deserialization function to use. + +Before: + +```rust +unconstrained fn compute_note_hash_and_nullifier( + contract_address: AztecAddress, + nonce: Field, + storage_slot: Field, + preimage: [Field; TOKEN_NOTE_LEN] +) -> pub [Field; 4] { + let note_header = NoteHeader::new(contract_address, nonce, storage_slot); + + if (storage_slot == storage.pending_shields.get_storage_slot()) { + note_utils::compute_note_hash_and_nullifier(TransparentNote::deserialize_content, note_header, preimage) + } else if (note_type_id == storage.slow_update.get_storage_slot()) { + note_utils::compute_note_hash_and_nullifier(FieldNote::deserialize_content, note_header, preimage) + } else { + note_utils::compute_note_hash_and_nullifier(TokenNote::deserialize_content, note_header, preimage) + } +``` + +Now: + +```rust +unconstrained fn compute_note_hash_and_nullifier( + contract_address: AztecAddress, + nonce: Field, + storage_slot: Field, + note_type_id: Field, + preimage: [Field; TOKEN_NOTE_LEN] +) -> pub [Field; 4] { + let note_header = NoteHeader::new(contract_address, nonce, storage_slot); + + if (note_type_id == TransparentNote::get_note_type_id()) { + note_utils::compute_note_hash_and_nullifier(TransparentNote::deserialize_content, note_header, preimage) + } else if (note_type_id == FieldNote::get_note_type_id()) { + note_utils::compute_note_hash_and_nullifier(FieldNote::deserialize_content, note_header, preimage) + } else { + note_utils::compute_note_hash_and_nullifier(TokenNote::deserialize_content, note_header, preimage) + } +``` + +The `NoteInterface` trait now has an additional `get_note_type_id()` function. This implementation will be autogenerated in the future, but for now providing any unique ID will suffice. The suggested way to do it is by running the Python command shown in the comment below: + +```rust +impl NoteInterface for MyCustomNote { + fn get_note_type_id() -> Field { + // python -c "print(int(''.join(str(ord(c)) for c in 'MyCustomNote')))" + 771216711711511611110978111116101 + } +} +``` + +### [js] Importing contracts in JS + +`@aztec/noir-contracts` is now `@aztec/noir-contracts.js`. You'll need to update your package.json & imports. + +Before: + +```js +import { TokenContract } from "@aztec/noir-contracts/Token"; +``` + +Now: + +```js +import { TokenContract } from "@aztec/noir-contracts.js/Token"; +``` + +### [Aztec.nr] Aztec.nr contracts location change in Nargo.toml + +Aztec contracts are now moved outside of the `yarn-project` folder and into `noir-projects`, so you need to update your imports. + +Before: + +```rust +easy_private_token_contract = {git = "https://github.com/AztecProtocol/aztec-packages/", tag ="v0.23.0", directory = "yarn-project/noir-contracts/contracts/easy_private_token_contract"} +``` + +Now, update the `yarn-project` folder for `noir-projects`: + +```rust +easy_private_token_contract = {git = "https://github.com/AztecProtocol/aztec-packages/", tag ="v0.24.0", directory = "noir-projects/noir-contracts/contracts/easy_private_token_contract"} +``` + +## 0.22.0 + +### `Note::compute_note_hash` renamed to `Note::compute_note_content_hash` + +The `compute_note_hash` function in of the `Note` trait has been renamed to `compute_note_content_hash` to avoid being confused with the actual note hash. + +Before: + +```rust +impl NoteInterface for CardNote { + fn compute_note_hash(self) -> Field { + pedersen_hash([ + self.owner.to_field(), + ], 0) + } +``` + +Now: + +```rust +impl NoteInterface for CardNote { + fn compute_note_content_hash(self) -> Field { + pedersen_hash([ + self.owner.to_field(), + ], 0) + } +``` + +### Introduce `compute_note_hash_for_consumption` and `compute_note_hash_for_insertion` + +Makes a split in logic for note hash computation for consumption and insertion. This is to avoid confusion between the two, and to make it clear that the note hash for consumption is different from the note hash for insertion (sometimes). + +`compute_note_hash_for_consumption` replaces `compute_note_hash_for_read_or_nullify`. +`compute_note_hash_for_insertion` is new, and mainly used in `lifecycle.nr`` + +### `Note::serialize_content` and `Note::deserialize_content` added to `NoteInterface + +The `NoteInterface` have been extended to include `serialize_content` and `deserialize_content` functions. This is to convey the difference between serializing the full note, and just the content. This change allows you to also add a `serialize` function to support passing in a complete note to a function. + +Before: + +```rust +impl Serialize for AddressNote { + fn serialize(self) -> [Field; ADDRESS_NOTE_LEN]{ + [self.address.to_field(), self.owner.to_field(), self.randomness] + } +} +impl Deserialize for AddressNote { + fn deserialize(serialized_note: [Field; ADDRESS_NOTE_LEN]) -> Self { + AddressNote { + address: AztecAddress::from_field(serialized_note[0]), + owner: AztecAddress::from_field(serialized_note[1]), + randomness: serialized_note[2], + header: NoteHeader::empty(), + } + } +``` + +Now + +```rust +impl NoteInterface for AddressNote { + fn serialize_content(self) -> [Field; ADDRESS_NOTE_LEN]{ + [self.address.to_field(), self.owner.to_field(), self.randomness] + } + + fn deserialize_content(serialized_note: [Field; ADDRESS_NOTE_LEN]) -> Self { + AddressNote { + address: AztecAddress::from_field(serialized_note[0]), + owner: AztecAddress::from_field(serialized_note[1]), + randomness: serialized_note[2], + header: NoteHeader::empty(), + } + } + ... +} +``` + +### [Aztec.nr] No storage.init() and `Serialize`, `Deserialize`, `NoteInterface` as Traits, removal of SerializationMethods and SERIALIZED_LEN + +Storage definition and initialization has been simplified. Previously: + +```rust +struct Storage { + leader: PublicState, + legendary_card: Singleton, + profiles: Map>, + test: Set, + imm_singleton: PrivateImmutable, +} + +impl Storage { + fn init(context: Context) -> Self { + Storage { + leader: PublicMutable::new( + context, + 1, + LeaderSerializationMethods, + ), + legendary_card: PrivateMutable::new(context, 2, CardNoteMethods), + profiles: Map::new( + context, + 3, + |context, slot| { + PrivateMutable::new(context, slot, CardNoteMethods) + }, + ), + test: Set::new(context, 4, CardNoteMethods), + imm_singleton: PrivateImmutable::new(context, 4, CardNoteMethods), + } + } + } +``` + +Now: + +```rust +struct Storage { + leader: PublicMutable, + legendary_card: Singleton, + profiles: Map>, + test: Set, + imm_singleton: PrivateImmutable, +} +``` + +For this to work, Notes must implement Serialize, Deserialize and NoteInterface Traits. Previously: + +```rust +use dep::aztec::protocol_types::address::AztecAddress; +use dep::aztec::{ + note::{ + note_header::NoteHeader, + note_interface::NoteInterface, + utils::compute_note_hash_for_read_or_nullify, + }, + oracle::{ + nullifier_key::get_nullifier_secret_key, + get_public_key::get_public_key, + }, + log::emit_encrypted_log, + hash::pedersen_hash, + context::PrivateContext, +}; + +// Shows how to create a custom note + +global CARD_NOTE_LEN: Field = 1; + +impl CardNote { + pub fn new(owner: AztecAddress) -> Self { + CardNote { + owner, + } + } + + pub fn serialize(self) -> [Field; CARD_NOTE_LEN] { + [self.owner.to_field()] + } + + pub fn deserialize(serialized_note: [Field; CARD_NOTE_LEN]) -> Self { + CardNote { + owner: AztecAddress::from_field(serialized_note[1]), + } + } + + pub fn compute_note_hash(self) -> Field { + pedersen_hash([ + self.owner.to_field(), + ],0) + } + + pub fn compute_nullifier(self, context: &mut PrivateContext) -> Field { + let note_hash_for_nullify = compute_note_hash_for_read_or_nullify(CardNoteMethods, self); + let secret = context.request_nullifier_secret_key(self.owner); + pedersen_hash([ + note_hash_for_nullify, + secret.high, + secret.low, + ],0) + } + + pub fn compute_nullifier_without_context(self) -> Field { + let note_hash_for_nullify = compute_note_hash_for_read_or_nullify(CardNoteMethods, self); + let secret = get_nullifier_secret_key(self.owner); + pedersen_hash([ + note_hash_for_nullify, + secret.high, + secret.low, + ],0) + } + + pub fn set_header(&mut self, header: NoteHeader) { + self.header = header; + } + + // Broadcasts the note as an encrypted log on L1. + pub fn broadcast(self, context: &mut PrivateContext, slot: Field) { + let encryption_pub_key = get_public_key(self.owner); + emit_encrypted_log( + context, + (*context).this_address(), + slot, + encryption_pub_key, + self.serialize(), + ); + } +} + +fn deserialize(serialized_note: [Field; CARD_NOTE_LEN]) -> CardNote { + CardNote::deserialize(serialized_note) +} + +fn serialize(note: CardNote) -> [Field; CARD_NOTE_LEN] { + note.serialize() +} + +fn compute_note_hash(note: CardNote) -> Field { + note.compute_note_hash() +} + +fn compute_nullifier(note: CardNote, context: &mut PrivateContext) -> Field { + note.compute_nullifier(context) +} + +fn compute_nullifier_without_context(note: CardNote) -> Field { + note.compute_nullifier_without_context() +} + +fn get_header(note: CardNote) -> NoteHeader { + note.header +} + +fn set_header(note: &mut CardNote, header: NoteHeader) { + note.set_header(header) +} + +// Broadcasts the note as an encrypted log on L1. +fn broadcast(context: &mut PrivateContext, slot: Field, note: CardNote) { + note.broadcast(context, slot); +} + +global CardNoteMethods = NoteInterface { + deserialize, + serialize, + compute_note_hash, + compute_nullifier, + compute_nullifier_without_context, + get_header, + set_header, + broadcast, +}; +``` + +Now: + +```rust +use dep::aztec::{ + note::{ + note_header::NoteHeader, + note_interface::NoteInterface, + utils::compute_note_hash_for_read_or_nullify, + }, + oracle::{ + nullifier_key::get_nullifier_secret_key, + get_public_key::get_public_key, + }, + log::emit_encrypted_log, + hash::pedersen_hash, + context::PrivateContext, + protocol_types::{ + address::AztecAddress, + traits::{Serialize, Deserialize, Empty} + } +}; + +// Shows how to create a custom note + +global CARD_NOTE_LEN: Field = 1; + +impl CardNote { + pub fn new(owner: AztecAddress) -> Self { + CardNote { + owner, + } + } +} + +impl NoteInterface for CardNote { + fn compute_note_content_hash(self) -> Field { + pedersen_hash([ + self.owner.to_field(), + ],0) + } + + fn compute_nullifier(self, context: &mut PrivateContext) -> Field { + let note_hash_for_nullify = compute_note_hash_for_read_or_nullify(self); + let secret = context.request_nullifier_secret_key(self.owner); + pedersen_hash([ + note_hash_for_nullify, + secret.high, + secret.low, + ],0) + } + + fn compute_nullifier_without_context(self) -> Field { + let note_hash_for_nullify = compute_note_hash_for_read_or_nullify(self); + let secret = get_nullifier_secret_key(self.owner); + pedersen_hash([ + note_hash_for_nullify, + secret.high, + secret.low, + ],0) + } + + fn set_header(&mut self, header: NoteHeader) { + self.header = header; + } + + fn get_header(note: CardNote) -> NoteHeader { + note.header + } + + fn serialize_content(self) -> [Field; CARD_NOTE_LEN]{ + [self.owner.to_field()] + } + + fn deserialize_content(serialized_note: [Field; CARD_NOTE_LEN]) -> Self { + AddressNote { + owner: AztecAddress::from_field(serialized_note[0]), + header: NoteHeader::empty(), + } + } + + // Broadcasts the note as an encrypted log on L1. + fn broadcast(self, context: &mut PrivateContext, slot: Field) { + let encryption_pub_key = get_public_key(self.owner); + emit_encrypted_log( + context, + (*context).this_address(), + slot, + encryption_pub_key, + self.serialize(), + ); + } +} +``` + +Public state must implement Serialize and Deserialize traits. + +It is still possible to manually implement the storage initialization (for custom storage wrappers or internal types that don't implement the required traits). For the above example, the `impl Storage` section would look like this: + +```rust +impl Storage { + fn init(context: Context) -> Self { + Storage { + leader: PublicMutable::new( + context, + 1 + ), + legendary_card: PrivateMutable::new(context, 2), + profiles: Map::new( + context, + 3, + |context, slot| { + PrivateMutable::new(context, slot) + }, + ), + test: Set::new(context, 4), + imm_singleton: PrivateImmutable::new(context, 4), + } + } +} +``` + +## 0.20.0 + +### [Aztec.nr] Changes to `NoteInterface` + +1. Changing `compute_nullifier()` to `compute_nullifier(private_context: PrivateContext)` + + This API is invoked for nullifier generation within private functions. When using a secret key for nullifier creation, retrieve it through: + + `private_context.request_nullifier_secret_key(account_address)` + + The private context will generate a request for the kernel circuit to validate that the secret key does belong to the account. + + Before: + + ```rust + pub fn compute_nullifier(self) -> Field { + let secret = oracle.get_secret_key(self.owner); + pedersen_hash([ + self.value, + secret.low, + secret.high, + ]) + } + ``` + + Now: + + ```rust + pub fn compute_nullifier(self, context: &mut PrivateContext) -> Field { + let secret = context.request_nullifier_secret_key(self.owner); + pedersen_hash([ + self.value, + secret.low, + secret.high, + ]) + } + ``` + +2. New API `compute_nullifier_without_context()`. + + This API is used within unconstrained functions where the private context is not available, and using an unverified nullifier key won't affect the network or other users. For example, it's used in `compute_note_hash_and_nullifier()` to compute values for the user's own notes. + + ```rust + pub fn compute_nullifier_without_context(self) -> Field { + let secret = oracle.get_nullifier_secret_key(self.owner); + pedersen_hash([ + self.value, + secret.low, + secret.high, + ]) + } + ``` + + > Note that the `get_secret_key` oracle API has been renamed to `get_nullifier_secret_key`. + +## 0.18.0 + +### [Aztec.nr] Remove `protocol_types` from Nargo.toml + +The `protocol_types` package is now being reexported from `aztec`. It can be accessed through `dep::aztec::protocol_types`. + +```toml +aztec = { git="https://github.com/AztecProtocol/aztec-packages/", tag="v3.0.2", directory="yarn-project/aztec-nr/aztec" } +``` + +### [Aztec.nr] key type definition in Map + +The `Map` class now requires defining the key type in its declaration which _must_ implement the `ToField` trait. + +Before: + +```rust +struct Storage { + balances: Map> +} + +let user_balance = balances.at(owner.to_field()) +``` + +Now: + +```rust +struct Storage { + balances: Map> +} + +let user_balance = balances.at(owner) +``` + +### [js] Updated function names + +- `waitForSandbox` renamed to `waitForPXE` in `@aztec/aztec.js` +- `getSandboxAccountsWallets` renamed to `getInitialTestAccountsWallets` in `@aztec/accounts/testing` + +## 0.17.0 + +### [js] New `@aztec/accounts` package + +Before: + +```js +import { getSchnorrAccount } from "@aztec/aztec.js"; // previously you would get the default accounts from the `aztec.js` package: +``` + +Now, import them from the new package `@aztec/accounts` + +```js +import { getSchnorrAccount } from "@aztec/accounts"; +``` + +### Typed Addresses + +Address fields in Aztec.nr now is of type `AztecAddress` as opposed to `Field` + +Before: + +```rust +unconstrained fn compute_note_hash_and_nullifier(contract_address: Field, nonce: Field, storage_slot: Field, serialized_note: [Field; VALUE_NOTE_LEN]) -> [Field; 4] { + let note_header = NoteHeader::new(_address, nonce, storage_slot); + ... +``` + +Now: + +```rust +unconstrained fn compute_note_hash_and_nullifier( + contract_address: AztecAddress, + nonce: Field, + storage_slot: Field, + serialized_note: [Field; VALUE_NOTE_LEN] + ) -> pub [Field; 4] { + let note_header = NoteHeader::new(contract_address, nonce, storage_slot); +``` + +Similarly, there are changes when using aztec.js to call functions. + +To parse a `AztecAddress` to BigInt, use `.inner` +Before: + +```js +const tokenBigInt = await bridge.methods.token().simulate(); +``` + +Now: + +```js +const tokenBigInt = (await bridge.methods.token().simulate()).inner; +``` + +### [Aztec.nr] Add `protocol_types` to Nargo.toml + +```toml +aztec = { git="https://github.com/AztecProtocol/aztec-packages/", tag="v3.0.2", directory="yarn-project/aztec-nr/aztec" } +protocol_types = { git="https://github.com/AztecProtocol/aztec-packages/", tag="v3.0.2", directory="yarn-project/noir-protocol-circuits/crates/types"} +``` + +### [Aztec.nr] moving compute_address func to AztecAddress + +Before: + +```rust +let calculated_address = compute_address(pub_key_x, pub_key_y, partial_address); +``` + +Now: + +```rust +let calculated_address = AztecAddress::compute(pub_key_x, pub_key_y, partial_address); +``` + +### [Aztec.nr] moving `compute_selector` to FunctionSelector + +Before: + +```rust +let selector = compute_selector("_initialize((Field))"); +``` + +Now: + +```rust +let selector = FunctionSelector::from_signature("_initialize((Field))"); +``` + +### [js] Importing contracts in JS + +Contracts are now imported from a file with the type's name. + +Before: + +```js +import { TokenContract } from "@aztec/noir-contracts/types"; +``` + +Now: + +```js +import { TokenContract } from "@aztec/noir-contracts/Token"; +``` + +### [Aztec.nr] Aztec example contracts location change in Nargo.toml + +Aztec contracts are now moved outside of the `src` folder, so you need to update your imports. + +Before: + +```rust +easy_private_token_contract = {git = "https://github.com/AztecProtocol/aztec-packages/", tag ="v0.16.9", directory = "noir-projects/noir-contracts/contracts/easy_private_token_contract"} +``` + +Now, just remove the `src` folder,: + +```rust +easy_private_token_contract = {git = "https://github.com/AztecProtocol/aztec-packages/", tag ="v0.17.0", directory = "noir-projects/noir-contracts/contracts/easy_private_token_contract"} +``` diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/tutorials/_category_.json b/docs/developer_versioned_docs/version-v3.0.2/docs/tutorials/_category_.json new file mode 100644 index 000000000000..ef8209bd2fa7 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/tutorials/_category_.json @@ -0,0 +1,6 @@ +{ + "label": "Tutorials", + "position": 1, + "collapsible": true, + "collapsed": true +} diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/tutorials/contract_tutorials/_category_.json b/docs/developer_versioned_docs/version-v3.0.2/docs/tutorials/contract_tutorials/_category_.json new file mode 100644 index 000000000000..3900e03c64d8 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/tutorials/contract_tutorials/_category_.json @@ -0,0 +1,6 @@ +{ + "label": "Contract Tutorials", + "position": 1, + "collapsible": true, + "collapsed": true +} \ No newline at end of file diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/tutorials/contract_tutorials/counter_contract.md b/docs/developer_versioned_docs/version-v3.0.2/docs/tutorials/contract_tutorials/counter_contract.md new file mode 100644 index 000000000000..8e8da66fb570 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/tutorials/contract_tutorials/counter_contract.md @@ -0,0 +1,194 @@ +--- +title: Counter Contract +description: Code-along tutorial for creating a simple counter contract on Aztec. +sidebar_position: 0 +--- + +import Image from "@theme/IdealImage"; + +In this guide, we will create our first Aztec.nr smart contract. We will build a simple private counter, where you can keep your own private counter - so no one knows what ID you are at or when you increment! This contract will get you started with the basic setup and syntax of Aztec.nr, but doesn't showcase all of the awesome stuff Aztec is capable of. + +This tutorial is compatible with the Aztec version `v3.0.2`. Install the correct version with `aztec-up -v 3.0.2`. Or if you'd like to use a different version, you can find the relevant tutorial by clicking the version dropdown at the top of the page. + +## Prerequisites + +- You have followed the [quickstart](../../../getting_started_on_local_network.md) +- Running Aztec local network +- Installed [Noir LSP](../../aztec-nr/installation.md) (optional) + +## Set up a project + +Run this to create a new contract project: + +```bash +aztec new --contract counter +``` + +Your structure should look like this: + +```tree +. +|-counter +| |-src +| | |-main.nr +| |-Nargo.toml +``` + +The file `main.nr` will soon turn into our smart contract! + +Add the following dependencies to `Nargo.toml` under the autogenerated content: + +```toml +[dependencies] +aztec = { git="https://github.com/AztecProtocol/aztec-packages/", tag="v3.0.2", directory="noir-projects/aztec-nr/aztec" } +value_note = { git="https://github.com/AztecProtocol/aztec-packages/", tag="v3.0.2", directory="noir-projects/aztec-nr/value-note"} +easy_private_state = { git="https://github.com/AztecProtocol/aztec-packages/", tag="v3.0.2", directory="noir-projects/aztec-nr/easy-private-state"} +``` + +## Define the functions + +Go to `main.nr`, and replace the boilerplate code with this contract initialization: + +```rust +use dep::aztec::macros::aztec; + +#[aztec] +pub contract Counter { +} +``` + +This defines a contract called `Counter`. + +## Imports + +We need to define some imports. + +Write this inside your contract, ie inside these brackets: + +```rust +pub contract Counter { + // imports go here! +} +``` + +```rust title="imports" showLineNumbers +use aztec::{ + macros::{functions::{external, initializer}, storage::storage}, + messages::message_delivery::MessageDelivery, + oracle::debug_log::debug_log_format, + protocol_types::{address::AztecAddress, traits::ToField}, + state_vars::Owned, +}; +use balance_set::BalanceSet; +``` +> Source code: docs/examples/contracts/counter_contract/src/main.nr#L7-L16 + + +- `use aztec::macros::{functions::{external, initializer}, storage::storage},` + Imports the macros needed to define function types (`external`, `initializer`) and the `storage` macro for declaring contract storage structures. + +- `protocol_types::{address::AztecAddress, traits::ToField},` + Brings in `AztecAddress` (used to identify accounts/contracts) and traits for converting values to and from field elements, necessary for serialization and formatting inside Aztec. + +- `state_vars::Map,` + Brings in `Map`, used for creating state mappings, like our counters. + +- `use easy_private_state::EasyPrivateUint;` + Imports a wrapper to manage private integer-like state variables (ie our counter), abstracting away notes. + +## Declare storage + +Add this below the imports. It declares the storage variables for our contract. We are going to store a mapping of values for each `AztecAddress`. + +```rust title="storage_struct" showLineNumbers +#[storage] +struct Storage { + counters: Owned, Context>, +} +``` +> Source code: docs/examples/contracts/counter_contract/src/main.nr#L18-L23 + + +## Keep the counter private + +Now we’ve got a mechanism for storing our private state, we can start using it to ensure the privacy of balances. + +Let’s create a constructor method to run on deployment that assigns an initial count to a specified owner. This function is called `initialize`, but behaves like a constructor. It is the `#[initializer]` decorator that specifies that this function behaves like a constructor. Write this: + +```rust title="constructor" showLineNumbers +#[initializer] +#[external("private")] +// We can name our initializer anything we want as long as it's marked as aztec(initializer) +fn initialize(headstart: u64, owner: AztecAddress) { + self.storage.counters.at(owner).add(headstart as u128).deliver( + MessageDelivery.CONSTRAINED_ONCHAIN, + ); +} +``` +> Source code: docs/examples/contracts/counter_contract/src/main.nr#L25-L34 + + +This function accesses the counts from storage. Then it assigns the passed initial counter to the `owner`'s counter privately using `at().add()`. + +We have annotated this and other functions with `#[external("private")]` which are ABI macros so the compiler understands it will handle private inputs. + +## Incrementing our counter + +Now let’s implement the `increment` function we defined in the first step. + +```rust title="increment" showLineNumbers +#[external("private")] +fn increment(owner: AztecAddress) { + debug_log_format("Incrementing counter for owner {0}", [owner.to_field()]); + self.storage.counters.at(owner).add(1).deliver(MessageDelivery.CONSTRAINED_ONCHAIN); +} +``` +> Source code: docs/examples/contracts/counter_contract/src/main.nr#L36-L42 + + +The `increment` function works very similarly to the `constructor`, but instead directly adds 1 to the counter rather than passing in an initial count parameter. + +## Getting a counter + +The last thing we need to implement is the function in order to retrieve a counter. In the `getCounter` we defined in the first step, write this: + +```rust title="get_counter" showLineNumbers +#[external("utility")] +unconstrained fn get_counter(owner: AztecAddress) -> pub u128 { + self.storage.counters.at(owner).balance_of() +} +``` +> Source code: docs/examples/contracts/counter_contract/src/main.nr#L44-L49 + + +This is a `utility` function which is used to obtain the counter information outside of a transaction. We retrieve a reference to the `owner`'s `counter` from the `counters` Map. The `get_balance` function then operates on the owner's counter. This yields a private counter that only the private key owner can decrypt. + +## Compile + +Now we've written a simple Aztec.nr smart contract, we can compile it. + +### Compile the smart contract + +In `./counter/` directory, run these commands: + +```bash +aztec compile # compiles the contract +``` + +The first command compiles your Noir contract and creates a `target` folder with a `.json` artifact inside. The second command processes these artifacts for use with Aztec (transpiling for the AVM and generating verification keys). Do not worry if you see some warnings - Aztec is in fast development and it is likely you will see some irrelevant warning messages. + +After compiling and processing, you can generate a typescript class using `aztec codegen` command. + +In the same directory, run this: + +```bash +aztec codegen -o src/artifacts target +``` + +You can now use the artifact and/or the TS class in your Aztec.js! + +## Next Steps + +### Optional: Learn more about concepts mentioned here + +- [Functions and annotations like `#[external("private")]`](../../aztec-nr/framework-description/functions/function_transforms.md#private-functions) diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/tutorials/contract_tutorials/token_contract.md b/docs/developer_versioned_docs/version-v3.0.2/docs/tutorials/contract_tutorials/token_contract.md new file mode 100644 index 000000000000..35be81b39817 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/tutorials/contract_tutorials/token_contract.md @@ -0,0 +1,679 @@ +--- +title: Private Token Contract +sidebar_position: 1 +tags: [privacy, tokens, intermediate] +description: Build a privacy-preserving token for employee mental health benefits that keeps spending habits confidential. +--- + +## The Privacy Challenge: Mental Health Benefits at Giggle + +Giggle (a fictional tech company) wants to support their employees' mental health by providing BOB tokens that can be spent at Bob's Psychology Clinic. However, employees have a crucial requirement: **complete privacy**. They don't want Giggle to know: + +- How many BOB tokens they've actually used +- When they're using mental health services +- Their therapy patterns or frequency + +In this tutorial, we'll build a token contract that allows Giggle to mint BOB tokens for employees while ensuring complete privacy in how those tokens are spent. + +## Prerequisites + +This is an intermediate tutorial that assumes you have: + +- Completed the [Counter Contract tutorial](./counter_contract.md) +- A Running Aztec local network (see the Counter tutorial for setup) +- Basic understanding of Aztec.nr syntax and structure +- Aztec toolchain installed (`aztec-up -v 3.0.2`) + +If you haven't completed the Counter Contract tutorial, please do so first as we'll skip the basic setup steps covered there. + +## What We're Building + +We'll create BOB tokens with: + +- **Public and Private minting**: Giggle can mint tokens in private or public +- **Public and Private transfers**: Employees can spend tokens at Bob's clinic with full privacy + +### Project Setup + +Let's create a simple yarn + aztec.nr project: + +```bash +yarn init +# This is to ensure yarn uses node_modules instead of pnp for dependency installation +yarn config set nodeLinker node-modules +yarn add @aztec/aztec.js@v3.0.2 @aztec/accounts@v3.0.2 @aztec/test-wallet@v3.0.2 @aztec/kv-store@v3.0.2 +aztec init +``` + +## Contract structure + +We have a messy, but working structure. In `src/main.nr` we even have a proto-contract. Let's replace it with a simple starting point: + +```rust +use aztec::macros::aztec; + +#[aztec] +pub contract BobToken { + // We'll build the mental health token here +} +``` + +The `#[aztec]` macro transforms our contract code to work with Aztec's privacy protocol. We'll rename it from `StarterToken` to `BobToken` to reflect our use case. + +Let's import the Aztec.nr library by adding it to our dependencies in `Nargo.toml`: + +```toml +[package] +name = "bob_token_contract" +type = "contract" + +[dependencies] +aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v3.0.2", directory = "noir-projects/aztec-nr/aztec" } +``` + +Since we're here, let's import more specific stuff from this library: + +```rust +#[aztec] +pub contract BobToken { + use aztec::{ + macros::{functions::{external, initializer, only_self}, storage::storage}, + messages::message_delivery::MessageDelivery, + protocol_types::address::AztecAddress, + state_vars::{Map, Owned}, + state_vars::public_mutable::PublicMutable, + }; +} +``` + +These are the different macros we need to define the visibility of functions, and some handy types and functions. + +## Building the Mental Health Token System + +### The Privacy Architecture + +Before we start coding, let's understand how privacy works in our mental health token system: + +1. **Public Layer**: Giggle mints tokens publicly - transparent and auditable +2. **Private Layer**: Employees transfer and spend tokens privately - completely confidential +3. **Cross-layer Transfer**: Employees can move tokens between public and private domains as needed + +This architecture ensures that while the initial allocation is transparent (important for corporate governance), the actual usage remains completely private. + +:::info Privacy Note +In Aztec, private state uses a UTXO model with "notes" - think of them as encrypted receipts that only the owner can decrypt and spend. When an employee receives BOB tokens privately, they get encrypted notes that only they can see and use. +::: + +Let's start building! Remember to import types as needed - your IDE's Noir extension can help with auto-imports. + +## Part 1: Public Minting for Transparency + +Let's start with the public components that Giggle will use to mint and track initial token allocations. + +### Setting Up Storage + +First, define the storage for our BOB tokens: + +```rust +#[storage] +struct Storage { + // Giggle's admin address + owner: PublicMutable, + // Public balances - visible for transparency + public_balances: Map, Context>, +} +``` + +This storage structure allows: + +- `owner`: Stores Giggle's admin address (who can mint tokens) +- `public_balances`: Tracks public token balances (employees can verify their allocations) + +:::tip Why Public Balances? +While employees want privacy when spending, having public balances during minting allows: + +1. Employees to verify they received their mental health benefits +2. Auditors to confirm fair distribution +3. Transparency in the allocation process + +::: + +### Initializing Giggle as Owner + +When deploying the contract, we need to set Giggle as the owner: + +```rust title="setup" showLineNumbers +#[initializer] +#[external("public")] +fn setup() { + // Giggle becomes the owner who can mint mental health tokens + self.storage.owner.write(self.msg_sender().unwrap()); +} +``` +> Source code: docs/examples/contracts/bob_token_contract/src/main.nr#L33-L40 + + +The `#[initializer]` decorator ensures this runs once during deployment. Only Giggle's address will have the power to mint new BOB tokens for employees. + +### Minting BOB Tokens for Employees + +Giggle needs a way to allocate mental health tokens to employees: + +```rust title="mint_public" showLineNumbers +#[external("public")] +fn mint_public(employee: AztecAddress, amount: u64) { + // Only Giggle can mint tokens + assert_eq(self.msg_sender().unwrap(), self.storage.owner.read(), "Only Giggle can mint BOB tokens"); + + // Add tokens to employee's public balance + let current_balance = self.storage.public_balances.at(employee).read(); + self.storage.public_balances.at(employee).write(current_balance + amount); +} +``` +> Source code: docs/examples/contracts/bob_token_contract/src/main.nr#L42-L52 + + +This public minting function: + +1. Verifies that only Giggle (the owner) is calling +2. Transparently adds tokens to the employee's public balance +3. Creates an auditable record of the allocation + +:::info Real-World Scenario +Imagine Giggle allocating 100 BOB tokens to each employee at the start of the year. This public minting ensures employees can verify they received their benefits, while their actual usage remains private. +::: + +### Public Transfers (Optional Transparency) + +While most transfers will be private, we'll add public transfers for cases where transparency is desired: + +```rust title="transfer_public" showLineNumbers +#[external("public")] +fn transfer_public(to: AztecAddress, amount: u64) { + let sender = self.msg_sender().unwrap(); + let sender_balance = self.storage.public_balances.at(sender).read(); + assert(sender_balance >= amount, "Insufficient BOB tokens"); + + // Deduct from sender + self.storage.public_balances.at(sender).write(sender_balance - amount); + + // Add to recipient + let recipient_balance = self.storage.public_balances.at(to).read(); + self.storage.public_balances.at(to).write(recipient_balance + amount); +} +``` +> Source code: docs/examples/contracts/bob_token_contract/src/main.nr#L54-L68 + + +This might be used when: + +- An employee transfers tokens to a colleague who's comfortable with transparency +- Bob's clinic makes a public refund +- Any scenario where privacy isn't required + +### Admin Transfer (Future-Proofing) + +In case Giggle's mental health program administration changes: + +```rust title="transfer_ownership" showLineNumbers +#[external("public")] +fn transfer_ownership(new_owner: AztecAddress) { + assert_eq(self.msg_sender().unwrap(), self.storage.owner.read(), "Only current admin can transfer ownership"); + self.storage.owner.write(new_owner); +} +``` +> Source code: docs/examples/contracts/bob_token_contract/src/main.nr#L70-L76 + + +## Your First Deployment - Let's See It Work + +### Compile Your Contract + +You've written enough code to have a working token! Let's compile and test it: + +```bash +aztec compile +``` + +### Generate TypeScript Interface + +```bash +aztec codegen target --outdir artifacts +``` + +You should now have a nice typescript interface in a new `artifacts` folder. Pretty useful! + +### Deploy and Test + +Create `index.ts`. We will connect to our running local network and its wallet, then deploy the test accounts and get three wallets out of it. + +Then we will use the `giggleWallet` to deploy our contract, mint 100 BOB to Alice, then transfer 10 of those to Bob's Clinic publicly... for now. Let's go: + +```typescript +import { BobTokenContract } from './artifacts/BobToken.js'; +import { AztecAddress } from '@aztec/aztec.js/addresses'; +import { createAztecNodeClient } from '@aztec/aztec.js/node'; +import { getInitialTestAccountsData } from '@aztec/accounts/testing'; +import { TestWallet } from '@aztec/test-wallet/server'; +import { openTmpStore } from '@aztec/kv-store/lmdb'; + +async function main() { + // Connect to local network + const node = createAztecNodeClient('http://localhost:8080'); + + const store = await openTmpStore(); + + const wallet = await TestWallet.create(node); + + const [giggleWalletData, aliceWalletData, bobClinicWalletData] = await getInitialTestAccountsData(); + const giggleAccount = await wallet.createSchnorrAccount(giggleWalletData.secret, giggleWalletData.salt); + const aliceAccount = await wallet.createSchnorrAccount(aliceWalletData.secret, aliceWalletData.salt); + const bobClinicAccount = await wallet.createSchnorrAccount(bobClinicWalletData.secret, bobClinicWalletData.salt); + + const giggleAddress = (await giggleAccount.getAccount()).getAddress(); + const aliceAddress = (await aliceAccount.getAccount()).getAddress(); + const bobClinicAddress = (await bobClinicAccount.getAccount()).getAddress(); + + const bobToken = await BobTokenContract + .deploy( + wallet, + ) + .send({ from: giggleAddress }) + .deployed(); + + await bobToken.methods + .mint_public(aliceAddress, 100n) + .send({ from: giggleAddress }) + .wait(); + + await bobToken.methods + .transfer_public(bobClinicAddress, 10n) + .send({ from: aliceAddress }) + .wait(); +} + +main().catch(console.error); +``` + +Run your test: + +```bash +npx tsx index.ts +``` + +:::tip + +What's this `tsx` dark magic? Well, it just compiles and runs typescript using reasonable defaults. Pretty cool for small snippets like this! + +::: + +### 🎉 Celebrate + +Congratulations! You've just deployed a working token contract on Aztec! You can: + +- ✅ Mint BOB tokens as Giggle +- ✅ Transfer tokens between employees +- ✅ Track balances publicly + +But there's a problem... **Giggle can see everything!** They know: + +- Who's transferring tokens +- How much is being spent +- When mental health services are being used + +This defeats the whole purpose of our mental health privacy initiative. Let's fix this by adding private functionality! + +## Part 2: Adding Privacy - The Real Magic Begins + +Now let's add the privacy features that make our mental health benefits truly confidential. + +### Understanding Private Notes + +Here's where Aztec's privacy magic happens. Unlike public balances (a single number), private balances are collections of encrypted "notes". Think of it this way: + +- **Public balance**: "Alice has 100 BOB tokens" (visible to everyone) +- **Private balance**: Alice has encrypted notes [Note1: 30 BOB, Note2: 50 BOB, Note3: 20 BOB] that only she can decrypt + +When Alice spends 40 BOB tokens at Bob's clinic: + +1. She consumes Note1 (30 BOB) and Note2 (50 BOB) = 80 BOB total +2. She creates a new note for Bob's clinic (40 BOB) +3. She creates a "change" note for herself (40 BOB) +4. The consumed notes are nullified (marked as spent) + +In this case, all that the network sees (including Giggle) is just "something happening to some state in some contract". How cool is that? + +### Updating Storage for Privacy + +For something like balances, you can use a simple library called `easy_private_state` which abstracts away a custom private Note. A Note is at the core of how private state works in Aztec and you can read about it [here](../../foundational-topics/state_management.md). For now, let's just import the library in `Nargo.toml`: + +```toml +[dependencies] +easy_private_state = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v3.0.2", directory = "noir-projects/aztec-nr/easy-private-state" } +``` + +Then import `EasyPrivateUint` in our contract: + +```rust +use aztec::macros::aztec; + +#[aztec] +pub contract BobToken { + // ... other imports + use easy_private_state::EasyPrivateUint; + // ... +} +``` + +We need to update the contract storage to have private balances as well: + +```rust title="storage" showLineNumbers +#[storage] +struct Storage { + // Giggle's admin address + owner: PublicMutable, + // Public balances - visible for transparency + public_balances: Map, Context>, + // Private balances - only the owner can see these + private_balances: Owned, Context>, +} +``` +> Source code: docs/examples/contracts/bob_token_contract/src/main.nr#L20-L31 + + +The `private_balances` use `EasyPrivateUint` which manages encrypted notes automatically. + +### Moving Tokens to Privateland + +Great, now our contract knows about private balances. Let's implement a method to allow users to move their publicly minted tokens there: + +```rust title="public_to_private" showLineNumbers +#[external("private")] +fn public_to_private(amount: u64) { + let sender = self.msg_sender().unwrap(); + // This will enqueue a public function to deduct from public balance + self.enqueue_self._deduct_public_balance(sender, amount); + // Add to private balance + self.storage.private_balances.at(sender).add(amount as u128).deliver( + MessageDelivery.CONSTRAINED_ONCHAIN, + ); +} +``` +> Source code: docs/examples/contracts/bob_token_contract/src/main.nr#L78-L89 + + +And the helper function: + +```rust title="_deduct_public_balance" showLineNumbers +#[external("public")] +#[only_self] +fn _deduct_public_balance(owner: AztecAddress, amount: u64) { + let balance = self.storage.public_balances.at(owner).read(); + assert(balance >= amount, "Insufficient public BOB tokens"); + self.storage.public_balances.at(owner).write(balance - amount); +} +``` +> Source code: docs/examples/contracts/bob_token_contract/src/main.nr#L91-L99 + + +By calling `public_to_private` we're telling the network "deduct this amount from my balance" while simultaneously creating a Note with that balance in privateland. + +### Private Transfers + +Now for the crucial privacy feature - transferring BOB tokens in privacy. This is actually pretty simple: + +```rust title="transfer_private" showLineNumbers +#[external("private")] +fn transfer_private(to: AztecAddress, amount: u64) { + let sender = self.msg_sender().unwrap(); + // Spend sender's notes (consumes existing notes) + self.storage.private_balances.at(sender).sub(amount as u128).deliver( + MessageDelivery.CONSTRAINED_ONCHAIN, + ); + // Create new notes for recipient + self.storage.private_balances.at(to).add(amount as u128).deliver( + MessageDelivery.CONSTRAINED_ONCHAIN, + ); +} +``` +> Source code: docs/examples/contracts/bob_token_contract/src/main.nr#L102-L115 + + +This function simply nullifies the sender's notes, while adding them to the recipient. + +:::info Real-World Impact + +When an employee uses 50 BOB tokens at Bob's clinic, this private transfer ensures Giggle has no visibility into: + +- The fact that the employee is seeking mental health services +- The frequency of visits +- The amount spent on treatment + +::: + +### Checking Balances + +Employees can check their BOB token balances without hitting the network by using utility unconstrained functions: + +```rust title="check_balances" showLineNumbers +#[external("utility")] +unconstrained fn private_balance_of(owner: AztecAddress) -> pub u128 { + self.storage.private_balances.at(owner).balance_of() +} + +#[external("utility")] +unconstrained fn public_balance_of(owner: AztecAddress) -> pub u64 { + self.storage.public_balances.at(owner).read() +} +``` +> Source code: docs/examples/contracts/bob_token_contract/src/main.nr#L117-L127 + + +## Part 3: Securing Private Minting + +Let's make this a little bit harder, and more interesting. Let's say Giggle doesn't want to mint the tokens in public. Can we have private minting on Aztec? + +Sure we can. Let's see. + +### Understanding Execution Domains + +Our BOB token system operates in two domains: + +1. **Public Domain**: Where Giggle mints tokens transparently +2. **Private Domain**: Where employees spend tokens confidentially + +The key challenge: How do we ensure only Giggle can mint tokens when the minting happens in a private function? + +:::warning Privacy Trade-off + +Private functions can't directly read current public state (like who the owner is). They can only read historical public state or enqueue public function calls for validation. + +::: + +### The Access Control Challenge + +We want Giggle to mint BOB tokens directly to employees' private balances (for maximum privacy), but we need to ensure only Giggle can do this. The challenge: ownership is stored publicly, but private functions can't read current public state. + +Let's use a clever pattern where private functions enqueue public validation checks. First we make a little helper function in public. Remember, public functions always run _after_ private functions, since private functions run client-side. + +```rust title="_assert_is_owner" showLineNumbers +#[external("public")] +#[only_self] +fn _assert_is_owner(address: AztecAddress) { + assert_eq(address, self.storage.owner.read(), "Only Giggle can mint BOB tokens"); +} +``` +> Source code: docs/examples/contracts/bob_token_contract/src/main.nr#L129-L135 + + +Now we can add a secure private minting function. It looks pretty easy, and it is, since the whole thing will revert if the public function fails: + +```rust title="mint_private" showLineNumbers +#[external("private")] +fn mint_private(employee: AztecAddress, amount: u64) { + // Enqueue ownership check (will revert if not Giggle) + self.enqueue_self._assert_is_owner(self.msg_sender().unwrap()); + + // If check passes, mint tokens privately + self.storage.private_balances.at(employee).add(amount as u128).deliver( + MessageDelivery.CONSTRAINED_ONCHAIN, + ); +} +``` +> Source code: docs/examples/contracts/bob_token_contract/src/main.nr#L137-L148 + + +This pattern ensures: + +1. The private minting executes first (creating the proof) +2. The public ownership check executes after +3. If the check fails, the entire transaction (including the private part) reverts +4. Only Giggle can successfully mint BOB tokens + +## Part 4: Converting Back to Public + +For the sake of completeness, let's also have a function that brings the tokens back to publicland: + +```rust title="private_to_public" showLineNumbers +#[external("private")] +fn private_to_public(amount: u64) { + let sender = self.msg_sender().unwrap(); + // Remove from private balance + self.storage.private_balances.at(sender).sub(amount as u128).deliver( + MessageDelivery.CONSTRAINED_ONCHAIN, + ); + // Enqueue public credit + self.enqueue_self._credit_public_balance(sender, amount); +} + +#[external("public")] +#[only_self] +fn _credit_public_balance(owner: AztecAddress, amount: u64) { + let balance = self.storage.public_balances.at(owner).read(); + self.storage.public_balances.at(owner).write(balance + amount); +} +``` +> Source code: docs/examples/contracts/bob_token_contract/src/main.nr#L151-L169 + + +Now you've made changes to your contract, you need to recompile your contract. + +Here are the steps from above, for reference: + +```bash +aztec compile +aztec codegen target --outdir artifacts +``` + +## Testing the Complete Privacy System + +Now that you've implemented all the privacy features, let's update our test script to showcase the full privacy flow: + +### Update Your Test Script + +Let's stop being lazy and add a nice little "log" function that just spits out everyone's balances to the console, for example: + +```typescript +// at the top of your file +async function getBalances(contract: BobTokenContract, aliceAddress: AztecAddress, bobAddress: AztecAddress) { + Promise.all([ + contract.methods + .public_balance_of(aliceAddress) + .simulate({ from: aliceAddress }), + contract.methods + .private_balance_of(aliceAddress) + .simulate({ from: aliceAddress }), + contract.methods + .public_balance_of(bobAddress) + .simulate({ from: bobAddress }), + contract.methods + .private_balance_of(bobAddress) + .simulate({ from: bobAddress }) + ]).then(([alicePublicBalance, alicePrivateBalance, bobPublicBalance, bobPrivateBalance]) => { + console.log(`📊 Alice has ${alicePublicBalance} public BOB tokens and ${alicePrivateBalance} private BOB tokens`); + console.log(`📊 Bob's Clinic has ${bobPublicBalance} public BOB tokens and ${bobPrivateBalance} private BOB tokens`); + }); +} +``` + +Looks ugly but it does what it says: prints Alice's and Bob's balances. This will make it easier to see our contract working. + +Now let's add some more stuff to our `index.ts`: + +```typescript +async function main() { + // ...etc + await bobToken.methods + .mint_public(aliceAddress, 100n) + .send({ from: giggleAddress }) + .wait(); + await getBalances(bobToken, aliceAddress, bobClinicAddress); + + await bobToken.methods + .transfer_public(bobClinicAddress, 10n) + .send({ from: aliceAddress }) + .wait(); + await getBalances(bobToken, aliceAddress, bobClinicAddress); + + await bobToken.methods + .public_to_private(90n) + .send({ from: aliceAddress }) + .wait(); + await getBalances(bobToken, aliceAddress, bobClinicAddress); + + await bobToken.methods + .transfer_private(bobClinicAddress, 50n) + .send({ from: aliceAddress }) + .wait(); + await getBalances(bobToken, aliceAddress, bobClinicAddress); + + await bobToken.methods + .private_to_public(10n) + .send({ from: aliceAddress }) + .wait(); + await getBalances(bobToken, aliceAddress, bobClinicAddress); + + await bobToken.methods + .mint_private(aliceAddress, 100n) + .send({ from: giggleAddress }) + .wait(); + await getBalances(bobToken, aliceAddress, bobClinicAddress); +} + +main().catch(console.error); +``` + +The flow is something like: + +- Giggle mints Alice 100 BOB in public +- Alice transfers 10 BOB to Bob in public +- Alice makes the remaining 90 BOB private +- Alice transfers 50 of those to Bob, in private +- Of the remaining 40 BOB, she makes 10 public again +- Giggle mints 100 BOB tokens for Alice, in private + +Let's give it a try: + +```bash +npx tsx index.ts +``` + +You should see the complete privacy journey from transparent allocation to confidential usage! + +## Summary + +You've built a privacy-preserving token system that solves a real-world problem: enabling corporate mental health benefits while protecting employee privacy. This demonstrates Aztec's unique ability to provide both transparency and privacy where each is most needed. + +The BOB token shows how blockchain can enable new models of corporate benefits that weren't possible before - where verification and privacy coexist, empowering employees to seek help without fear of judgment or career impact. + +### What You Learned + +- How to create tokens with both public and private states +- How to bridge between public and private domains +- How to implement access control across execution contexts +- How to build real-world privacy solutions on Aztec + +### Continue Your Journey + +- Explore [cross-chain communication](../../aztec-nr/framework-description/ethereum-aztec-messaging/index.md) to integrate with existing health systems +- Learn about [account abstraction](../../foundational-topics/accounts/index.md) for recovery mechanisms diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/tutorials/js_tutorials/_category_.json b/docs/developer_versioned_docs/version-v3.0.2/docs/tutorials/js_tutorials/_category_.json new file mode 100644 index 000000000000..d497430c8a5e --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/tutorials/js_tutorials/_category_.json @@ -0,0 +1,6 @@ +{ + "label": "Full-Stack Tutorials", + "position": 2, + "collapsible": true, + "collapsed": true +} diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/tutorials/js_tutorials/aztecjs-getting-started.md b/docs/developer_versioned_docs/version-v3.0.2/docs/tutorials/js_tutorials/aztecjs-getting-started.md new file mode 100644 index 000000000000..15af753428b6 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/tutorials/js_tutorials/aztecjs-getting-started.md @@ -0,0 +1,150 @@ +--- +title: Deploying a Token Contract +sidebar_position: 0 +description: A tutorial going through how to deploy a token contract to the local network using typescript. +--- + +import Image from "@theme/IdealImage"; + +In this guide, we will retrieving the local network and deploy a pre-written token contract to it using Aztec.js. [Check out the source code](https://github.com/AztecProtocol/aztec-packages/blob/master/noir-projects/noir-contracts/contracts/app/token_contract/src/main.nr). We will then use Aztec.js to interact with this contract and transfer tokens. + +Before starting, make sure to be running Aztec local network at version 3.0.2. Check out [the guide](../../tutorials/local_network.md) for info about that. + +## Set up the project + +Let's initialize a yarn project first. You can init it with the dependencies we need: + +```sh +yarn add typescript @types/node tsx +``` + +:::tip + +Never heard of `tsx`? Well, it will just run `typescript` with reasonable defaults. Pretty cool for a small example like this one. You may want to tune in your own project's `tsconfig.json` later! + +::: + +Let's also import the Aztec dependencies for this tutorial: + +```sh +yarn add @aztec/aztec.js@3.0.2 @aztec/accounts@3.0.2 @aztec/noir-contracts.js@3.0.2 +``` + +Aztec.js assumes your project is using ESM, so make sure you add `"type": "module"` to `package.json`. You probably also want at least a `start` script. For example: + +```json +{ + "type": "module", + "scripts": { + "start": "tsx index.ts" + } +} +``` + +### Connecting to the local network + +We want to [connect to our running local network](../../aztec-js/how_to_connect_to_local_network.md) and import the test accounts into a new wallet. Let's call them Alice and Bob (of course). Create an `index.ts` with it: + +```typescript +import { createAztecNodeClient } from "@aztec/aztec.js/node"; +import { TestWallet } from "@aztec/test-wallet/server"; +import { getInitialTestAccountsData } from "@aztec/accounts/testing"; + +const nodeUrl = "http://localhost:8080"; +const node = createAztecNodeClient(nodeUrl); +const wallet = await TestWallet.create(node); + +const [alice, bob] = await getInitialTestAccountsData(); +await wallet.createSchnorrAccount(alice.secret, alice.salt); +await wallet.createSchnorrAccount(bob.secret, bob.salt); +``` + +## Deploy the token contract + +Now that we have our accounts loaded, let's move on to deploy our pre-compiled token smart contract. You can find the full code for the contract [here (GitHub link)](https://github.com/AztecProtocol/aztec-packages/tree/master/noir-projects/noir-contracts/contracts/app/token_contract/src). + +Let's import the interface directly, and make Alice the admin: + +```typescript +import { TokenContract } from "@aztec/noir-contracts.js/Token"; + +const token = await TokenContract.deploy( + wallet, + alice.address, + "TokenName", + "TKN", + 18 +) + .send({ from: alice.address }) + .deployed(); +``` + +## Mint and transfer + +Let's go ahead and have Alice mint herself some tokens, in private: + +```typescript +await token.methods + .mint_to_private(alice.address, 100) + .send({ from: alice.address }) + .wait(); +``` + +Let's check both Alice's and Bob's balances now: + +```typescript +let aliceBalance = await token.methods + .balance_of_private(alice.address) + .simulate({ from: alice.address }); +console.log(`Alice's balance: ${aliceBalance}`); // whoooaa 100 tokens +let bobBalance = await token.methods + .balance_of_private(bob.address) + .simulate({ from: bob.address }); +console.log(`Bob's balance: ${bobBalance}`); // you get nothin' 🥹 +``` + +Great! Let's have Alice transfer some tokens to Bob, also in private: + +```typescript +await token.methods + .transfer(bob.address, 10) + .send({ from: alice.address }) + .wait(); +bobBalance = await token.methods + .balance_of_private(bob.address) + .simulate({ from: bob.address }); +console.log(`Bob's balance: ${bobBalance}`); +``` + +Nice, Bob should now see 10 tokens in his balance! Thanks Alice! + +## Other cool things + +Say that Alice is nice and wants to set Bob as a minter. Even though it's a public function, it can be called in a similar way: + +```typescript +await token.methods + .set_minter(bob.address, true) + .send({ from: alice.address }) + .wait(); +``` + +Bob is now the minter, so he can mint some tokens to himself, notice that for the time being, you need to bind `token` to Bob's wallet with `withWallet(bob)`: + +```typescript +await token + .withWallet(bob) + .methods.mint_to_private(bob.address, 100) + .send({ from: bob.address }) + .wait(); +bobBalance = await token.methods + .balance_of_private(bob.address) + .simulate({ from: bob.address }); +console.log(`Bob's balance: ${bobBalance}`); +``` + +:::info + +Have a look at the [contract source](https://github.com/AztecProtocol/aztec-packages/blob/master/noir-projects/noir-contracts/contracts/app/token_contract/src/main.nr). Notice is that the `mint_to_private` function we used above actually starts a partial note. This allows the total balance to increase while keeping the recipient private! How cool is that? + +::: diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/tutorials/js_tutorials/token_bridge.md b/docs/developer_versioned_docs/version-v3.0.2/docs/tutorials/js_tutorials/token_bridge.md new file mode 100644 index 000000000000..d15d03928d69 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/tutorials/js_tutorials/token_bridge.md @@ -0,0 +1,1057 @@ +--- +title: "Bridge Your NFT to Aztec" +sidebar_position: 1 +description: "Build a private NFT bridge that moves CryptoPunks between Ethereum and Aztec with encrypted ownership using custom notes and PrivateSet." +--- + +## Why Bridge an NFT? + +Imagine you own a CryptoPunk NFT on Ethereum. You want to use it in games, social apps, or DeFi protocols, but gas fees on Ethereum make every interaction expensive. What if you could move your Punk to Aztec (L2), use it **privately** in dozens of applications, and then bring it back to Ethereum when you're ready to sell? + +In this tutorial, you'll build a **private NFT bridge**. By the end, you'll understand how **portals** work and how **cross-chain messages** flow between L1 and L2. + +Before starting, make sure you have the Aztec local network running at version v3.0.2. Check out [the local network guide](../../../getting_started_on_local_network.md) for setup instructions. + +## What You'll Build + +You'll create two contracts with **privacy at the core**: + +- **NFTPunk (L2)** - An NFT contract with encrypted ownership using `PrivateSet` +- **NFTBridge (L2)** - A bridge that mints NFTs privately when claiming L1 messages + +This tutorial focuses on the L2 side to keep things manageable. You'll learn the essential privacy patterns that apply to any asset bridge on Aztec. + +## Project Setup + +Let's start simple. Since this is an Ethereum project, it's easier to just start with Hardhat: + +```bash +git clone https://github.com/critesjosh/hardhat-aztec-example +``` + +You're cloning a repo here to make it easier for Aztec's `l1-contracts` to be mapped correctly. You should now have a `hardhat-aztec-example` folder with Hardhat's default starter, with a few changes in `package.json`. + +We want to add a few more dependencies now before we start: + +```bash +cd hardhat-aztec-example +yarn add @aztec/aztec.js@3.0.2 @aztec/accounts@3.0.2 @aztec/stdlib@3.0.2 @aztec/test-wallet@3.0.2 tsx +``` + +Now start the local network in another terminal: + +```bash +aztec start --local-network +``` + +This should start two important services on ports 8080 and 8545, respectively: Aztec and Anvil (an Ethereum development node). + +## Part 1: Building the NFT Contract + +Let's start with a basic NFT contract on Aztec. That's the representation of the NFT locked on the L2 side: + +```mermaid +graph LR + subgraph Ethereum["Ethereum (L1)"] + L1NFT["🎨 L1 NFT
(CryptoPunk)"] + L1Portal["🌉 L1 Portal
(TokenPortal)"] + end + + subgraph Aztec["Aztec (L2)"] + L2Bridge["🔗 L2 Bridge
(NFTBridge)"] + L2NFT["🎭 L2 NFT
(NFTPunk)"] + end + + L1NFT -->|"Lock NFT"| L1Portal + L1Portal -->|"L1→L2 Message"| L2Bridge + L2Bridge -->|"Mint Private"| L2NFT + + L2NFT -.->|"Burn"| L2Bridge + L2Bridge -.->|"L2→L1 Message"| L1Portal + L1Portal -.->|"Unlock NFT"| L1NFT + + style L2NFT fill:#4ade80,stroke:#22c55e,stroke-width:3px + style L2Bridge fill:#f0f0f0,stroke:#999,stroke-width:2px + style L1Portal fill:#f0f0f0,stroke:#999,stroke-width:2px + style L1NFT fill:#f0f0f0,stroke:#999,stroke-width:2px + + classDef highlight fill:#4ade80,stroke:#22c55e,stroke-width:3px +``` + +Let's create that crate in the `contracts` folder so it looks tidy: + +```bash +aztec new contracts/aztec/nft +cd contracts/aztec/nft +``` + +Open `Nargo.toml` and make sure you add `aztec` as a dependency: + +```toml +[dependencies] +aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v3.0.2", directory = "noir-projects/aztec-nr/aztec" } +``` + +### Create the NFT Note + +First, let's create a custom note type for private NFT ownership. In the `src/` directory, create a new file called `nft.nr`: + +```bash +touch src/nft.nr +``` + +In this file, you're going to create a **private note** that represents NFT ownership. This is a struct with macros that indicate it is a note that can be compared and packed: + +```rust title="nft_note_struct" showLineNumbers +use dep::aztec::{ + macros::notes::note, + protocol_types::{ + address::AztecAddress, + traits::Packable, + }, + oracle::random::random, +}; + +#[derive(Eq, Packable)] +#[note] +pub struct NFTNote { + pub token_id: Field, +} +``` +> Source code: docs/examples/tutorials/token_bridge_contract/contracts/aztec/nft/src/nft.nr#L1-L16 + + +You now have a note that represents the owner of a particular NFT. Next, move on to the contract itself. + +:::tip Custom Notes + +Notes are powerful concepts. Learn more about how to use them in the [state management guide](../../foundational-topics/state_management.md). + +::: + +### Define Storage + +Back in `main.nr`, you can now build the contract storage. You need: + +- **admin**: Who controls the contract (set once, never changes) +- **minter**: The bridge address (set once by admin) +- **nfts**: Track which NFTs exist (public, needed for bridging) +- **owners**: Private ownership using the NFTNote + +One interesting aspect of this storage configuration is the use of `DelayedPublicMutable`, which allows private functions to read and use public state. You're using it to publicly track which NFTs are already minted while keeping their owners private. Read more about `DelayedPublicMutable` in [the storage guide](../../aztec-nr/framework-description/how_to_define_storage.md). + +Write the storage struct and a simple [initializer](../../foundational-topics/contract_creation.md#initialization) to set the admin in the `main.nr` file: + +```rust title="contract_setup" showLineNumbers +use aztec::macros::aztec; +pub mod nft; + +#[aztec] +pub contract NFTPunk { + use dep::aztec::{ + macros::{storage::storage, functions::{external, utility, initializer, only_self}}, + protocol_types::{address::AztecAddress}, + state_vars::{PrivateSet, PublicImmutable, delayed_public_mutable::DelayedPublicMutable, Map} + }; + use crate::nft::NFTNote; + use dep::aztec::messages::message_delivery::MessageDelivery; + use aztec::note::{note_getter_options::NoteGetterOptions, note_interface::NoteProperties, note_viewer_options::NoteViewerOptions}; + use aztec::utils::comparison::Comparator; + + #[storage] + struct Storage { + admin: PublicImmutable, + minter: PublicImmutable, + nfts: Map, Context>, + owners: PrivateSet, + } + #[external("public")] + #[initializer] + fn constructor(admin: AztecAddress) { + self.storage.admin.initialize(admin); + } +``` +> Source code: docs/examples/tutorials/token_bridge_contract/contracts/aztec/nft/src/main.nr#L1-L29 + + +### Utility Functions + +Add an internal function to handle the `DelayedPublicMutable` value change. Mark the function as public and internal with [specific macros](../../aztec-nr/framework-description/macros.md): + +```rust title="mark_nft_exists" showLineNumbers +#[external("public")] +#[only_self] +fn _mark_nft_exists(token_id: Field, exists: bool) { + self.storage.nfts.at(token_id).schedule_value_change(exists); +} +``` +> Source code: docs/examples/tutorials/token_bridge_contract/contracts/aztec/nft/src/main.nr#L39-L45 + + +This internal function uses `schedule_value_change` to update the `nfts` storage, preventing the same NFT from being minted twice or burned when it doesn't exist. You'll call this public function from a private function later. + +Another useful function checks how many notes a caller has. You can use this later to verify the claim and exit from L2: + +```rust title="notes_of" showLineNumbers +#[external("utility")] +unconstrained fn notes_of(from: AztecAddress) -> Field { + let notes = self.storage.owners.at(from).view_notes(NoteViewerOptions::new()); + notes.len() as Field +} +``` +> Source code: docs/examples/tutorials/token_bridge_contract/contracts/aztec/nft/src/main.nr#L61-L67 + + +### Add Minting and Burning + +Before anything else, you need to set the minter. This will be the bridge contract, so only the bridge contract can mint NFTs. This value doesn't need to change after initialization. Here's how to initialize the `PublicImmutable`: + +```rust title="set_minter" showLineNumbers +#[external("public")] +fn set_minter(minter: AztecAddress) { + assert(self.storage.admin.read().eq(self.msg_sender().unwrap()), "caller is not admin"); + self.storage.minter.initialize(minter); +} +``` +> Source code: docs/examples/tutorials/token_bridge_contract/contracts/aztec/nft/src/main.nr#L31-L37 + + +Now for the magic - minting NFTs **privately**. The bridge will call this to mint to a user, emit a new [constrained event](../../aztec-nr/framework-description/how_to_emit_event.md) (best practice when "sending someone a note"), and then [enqueue a public call](../../aztec-nr/framework-description/how_to_call_contracts.md) to the `_mark_nft_exists` function: + +```rust title="mint" showLineNumbers +#[external("private")] +fn mint(to: AztecAddress, token_id: Field) { + assert(self.storage.minter.read().eq(self.msg_sender().unwrap()), "caller is not the authorized minter"); + + // we create an NFT note and insert it to the PrivateSet - a collection of notes meant to be read in private + let new_nft = NFTNote { token_id }; + self.storage.owners.at(to).insert(new_nft).deliver(MessageDelivery.CONSTRAINED_ONCHAIN); + + // calling the internal public function above to indicate that the NFT is taken + self.enqueue_self._mark_nft_exists(token_id, true); +} +``` +> Source code: docs/examples/tutorials/token_bridge_contract/contracts/aztec/nft/src/main.nr#L47-L59 + + +The bridge will also need to burn NFTs when users withdraw back to L1: + +```rust title="burn" showLineNumbers +#[external("private")] +fn burn(from: AztecAddress, token_id: Field) { + assert(self.storage.minter.read().eq(self.msg_sender().unwrap()), "caller is not the authorized minter"); + + // from the NFTNote properties, selects token_id and compares it against the token_id to be burned + let options = NoteGetterOptions::new().select(NFTNote::properties().token_id, Comparator.EQ, token_id).set_limit(1); + let notes = self.storage.owners.at(from).pop_notes(options); + assert(notes.len() == 1, "NFT not found"); + + self.enqueue_self._mark_nft_exists(token_id, false); +} +``` +> Source code: docs/examples/tutorials/token_bridge_contract/contracts/aztec/nft/src/main.nr#L69-L81 + + +### Compiling! + +Let's verify it compiles: + +```bash +aztec compile +``` + +🎉 You should see "Compiled successfully!" This means our private NFT contract is ready. Now let's build the bridge. + +## Part 2: Building the Bridge + +We have built the L2 NFT contract. This is the L2 representation of an NFT that is locked on the L1 bridge. + +The L2 bridge is the contract that talks to the L1 bridge through cross-chain messaging. You can read more about this protocol [here](../../../docs/aztec-nr/framework-description/ethereum-aztec-messaging/index.md). + +```mermaid +graph LR + subgraph Ethereum["Ethereum (L1)"] + L1NFT["🎨 L1 NFT
(CryptoPunk)"] + L1Portal["🌉 L1 Portal
(TokenPortal)"] + end + + subgraph Aztec["Aztec (L2)"] + L2Bridge["🔗 L2 Bridge
(NFTBridge)"] + L2NFT["🎭 L2 NFT
(NFTPunk)"] + end + + L1NFT -->|"Lock NFT"| L1Portal + L1Portal -->|"L1→L2 Message"| L2Bridge + L2Bridge -->|"Mint Private"| L2NFT + + L2NFT -.->|"Burn"| L2Bridge + L2Bridge -.->|"L2→L1 Message"| L1Portal + L1Portal -.->|"Unlock NFT"| L1NFT + + style L2Bridge fill:#4ade80,stroke:#22c55e,stroke-width:3px + style L2NFT fill:#f0f0f0,stroke:#999,stroke-width:2px + style L1Portal fill:#f0f0f0,stroke:#999,stroke-width:2px + style L1NFT fill:#f0f0f0,stroke:#999,stroke-width:2px + + classDef highlight fill:#4ade80,stroke:#22c55e,stroke-width:3px +``` + +Let's create a new contract in the same tidy `contracts/aztec` folder: + +```bash +cd .. +aztec new --contract nft_bridge +cd nft_bridge +``` + +And again, add the `aztec-nr` dependency to `Nargo.toml`. We also need to add the `NFTPunk` contract we just wrote above: + +```toml +[dependencies] +aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v3.0.2", directory = "noir-projects/aztec-nr/aztec" } +NFTPunk = { path = "../nft" } +``` + +### Understanding Bridges + +A bridge has two jobs: + +1. **Claim**: When someone deposits an NFT on L1, mint it on L2 +2. **Exit**: When someone wants to withdraw, burn on L2 and unlock on L1 + +This means having knowledge about the L2 NFT contract, and the bridge on the L1 side. That's what goes into our bridge's storage. + +### Bridge Storage + +Clean up `main.nr` which is just a placeholder, and let's write the storage struct and the constructor. We'll use `PublicImmutable` since these values never change: + +```rust title="bridge_setup" showLineNumbers +use aztec::macros::aztec; + +#[aztec] +pub contract NFTBridge { + use dep::aztec::{ + macros::{storage::storage, functions::{external, initializer}}, + protocol_types::{address::AztecAddress, address::EthAddress, hash::sha256_to_field}, + state_vars::{PublicImmutable}, + }; + use dep::NFTPunk::NFTPunk; + + #[storage] + struct Storage { + nft: PublicImmutable, + portal: PublicImmutable, + } + + #[external("public")] + #[initializer] + fn constructor(nft: AztecAddress) { + self.storage.nft.initialize(nft); + } + + #[external("public")] + fn set_portal(portal: EthAddress) { + self.storage.portal.initialize(portal); + } +``` +> Source code: docs/examples/tutorials/token_bridge_contract/contracts/aztec/nft_bridge/src/main.nr#L1-L29 + + +You can't initialize the `portal` value in the constructor because the L1 portal hasn't been deployed yet. You'll need another function to set it up after the L1 portal is deployed. + +### Adding the Bridge Functions + +The Aztec network provides a way to consume messages from L1 to L2 called `consume_l1_to_l2_message`. + +You need to define how to encode messages. Here's a simple approach: when an NFT is being bridged, the L1 portal sends a hash of its `token_id` through the bridge, signaling which `token_id` was locked and can be minted on L2. This approach is simple but sufficient for this tutorial. + +Build the `claim` function, which consumes the message and mints the NFT on the L2 side: + +```rust title="claim" showLineNumbers +#[external("private")] +fn claim(to: AztecAddress, token_id: Field, secret: Field, message_leaf_index: Field) { + // Compute the message hash that was sent from L1 + let token_id_bytes: [u8; 32] = (token_id as Field).to_be_bytes(); + let content_hash = sha256_to_field(token_id_bytes); + + // Consume the L1 -> L2 message + context.consume_l1_to_l2_message( + content_hash, + secret, + self.storage.portal.read(), + message_leaf_index + ); + + // Mint the NFT on L2 + let nft = self.storage.nft.read(); + NFTPunk::at(nft).mint(to, token_id).call(&mut context); +} +``` +> Source code: docs/examples/tutorials/token_bridge_contract/contracts/aztec/nft_bridge/src/main.nr#L31-L50 + + +:::tip Secret + +The secret prevents front-running. Certainly you don't want anyone to claim your NFT on the L2 side by just being faster. Adding a secret acts like a "password": you can only claim it if you know it. + +::: + +Similarly, exiting to L1 means burning the NFT on the L2 side and pushing a message through the protocol. To ensure only the L1 recipient can claim it, hash the `token_id` together with the `recipient`: + +```rust title="exit" showLineNumbers +#[external("private")] +fn exit( + token_id: Field, + recipient: EthAddress +) { + // Create L2->L1 message to unlock NFT on L1 + let token_id_bytes: [u8; 32] = token_id.to_be_bytes(); + let recipient_bytes: [u8; 20] = recipient.to_be_bytes(); + let content = sha256_to_field(token_id_bytes.concat(recipient_bytes)); + context.message_portal(storage.portal.read(), content); + + // Burn the NFT on L2 + let nft = self.storage.nft.read(); + NFTPunk::at(nft).burn(context.msg_sender().unwrap(), token_id).call(&mut context); +} +``` +> Source code: docs/examples/tutorials/token_bridge_contract/contracts/aztec/nft_bridge/src/main.nr#L52-L68 + + +Cross-chain messaging on Aztec is powerful because it doesn't conform to any specific format—you can structure messages however you want. + +:::tip Private Functions + +Both `claim` and `exit` are `#[private]`, which means the bridging process is private—nobody can see who's bridging which NFT by watching the chain. + +::: + +### Compile the Bridge + +```bash +aztec compile +``` + +Bridge compiled successfully! Now process both contracts and generate TypeScript bindings: + +```bash +cd ../nft +aztec codegen target --outdir ../artifacts + +cd ../nft_bridge +aztec codegen target --outdir ../artifacts +``` + +An `artifacts` folder should appear with TypeScript bindings for each contract. You'll use these when deploying the contracts. + +## Part 3: The Ethereum Side + +Now build the L1 contracts. You need: + +- A simple ERC721 NFT contract (the "CryptoPunk") +- A portal contract that locks/unlocks NFTs and communicates with Aztec + +### Install Dependencies + +Aztec's contracts are already in your `package.json`. You just need to add the OpenZeppelin contracts that provide the default ERC721 implementation: + +```bash +cd ../../.. +yarn add @openzeppelin/contracts +``` + +### Create a Simple NFT + +Delete the "Counter" contracts that show up by default in `contracts` and create `contracts/SimpleNFT.sol`: + +```bash +touch contracts/SimpleNFT.sol +``` + +Create a minimal NFT contract sufficient for demonstrating bridging: + +```solidity title="simple_nft" showLineNumbers +pragma solidity >=0.8.27; + +import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol"; + +contract SimpleNFT is ERC721 { + uint256 private _currentTokenId; + + constructor() ERC721("SimplePunk", "SPUNK") {} + + function mint(address to) external returns (uint256) { + uint256 tokenId = _currentTokenId++; + _mint(to, tokenId); + return tokenId; + } +} +``` +> Source code: docs/examples/tutorials/token_bridge_contract/contracts/SimpleNFT.sol#L2-L18 + + +### Create the NFT Portal + +The NFT Portal has more code, so build it step-by-step. Create `contracts/NFTPortal.sol`: + +```bash +touch contracts/NFTPortal.sol +``` + +Initialize it with Aztec's registry, which holds the canonical contracts for Aztec-related contracts, including the Inbox and Outbox. These are the message-passing contracts—Aztec sequencers read any messages on these contracts. + +```solidity title="portal_setup" showLineNumbers +import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; +import {IRegistry} from "@aztec/l1-contracts/src/governance/interfaces/IRegistry.sol"; +import {IInbox} from "@aztec/l1-contracts/src/core/interfaces/messagebridge/IInbox.sol"; +import {IOutbox} from "@aztec/l1-contracts/src/core/interfaces/messagebridge/IOutbox.sol"; +import {IRollup} from "@aztec/l1-contracts/src/core/interfaces/IRollup.sol"; +import {DataStructures} from "@aztec/l1-contracts/src/core/libraries/DataStructures.sol"; +import {Hash} from "@aztec/l1-contracts/src/core/libraries/crypto/Hash.sol"; + +contract NFTPortal { + IRegistry public registry; + IERC721 public nftContract; + bytes32 public l2Bridge; + + IRollup public rollup; + IOutbox public outbox; + IInbox public inbox; + uint256 public rollupVersion; + + function initialize(address _registry, address _nftContract, bytes32 _l2Bridge) external { + registry = IRegistry(_registry); + nftContract = IERC721(_nftContract); + l2Bridge = _l2Bridge; + + rollup = IRollup(address(registry.getCanonicalRollup())); + outbox = rollup.getOutbox(); + inbox = rollup.getInbox(); + rollupVersion = rollup.getVersion(); + } +``` +> Source code: docs/examples/tutorials/token_bridge_contract/contracts/NFTPortal.sol#L4-L33 + + +The core logic is similar to the L2 logic. `depositToAztec` calls the `Inbox` canonical contract to send a message to Aztec, and `withdraw` calls the `Outbox` contract. + +Add these two functions with explanatory comments: + +```solidity title="portal_deposit_and_withdraw" showLineNumbers + // Lock NFT and send message to L2 + function depositToAztec(uint256 tokenId, bytes32 secretHash) external returns (bytes32, uint256) { + // Lock the NFT + nftContract.transferFrom(msg.sender, address(this), tokenId); + + // Prepare L2 message - just a naive hash of our tokenId + DataStructures.L2Actor memory actor = DataStructures.L2Actor(l2Bridge, rollupVersion); + bytes32 contentHash = Hash.sha256ToField(abi.encode(tokenId)); + + // Send message to Aztec + (bytes32 key, uint256 index) = inbox.sendL2Message(actor, contentHash, secretHash); + return (key, index); + } + + // Unlock NFT after L2 burn + function withdraw( + uint256 tokenId, + uint256 l2BlockNumber, + uint256 leafIndex, + bytes32[] calldata path + ) external { + // Verify message from L2 + DataStructures.L2ToL1Msg memory message = DataStructures.L2ToL1Msg({ + sender: DataStructures.L2Actor(l2Bridge, rollupVersion), + recipient: DataStructures.L1Actor(address(this), block.chainid), + content: Hash.sha256ToField(abi.encodePacked(tokenId, msg.sender)) + }); + + outbox.consume(message, l2BlockNumber, leafIndex, path); + + // Unlock NFT + nftContract.transferFrom(address(this), msg.sender, tokenId); + } +} +``` +> Source code: docs/examples/tutorials/token_bridge_contract/contracts/NFTPortal.sol#L35-L70 + + +The portal handles two flows: + +- **depositToAztec**: Locks NFT on L1, sends message to L2 +- **withdraw**: Verifies L2 message, unlocks NFT on L1 + +### Compile + +Let's make sure everything compiles: + +```bash +npx hardhat compile +``` + +You should see successful compilation of both contracts! + +## Part 4: Compiling, Deploying, and Testing + +Now deploy everything and test the full flow. This will help you understand how everything fits together. + +Delete the placeholders in `scripts` and create `index.ts`: + +```bash +touch scripts/index.ts +``` + +This script will implement the user flow. + +:::warning Testnet + +This section assumes you're working locally using the local network. For the testnet, you need to account for some things: + +- Your clients need to point to some Sepolia Node and to the public Aztec Full Node +- You need to [deploy your own Aztec accounts](../../aztec-js/how_to_create_account.md) +- You need to pay fees in some other way. Learn how in the [fees guide](../../aztec-js/how_to_pay_fees.md) + +::: + +### Deploying and Initializing + +First, initialize the clients: `aztec.js` for Aztec and `viem` for Ethereum: + +```typescript title="setup" showLineNumbers +import { privateKeyToAccount } from "viem/accounts"; +import { + createPublicClient, + createWalletClient, + http, + pad, + getAbiItem, + toEventHash, +} from "viem"; +import { foundry } from "viem/chains"; +import { EthAddress } from "@aztec/aztec.js/addresses"; +import { Fr } from "@aztec/aztec.js/fields"; +import { createAztecNodeClient } from "@aztec/aztec.js/node"; +import { computeSecretHash } from "@aztec/stdlib/hash"; +import { computeL2ToL1MembershipWitness } from "@aztec/stdlib/messaging"; +import { sha256ToField } from "@aztec/foundation/crypto"; +import { computeL2ToL1MessageHash } from "@aztec/stdlib/hash"; +import { TestWallet } from "@aztec/test-wallet/server"; +import { getInitialTestAccountsData } from "@aztec/accounts/testing"; +import SimpleNFT from "../artifacts/contracts/SimpleNFT.sol/SimpleNFT.json"; +import NFTPortal from "../artifacts/contracts/NFTPortal.sol/NFTPortal.json"; +import { NFTPunkContract } from "../contracts/aztec/artifacts/NFTPunk.js"; +import { NFTBridgeContract } from "../contracts/aztec/artifacts/NFTBridge.js"; + +// Setup L1 clients using anvil's 1st account which should have a ton of ETH already +const l1Account = privateKeyToAccount( + "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" +); +const publicClient = createPublicClient({ + chain: foundry, + transport: http("http://localhost:8545"), +}); +const ethWallet = createWalletClient({ + account: l1Account, + chain: foundry, + transport: http("http://localhost:8545"), +}); + +// Setup L2 using Aztec's local network and one of its initial accounts +console.log("🔮 Setting up L2...\n"); +const node = createAztecNodeClient("http://localhost:8080"); +const aztecWallet = await TestWallet.create(node); +const [accData] = await getInitialTestAccountsData(); +const account = await aztecWallet.createSchnorrAccount( + accData.secret, + accData.salt +); +console.log(`✅ Account: ${account.address.toString()}\n`); + +// Get node info +const nodeInfo = await node.getNodeInfo(); +const registryAddress = nodeInfo.l1ContractAddresses.registryAddress.toString(); +const inboxAddress = nodeInfo.l1ContractAddresses.inboxAddress.toString(); +``` +> Source code: docs/examples/tutorials/token_bridge_contract/scripts/index.ts#L3-L57 + + +You now have wallets for both chains, correctly connected to their respective chains. Next, deploy the L1 contracts: + +```typescript title="deploy_l1_contracts" showLineNumbers +console.log("📦 Deploying L1 contracts...\n"); + +const nftDeploymentHash = await ethWallet.deployContract({ + abi: SimpleNFT.abi, + bytecode: SimpleNFT.bytecode as `0x${string}`, +}); +const nftReceipt = await publicClient.waitForTransactionReceipt({ + hash: nftDeploymentHash, +}); +const nftAddress = nftReceipt.contractAddress!; + +const portalDeploymentHash = await ethWallet.deployContract({ + abi: NFTPortal.abi, + bytecode: NFTPortal.bytecode as `0x${string}`, +}); +const portalReceipt = await publicClient.waitForTransactionReceipt({ + hash: portalDeploymentHash, +}); +const portalAddress = portalReceipt.contractAddress!; + +console.log(`✅ SimpleNFT: ${nftAddress}`); +console.log(`✅ NFTPortal: ${portalAddress}\n`); +``` +> Source code: docs/examples/tutorials/token_bridge_contract/scripts/index.ts#L59-L82 + + +Now deploy the L2 contracts. Thanks to the TypeScript bindings generated with `aztec codegen`, deployment is straightforward: + +```typescript title="deploy_l2_contracts" showLineNumbers +console.log("📦 Deploying L2 contracts...\n"); + +const l2Nft = await NFTPunkContract.deploy(aztecWallet, account.address) + .send({ from: account.address }) + .deployed(); + +const l2Bridge = await NFTBridgeContract.deploy(aztecWallet, l2Nft.address) + .send({ from: account.address }) + .deployed(); + +console.log(`✅ L2 NFT: ${l2Nft.address.toString()}`); +console.log(`✅ L2 Bridge: ${l2Bridge.address.toString()}\n`); +``` +> Source code: docs/examples/tutorials/token_bridge_contract/scripts/index.ts#L84-L97 + + +Now that you have the L2 bridge's contract address, initialize the L1 bridge: + +```typescript title="initialize_portal" showLineNumbers +console.log("🔧 Initializing portal..."); + +const hash = await ethWallet.writeContract({ + address: portalAddress as `0x${string}`, + abi: NFTPortal.abi, + functionName: "initialize", + args: [ + registryAddress as `0x${string}`, + nftAddress as `0x${string}`, + l2Bridge.address.toString() as `0x${string}`, + ], +}); +await publicClient.waitForTransactionReceipt({ hash }); + +console.log("✅ Portal initialized\n"); +``` +> Source code: docs/examples/tutorials/token_bridge_contract/scripts/index.ts#L99-L115 + + +The L2 contracts were already initialized when you deployed them, but you still need to: + +- Tell the L2 bridge about Ethereum's portal address (by calling `set_portal` on the bridge) +- Tell the L2 NFT contract who the minter is (by calling `set_minter` on the L2 NFT contract) + +Complete these initialization steps: + +```typescript title="initialize_l2_bridge" showLineNumbers +console.log("🔧 Setting up L2 bridge..."); + +await l2Bridge.methods + .set_portal(EthAddress.fromString(portalAddress)) + .send({ from: account.address }) + .wait(); + +await l2Nft.methods + .set_minter(l2Bridge.address) + .send({ from: account.address }) + .wait(); + +console.log("✅ Bridge configured\n"); +``` +> Source code: docs/examples/tutorials/token_bridge_contract/scripts/index.ts#L117-L131 + + +This completes the setup. It's a lot of configuration, but you're dealing with four contracts across two chains. + +### L1 → L2 Flow + +Now for the main flow. Mint a CryptoPunk on L1, deposit it to Aztec, and claim it on Aztec. Put everything in the same script. To mint, call the L1 contract with `mint`, which will mint `tokenId = 0`: + +```typescript title="mint_nft_l1" showLineNumbers +console.log("🎨 Minting NFT on L1..."); + +const mintHash = await ethWallet.writeContract({ + address: nftAddress as `0x${string}`, + abi: SimpleNFT.abi, + functionName: "mint", + args: [l1Account.address], +}); +await publicClient.waitForTransactionReceipt({ hash: mintHash }); + +// no need to parse logs, this will be tokenId 0 since it's a fresh contract +const tokenId = 0n; + +console.log(`✅ Minted tokenId: ${tokenId}\n`); +``` +> Source code: docs/examples/tutorials/token_bridge_contract/scripts/index.ts#L133-L148 + + +To bridge, first approve the portal address to transfer the NFT, then transfer it by calling `depositToAztec`: + +```typescript title="deposit_to_aztec" showLineNumbers +console.log("🌉 Depositing NFT to Aztec..."); + +const secret = Fr.random(); +const secretHash = await computeSecretHash(secret); + +const approveHash = await ethWallet.writeContract({ + address: nftAddress as `0x${string}`, + abi: SimpleNFT.abi, + functionName: "approve", + args: [portalAddress as `0x${string}`, tokenId], +}); +await publicClient.waitForTransactionReceipt({ hash: approveHash }); + +const depositHash = await ethWallet.writeContract({ + address: portalAddress as `0x${string}`, + abi: NFTPortal.abi, + functionName: "depositToAztec", + args: [ + tokenId, + pad(secretHash.toString() as `0x${string}`, { dir: "left", size: 32 }), + ], +}); +const depositReceipt = await publicClient.waitForTransactionReceipt({ + hash: depositHash, +}); +``` +> Source code: docs/examples/tutorials/token_bridge_contract/scripts/index.ts#L150-L176 + + +The `Inbox` contract will emit an important log: `MessageSent(inProgress, index, leaf, updatedRollingHash);`. This log provides the **leaf index** of the message in the [L1-L2 Message Tree](../../aztec-nr/framework-description/ethereum-aztec-messaging/index.md)—the location of the message in the tree that will appear on L2. You need this index, plus the secret, to correctly claim and decrypt the message. + +Use viem to extract this information: + +```typescript title="get_message_leaf_index" showLineNumbers +const INBOX_ABI = [ + { + type: "event", + name: "MessageSent", + inputs: [ + { name: "l2BlockNumber", type: "uint256", indexed: true }, + { name: "index", type: "uint256", indexed: false }, + { name: "hash", type: "bytes32", indexed: true }, + { name: "rollingHash", type: "bytes16", indexed: false }, + ], + }, +] as const; +const messageSentTopic = toEventHash(INBOX_ABI[0]); +const messageSentLog = depositReceipt.logs!.find( + (log: any) => + log.address.toLowerCase() === inboxAddress.toLowerCase() && + log.topics[0] === messageSentTopic +); + +const indexHex = messageSentLog!.data!.slice(0, 66); +const messageLeafIndex = new Fr(BigInt(indexHex)); +``` +> Source code: docs/examples/tutorials/token_bridge_contract/scripts/index.ts#L178-L200 + + +This extracts the logs from the deposit and retrieves the leaf index. You can now claim it on L2. However, for security reasons, at least 2 blocks must pass before a message can be claimed on L2. If you called `claim` on the L2 contract immediately, it would return "no message available". + +Add a utility function to mine two blocks (it deploys a contract with a random salt): + +```typescript title="mine_blocks" showLineNumbers +async function mine2Blocks(aztecWallet: TestWallet, accountAddress: any) { + await NFTPunkContract.deploy(aztecWallet, accountAddress) + .send({ from: accountAddress, contractAddressSalt: Fr.random() }) + .deployed(); + await NFTPunkContract.deploy(aztecWallet, accountAddress) + .send({ from: accountAddress, contractAddressSalt: Fr.random() }) + .deployed(); +} +``` +> Source code: docs/examples/tutorials/token_bridge_contract/scripts/index.ts#L202-L211 + + +Now claim the message on L2: + +```typescript title="claim_on_l2" showLineNumbers +// Mine blocks +await mine2Blocks(aztecWallet, account.address); + +// Check notes before claiming (should be 0) +console.log("📝 Checking notes before claim..."); +const notesBefore = await l2Nft.methods + .notes_of(account.address) + .simulate({ from: account.address }); +console.log(` Notes count: ${notesBefore}`); + +console.log("🎯 Claiming NFT on L2..."); +await l2Bridge.methods + .claim(account.address, new Fr(Number(tokenId)), secret, messageLeafIndex) + .send({ from: account.address }) + .wait(); +console.log("✅ NFT claimed on L2\n"); + +// Check notes after claiming (should be 1) +console.log("📝 Checking notes after claim..."); +const notesAfterClaim = await l2Nft.methods + .notes_of(account.address) + .simulate({ from: account.address }); +console.log(` Notes count: ${notesAfterClaim}\n`); +``` +> Source code: docs/examples/tutorials/token_bridge_contract/scripts/index.ts#L213-L237 + + +### L2 → L1 Flow + +Great! You can expand the L2 contract to add features like NFT transfers. For now, exit the NFT on L2 and redeem it on L1. Mine two blocks because of `DelayedMutable`: + +```typescript title="exit_from_l2" showLineNumbers +// L2 → L1 flow +console.log("🚪 Exiting NFT from L2..."); +// Mine blocks, not necessary on devnet, but must wait for 2 blocks +await mine2Blocks(aztecWallet, account.address); + +const recipientEthAddress = EthAddress.fromString(l1Account.address); + +const exitReceipt = await l2Bridge.methods + .exit(new Fr(Number(tokenId)), recipientEthAddress) + .send({ from: account.address }) + .wait(); + +console.log(`✅ Exit message sent (block: ${exitReceipt.blockNumber})\n`); + +// Check notes after burning (should be 0 again) +console.log("📝 Checking notes after burn..."); +const notesAfterBurn = await l2Nft.methods + .notes_of(account.address) + .simulate({ from: account.address }); +console.log(` Notes count: ${notesAfterBurn}\n`); +``` +> Source code: docs/examples/tutorials/token_bridge_contract/scripts/index.ts#L239-L260 + + +Just like in the L1 → L2 flow, you need to know what to claim on L1. Where in the message tree is the message you want to claim? Use the utility `computeL2ToL1MembershipWitness`, which provides the leaf and the sibling path of the message: + +```typescript title="get_withdrawal_witness" showLineNumbers +// Compute the message hash directly from known parameters +// This matches what the portal contract expects: Hash.sha256ToField(abi.encodePacked(tokenId, recipient)) +const tokenIdBuffer = new Fr(Number(tokenId)).toBuffer(); +const recipientBuffer = Buffer.from( + recipientEthAddress.toString().slice(2), + "hex" +); +const content = sha256ToField([ + Buffer.concat([tokenIdBuffer, recipientBuffer]), +]); + +// Get rollup version from the portal contract (it stores it during initialize) +const version = await publicClient.readContract({ + address: portalAddress as `0x${string}`, + abi: NFTPortal.abi, + functionName: "rollupVersion", +}); + +// Compute the L2→L1 message hash +const msgLeaf = computeL2ToL1MessageHash({ + l2Sender: l2Bridge.address, + l1Recipient: EthAddress.fromString(portalAddress), + content, + rollupVersion: new Fr(version), + chainId: new Fr(foundry.id), +}); + +// Wait for the block to be proven before withdrawing +// Waiting for the block to be proven is not necessary on the local network, but it is necessary on devnet +console.log("⏳ Waiting for block to be proven..."); +console.log(` Exit block number: ${exitReceipt.blockNumber}`); + +let provenBlockNumber = await node.getProvenBlockNumber(); +console.log(` Current proven block: ${provenBlockNumber}`); + +while (provenBlockNumber < exitReceipt.blockNumber!) { + console.log( + ` Waiting... (proven: ${provenBlockNumber}, needed: ${exitReceipt.blockNumber})` + ); + await new Promise((resolve) => setTimeout(resolve, 10000)); // Wait 10 seconds + provenBlockNumber = await node.getProvenBlockNumber(); +} + +console.log("✅ Block proven!\n"); + +// Compute the membership witness using the message hash +const witness = await computeL2ToL1MembershipWitness( + node, + exitReceipt.blockNumber!, + msgLeaf +); +const siblingPathHex = witness!.siblingPath + .toBufferArray() + .map((buf: Buffer) => `0x${buf.toString("hex")}` as `0x${string}`); +``` +> Source code: docs/examples/tutorials/token_bridge_contract/scripts/index.ts#L262-L317 + + +With this information, call the L1 contract and use the index and the sibling path to claim the L1 NFT: + +```typescript title="withdraw_on_l1" showLineNumbers +console.log("💰 Withdrawing NFT on L1..."); +const withdrawHash = await ethWallet.writeContract({ + address: portalAddress as `0x${string}`, + abi: NFTPortal.abi, + functionName: "withdraw", + args: [ + tokenId, + BigInt(exitReceipt.blockNumber!), + BigInt(witness!.leafIndex), + siblingPathHex, + ], +}); +await publicClient.waitForTransactionReceipt({ hash: withdrawHash }); +console.log("✅ NFT withdrawn to L1\n"); +``` +> Source code: docs/examples/tutorials/token_bridge_contract/scripts/index.ts#L319-L334 + + +You can now try the whole flow with: + +```typescript +npx hardhat run scripts/index.ts --network localhost +``` + +## What You Built + +A complete private NFT bridge with: + +1. **L1 Contracts** (Solidity) + + - `SimpleNFT`: Basic ERC721 for testing + - `NFTPortal`: Locks/unlocks NFTs and handles L1↔L2 messaging + +2. **L2 Contracts** (Noir) + + - `NFTPunk`: Private NFT with encrypted ownership using `PrivateSet` + - `NFTBridge`: Claims L1 messages and mints NFTs privately + +3. **Full Flow** + - Mint NFT on L1 + - Deploy portal and bridge + - Lock NFT on L1 → message sent to L2 + - Claim on L2 → private NFT minted + - Later: Burn on L2 → message to L1 → unlock + +## Next Steps + +- Add a web frontend for easy bridging +- Implement batch bridging for multiple NFTs +- Add metadata bridging +- Write comprehensive tests +- Add proper access controls + +:::tip Learn More + +- [State management page](../../foundational-topics/state_management.md) +- [Cross-chain messaging](../../aztec-nr/framework-description/ethereum-aztec-messaging/index.md) + ::: diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/tutorials/local_network.md b/docs/developer_versioned_docs/version-v3.0.2/docs/tutorials/local_network.md new file mode 100644 index 000000000000..dd0df308486c --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/tutorials/local_network.md @@ -0,0 +1,205 @@ +--- +title: Run Aztec in a Local Network +sidebar_position: 0 +tags: [local_network, wallet] +description: Information about running the Aztec local network development environment. +--- + + + +- Current version: `v3.0.2` +- Update with `aztec-up` + +On this page you will find + +- [Understanding versions](#versions) +- [How to automatically update Aztec's local network and aztec command](#updating) +- [How to update Aztec.nr packages](#updating-aztecnr-packages) +- [How to update Aztec.js packages](#updating-aztecjs-packages) +- [How to enable client-side proving](#local-network-pxe-proving) + +## Versions + +Aztec tools (local network, nargo), dependencies (Aztec.nr), and sample contracts are constantly being improved. +When developing and referring to example .nr files/snippets, it is helpful to verify the versions of different components (below), and if required keep them in lock-step by [updating](#updating). + +### Dependency versions + +Dependency versions in a contract's `Nargo.toml` file correspond to the `aztec-packages` repository tag `aztec-packages` (filter tags by `aztec`...) + +If you get an error like: `Cannot read file ~/nargo/github.com/AztecProtocol/aztec-packages/...` +Check the `git=` github url, tag, and directory. + +### Example contract versions + +Example contracts serve as a helpful reference between versions of the Aztec.nr framework since they are strictly maintained with each release. + +Code referenced in the documentation is sourced from contracts within [this directory (GitHub link)](https://github.com/AztecProtocol/aztec-packages/tree/v3.0.2/noir-projects/noir-contracts/contracts). + +As in the previous section, the location of the noir contracts moved at version `0.24.0`, from `yarn-project/noir-contracts` before, to `noir-projects/noir-contracts`. + +:::tip +Notice the difference between the sample Counter contract from `0.23.0` to `0.24.0` shows the `note_type_id` was added. + +```shell +diff ~/nargo/github.com/AztecProtocol/v0.23.0/yarn-project/noir-contracts/contracts/test/counter_contract/src/main.nr ~/nargo/github.com/AztecProtocol/v0.24.0/noir-projects/noir-contracts/contracts/test/counter_contract/src/main.nr +``` + +``` +57a58 +> note_type_id: Field, +``` + +::: + +### Language server version + +The [Noir LSP](../aztec-nr/installation.md) uses your local version of `aztec`, and thus also `aztec compile`. +The path of the former (once installed) can be seen by hovering over "Nargo" in the bottom status bar of VS Code, and the latter via the `which aztec` command. + +:::caution +For Aztec contract files, this should be `aztec` and for noir-only files this should be `nargo`. Mismatching tools and file types will generate misleading syntax and compiler errors. +::: + +This can present confusion when opening older contracts (and dependencies) written in older version of noir, such as: + +- Logs filled with errors from the dependencies +- Or the LSP fails (re-runs automatically then stops) + The second point requires a restart of the extension, which you can trigger with the command palette (Ctrl + Shift + P) and typing "Reload Window". + +## Updating + +### Steps to keep up to date + +1. Update the Aztec local network to the latest version (includes `aztec` command, pxe, etc): + +```shell +aztec-up +``` + +To update to a specific version, pass the version number after the `aztec-up` command, or set `VERSION` for a particular git tag, eg for [v**0.77.0**](https://github.com/AztecProtocol/aztec-packages/tree/v0.77.0) + +```shell +aztec-up 0.77.0 +# or +VERSION=0.77.0 aztec-up +``` + +2. Update Aztec.nr and individual @aztec dependencies: + +Inside your project run: + +```shell +cd your/aztec/project +aztec update . --contract src/contract1 --contract src/contract2 +``` + +The local network must be running for the update command to work. Make sure it is [installed and running](../aztec-cli/local-network-reference.md). + +Follow [updating Aztec.nr packages](#updating-aztecnr-packages) and [updating JavaScript packages](#updating-aztecjs-packages) guides. + +3. Refer to [Migration Notes](../resources/migration_notes.md) on any breaking changes that might affect your dapp + +--- + +There are four components whose versions need to be kept compatible: + +1. Aztec local network (includes the `aztec` command) +2. `Aztec.nr`, the Noir framework for writing Aztec contracts + +First three are packaged together in docker and are kept compatible by running `aztec-up`. +But you need to update your Aztec.nr version manually or using `aztec update`. + +## Updating Aztec.nr packages + +### Automatic update + +You can update your Aztec.nr packages to the appropriate version with the `aztec update` command. Run this command from the root of your project and pass the paths to the folders containing the Nargo.toml files for your projects like so: + +```shell +aztec update . --contract src/contract1 --contract src/contract2 +``` + +### Manual update + +To update the aztec.nr packages manually, update the tags of the `aztec.nr` dependencies in the `Nargo.toml` file. + +```diff +[dependencies] +-aztec = { git="https://github.com/AztecProtocol/aztec-packages", tag="v0.7.5", directory="noir-projects/aztec-nr/aztec" } ++aztec = { git="https://github.com/AztecProtocol/aztec-packages", tag="v3.0.2", directory="noir-projects/aztec-nr/aztec" } +-value_note = { git="https://github.com/AztecProtocol/aztec-packages", tag="v0.7.5", directory="noir-projects/aztec-nr/value-note" } ++value_note = { git="https://github.com/AztecProtocol/aztec-packages", tag="v3.0.2", directory="noir-projects/aztec-nr/value-note" } +``` + +Go to the contract directory and try compiling it to verify that the update was successful: + +```shell +cd /your/contract/directory +aztec compile # compiles the contract +``` + +If the dependencies fail to resolve ensure that the tag matches a tag in the [aztec-packages repository (GitHub link)](https://github.com/AztecProtocol/aztec-packages/tags). + +## Updating Aztec.js packages + +To update Aztec.js packages, go to your `package.json` and replace the versions in the dependencies. + +```diff +[dependencies] +-"@aztec/accounts": "0.7.5", ++"@aztec/accounts": "v3.0.2", +-"@aztec/noir-contracts.js": "0.35.1", ++"@aztec/accounts": "v3.0.2", +``` + +## Local Network PXE Proving + +The local network does not have client-side proving in the PXE enabled by default. This reduces testing times and increases development speed by allowing for rapid iteration. + +You may want to enable client-side proving in the local network to better understand how long it takes to execute Aztec transactions. There are 2 ways of doing this: + +1. Run the local network in proving mode (every transaction wil be proved) or +2. Use `aztec-wallet` cli to prove a one-off transaction + +:::note +Proving is much slower and should only be used sparingly to analyze real proving times of executing private functions of a contract. +::: + +### Local Network in Proving Mode + +Here every transaction, contract deployment will be proved. If you want to just prove a single transaction, follow [proving with aztec-wallet cli](#proving-with-aztec-wallet). + +#### Usage + +To enable client-side proving: + +```bash +PXE_PROVER_ENABLED=1 aztec start --local-network +``` + +The local network will take much longer to start. The first time it starts, it will need to download a large crs file, which can take several minutes even on a fast internet connection. This is a one-time operation, you will not need to download it again until you update to a new Aztec version. + +The local network will also deploy 3 Schnorr account contracts on startup. The local network will need to generate transaction proofs for deployment, which will take additional time. + +Once everything has been set up, you will see that the PXE is listening on `localhost:8080` as you would see with the local network running in the default mode. At this point you can use the local network as you would without client-side proving enabled. + +### Proving with `aztec-wallet` + +You can enable proving on a per-transaction basis using the `aztec-wallet` CLI by setting the `PXE_PROVER_ENABLED` environment variable to `1`. This will use your local `bb` binary to prove the transaction. + +```bash +PXE_PROVER_ENABLED=1 aztec-wallet create-account -a test +``` + +Check the [Quickstart](../../getting_started_on_local_network.md) for a refresher on how to send transactions using `aztec-wallet` or check the [reference here](../wallet-cli/cli_wallet_reference.md) + +Note that you do not need to restart the local network in order to start sending proven transactions. You can optionally set this for one-off transactions. + +If this is the first time you are sending transactions with proving enabled, it will take a while to download a CRS file (which is several MBs) that is required for proving. + +:::note +You can also profile your transactions to get gate count, if you don't want to prove your transactions but check how many constraints it is. Follow the [guide here](../aztec-nr/framework-description/advanced/how_to_profile_transactions.md) +::: + +You can learn more about custom commands in the [local network reference](../aztec-cli/local-network-reference.md). diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/wallet-cli/_category_.json b/docs/developer_versioned_docs/version-v3.0.2/docs/wallet-cli/_category_.json new file mode 100644 index 000000000000..9bcac906fada --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/wallet-cli/_category_.json @@ -0,0 +1,6 @@ +{ + "label": "Wallet CLI", + "position": 5, + "collapsible": true, + "collapsed": true +} diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/wallet-cli/cli_wallet_reference.md b/docs/developer_versioned_docs/version-v3.0.2/docs/wallet-cli/cli_wallet_reference.md new file mode 100644 index 000000000000..76d9cfe1b195 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/wallet-cli/cli_wallet_reference.md @@ -0,0 +1,524 @@ +--- +title: Reference +description: Comprehensive auto-generated reference for the Aztec Wallet CLI command-line interface with all commands and options. +tags: [cli, reference, autogenerated, wallet] +sidebar_position: 10 +--- + +# Reference + +*This documentation is auto-generated from the `aztec-wallet` CLI help output.* + + +*Generated: Wed Dec 10 21:36:08 -03 2025* + +*Command: `aztec-wallet`* + +## Table of Contents + +- [aztec-wallet](#aztec-wallet) + - [aztec-wallet import-test-accounts](#aztec-wallet-import-test-accounts) + - [aztec-wallet create-account](#aztec-wallet-create-account) + - [aztec-wallet deploy-account](#aztec-wallet-deploy-account) + - [aztec-wallet deploy](#aztec-wallet-deploy) + - [aztec-wallet send](#aztec-wallet-send) + - [aztec-wallet simulate](#aztec-wallet-simulate) + - [aztec-wallet profile](#aztec-wallet-profile) + - [aztec-wallet bridge-fee-juice](#aztec-wallet-bridge-fee-juice) + - [aztec-wallet create-authwit](#aztec-wallet-create-authwit) + - [aztec-wallet authorize-action](#aztec-wallet-authorize-action) + - [aztec-wallet get-tx](#aztec-wallet-get-tx) + - [aztec-wallet register-sender](#aztec-wallet-register-sender) + - [aztec-wallet register-contract](#aztec-wallet-register-contract) + - [aztec-wallet alias](#aztec-wallet-alias) + - [aztec-wallet get-alias](#aztec-wallet-get-alias) + - [aztec-wallet create-secret](#aztec-wallet-create-secret) +## aztec-wallet + +Aztec wallet + +**Usage:** +```bash +wallet [options] [command] +``` + +**Available Commands:** + +- `import-test-accounts [options]` - Import test accounts from pxe. +- `create-account [options]` - Creates an aztec account that can be used for sending transactions. +- `deploy-account [options]
` - Deploys an already registered aztec account that can be used for sending transactions. +- `deploy [options] [artifact]` - Deploys a compiled Aztec.nr contract to Aztec. +- `send [options] ` - Calls a function on an Aztec contract. +- `simulate [options] ` - Simulates the execution of a function on an Aztec contract. +- `profile [options] ` - Profiles a private function by counting the unconditional operations in its execution steps +- `bridge-fee-juice [options] ` - Mints L1 Fee Juice and pushes them to L2. +- `create-authwit [options] ` - Creates an authorization witness that can be privately sent to a caller so they can perform an action on behalf of the provided account +- `authorize-action [options] ` - Authorizes a public call on the caller, so they can perform an action on behalf of the provided account +- `get-tx [options] [txHash]` - Gets the status of the recent txs, or a detailed view if a specific transaction hash is provided +- `register-sender [options] [address]` - Registers a sender's address in the wallet, so the note synching process will look for notes sent by them +- `register-contract [options] [address] [artifact]` - Registers a contract in this wallet's PXE +- `alias ` - Aliases information for easy reference. +- `get-alias [alias]` - Shows stored aliases +- `create-secret [options]` - Creates an aliased secret to use in other commands +- `help [command]` - display help for command + +**Options:** + +- `-V --version` - output the version number +- `-d --data-dir ` - Storage directory for wallet data (default: "/Users/aztec/.aztec/wallet") +- `-p --prover ` - The type of prover the wallet uses (choices: "wasm", "native", "none", default: "native", env: PXE_PROVER) +- `-n --node-url ` - URL of the Aztec node to connect to (default: "http://host.docker.internal:8080", env: AZTEC_NODE_URL) +- `-h --help` - display help for command + + +### Subcommands + +### aztec-wallet import-test-accounts + +``` +Usage: wallet import-test-accounts [options] + +Import test accounts from pxe. + +Options: + --json Emit output as json + -h, --help display help for command +2025/12/10 21:36:09 socat[62917] E exactly 2 addresses required (there are 3); use option "-h" for help + +``` + +### aztec-wallet create-account + +``` +Usage: wallet create-account [options] + +Creates an aztec account that can be used for sending transactions. Registers +the account on the PXE and deploys an account contract. Uses a Schnorr +single-key account which uses the same key for encryption and authentication +(not secure for production usage). + +Options: + -f, --from Alias or address of the account performing the deployment + --skip-initialization Skip initializing the account contract. Useful for publicly deploying an existing account. + --public-deploy Publishes the account contract instance (and the class, if needed). Needed if the contract contains public functions. + --register-class Register the contract class (useful for when the contract class has not been deployed yet). + -p, --public-key Public key that identifies a private signing key stored outside of the wallet. Used for ECDSA SSH accounts over the secp256r1 curve. + -sk, --secret-key Secret key for account. Uses random by default. (env: SECRET_KEY) + -a, --alias Alias for the account. Used for easy reference in subsequent commands. + -t, --type Type of account to create (choices: "schnorr", "ecdsasecp256r1", "ecdsasecp256r1ssh", "ecdsasecp256k1", default: "schnorr") + --register-only Just register the account on the Wallet. Do not deploy or initialize the account contract. + --json Emit output as json + --no-wait Skip waiting for the contract to be deployed. Print the hash of deployment transaction + -v, --verbose Provide timings on all executed operations (synching, simulating, proving) (default: false) + --payment Fee payment method and arguments. + Parameters: + method Valid values: "fee_juice", "fpc-public", "fpc-private", "fpc-sponsored" Default: fee_juice + asset The asset used for fee payment. Required for "fpc-public" and "fpc-private". + fpc The FPC contract that pays in fee juice. Not required for the "fee_juice" method. + claim Whether to use a previously stored claim to bridge fee juice. + claimSecret The secret to claim fee juice on L1. + claimAmount The amount of fee juice to be claimed. + messageLeafIndex The index of the claim in the l1toL2Message tree. + Format: --payment method=name,asset=address,fpc=address ... + --gas-limits Gas limits for the tx. + --max-fees-per-gas Maximum fees per gas unit for DA and L2 computation. + --max-priority-fees-per-gas Maximum priority fees per gas unit for DA and L2 computation. + --estimate-gas-only Only report gas estimation for the tx, do not send it. + -h, --help display help for command +2025/12/10 21:36:10 socat[62945] E exactly 2 addresses required (there are 3); use option "-h" for help + +``` + +### aztec-wallet deploy-account + +``` +Usage: wallet deploy-account [options]
+ +Deploys an already registered aztec account that can be used for sending +transactions. + +Arguments: + address The address of the contract to register + +Options: + -f, --from Alias or address of the account performing the deployment + --json Emit output as json + --no-wait Skip waiting for the contract to be deployed. Print the hash of deployment transaction + --register-class Register the contract class (useful for when the contract class has not been deployed yet). + --public-deploy Publishes the account contract instance (and the class, if needed). Needed if the contract contains public functions. + --skip-initialization Skip initializing the account contract. Useful for publicly deploying an existing account. + -v, --verbose Provide timings on all executed operations (synching, simulating, proving) (default: false) + --payment Fee payment method and arguments. + Parameters: + method Valid values: "fee_juice", "fpc-public", "fpc-private", "fpc-sponsored" Default: fee_juice + asset The asset used for fee payment. Required for "fpc-public" and "fpc-private". + fpc The FPC contract that pays in fee juice. Not required for the "fee_juice" method. + claim Whether to use a previously stored claim to bridge fee juice. + claimSecret The secret to claim fee juice on L1. + claimAmount The amount of fee juice to be claimed. + messageLeafIndex The index of the claim in the l1toL2Message tree. + Format: --payment method=name,asset=address,fpc=address ... + --gas-limits Gas limits for the tx. + --max-fees-per-gas Maximum fees per gas unit for DA and L2 computation. + --max-priority-fees-per-gas Maximum priority fees per gas unit for DA and L2 computation. + --estimate-gas-only Only report gas estimation for the tx, do not send it. + -h, --help display help for command +2025/12/10 21:36:11 socat[62955] E exactly 2 addresses required (there are 3); use option "-h" for help + +``` + +### aztec-wallet deploy + +``` +Usage: wallet deploy [options] [artifact] + +Deploys a compiled Aztec.nr contract to Aztec. + +Arguments: + artifact Path to a compiled Aztec contract's artifact in JSON format. If executed inside a nargo workspace, a package and contract name can be specified as package@contract + +Options: + --init The contract initializer function to call (default: "constructor") + --no-init Leave the contract uninitialized + -k, --public-key Optional encryption public key for this address. Set this value only if this contract is expected to receive private notes, which will be encrypted using this public key. + -s, --salt Optional deployment salt as a hex string for generating the deployment address. + --universal Do not mix the sender address into the deployment. + --args [args...] Constructor arguments (default: []) + -f, --from Alias or address of the account to deploy from + -a, --alias Alias for the contract. Used for easy reference subsequent commands. + --json Emit output as json + --no-wait Skip waiting for the contract to be deployed. Print the hash of deployment transaction + --no-class-registration Don't register this contract class + --no-public-deployment Don't emit this contract's public bytecode + --timeout The amount of time in seconds to wait for the deployment to post to L2 + -v, --verbose Provide timings on all executed operations (synching, simulating, proving) (default: false) + --payment Fee payment method and arguments. + Parameters: + method Valid values: "fee_juice", "fpc-public", "fpc-private", "fpc-sponsored" Default: fee_juice + asset The asset used for fee payment. Required for "fpc-public" and "fpc-private". + fpc The FPC contract that pays in fee juice. Not required for the "fee_juice" method. + claim Whether to use a previously stored claim to bridge fee juice. + claimSecret The secret to claim fee juice on L1. + claimAmount The amount of fee juice to be claimed. + messageLeafIndex The index of the claim in the l1toL2Message tree. + Format: --payment method=name,asset=address,fpc=address ... + --gas-limits Gas limits for the tx. + --max-fees-per-gas Maximum fees per gas unit for DA and L2 computation. + --max-priority-fees-per-gas Maximum priority fees per gas unit for DA and L2 computation. + --estimate-gas-only Only report gas estimation for the tx, do not send it. + -h, --help display help for command +2025/12/10 21:36:12 socat[62985] E exactly 2 addresses required (there are 3); use option "-h" for help + +``` + +### aztec-wallet send + +``` +Usage: wallet send [options] + +Calls a function on an Aztec contract. + +Arguments: + functionName Name of function to execute + +Options: + --args [args...] Function arguments (default: []) + -c, --contract-artifact Path to a compiled Aztec contract's artifact in JSON format. If executed inside a nargo workspace, a package and contract name can be specified as package@contract + -ca, --contract-address
Aztec address of the contract. + -a, --alias Alias for the transaction hash. Used for easy reference in subsequent commands. + -aw, --auth-witness Authorization witness to use for the transaction. If using multiple, pass a comma separated string + -f, --from Alias or address of the account to send the transaction from + --no-wait Print transaction hash without waiting for it to be mined + -v, --verbose Provide timings on all executed operations (synching, simulating, proving) (default: false) + --payment Fee payment method and arguments. + Parameters: + method Valid values: "fee_juice", "fpc-public", "fpc-private", "fpc-sponsored" Default: fee_juice + asset The asset used for fee payment. Required for "fpc-public" and "fpc-private". + fpc The FPC contract that pays in fee juice. Not required for the "fee_juice" method. + claim Whether to use a previously stored claim to bridge fee juice. + claimSecret The secret to claim fee juice on L1. + claimAmount The amount of fee juice to be claimed. + messageLeafIndex The index of the claim in the l1toL2Message tree. + Format: --payment method=name,asset=address,fpc=address ... + --gas-limits Gas limits for the tx. + --max-fees-per-gas Maximum fees per gas unit for DA and L2 computation. + --max-priority-fees-per-gas Maximum priority fees per gas unit for DA and L2 computation. + --estimate-gas-only Only report gas estimation for the tx, do not send it. + -h, --help display help for command +2025/12/10 21:36:13 socat[62995] E exactly 2 addresses required (there are 3); use option "-h" for help + +``` + +### aztec-wallet simulate + +``` +Usage: wallet simulate [options] + +Simulates the execution of a function on an Aztec contract. + +Arguments: + functionName Name of function to simulate + +Options: + --args [args...] Function arguments (default: []) + -ca, --contract-address
Aztec address of the contract. + -c, --contract-artifact Path to a compiled Aztec contract's artifact in JSON format. If executed inside a nargo workspace, a package and contract name can be specified as package@contract + -sk, --secret-key The sender's secret key (env: SECRET_KEY) + -aw, --auth-witness Authorization witness to use for the simulation + -f, --from Alias or address of the account to simulate from + -v, --verbose Provide timings on all executed operations (synching, simulating, proving) (default: false) + --payment Fee payment method and arguments. + Parameters: + method Valid values: "fee_juice", "fpc-public", "fpc-private", "fpc-sponsored" Default: fee_juice + asset The asset used for fee payment. Required for "fpc-public" and "fpc-private". + fpc The FPC contract that pays in fee juice. Not required for the "fee_juice" method. + claim Whether to use a previously stored claim to bridge fee juice. + claimSecret The secret to claim fee juice on L1. + claimAmount The amount of fee juice to be claimed. + messageLeafIndex The index of the claim in the l1toL2Message tree. + Format: --payment method=name,asset=address,fpc=address ... + --gas-limits Gas limits for the tx. + --max-fees-per-gas Maximum fees per gas unit for DA and L2 computation. + --max-priority-fees-per-gas Maximum priority fees per gas unit for DA and L2 computation. + --estimate-gas-only Only report gas estimation for the tx, do not send it. + -h, --help display help for command +2025/12/10 21:36:14 socat[63023] E exactly 2 addresses required (there are 3); use option "-h" for help + +``` + +### aztec-wallet profile + +``` +Usage: wallet profile [options] + +Profiles a private function by counting the unconditional operations in its +execution steps + +Arguments: + functionName Name of function to simulate + +Options: + --args [args...] Function arguments (default: []) + -ca, --contract-address
Aztec address of the contract. + -c, --contract-artifact Path to a compiled Aztec contract's artifact in JSON format. If executed inside a nargo workspace, a package and contract name can be specified as package@contract + --debug-execution-steps-dir
Directory to write execution step artifacts for bb profiling/debugging. + -aw, --auth-witness Authorization witness to use for the simulation + -f, --from Alias or address of the account to simulate from + --payment Fee payment method and arguments. + Parameters: + method Valid values: "fee_juice", "fpc-public", "fpc-private", "fpc-sponsored" Default: fee_juice + asset The asset used for fee payment. Required for "fpc-public" and "fpc-private". + fpc The FPC contract that pays in fee juice. Not required for the "fee_juice" method. + claim Whether to use a previously stored claim to bridge fee juice. + claimSecret The secret to claim fee juice on L1. + claimAmount The amount of fee juice to be claimed. + messageLeafIndex The index of the claim in the l1toL2Message tree. + Format: --payment method=name,asset=address,fpc=address ... + --gas-limits Gas limits for the tx. + --max-fees-per-gas Maximum fees per gas unit for DA and L2 computation. + --max-priority-fees-per-gas Maximum priority fees per gas unit for DA and L2 computation. + --estimate-gas-only Only report gas estimation for the tx, do not send it. + -h, --help display help for command +2025/12/10 21:36:15 socat[63033] E exactly 2 addresses required (there are 3); use option "-h" for help + +``` + +### aztec-wallet bridge-fee-juice + +``` +Usage: wallet bridge-fee-juice [options] + +Mints L1 Fee Juice and pushes them to L2. + +Arguments: + amount The amount of Fee Juice to mint and bridge. + recipient Aztec address of the recipient. + +Options: + --l1-rpc-urls List of Ethereum host URLs. Chain identifiers + localhost and testnet can be used (comma + separated) (default: + ["http://host.docker.internal:8545"]) + -m, --mnemonic The mnemonic to use for deriving the Ethereum + address that will mint and bridge (default: "test + test test test test test test test test test test + junk") + --mint Mint the tokens on L1 (default: false) + --l1-private-key The private key to the eth account bridging + -c, --l1-chain-id Chain ID of the ethereum host (default: 31337, + env: L1_CHAIN_ID) + --json Output the claim in JSON format + --no-wait Wait for the bridged funds to be available in L2, + polling every 60 seconds + --interval The polling interval in seconds for the bridged + funds (default: "60") + -h, --help display help for command +2025/12/10 21:36:16 socat[63061] E exactly 2 addresses required (there are 3); use option "-h" for help + +``` + +### aztec-wallet create-authwit + +``` +Usage: wallet create-authwit [options] + +Creates an authorization witness that can be privately sent to a caller so they +can perform an action on behalf of the provided account + +Arguments: + functionName Name of function to authorize + caller Account to be authorized to perform the action + +Options: + --args [args...] Function arguments (default: []) + -ca, --contract-address
Aztec address of the contract. + -c, --contract-artifact Path to a compiled Aztec contract's artifact in JSON format. If executed inside a nargo workspace, a package and contract name can be specified as package@contract + -f, --from Alias or address of the account to simulate from + -a, --alias Alias for the authorization witness. Used for easy reference in subsequent commands. + -h, --help display help for command +2025/12/10 21:36:17 socat[63079] E exactly 2 addresses required (there are 3); use option "-h" for help + +``` + +### aztec-wallet authorize-action + +``` +Usage: wallet authorize-action [options] + +Authorizes a public call on the caller, so they can perform an action on behalf +of the provided account + +Arguments: + functionName Name of function to authorize + caller Account to be authorized to perform the action + +Options: + --args [args...] Function arguments (default: []) + -ca, --contract-address
Aztec address of the contract. + -c, --contract-artifact Path to a compiled Aztec contract's artifact in JSON format. If executed inside a nargo workspace, a package and contract name can be specified as package@contract + -f, --from Alias or address of the account to simulate from + -h, --help display help for command +2025/12/10 21:36:18 socat[63107] E exactly 2 addresses required (there are 3); use option "-h" for help + +``` + +### aztec-wallet get-tx + +``` +Usage: wallet get-tx [options] [txHash] + +Gets the status of the recent txs, or a detailed view if a specific transaction +hash is provided + +Arguments: + txHash A transaction hash to get the receipt for. + +Options: + -p, --page The page number to display (default: 1) + -s, --page-size The number of transactions to display per page + (default: 10) + -h, --help display help for command +2025/12/10 21:36:19 socat[63117] E exactly 2 addresses required (there are 3); use option "-h" for help + +``` + +### aztec-wallet register-sender + +``` +Usage: wallet register-sender [options] [address] + +Registers a sender's address in the wallet, so the note synching process will +look for notes sent by them + +Arguments: + address The address of the sender to register + +Options: + -a, --alias Alias for the sender. Used for easy reference in + subsequent commands. + -h, --help display help for command +2025/12/10 21:36:20 socat[63127] E exactly 2 addresses required (there are 3); use option "-h" for help + +``` + +### aztec-wallet register-contract + +``` +Usage: wallet register-contract [options] [address] [artifact] + +Registers a contract in this wallet's PXE + +Arguments: + address The address of the contract to register + artifact Path to a compiled Aztec contract's artifact in + JSON format. If executed inside a nargo workspace, + a package and contract name can be specified as + package@contract + +Options: + --init The contract initializer function to call + (default: "constructor") + -k, --public-key Optional encryption public key for this address. + Set this value only if this contract is expected + to receive private notes, which will be encrypted + using this public key. + -s, --salt Optional deployment salt as a hex string for + generating the deployment address. + --deployer The address of the account that deployed the + contract + --args [args...] Constructor arguments (default: []) + -a, --alias Alias for the contact. Used for easy reference in + subsequent commands. + -h, --help display help for command +2025/12/10 21:36:21 socat[63155] E exactly 2 addresses required (there are 3); use option "-h" for help + +``` + +### aztec-wallet alias + +``` +Usage: wallet alias [options] + +Aliases information for easy reference. + +Arguments: + type Type of alias to create (choices: "accounts", "contracts", + "artifacts", "secrets", "transactions", "authwits") + key Key to alias. + value Value to assign to the alias. + +Options: + -h, --help display help for command +2025/12/10 21:36:21 socat[63165] E exactly 2 addresses required (there are 3); use option "-h" for help + +``` + +### aztec-wallet get-alias + +``` +Usage: wallet get-alias [options] [alias] + +Shows stored aliases + +Arguments: + alias Alias to retrieve + +Options: + -h, --help display help for command +2025/12/10 21:36:22 socat[63195] E exactly 2 addresses required (there are 3); use option "-h" for help + +``` + +### aztec-wallet create-secret + +``` +Usage: wallet create-secret [options] + +Creates an aliased secret to use in other commands + +Options: + -a, --alias Key to alias the secret with + -h, --help display help for command +2025/12/10 21:36:23 socat[63205] E exactly 2 addresses required (there are 3); use option "-h" for help + +``` diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/wallet-cli/cli_wallet_reference_autogen.md b/docs/developer_versioned_docs/version-v3.0.2/docs/wallet-cli/cli_wallet_reference_autogen.md new file mode 100644 index 000000000000..0c379401bce8 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/wallet-cli/cli_wallet_reference_autogen.md @@ -0,0 +1,528 @@ +--- +title: Aztec Wallet CLI Reference (Auto-generated) +description: Comprehensive auto-generated reference for the Aztec Wallet CLI command-line interface with all commands and options. +tags: [cli, reference, autogenerated, wallet] +sidebar_position: 10 +--- + +# Aztec Wallet CLI Reference + +*This documentation is auto-generated from the `aztec-wallet` CLI help output.* + +:::info +This is an auto-generated reference. For a more curated guide with examples and best practices, see the [manual Aztec Wallet CLI reference](cli_wallet_reference.md). +::: + + +*Generated: Thu Nov 6 02:38:33 HKT 2025* + +*Command: `aztec-wallet`* + +## Table of Contents + +- [aztec-wallet](#aztec-wallet) + - [aztec-wallet import-test-accounts](#aztec-wallet-import-test-accounts) + - [aztec-wallet create-account](#aztec-wallet-create-account) + - [aztec-wallet deploy-account](#aztec-wallet-deploy-account) + - [aztec-wallet deploy](#aztec-wallet-deploy) + - [aztec-wallet send](#aztec-wallet-send) + - [aztec-wallet simulate](#aztec-wallet-simulate) + - [aztec-wallet profile](#aztec-wallet-profile) + - [aztec-wallet bridge-fee-juice](#aztec-wallet-bridge-fee-juice) + - [aztec-wallet create-authwit](#aztec-wallet-create-authwit) + - [aztec-wallet authorize-action](#aztec-wallet-authorize-action) + - [aztec-wallet get-tx](#aztec-wallet-get-tx) + - [aztec-wallet register-sender](#aztec-wallet-register-sender) + - [aztec-wallet register-contract](#aztec-wallet-register-contract) + - [aztec-wallet alias](#aztec-wallet-alias) + - [aztec-wallet get-alias](#aztec-wallet-get-alias) + - [aztec-wallet create-secret](#aztec-wallet-create-secret) +## aztec-wallet + +Aztec wallet + +**Usage:** +```bash +wallet [options] [command] +``` + +**Available Commands:** + +- `import-test-accounts [options]` - Import test accounts from pxe. +- `create-account [options]` - Creates an aztec account that can be used for sending transactions. +- `deploy-account [options]
` - Deploys an already registered aztec account that can be used for sending transactions. +- `deploy [options] [artifact]` - Deploys a compiled Aztec.nr contract to Aztec. +- `send [options] ` - Calls a function on an Aztec contract. +- `simulate [options] ` - Simulates the execution of a function on an Aztec contract. +- `profile [options] ` - Profiles a private function by counting the unconditional operations in its execution steps +- `bridge-fee-juice [options] ` - Mints L1 Fee Juice and pushes them to L2. +- `create-authwit [options] ` - Creates an authorization witness that can be privately sent to a caller so they can perform an action on behalf of the provided account +- `authorize-action [options] ` - Authorizes a public call on the caller, so they can perform an action on behalf of the provided account +- `get-tx [options] [txHash]` - Gets the status of the recent txs, or a detailed view if a specific transaction hash is provided +- `register-sender [options] [address]` - Registers a sender's address in the wallet, so the note synching process will look for notes sent by them +- `register-contract [options] [address] [artifact]` - Registers a contract in this wallet's PXE +- `alias ` - Aliases information for easy reference. +- `get-alias [alias]` - Shows stored aliases +- `create-secret [options]` - Creates an aliased secret to use in other commands +- `help [command]` - display help for command + +**Options:** + +- `-V --version` - output the version number +- `-d --data-dir ` - Storage directory for wallet data (default: "/Users/aztec/.aztec/wallet") +- `-p --prover ` - The type of prover the wallet uses (choices: "wasm", "native", "none", default: "native", env: PXE_PROVER) +- `-n --node-url ` - URL of the Aztec node to connect to (default: "http://host.docker.internal:8080", env: AZTEC_NODE_URL) +- `-h --help` - display help for command + + +### Subcommands + +### aztec-wallet import-test-accounts + +``` +Usage: wallet import-test-accounts [options] + +Import test accounts from pxe. + +Options: + --json Emit output as json + -h, --help display help for command +2025/11/06 02:38:35 socat[72638] E bind(5, {LEN=16 AF=2 0.0.0.0:12345}, 16): Address already in use + +``` + +### aztec-wallet create-account + +``` +Usage: wallet create-account [options] + +Creates an aztec account that can be used for sending transactions. Registers +the account on the PXE and deploys an account contract. Uses a Schnorr +single-key account which uses the same key for encryption and authentication +(not secure for production usage). + +Options: + -f, --from Alias or address of the account performing the deployment + --skip-initialization Skip initializing the account contract. Useful for publicly deploying an existing account. + --public-deploy Publishes the account contract instance (and the class, if needed). Needed if the contract contains public functions. + --register-class Register the contract class (useful for when the contract class has not been deployed yet). + -p, --public-key Public key that identifies a private signing key stored outside of the wallet. Used for ECDSA SSH accounts over the secp256r1 curve. + -sk, --secret-key Secret key for account. Uses random by default. (env: SECRET_KEY) + -a, --alias Alias for the account. Used for easy reference in subsequent commands. + -t, --type Type of account to create (choices: "schnorr", "ecdsasecp256r1", "ecdsasecp256r1ssh", "ecdsasecp256k1", default: "schnorr") + --register-only Just register the account on the Wallet. Do not deploy or initialize the account contract. + --json Emit output as json + --no-wait Skip waiting for the contract to be deployed. Print the hash of deployment transaction + -v, --verbose Provide timings on all executed operations (synching, simulating, proving) (default: false) + --payment Fee payment method and arguments. + Parameters: + method Valid values: "fee_juice", "fpc-public", "fpc-private", "fpc-sponsored" Default: fee_juice + asset The asset used for fee payment. Required for "fpc-public" and "fpc-private". + fpc The FPC contract that pays in fee juice. Not required for the "fee_juice" method. + claim Whether to use a previously stored claim to bridge fee juice. + claimSecret The secret to claim fee juice on L1. + claimAmount The amount of fee juice to be claimed. + messageLeafIndex The index of the claim in the l1toL2Message tree. + Format: --payment method=name,asset=address,fpc=address ... + --gas-limits Gas limits for the tx. + --max-fees-per-gas Maximum fees per gas unit for DA and L2 computation. + --max-priority-fees-per-gas Maximum priority fees per gas unit for DA and L2 computation. + --estimate-gas-only Only report gas estimation for the tx, do not send it. + -h, --help display help for command +2025/11/06 02:38:37 socat[72822] E bind(5, {LEN=16 AF=2 0.0.0.0:12345}, 16): Address already in use + +``` + +### aztec-wallet deploy-account + +``` +Usage: wallet deploy-account [options]
+ +Deploys an already registered aztec account that can be used for sending +transactions. + +Arguments: + address The address of the contract to register + +Options: + -f, --from Alias or address of the account performing the deployment + --json Emit output as json + --no-wait Skip waiting for the contract to be deployed. Print the hash of deployment transaction + --register-class Register the contract class (useful for when the contract class has not been deployed yet). + --public-deploy Publishes the account contract instance (and the class, if needed). Needed if the contract contains public functions. + --skip-initialization Skip initializing the account contract. Useful for publicly deploying an existing account. + -v, --verbose Provide timings on all executed operations (synching, simulating, proving) (default: false) + --payment Fee payment method and arguments. + Parameters: + method Valid values: "fee_juice", "fpc-public", "fpc-private", "fpc-sponsored" Default: fee_juice + asset The asset used for fee payment. Required for "fpc-public" and "fpc-private". + fpc The FPC contract that pays in fee juice. Not required for the "fee_juice" method. + claim Whether to use a previously stored claim to bridge fee juice. + claimSecret The secret to claim fee juice on L1. + claimAmount The amount of fee juice to be claimed. + messageLeafIndex The index of the claim in the l1toL2Message tree. + Format: --payment method=name,asset=address,fpc=address ... + --gas-limits Gas limits for the tx. + --max-fees-per-gas Maximum fees per gas unit for DA and L2 computation. + --max-priority-fees-per-gas Maximum priority fees per gas unit for DA and L2 computation. + --estimate-gas-only Only report gas estimation for the tx, do not send it. + -h, --help display help for command +2025/11/06 02:38:39 socat[73008] E bind(5, {LEN=16 AF=2 0.0.0.0:12345}, 16): Address already in use + +``` + +### aztec-wallet deploy + +``` +Usage: wallet deploy [options] [artifact] + +Deploys a compiled Aztec.nr contract to Aztec. + +Arguments: + artifact Path to a compiled Aztec contract's artifact in JSON format. If executed inside a nargo workspace, a package and contract name can be specified as package@contract + +Options: + --init The contract initializer function to call (default: "constructor") + --no-init Leave the contract uninitialized + -k, --public-key Optional encryption public key for this address. Set this value only if this contract is expected to receive private notes, which will be encrypted using this public key. + -s, --salt Optional deployment salt as a hex string for generating the deployment address. + --universal Do not mix the sender address into the deployment. + --args [args...] Constructor arguments (default: []) + -f, --from Alias or address of the account to deploy from + -a, --alias Alias for the contract. Used for easy reference subsequent commands. + --json Emit output as json + --no-wait Skip waiting for the contract to be deployed. Print the hash of deployment transaction + --no-class-registration Don't register this contract class + --no-public-deployment Don't emit this contract's public bytecode + --timeout The amount of time in seconds to wait for the deployment to post to L2 + -v, --verbose Provide timings on all executed operations (synching, simulating, proving) (default: false) + --payment Fee payment method and arguments. + Parameters: + method Valid values: "fee_juice", "fpc-public", "fpc-private", "fpc-sponsored" Default: fee_juice + asset The asset used for fee payment. Required for "fpc-public" and "fpc-private". + fpc The FPC contract that pays in fee juice. Not required for the "fee_juice" method. + claim Whether to use a previously stored claim to bridge fee juice. + claimSecret The secret to claim fee juice on L1. + claimAmount The amount of fee juice to be claimed. + messageLeafIndex The index of the claim in the l1toL2Message tree. + Format: --payment method=name,asset=address,fpc=address ... + --gas-limits Gas limits for the tx. + --max-fees-per-gas Maximum fees per gas unit for DA and L2 computation. + --max-priority-fees-per-gas Maximum priority fees per gas unit for DA and L2 computation. + --estimate-gas-only Only report gas estimation for the tx, do not send it. + -h, --help display help for command +2025/11/06 02:38:40 socat[73175] E bind(5, {LEN=16 AF=2 0.0.0.0:12345}, 16): Address already in use + +``` + +### aztec-wallet send + +``` +Usage: wallet send [options] + +Calls a function on an Aztec contract. + +Arguments: + functionName Name of function to execute + +Options: + --args [args...] Function arguments (default: []) + -c, --contract-artifact Path to a compiled Aztec contract's artifact in JSON format. If executed inside a nargo workspace, a package and contract name can be specified as package@contract + -ca, --contract-address
Aztec address of the contract. + -a, --alias Alias for the transaction hash. Used for easy reference in subsequent commands. + -aw, --auth-witness Authorization witness to use for the transaction. If using multiple, pass a comma separated string + -f, --from Alias or address of the account to send the transaction from + --no-wait Print transaction hash without waiting for it to be mined + -v, --verbose Provide timings on all executed operations (synching, simulating, proving) (default: false) + --payment Fee payment method and arguments. + Parameters: + method Valid values: "fee_juice", "fpc-public", "fpc-private", "fpc-sponsored" Default: fee_juice + asset The asset used for fee payment. Required for "fpc-public" and "fpc-private". + fpc The FPC contract that pays in fee juice. Not required for the "fee_juice" method. + claim Whether to use a previously stored claim to bridge fee juice. + claimSecret The secret to claim fee juice on L1. + claimAmount The amount of fee juice to be claimed. + messageLeafIndex The index of the claim in the l1toL2Message tree. + Format: --payment method=name,asset=address,fpc=address ... + --gas-limits Gas limits for the tx. + --max-fees-per-gas Maximum fees per gas unit for DA and L2 computation. + --max-priority-fees-per-gas Maximum priority fees per gas unit for DA and L2 computation. + --estimate-gas-only Only report gas estimation for the tx, do not send it. + -h, --help display help for command +2025/11/06 02:38:42 socat[73359] E bind(5, {LEN=16 AF=2 0.0.0.0:12345}, 16): Address already in use + +``` + +### aztec-wallet simulate + +``` +Usage: wallet simulate [options] + +Simulates the execution of a function on an Aztec contract. + +Arguments: + functionName Name of function to simulate + +Options: + --args [args...] Function arguments (default: []) + -ca, --contract-address
Aztec address of the contract. + -c, --contract-artifact Path to a compiled Aztec contract's artifact in JSON format. If executed inside a nargo workspace, a package and contract name can be specified as package@contract + -sk, --secret-key The sender's secret key (env: SECRET_KEY) + -aw, --auth-witness Authorization witness to use for the simulation + -f, --from Alias or address of the account to simulate from + -v, --verbose Provide timings on all executed operations (synching, simulating, proving) (default: false) + --payment Fee payment method and arguments. + Parameters: + method Valid values: "fee_juice", "fpc-public", "fpc-private", "fpc-sponsored" Default: fee_juice + asset The asset used for fee payment. Required for "fpc-public" and "fpc-private". + fpc The FPC contract that pays in fee juice. Not required for the "fee_juice" method. + claim Whether to use a previously stored claim to bridge fee juice. + claimSecret The secret to claim fee juice on L1. + claimAmount The amount of fee juice to be claimed. + messageLeafIndex The index of the claim in the l1toL2Message tree. + Format: --payment method=name,asset=address,fpc=address ... + --gas-limits Gas limits for the tx. + --max-fees-per-gas Maximum fees per gas unit for DA and L2 computation. + --max-priority-fees-per-gas Maximum priority fees per gas unit for DA and L2 computation. + --estimate-gas-only Only report gas estimation for the tx, do not send it. + -h, --help display help for command +2025/11/06 02:38:44 socat[73475] E bind(5, {LEN=16 AF=2 0.0.0.0:12345}, 16): Address already in use + +``` + +### aztec-wallet profile + +``` +Usage: wallet profile [options] + +Profiles a private function by counting the unconditional operations in its +execution steps + +Arguments: + functionName Name of function to simulate + +Options: + --args [args...] Function arguments (default: []) + -ca, --contract-address
Aztec address of the contract. + -c, --contract-artifact Path to a compiled Aztec contract's artifact in JSON format. If executed inside a nargo workspace, a package and contract name can be specified as package@contract + --debug-execution-steps-dir
Directory to write execution step artifacts for bb profiling/debugging. + -aw, --auth-witness Authorization witness to use for the simulation + -f, --from Alias or address of the account to simulate from + --payment Fee payment method and arguments. + Parameters: + method Valid values: "fee_juice", "fpc-public", "fpc-private", "fpc-sponsored" Default: fee_juice + asset The asset used for fee payment. Required for "fpc-public" and "fpc-private". + fpc The FPC contract that pays in fee juice. Not required for the "fee_juice" method. + claim Whether to use a previously stored claim to bridge fee juice. + claimSecret The secret to claim fee juice on L1. + claimAmount The amount of fee juice to be claimed. + messageLeafIndex The index of the claim in the l1toL2Message tree. + Format: --payment method=name,asset=address,fpc=address ... + --gas-limits Gas limits for the tx. + --max-fees-per-gas Maximum fees per gas unit for DA and L2 computation. + --max-priority-fees-per-gas Maximum priority fees per gas unit for DA and L2 computation. + --estimate-gas-only Only report gas estimation for the tx, do not send it. + -h, --help display help for command +2025/11/06 02:38:46 socat[73649] E bind(5, {LEN=16 AF=2 0.0.0.0:12345}, 16): Address already in use + +``` + +### aztec-wallet bridge-fee-juice + +``` +Usage: wallet bridge-fee-juice [options] + +Mints L1 Fee Juice and pushes them to L2. + +Arguments: + amount The amount of Fee Juice to mint and bridge. + recipient Aztec address of the recipient. + +Options: + --l1-rpc-urls List of Ethereum host URLs. Chain identifiers + localhost and testnet can be used (comma + separated) (default: + ["http://host.docker.internal:8545"]) + -m, --mnemonic The mnemonic to use for deriving the Ethereum + address that will mint and bridge (default: "test + test test test test test test test test test test + junk") + --mint Mint the tokens on L1 (default: false) + --l1-private-key The private key to the eth account bridging + -c, --l1-chain-id Chain ID of the ethereum host (default: 31337, + env: L1_CHAIN_ID) + --json Output the claim in JSON format + --no-wait Wait for the bridged funds to be available in L2, + polling every 60 seconds + --interval The polling interval in seconds for the bridged + funds (default: "60") + -h, --help display help for command +2025/11/06 02:38:48 socat[73882] E bind(5, {LEN=16 AF=2 0.0.0.0:12345}, 16): Address already in use + +``` + +### aztec-wallet create-authwit + +``` +Usage: wallet create-authwit [options] + +Creates an authorization witness that can be privately sent to a caller so they +can perform an action on behalf of the provided account + +Arguments: + functionName Name of function to authorize + caller Account to be authorized to perform the action + +Options: + --args [args...] Function arguments (default: []) + -ca, --contract-address
Aztec address of the contract. + -c, --contract-artifact Path to a compiled Aztec contract's artifact in JSON format. If executed inside a nargo workspace, a package and contract name can be specified as package@contract + -f, --from Alias or address of the account to simulate from + -a, --alias Alias for the authorization witness. Used for easy reference in subsequent commands. + -h, --help display help for command +2025/11/06 02:38:49 socat[74097] E bind(5, {LEN=16 AF=2 0.0.0.0:12345}, 16): Address already in use + +``` + +### aztec-wallet authorize-action + +``` +Usage: wallet authorize-action [options] + +Authorizes a public call on the caller, so they can perform an action on behalf +of the provided account + +Arguments: + functionName Name of function to authorize + caller Account to be authorized to perform the action + +Options: + --args [args...] Function arguments (default: []) + -ca, --contract-address
Aztec address of the contract. + -c, --contract-artifact Path to a compiled Aztec contract's artifact in JSON format. If executed inside a nargo workspace, a package and contract name can be specified as package@contract + -f, --from Alias or address of the account to simulate from + -h, --help display help for command +2025/11/06 02:38:51 socat[74325] E bind(5, {LEN=16 AF=2 0.0.0.0:12345}, 16): Address already in use + +``` + +### aztec-wallet get-tx + +``` +Usage: wallet get-tx [options] [txHash] + +Gets the status of the recent txs, or a detailed view if a specific transaction +hash is provided + +Arguments: + txHash A transaction hash to get the receipt for. + +Options: + -p, --page The page number to display (default: 1) + -s, --page-size The number of transactions to display per page + (default: 10) + -h, --help display help for command +2025/11/06 02:38:53 socat[74531] E bind(5, {LEN=16 AF=2 0.0.0.0:12345}, 16): Address already in use + +``` + +### aztec-wallet register-sender + +``` +Usage: wallet register-sender [options] [address] + +Registers a sender's address in the wallet, so the note synching process will +look for notes sent by them + +Arguments: + address The address of the sender to register + +Options: + -a, --alias Alias for the sender. Used for easy reference in + subsequent commands. + -h, --help display help for command +2025/11/06 02:38:55 socat[74757] E bind(5, {LEN=16 AF=2 0.0.0.0:12345}, 16): Address already in use + +``` + +### aztec-wallet register-contract + +``` +Usage: wallet register-contract [options] [address] [artifact] + +Registers a contract in this wallet's PXE + +Arguments: + address The address of the contract to register + artifact Path to a compiled Aztec contract's artifact in + JSON format. If executed inside a nargo workspace, + a package and contract name can be specified as + package@contract + +Options: + --init The contract initializer function to call + (default: "constructor") + -k, --public-key Optional encryption public key for this address. + Set this value only if this contract is expected + to receive private notes, which will be encrypted + using this public key. + -s, --salt Optional deployment salt as a hex string for + generating the deployment address. + --deployer The address of the account that deployed the + contract + --args [args...] Constructor arguments (default: []) + -a, --alias Alias for the contact. Used for easy reference in + subsequent commands. + -h, --help display help for command +2025/11/06 02:38:57 socat[74814] E bind(5, {LEN=16 AF=2 0.0.0.0:12345}, 16): Address already in use + +``` + +### aztec-wallet alias + +``` +Usage: wallet alias [options] + +Aliases information for easy reference. + +Arguments: + type Type of alias to create (choices: "accounts", "contracts", + "artifacts", "secrets", "transactions", "authwits") + key Key to alias. + value Value to assign to the alias. + +Options: + -h, --help display help for command +2025/11/06 02:38:58 socat[74996] E bind(5, {LEN=16 AF=2 0.0.0.0:12345}, 16): Address already in use + +``` + +### aztec-wallet get-alias + +``` +Usage: wallet get-alias [options] [alias] + +Shows stored aliases + +Arguments: + alias Alias to retrieve + +Options: + -h, --help display help for command +2025/11/06 02:39:00 socat[75164] E bind(5, {LEN=16 AF=2 0.0.0.0:12345}, 16): Address already in use + +``` + +### aztec-wallet create-secret + +``` +Usage: wallet create-secret [options] + +Creates an aliased secret to use in other commands + +Options: + -a, --alias Key to alias the secret with + -h, --help display help for command +2025/11/06 02:39:02 socat[75350] E bind(5, {LEN=16 AF=2 0.0.0.0:12345}, 16): Address already in use + +``` diff --git a/docs/developer_versioned_docs/version-v3.0.2/docs/wallet-cli/faceid_wallet.md b/docs/developer_versioned_docs/version-v3.0.2/docs/wallet-cli/faceid_wallet.md new file mode 100644 index 000000000000..b2b7c81dc68b --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/docs/wallet-cli/faceid_wallet.md @@ -0,0 +1,93 @@ +--- +title: Using FaceID to Sign Transactions +tags: [local_network, wallet, cli] +keywords: [wallet, cli wallet, faceid] +sidebar_position: 5 +description: In this tutorial, we will use Apple Mac's Secure Enclave to store the private key, and use it in Aztec's CLI Wallet. This enables fully private, native, and ... +--- + +In this tutorial, we will use Apple Mac's Secure Enclave to store the private key, and use it in Aztec's [CLI Wallet](./cli_wallet_reference.md). This enables fully private, native, and seedless account abstraction! + +:::warning + +Aztec is in active development and this has only been tested on MacOS. Please reach out if this tutorial does not work for you, and let us know your operating system. + +::: + +:::note +This tutorial is for the local network and will need adjustments if you want to use it on testnet. Install the local network [here](../../getting_started_on_local_network.md). +::: + +## Prerequisites + +For this tutorial, we will need to have the [Local Network](../aztec-cli/local-network-reference.md) installed. + +We also need to install Secretive, a nice open-source package that allows us to store keys on the Secure Enclave. You can head to the [secretive releases page](https://github.com/maxgoedjen/secretive/releases) and get the last release's `zip`, unzip and move to Applications, or use [Homebrew](https://brew.sh/): + +```bash +brew install secretive +``` + +Open it from the Applications folder and copy the provided Socket Path (the one it tells you to add to your .ssh config). Export it as a terminal environment variable. For example: + +```bash +export SSH_AUTH_SOCK="/Users/your_user/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh" +``` + +Let's also install `socat` which helps us manage the socket connections. If using Homebrew: + +```bash +brew install socat +``` + +### Creating a key + +We will create our private key, which will be stored in the Secure Enclave. Open Secretive, click the "+" sign and create a key with authentication. You can give it any name you like. Secretive will then store it in the Secure Enclave. + +Make sure Secretive's "Secret Agent" is running. + +:::info + +The Secure Enclave is a protected chip on most recent iPhones and Macs and it's meant to be airgapped. It is not safe to use in production. + +Fortunately, Aztec implements [Account Abstraction](../foundational-topics/accounts/index.md#what-is-account-abstraction) at the protocol level. You could write logic to allow someone else to recover your account, or use a different key or keys for recovery. + +::: + +### Creating an account + +Now we can use the key to create an account. Every account on Aztec is a contract, so you can write your own contract with its own account logic. + +The Aztec team already wrote some account contract boilerplates we can use. One of them is an account that uses the `secp256r1` elliptic curve (the one the Secure Enclave uses). + +Let's create an account in our wallet: + +```bash +aztec-wallet create-account -a my-faceid-wallet -t ecdsasecp256r1ssh +``` + +This command creates an account using the `ecdsasecp256r1ssh` type and aliases it to `my-faceid-wallet`. + +You should see a prompt like `? What public key to use?` with the public key you created in Secretive. Select this. If you see the message `Account stored in database with aliases last & my-faceid-wallet` then you have successfully created the account! + +You can find other accounts by running `aztec-wallet create-account -h`. + +### Using the wallet + +Your FaceID-backed wallet is now ready to use. You can interact with it via the alias `accounts:my-faceid-wallet` just like any other wallet in the CLI. + +Verify your account was stored correctly: + +```bash +aztec-wallet get-alias accounts:my-faceid-wallet +``` + +From here, you can deploy contracts, send transactions, and interact with the network - each transaction will prompt you to authenticate with TouchID or your password. + +Check out the [CLI Wallet Reference](./cli_wallet_reference.md) for the full set of available commands, or follow the [Getting Started on Local Network](../../getting_started_on_local_network.md) guide to deploy contracts and interact with the network using your new wallet. + +### What next + +In this tutorial, we created an account with the Aztec's [CLI Wallet](./cli_wallet_reference.md), using the Apple Mac's Secure Enclave to store the private key. + +You can use a multitude of authentication methods, for example with RSA you could use a passport as a recovery, or even as a signer in a multisig. All of this is based on the [account contract](https://github.com/AztecProtocol/aztec-packages/tree/v3.0.2/noir-projects/noir-contracts/contracts/account). diff --git a/docs/developer_versioned_docs/version-v3.0.2/getting_started_on_devnet.md b/docs/developer_versioned_docs/version-v3.0.2/getting_started_on_devnet.md new file mode 100644 index 000000000000..2f67bc68da83 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/getting_started_on_devnet.md @@ -0,0 +1,270 @@ +--- +title: Setting up for Devnet +sidebar_position: 3 +tags: [testnet] +description: Guide for developers to get started with the Aztec devnet, including account creation and contract deployment. +--- + +import { AztecTestnetVersion } from '@site/src/components/Snippets/general_snippets'; + +This guide explains the differences between the local network and devnet, how to migrate from the local network to devnet, and how to start developing directly on devnet. + +## Local Network vs Devnet: Key Differences + +Before diving into the setup, it's important to understand the differences between the local network and devnet: + +### Local Network (Local Development) + +- Runs locally on your machine +- No proving by default (faster development) +- No fees +- Instant block times +- Test accounts automatically deployed +- Ideal for rapid development and testing + +### Devnet (Remote Network) + +- Remote environment with network of sequencers +- Always has fees enabled (need to pay or sponsor fees) +- ~36 second block times, longer L1 settlement +- No automatic test accounts + +:::info +If you're new to Aztec and want to understand local development first, check out the [local network guide](./docs/tutorials/local_network.md). +::: + +## Prerequisites + +Before working with devnet, ensure you have: + +1. [Docker](https://docs.docker.com/get-started/get-docker/) installed +2. Aztec CLI installed: + +```sh +bash -i <(curl -s https://install.aztec.network) +``` + +3. The devnet version installed: + +```bash +aztec-up 3.0.0-devnet.5 +``` + +:::warning +The devnet is version dependent. It is currently running version `3.0.0-devnet.5`. Maintain version consistency when interacting with the devnet to reduce errors. +::: + +## Getting Started on Devnet + +### Step 1: Set up your environment + +Set the required environment variables: + +```bash +export VERSION=3.0.0-devnet.5 +export NODE_URL=https://devnet.aztec-labs.com/ +export SPONSORED_FPC_ADDRESS=0x280e5686a148059543f4d0968f9a18cd4992520fcd887444b8689bf2726a1f97 +``` + +### Step 2: Create and deploy an account + +Unlike the local network, devnet has no pre-deployed accounts. You need to create your own, but first you need to register the sponsored FPC to pay transaction fees: + +```bash +aztec-wallet register-contract \ + --node-url $NODE_URL \ + --alias sponsoredfpc \ + $SPONSORED_FPC_ADDRESS SponsoredFPC \ + --salt 0 +``` + +Then create your account and deploy it: + +```bash +aztec-wallet create-account \ + --node-url $NODE_URL \ + --alias my-wallet \ + --payment method=fpc-sponsored,fpc=$SPONSORED_FPC_ADDRESS +``` + +:::note +The first transaction will take longer as it downloads proving keys. If you see `Timeout awaiting isMined`, the transaction is still processing - this is normal on testnet. +::: + +### Step 3: Deploy and interact with contracts + +Deploy a token contract as an example: + +```bash +aztec-wallet deploy \ + --node-url $NODE_URL \ + --from accounts:my-wallet \ + --payment method=fpc-sponsored,fpc=$SPONSORED_FPC_ADDRESS \ + --alias token \ + TokenContract \ + --args accounts:my-wallet Token TOK 18 --no-wait +``` + +You can check the transaction status on [aztecscan](https://devnet.aztecscan.xyz). + +Interact with your deployed contract: + +```bash +aztec-wallet send mint_to_private \ + --node-url $NODE_URL \ + --from accounts:my-wallet \ + --payment method=fpc-sponsored,fpc=$SPONSORED_FPC_ADDRESS \ + --contract-address token \ + --args accounts:my-wallet 10 +``` + +## Migrating from the Local Network to Testnet + +If you have an existing app running on your local network, here's how to migrate it to testnet: + +### 1. Connect to Testnet Node + +Instead of running a local network, connect to the testnet node: + +```sh +export NODE_URL=https://aztec-testnet-fullnode.zkv.xyz +``` + +When running `aztec-wallet` commands, include the node URL: + +```sh +aztec-wallet create-account -a main --node-url $NODE_URL +``` + +### 2. Initialize a TestWallet for Devnet + +You can connect to testnet directly from your app using AztecJS: + +In the browser: + +```javascript +import { TestWallet } from "@aztec/test-wallet/client/lazy"; +``` + +In Node.js: + +```javascript +import { TestWallet } from "@aztec/test-wallet/server"; +``` + +Then initialize with devnet configuration: + +```javascript +import { createAztecNodeClient } from "@aztec/aztec.js/node"; +import { TestWallet } from "@aztec/test-wallet/server"; + +const NODE_URL = "https://devnet.aztec-labs.com"; +const node = createAztecNodeClient(NODE_URL); +const wallet = await TestWallet.create(node); +``` + +### 3. Handle Fees on Devnet + +Unlike the local network, devnet requires fee payment. You have three options: + +1. **User pays their own fees** - Send them tokens or direct them to the faucet +2. **Your contract sponsors fees** - Deploy a fee-paying contract +3. **Use the canonical sponsored FPC** - Recommended for getting started + +:::info +See the [aztec-starter](https://github.com/AztecProtocol/aztec-starter/blob/154758c866fe34174f2e22b59e70e277fe8ecc73/src/utils/deploy_account.ts#L39) for an example of how to deploy a contract with the sponsored FPC. +::: + +### 4. Important Migration Considerations + +- **Register all contracts**: Including account contracts and the sponsored FPC in the wallet +- **No test accounts**: You'll need to deploy accounts manually +- **Longer transaction times**: Handle timeouts gracefully - transactions may still succeed +- **L1-L2 messaging delays**: + - L1→L2: Wait ~1.5-2 minutes (vs 2 blocks on the local network) + - L2→L1: Wait ~30 minutes for finalization (vs immediate on the local network) + +## Key Considerations When Using Devnet + +### Handling Transaction Timeouts + +Devnet transactions take longer than on the local network. Handle timeouts gracefully: + +```javascript +try { + const receipt = await tx.wait(); +} catch (error) { + if (error.message.includes("Timeout awaiting isMined")) { + console.log("Transaction sent but still being mined"); + // Check block explorer for status + } +} +``` + +### Environment Detection + +Detect which environment your code is running against: + +```javascript +const isDevnet = process.env.NODE_URL?.includes("devnet"); +const nodeUrl = process.env.NODE_URL || "http://localhost:8080"; +``` + +## Devnet information + +## RPC + +https://devnet.aztec-labs.com + +## Packages Versions / Github Tag + +3.0.0-devnet.4 + +## Network Configuration + +- **l1ChainId**: 11155111 +- **rollupVersion**: 1667575857 + +- **enr**: -Na4QDO8LfoSfCpWFbMPHwYZegt9P--3X8XCRmwuXD1SEtxdD2kx4K-ue5VuwG4DOWqDbsxLQ9Ja3Mr6OSmjV-8x-ToHhWF6dGVjsTAwLTExMTU1MTExLWIwNWYzNmM5LTE2Njc1NzU4NTctMjc2MzhiZjMtMDY4YTc5ZTiCaWSCdjSCaXCEIpEKG4lzZWNwMjU2azGhAvyGRkH6p8gsIWyI6vmqHxMIqAweVkShKk3mjGfL7e2Gg3RjcIKd0IN1ZH CCndCDdmVyjjMuMC4wLWRldm5ldC4y + +## Migration Notes + +[Migration Notes](./docs/resources/migration_notes.md) + +## L1 Contract Addresses + +- **registryAddress**: `0x9017a63e26eaf1197c49b4315a9f32a771abeea7` +- **slashFactoryAddress**: `0x4926e1bd0ba4c9f477c57ce7311c62d4075dca5c` +- **feeAssetHandlerAddress**: `0x252a71fc243812f747fc4782dea865a260ef81c9` +- **rollupAddress**: `0xb05f36c9dffa76f0af639385ef44d5560e0160c1` +- **inboxAddress**: `0x33631b33f335e249279db08b9b7272c9906c1405` +- **outboxAddress**: `0xfe37ceedec5674805fdc3cd5ca8aa6ca656cbfb9` +- **feeJuiceAddress**: `0xa9144418460188c2b59914e6a7cb01deb1e019d7` +- **stakingAssetAddress**: `0xdcaca47b74caf5c14ce023597f0e3b67e1f14496` +- **feeJuicePortalAddress**: `0xeea84a878a3fd52d14e7820dddb60d35219b9cd9` +- **coinIssuerAddress**: `0x48ab541e0f60e3138f6f24c5cc72993ffcdca462` +- **rewardDistributorAddress**: `0x4833dacefe705e31200d071a04d17bd29e2c740c` +- **governanceProposerAddress**: `0x4194937ab0bb3b1b4b1b1d770bb8577a0500911b` +- **governanceAddress**: `0x6af3cc6c09a72b5a0ab772f37fd7b719569f27b9` +- **gseAddress**: `0xeee2d3289dff43909b935da9ef2121fdcad8773f` + +## Protocol Contract Addresses + +- **classRegistry**: `0x0000000000000000000000000000000000000000000000000000000000000003` +- **feeJuice**: `0x0000000000000000000000000000000000000000000000000000000000000005` +- **instanceRegistry**: `0x0000000000000000000000000000000000000000000000000000000000000002` +- **multiCallEntrypoint**: `0x0000000000000000000000000000000000000000000000000000000000000004` +- **sponsoredFPC**: `0x280e5686a148059543f4d0968f9a18cd4992520fcd887444b8689bf2726a1f97` + +## Next Steps + +- **New to Aztec?** Start with the [local network tutorial](./docs/tutorials/local_network.md) for faster development +- **Ready for production testing?** Continue using devnet +- **Learn more:** Check out our [tutorials](./docs/tutorials/contract_tutorials/counter_contract.md) +- **Explore:** Visit [Aztec Playground](https://play.aztec.network/) + +## Additional Resources + +- [Fee payment guide](./docs/aztec-js/how_to_pay_fees.md) +- [Running a node](/network/) +- [Block explorers](https://devnet.aztecscan.xyz) diff --git a/docs/developer_versioned_docs/version-v3.0.2/getting_started_on_local_network.md b/docs/developer_versioned_docs/version-v3.0.2/getting_started_on_local_network.md new file mode 100644 index 000000000000..a91916a9644c --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/getting_started_on_local_network.md @@ -0,0 +1,278 @@ +--- +title: Getting Started on Local Network +description: Guide for developers to get started with the Aztec local network, including account creation and contract deployment. +sidebar_position: 0 +tags: [local_network, testnet] +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +Get started on your local environment using a local network. If you'd rather jump into devnet, read the [getting started on devnet guide](./getting_started_on_devnet.md). + +The local network is a local development Aztec network running fully on your machine, and interacting with a development Ethereum node. You can develop and deploy on it just like on a testnet or mainnet (when the time comes). The local network makes it faster and easier to develop and test your Aztec applications. + +What's included in the local network: + +- Local Ethereum network (Anvil) +- Deployed Aztec protocol contracts (for L1 and L2) +- A set of test accounts with some test tokens to pay fees +- Development tools to compile contracts and interact with the network (`aztec` and `aztec-wallet`) + +All of this comes packaged in a Docker container to make it easy to install and run. + +This guide will teach you how to install the Aztec local network, run it using the Aztec CLI, and interact with contracts using the wallet CLI. To jump right into the testnet instead, click the `Testnet` tab. + +## Prerequisites + +import { General, Fees } from '@site/src/components/Snippets/general_snippets'; + +You need two global dependencies on your machine: + +- +- Docker (visit [this page of the Docker docs](https://docs.docker.com/get-docker/) on how to install it) + +## Install and run the local network + +### Start Docker + +Docker needs to be running in order to install the local network. Find instructions on the [Docker website](https://docs.docker.com/get-started/). + +### Install the local network + +Run: + +```bash +bash -i <(curl -s https://install.aztec.network) +``` + +This will install the following tools: + +- **aztec** - compiles and tests aztec contracts and launches various infrastructure subsystems (full local network, sequencer, prover, pxe, etc) and provides utility commands to interact with the network +- **aztec-up** - a tool to upgrade the aztec toolchain to the latest, or specific versions. +- **aztec-wallet** - a tool for interacting with the aztec network + +### Start the local network + +Once these have been installed, to start the local network, run: + +```bash +aztec start --local-network +``` + +**Congratulations, you have just installed and run the Aztec local network!** + +```bash + /\ | | + / \ ___| |_ ___ ___ + / /\ \ |_ / __/ _ \/ __| + / ____ \ / /| || __/ (__ + /_/___ \_\/___|\__\___|\___| + +``` + +In the terminal, you will see some logs: + +1. Local network version +2. Contract addresses of rollup contracts +3. PXE (private execution environment) setup logs +4. Initial accounts that are shipped with the local network and can be used in tests + +You'll know the local network is ready to go when you see something like this: + +```bash +[INFO] Aztec Server listening on port 8080 +``` + +### Codespaces + +If you do not want to run the local network locally, or if your machine is unsupported (eg Windows), it is possible to run it within a GitHub Codespace. + +[GitHub Codespaces](https://github.com/features/codespaces) are a quick way to develop: they provision a remote machine with all tooling you need for Aztec in just a few minutes. You can use some prebuilt images to make it easier and faster. + +Choose a boilerplate and click "create new codespace": + +[![One-Click React Starter](/img/codespaces_badges/react_cta_badge.svg)](https://codespaces.new/AztecProtocol/aztec-packages?devcontainer_path=.devcontainer%2Freact%2Fdevcontainer.json) [![One-Click HTML/TS Starter](/img/codespaces_badges/vanilla_cta_badge.svg)](https://codespaces.new/AztecProtocol/aztec-packages?devcontainer_path=.devcontainer%2Fvanilla%2Fdevcontainer.json) [![One-Click Token Starter](/img/codespaces_badges/token_cta_badge.svg)](https://codespaces.new/AztecProtocol/aztec-packages?devcontainer_path=.devcontainer%2Ftoken%2Fdevcontainer.json) + +This creates a codespace with a prebuilt image containing one of the "Aztec Boxes" and a development network (local network). +- You can develop directly on the codespace, push it to a repo, make yourself at home. +- You can also just use the local network that comes with it. The URL will be logged, you just need to use it as your `PXE_URL`. + +You can then start, stop, or see the logs of your local network just by calling `local-network` or `npx aztec-app local-network`. Run `local-network -h` for a list of commands. + +Codespaces are way more powerful than you may initially think. For example, you can connect your local `vscode` to a remote codespace, for a fully contained development environment that doesn't use any of your computer resources! + +Visit the [codespaces documentation](https://docs.github.com/en/codespaces/overview) for more specific documentation around codespaces. + +## Using the local network test accounts + +import { CLI_Add_Test_Accounts } from '@site/src/components/Snippets/general_snippets'; + + + +To add the test accounts in the wallet, run this in another terminal: + +```bash +aztec-wallet import-test-accounts +``` + +We'll use the first test account, `test0`, throughout to pay for transactions. + +## Creating an account in the local network + +```bash +aztec-wallet create-account -a my-wallet --payment method=fee_juice,feePayer=test0 +``` + +This will create a new wallet with an account and give it the alias `my-wallet`. Accounts can be referenced with `accounts:`. You will see logs telling you the address, public key, secret key, and more. + +On successful depoyment of the account, you should see something like this: + +```bash +New account: + +Address: 0x066108a2398e3e2ff53ec4b502e4c2e778c6de91bb889de103d5b4567530d99c +Public key: 0x007343da506ea513e6c05ba4d5e92e3c682333d97447d45db357d05a28df0656181e47a6257e644c3277c0b11223b28f2b36c94f9b0a954523de61ac967b42662b60e402f55e3b7384ba61261335040fe4cd52cb0383f559a36eeea304daf67d1645b06c38ee6098f90858b21b90129e7e1fdc4666dd58d13ef8fab845b2211906656d11b257feee0e91a42cb28f46b80aabdc70baad50eaa6bb2c5a7acff4e30b5036e1eb8bdf96fad3c81e63836b8aa39759d11e1637bd71e3fc76e3119e500fbcc1a22e61df8f060004104c5a75b52a1b939d0f315ac29013e2f908ca6bc50529a5c4a2604c754d52c9e7e3dee158be21b7e8008e950991174e2765740f58 +Secret key: 0x1c94f8b19e91d23fd3ab6e15f7891fde7ba7cae01d3fa94e4c6afb4006ec0cfb +Partial address: 0x2fd6b540a6bb129dd2c05ff91a9c981fb5aa2ac8beb4268f10b3aa5fb4a0fcd1 +Salt: 0x0000000000000000000000000000000000000000000000000000000000000000 +Init hash: 0x28df95b579a365e232e1c63316375c45a16f6a6191af86c5606c31a940262db2 +Deployer: 0x0000000000000000000000000000000000000000000000000000000000000000 + +Waiting for account contract deployment... +Deploy tx hash: 0a632ded6269bda38ad6b54cd49bef033078218b4484b902e326c30ce9dc6a36 +Deploy tx fee: 200013616 +Account stored in database with aliases last & my-wallet +``` + +You may need to scroll up as there are some other logs printed after it. + +You can double check by running `aztec-wallet get-alias accounts:my-wallet`. + +For simplicity we'll keep using the test account, let's deploy our own test token! + +## Deploying a contract + +The local network comes with some contracts that you can deploy and play with. One of these is an example token contract. + +Deploy it with this: + +```bash +aztec-wallet deploy TokenContractArtifact --from accounts:test0 --args accounts:test0 TestToken TST 18 -a testtoken +``` + +This takes + +- the contract artifact as the argument, which is `TokenContractArtifact` +- the deployer account, which we used `test0` +- the args that the contract constructor takes, which is the `admin` (`accounts:test0`), `name` (`TestToken`), `symbol` (`TST`), and `decimals` (`18`). +- an alias `testtoken` (`-a`) so we can easily reference it later with `contracts:testtoken` + +On successful deployment, you should see something like this: + +```bash +aztec:wallet [INFO] Using wallet with address 0x066108a2398e3e2ff53ec4b502e4c2e778c6de91bb889de103d5b4567530d99c +0ms +Contract deployed at 0x15ce68d4be65819fe9c335132f10643b725a9ebc7d86fb22871f6eb8bdbc3abd +Contract partial address 0x25a91e546590d77108d7b184cb81b0a0999e8c0816da1a83a2fa6903480ea138 +Contract init hash 0x0abbaf0570bf684da355bd9a9a4b175548be6999625b9c8e0e9775d140c78506 +Deployment tx hash: 0a8ccd1f4e28092a8fa4d1cb85ef877f8533935c4e94b352a38af73eee17944f +Deployment salt: 0x266295eb5da322aba96fbb24f9de10b2ba01575dde846b806f884f749d416707 +Deployment fee: 200943060 +Contract stored in database with aliases last & testtoken +``` + +In the next step, let's mint some tokens! + +## Minting public tokens + +Call the public mint function like this: + +```bash +aztec-wallet send mint_to_public --from accounts:test0 --contract-address contracts:testtoken --args accounts:test0 100 +``` + +This takes + +- the function name as the argument, which is `mint_to_public` +- the `from` account (caller) which is `accounts:test0` +- the contract address, which is aliased as `contracts:testtoken` (or simply `testtoken`) +- the args that the function takes, which is the account to mint the tokens into (`test0`), and `amount` (`100`). + +This only works because we are using the secret key of the admin who has permissions to mint. + +A successful call should print something like this: + +```bash +aztec:wallet [INFO] Using wallet with address 0x066108a2398e3e2ff53ec4b502e4c2e778c6de91bb889de103d5b4567530d99c +0ms +Maximum total tx fee: 1161660 +Estimated total tx fee: 116166 +Estimated gas usage: da=1127,l2=115039,teardownDA=0,teardownL2=0 + +Transaction hash: 2ac383e8e2b68216cda154b52e940207a905c1c38dadba7a103c81caacec403d +Transaction has been mined + Tx fee: 200106180 + Status: success + Block number: 17 + Block hash: 1e27d200600bc45ab94d467c230490808d1e7d64f5ee6cee5e94a08ee9580809 +Transaction hash stored in database with aliases last & mint_to_public-9044 +``` + +You can double-check by calling the function that checks your public account balance: + +```bash +aztec-wallet simulate balance_of_public --from test0 --contract-address testtoken --args accounts:test0 +``` + +This should print + +```bash +Simulation result: 100n +``` + +## Playing with hybrid state and private functions + +In the following steps, we'll moving some tokens from public to private state, and check our private and public balance. + +```bash +aztec-wallet send transfer_to_private --from accounts:test0 --contract-address testtoken --args accounts:test0 25 +``` + +The arguments for `transfer_to_private` function are: + +- the account address to transfer to +- the amount of tokens to send to private + +A successful call should print something similar to what you've seen before. + +Now when you call `balance_of_public` again you will see 75! + +```bash +aztec-wallet simulate balance_of_public --from test0 --contract-address testtoken --args accounts:test0 +``` + +This should print + +```bash +Simulation result: 75n +``` + +And then call `balance_of_private` to check that you have your tokens! + +```bash +aztec-wallet simulate balance_of_private --from test0 --contract-address testtoken --args accounts:test0 +``` + +This should print + +```bash +Simulation result: 25n +``` + +**Congratulations, you now know the fundamentals of working with the Aztec local network!** You are ready to move onto the more fun stuff. + +## What's next? + +Want to build something cool on Aztec? + +- Check out the [Token Contract Tutorial](./docs/tutorials/contract_tutorials/token_contract.md) for a beginner tutorial, or jump into more advanced ones +- Start on your own thing and check out the How To Guides to help you! diff --git a/docs/developer_versioned_docs/version-v3.0.2/overview.md b/docs/developer_versioned_docs/version-v3.0.2/overview.md new file mode 100644 index 000000000000..2f28510b8864 --- /dev/null +++ b/docs/developer_versioned_docs/version-v3.0.2/overview.md @@ -0,0 +1,80 @@ +--- +title: Aztec Overview +sidebar_position: 0 +tags: [protocol] +description: Overview of Aztec, a privacy-first Layer 2 on Ethereum supporting smart contracts with private and public state and execution. +--- + +import Image from "@theme/IdealImage"; + +This page outlines Aztec's fundamental technical concepts. It is recommended to read this before diving into building on Aztec. + +## What is Aztec? + +Aztec is a privacy-first Layer 2 on Ethereum. It supports smart contracts with both private & public state and private & public execution. + + + +## High level view + + + +1. A user interacts with Aztec through Aztec.js (like web3js or ethersjs) +2. Private functions are executed in the PXE, which is client-side +3. Proofs and tree updates are sent to the Public VM (running on an Aztec node) +4. Public functions are executed in the Public VM +5. The Public VM rolls up the transactions that include private and public state updates into blocks +6. The block data and proof of a correct state transition are submitted to Ethereum for verification + +## Private and public execution + +Private functions are executed client side, on user devices to maintain maximum privacy. Public functions are executed by a remote network of nodes, similar to other blockchains. These distinct execution environments create a directional execution flow for a single transaction--a transaction begins in the private context on the user's device then moves to the public network. This means that private functions executed by a transaction can enqueue public functions to be executed later in the transaction life cycle, but public functions cannot call private functions. + +### Private Execution Environment (PXE) + +Private functions are executed on the user's device in the Private Execution Environment (PXE, pronounced 'pixie'), then it generates proofs for onchain verification. It is a client-side library for execution and proof-generation of private operations. It holds keys, notes, and generates proofs. It is included in aztec.js, a TypeScript library, and can be run within Node or the browser. + +Note: It is easy for private functions to be written in a detrimentally unoptimized way, because many intuitions of regular program execution do not apply to proving. For more about writing performant private functions in Noir, see [this page](https://noir-lang.org/docs/explainers/explainer-writing-noir) of the Noir documentation. + +### Aztec Virtual Machine (AVM) + +Public functions are executed by the Aztec Virtual Machine (AVM), which is conceptually similar to the Ethereum Virtual Machine (EVM). As such, writing efficient public functions follow the same intuition as gas-efficient solidity contracts. + +The PXE is unaware of the Public VM. And the Public VM is unaware of the PXE. They are completely separate execution environments. This means: + +- The PXE and the Public VM cannot directly communicate with each other +- Private transactions in the PXE are executed first, followed by public transactions + +## Private and public state + +Private state works with UTXOs, which are chunks of data that we call notes. To keep things private, notes are stored in an [append-only UTXO tree](./docs/foundational-topics/advanced/storage/indexed_merkle_tree.mdx), and a nullifier is created when notes are invalidated (aka deleted). Nullifiers are stored in their own [nullifier tree](./docs/foundational-topics/advanced/storage/indexed_merkle_tree.mdx). + +Public state works similarly to other chains like Ethereum, behaving like a public ledger. Public data is stored in a public data tree. + +![Public vs private state](@site/static/img/public-and-private-state-diagram.png) + +Aztec [smart contract](./docs/aztec-nr/framework-description/contract_structure.md) developers should keep in mind that different data types are used when manipulating private or public state. Working with private state is creating commitments and nullifiers to state, whereas working with public state is directly updating state. + +## Accounts and keys + +### Account abstraction + +Every account in Aztec is a smart contract (account abstraction). This allows implementing different schemes for authorizing transactions, nonce management, and fee payments. + +Developers can write their own account contract to define the rules by which user transactions are authorized and paid for, as well as how user keys are managed. + +Learn more about account contracts [here](./docs/foundational-topics/accounts/index.md). + +### Key pairs + +Each account in Aztec is backed by 3 key pairs: + +- A **nullifier key pair** used for note nullifier computation +- A **incoming viewing key pair** used to encrypt a note for the recipient +- A **outgoing viewing key pair** used to encrypt a note for the sender + +As Aztec has native account abstraction, accounts do not automatically have a signing key pair to authenticate transactions. This is up to the account contract developer to implement. + +## Noir + +Noir is a zero-knowledge domain specific language used for writing smart contracts for the Aztec network. It is also possible to write circuits with Noir that can be verified on or offchain. For more in-depth docs into the features of Noir, go to the [Noir documentation](https://noir-lang.org/). diff --git a/docs/developer_versioned_sidebars/version-v3.0.2-sidebars.json b/docs/developer_versioned_sidebars/version-v3.0.2-sidebars.json new file mode 100644 index 000000000000..738c8385fda1 --- /dev/null +++ b/docs/developer_versioned_sidebars/version-v3.0.2-sidebars.json @@ -0,0 +1,40 @@ +{ + "sidebar": [ + { + "type": "html", + "value": "Overview", + "className": "sidebar-title" + }, + { + "type": "doc", + "id": "overview" + }, + { + "type": "doc", + "id": "getting_started_on_local_network" + }, + { + "type": "doc", + "id": "getting_started_on_devnet" + }, + { + "type": "link", + "label": "Aztec Starter Repository", + "href": "https://github.com/AztecProtocol/aztec-starter" + }, + { + "type": "html", + "value": "Docs", + "className": "sidebar-title" + }, + { + "type": "autogenerated", + "dirName": "docs" + }, + { + "type": "link", + "label": "Get Inspired", + "href": "https://github.com/AztecProtocol/horizon" + } + ] +} diff --git a/docs/developer_versions.json b/docs/developer_versions.json index 4b1bf48fcc3b..39030271f930 100644 --- a/docs/developer_versions.json +++ b/docs/developer_versions.json @@ -1,5 +1,6 @@ [ "v3.0.0-nightly.20251214", + "v3.0.2", "v3.0.1", "v3.0.0-devnet.5" ] diff --git a/docs/network_versioned_docs/version-v3.0.2/concepts/_category_.json b/docs/network_versioned_docs/version-v3.0.2/concepts/_category_.json new file mode 100644 index 000000000000..19d79cf9e982 --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/concepts/_category_.json @@ -0,0 +1,6 @@ +{ + "position": 1, + "collapsible": true, + "collapsed": true, + "label": "Decentralization Concepts" +} diff --git a/docs/network_versioned_docs/version-v3.0.2/concepts/deployments/_category_.json b/docs/network_versioned_docs/version-v3.0.2/concepts/deployments/_category_.json new file mode 100644 index 000000000000..03142f5a9e87 --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/concepts/deployments/_category_.json @@ -0,0 +1,6 @@ +{ + "position": 2, + "collapsible": true, + "collapsed": true, + "label": "Deployments" +} diff --git a/docs/network_versioned_docs/version-v3.0.2/concepts/deployments/what_is_deployment.md b/docs/network_versioned_docs/version-v3.0.2/concepts/deployments/what_is_deployment.md new file mode 100644 index 000000000000..75003e1e66e4 --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/concepts/deployments/what_is_deployment.md @@ -0,0 +1,247 @@ +--- +sidebar_position: 0 +title: What is a Deployment? +description: Learn about the constituent components of a network deployment and the deployment process on the Aztec network. +--- + +An Aztec deployment is a set of the following contracts: + +| Smart Contract | Immutability | +| ---------------------------- | ------------ | +| Hypothetical Asset | Immutable | +| Issuer Contract | Immutable | +| Registry Contract | Immutable | +| Reward Distribution Contract | Mutable | +| Proposals Contract | Mutable | +| Governance Contract | Immutable | +| Rollup Contract | Immutable | + +## Hypothetical Asset Contract + +Hypothetical Asset would live on Ethereum L1. It may have a minter which would be the only actor capable of calling the `mint` function on the Hypothetical Asset contract. + +This is brought up to the community for discussion purposes only to illustrate how proposed governance mechanisms could work with a Hypothetical Asset. + +- **Sequencers** must stake the Hypothetical Asset within the instance's contract to join that instance's sequencer set. +- **Holders** must lock Hypothetical Asset with the Governance contract to be able to vote on proposals. +- **Provers** must deposit Hypothetical Asset in the escrow contract in order to bid for the right to create a proof for an epoch. + +## Issuer Contract + +This contract will be the sole minter of Hypothetical Asset. It will itself have an owner, which is the only actor capable of calling the `mint` function on the Hypothetical Asset ERC20 contract. + +The `mint` function will limit the amount of Hypothetical Assets that could be minted in a given time period. The reasoning behind this limit is that it makes supply expansions more predictable since "infinite mints" cannot be made. + +```mermaid +flowchart LR + Issuer -->|Calls mint| HypotheticalAsset +``` + +```solidity +contract Issuer is Ownable { + ERC20 immutable public ASSET; // Hypothetical Asset + uint256 immutable public RATE; + uint256 public timeOfLastMint; + + constructor(ERC20 _asset, uint256 _rate, address _owner) Ownable(_owner) { + ASSET = _asset; + RATE = _rate; + timeOfLastMint = block.timestamp; + } + + function mint(address _to, uint256 _amount) external onlyOwner { + uint256 maxMint = RATE * (block.timestamp - timeOfLastMint); + require(_amount <= maxMint, 'Insufficient mint available'); + + timeOfLastMint = block.timestamp; + ASSET.mint(_to, _amount); + } +} +``` + +## Registry Contract + +The governance of Aztec will be community driven - the Aztec community will be able to decide whether to upgrade or migrate to a new rollup instance. Portals / apps donʼt need to follow along with the Aztec governance and can specify the specific instance (i.e. “versionˮ) of the rollup that they view as canonical. + +Therefore it will be necessary to keep track onchain of what versions of the rollup have existed as well as what version the Aztec governance views as the current canonical rollup. Only the current canonical rollup from the perspective of Aztec governance will be eligible to claim any further Hypothetical Asset rewards. + +```mermaid +flowchart LR + Registry --> RollupContract0["Rollup Contract
Instance 0"] + Registry --> RollupContract1["Rollup Contract
Instance 1"] + Registry --> |Returns latest instance|RollupContractN["Rollup Contract
Instance n"] +``` + +In practice, the Registry is an array of rollup instances that can only be inserted into by the Registryʼs owner - the Governance contract. + +```solidity +contract Registry is IRegistry, Ownable { + struct Instance { + address rollup; + uint96 blockNumber; + } + + Instance[] public instances; + + constructor(address _gov) Ownable(_gov) { + instances.push( + Instance({address: address(0), blockNumber: block.number}) + ); + } + + function addInstance(address _rollup) external onlyOwner { + instances.push( + Instance({address: _rollup, blockNumber: block.number}) + ); + } + + function getRollup() external view returns (address) { + return instances[instances.length - 1].rollup; + } + + function getInstancesLength() external view returns (uint256) { + return instances.length; + } +} +``` + +## Reward Distribution Contract + +This contract distributes ERC20 rewards only to the instance the Registry contract says is canonical. This is separated from the Registry and the Issuer so that the distribution logic can be changed without replacing the Registry. + +In practice, the following flow is expected. Infrequently, the Aztec Governance votes for the Issuer smart contract to mint a quantity of Hypothetical Asset and send them to the Distribution contract. The rollup contract will call `claim(_to)` on the Distribution contract. This checks that the calling Rollup is the current canonical Rollup before releasing a Hypothetical Asset to the rollup. + +The Rollup smart contract implements custom logic for how to split `BLOCK_REWARDS` amongst the proposers/committee/provers who provide real work in the form of electricity and hardware intensive computational resources to the Rollup smart contract. + +```mermaid +flowchart TD + Issuer -->|1. Calls mint| HypotheticalAsset + Issuer -->|2. Transfer Hypothetical Asset| RewardDistribution + RollupContract -->|3. Calls claim| RewardDistribution +``` + +```solidity +contract RewardDistribution is Ownable { + uint256 public constant BLOCK_REWARD = xxx; + + IERC20 public immutable ASSET; + IRegistry public registry; + + // constructor etc + + function claim(address _to) external returns (uint256) { + address canonical = registry.getRollup(); + require(msg.sender == canonical); + ASSET.safeTransfer(_to, BLOCK_REWARD); + return BLOCK_REWARD; + } + + function updateRegistry(IRegistry _registry) external onlyOwner { + // ... + } +} +``` + +Rollup contacts implementations should not revert if the `claim()` call reverts because the rollup is no longer canonical. Otherwise, no one could sequence the rollup anymore. + +The separation of Distribution and Issuer is primarily for code hygiene purposes. + +The protocol inflation rate is defined in the Issuer smart contract as the constant `RATE`. It is not possible to change this inflation rate once the Issuer smart contract has been deployed. Aztec Governance can vote on a proposal to deploy a new Issuer smart contract that contains a new `RATE` + +The Aztec Governance will choose how often to call `mint()` on the Issuer smart contract which will send any Hypothetical Assets to the Distribution smart contract. The Distribution smart contract defines a `BLOCK_REWARD` constant value (again cannot be changed). Every epoch, the Rollup contract can call the Distribution smart contract to claim `BLOCK_REWARD` of Hypothetical Assets from the Distribution contract. + +Both `RATE` and `BLOCK_REWARD` will be set upon deployment of the Aztec Rollup by the Aztec Governance. Both values are immutable and cannot be changed without re-deploying a new smart contract and a successful vote by Aztec Governance to switch to the new smart contracts. + +## Proposals contract + +This is the only smart contract that is able to submit proposals to the Governance contract. + +The Proposals Contract will accept proposals only from sequencers of the current canonical instance, as indicated by the Registry. + +```solidity +contract Proposals is IProposals { + + // ... imports + + IGovernance public immutable GOVERNANCE; + IRegistry public immutable REGISTRY; + uint256 public immutable N; + uint256 public immutable M; + + constructor(IGovernance _governane, IRegistry _registry, uint256 _n, uint256 _m) { + // ... + + require(N > M / 2); + require(N <= M); + } + + function vote(address _proposal) external override(IProposals) returns (bool) { + require(_proposal.code.length > 0); + // ... + + Rollup instance = Rollup(REGISTRY.getRollup()); + address proposer = instance.getCurrentProposer(); + require(msg.sender == proposer); + } + // ... +} +``` + +To vote to table a proposal, the current sequencer of the canonical rollup must deploy the contracts being proposed to upgrade / migrate to, to the L1. Then the current sequencer deploys the upgrade logic i.e. `_proposal`, then call `Proposals.vote(_proposal)`. + +The Proposals contract will then count votes specifying that same `_proposal`. For a proposal to be nominated for voting, it must garner at least N votes in a single round, where a round is defined as a M consecutive L2 slots. Round 1 is L2 slots 0 - M - 1, while Round 2 is L2 slots M - 2M - 1 and so on. + +Note that a sequencer’s ability to vote is not affected by the rollupʼs availability since voting happens on the L1. + +```mermaid +flowchart TD + Issuer[Issuer] -->|1. Calls mint| HypotheticalAsset[Hypothetical Asset] + Issuer -->|2. Transfer Hypothetical Asset| RewardDistribution[Reward Distribution] + RewardDistribution -->|3. Calls claim| RollupContract[RollupContract] +``` + +If the quorum has been reahed, anyone can call `pushProposal(uint256 _roundNumber)` on the Proposals contract to send the proposal to the Governance contract for voting. As a result, only one proposal can be nominated for voting at any given round. + +## Governance contract + +This contract is the “assembly of Aztec citizensˮ that is the final arbiter of whether to enact the proposals from the Proposals Contract or not. + +This contract decides what is the canonical instance which gets block rewards. + +The Proposals contract tables proposals for voting, Holders who lock their Hypothetical Assets with the Governance contract may vote once for each Hypothetical Asset locked. They can vote either Yea or Nea. + +Once a proposal garners the minimum number of votes, and the Yay votes exceed Nay by at least the `quorum%` , the proposal can be executed by the Governance contract. + +```solidity +contract Governance is IGovernance { // ... imports + IERC20 public immutable ASSET; address public proposalsContract; // ... + constructor(IERC20 _asset, address _proposalsContract, ui nt256 _votingDelay, uint256 _votingDuration, uint256 _gracePeriod, uint256 _quorum, uin t256 _voteDifferential, uint256 _minimumVotes) { // ... + configuration = DataStructures.Configuration({ votingDelay: Timestamp.wrap(_votingDelay), // Min time between proposal creation and when voting starts votingDuration: Timestamp.wrap(_votingDuration), // Max duration of voting period + executionDelay: Timestamp.wrap(_executionDelay), // Min time between voting passing and proposal execution gracePeriod: Timestamp.wrap(_gracePeriod), // max time between proposal creation and proposal execution. + quorum: _quorum, // % of deposited ASSET that mus t participate in a vote (could be Yes or No) voteDifferential: _voteDifferential, // Yea must outweight Nea by this % to pass vote minimumVotes: _minimumVotes, // users with this much cummulative deposited ASSET must participate in the vote }) + } +// ... +function deposit(address _onBehalfOf, uint256 _amount) external override(IGovernance) { + // deposits are allowed on behalf of other addresses + users[_onBehalfOf].add(_amount); + // ... +} + +function initiateWithdraw(address _to, uint256 _amount) external override(IGovernance) returns (uint256) { + // ... + // No one can withdraw on behalf of someone else + users[msg.sender].sub(_amount); + // ... +} + +function propose(address _payload) external override(IGovernance) returns (bool) { + require(msg.sender == proposalsContract); + // ... +} + +function vote(uint256 _proposalId, uint256 _amount, bool _support) external override(IGovernance) returns (bool) {} + +function execute(uint256 _proposalId) external override(IGovernance) returns (bool) { + // execute proposal via `call()` +} +``` diff --git a/docs/network_versioned_docs/version-v3.0.2/concepts/governance/_category_.json b/docs/network_versioned_docs/version-v3.0.2/concepts/governance/_category_.json new file mode 100644 index 000000000000..69efe5a14964 --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/concepts/governance/_category_.json @@ -0,0 +1,6 @@ +{ + "position": 1, + "collapsible": true, + "collapsed": true, + "label": "Governance" +} diff --git a/docs/network_versioned_docs/version-v3.0.2/concepts/governance/governance.md b/docs/network_versioned_docs/version-v3.0.2/concepts/governance/governance.md new file mode 100644 index 000000000000..a96fa065538f --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/concepts/governance/governance.md @@ -0,0 +1,18 @@ +--- +id: governance +sidebar_position: 3 +title: Governance Overview +description: Learn about the governance process on the Aztec network. +--- + +import Image from "@theme/IdealImage"; + +This diagram outlines how governance works on Aztec: + + + +Sequencers put forward, or “nominate”, proposals for voting by the Aztec citizens. To do this, sequencers interact with the Governance Proposer smart contract. Nominations are “signals” by sequencers that they wish to put up for vote the execution of certain code by the Governance smart contract. + +If the Governance Proposer smart contract records a certain number of nominations/signals from sequencers, then the Governance Proposer smart contract initiates a voting process where any holders of any Hypothetical Assets can participate. + +All voting and signalling happen on the L1. diff --git a/docs/network_versioned_docs/version-v3.0.2/concepts/governance/putting_forward_proposals.md b/docs/network_versioned_docs/version-v3.0.2/concepts/governance/putting_forward_proposals.md new file mode 100644 index 000000000000..270f69e3c8be --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/concepts/governance/putting_forward_proposals.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 0 +title: Putting forward Proposals +description: Learn how to put forward proposals for governance on the Aztec network. +--- + +Sequencers of the _current_ canonical rollup (as indicated by the Registry) can propose changes to the Aztec community for voting. In order for a proposal to be voted on through the governance process, _N_ sequencers must nominate the proposal in any given round. A round is defined as a sequence of contiguous _M_ L2 blocks. Both _N_ and _M_ are governance defined parameters. + +Sequencers can only nominate a proposal during an L2 slot for which they’ve been assigned proposer duties. This minimizes timing games and provides a lower bound on the time required to successfully bring about a vote by governance. + +A mechanism is also proposed whereby any Hypothetical Asset holder (“Holderˮ) can burn a large quantity of Hypothetical Asset to trigger a vote on a proposal, without having the sequencers nominating the proposal. Note that Hypothetical Asset holders would still need to vote to approve any proposals nominated via this mechanism. + +To nominate a proposal, a sequencer of the current canonical rollup would deploy two sets of contracts: + +1. The upgraded contracts they wish to upgrade to +2. `code` which can be executed by governance to upgrade into these contracts + +Then when it is their turn as the proposer, they call `vote(address _proposal)` on the `Proposals` contract, where `_proposal ` is the address of the `code` payload. Alternatively, sequencers can set the `GOVERNANCE_PROPOSAL_PAYLOAD=_proposal` env variable which will call `vote(address _proposal)` during a slot they're eligible to signal in. diff --git a/docs/network_versioned_docs/version-v3.0.2/concepts/governance/upgrades.md b/docs/network_versioned_docs/version-v3.0.2/concepts/governance/upgrades.md new file mode 100644 index 000000000000..8bf80b60b125 --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/concepts/governance/upgrades.md @@ -0,0 +1,41 @@ +--- +sidebar_position: 4 +title: Upgrades +description: Learn about the network upgrade process for the Aztec network. +--- + +Upgrades involve transitioning the network to a new instance of the Rollup contract. They might fix vulnerabilities, introduce new features, or enhance performance. + +## AZIP + +It is expected that the community will coordinate upgrade proposals via an AZIP process, which is a design document outlining the upgrade rationale and one that allows for collecting technical input from and by the community. + +Once developers of client software agree to support the upgrade, sequencers can begin signaling to table this proposal from a certain block height. + +## Initial Contract Deployment + +The initial deployment creates a set of contracts, as described in the [Deployment section](../deployments/what_is_deployment.md). + +## Upgrading the Rollup Contract + +1. **Proposal Creation:** + + - A new Rollup contract is deployed to the network + - Proposal code to execute the upgrade is deployed separately + +2. **Sequencer Participation:** + + - Sequencers must signal their readiness by voting through the Proposals contract. + - This vote occurs during their assigned L2 slot, as dictated by the L1 Rollup smart contract. + +3. **Governance Approval:** + - Hypothetical Asset holders vote to approve or reject the proposal. Votes are proportional to the amount of Hypothetical Asset locked in the Governance contract. + +## Proposal Execution + +After governance approval and a delay period, the proposal becomes executable: + +- Any Ethereum account can call `execute(_proposalId)` on the Governance contract. +- The `execute` function calls the proposal code, transitioning the network to the new Rollup instance. + +For a more hands-on guide to participating in governance as a sequencer, see the [Governance and Proposal Process](../../operation/sequencer_management/creating_and_voting_on_proposals.md) guide. diff --git a/docs/network_versioned_docs/version-v3.0.2/concepts/governance/voting.md b/docs/network_versioned_docs/version-v3.0.2/concepts/governance/voting.md new file mode 100644 index 000000000000..e21008876b37 --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/concepts/governance/voting.md @@ -0,0 +1,11 @@ +--- +sidebar_position: 1 +title: Voting on Proposals +description: Learn about the voting process for governance on the Aztec network. +--- + +Holders have the ability to vote on proposals as long as they lock any Hypothetical Assets within the Governance contract. The act of locking the funds can be thought of as “activatingˮ the voting power of Hypothetical Asset. Locked Hypothetical Assets used to vote on a proposal must wait a delay before being withdrawn to prevent malicious governance attacks. + +Hypothetical Assets locked in the Governance contract are simply locked and not “at stakeˮ i.e. there are no slashing conditions. + +Since sequencers may be able to stake Hypothetical Assets with the rollup instances in order to join the sequencer set, the rollup instance could in turn lock those Hypothetical Assets in the Governance contract and vote on behalf of the sequencers. This is expected behavior. diff --git a/docs/network_versioned_docs/version-v3.0.2/concepts/proof_of_stake/_category_.json b/docs/network_versioned_docs/version-v3.0.2/concepts/proof_of_stake/_category_.json new file mode 100644 index 000000000000..b4fac2f6e6ab --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/concepts/proof_of_stake/_category_.json @@ -0,0 +1,6 @@ +{ + "position": 3, + "collapsible": true, + "collapsed": true, + "label": "Proof of Stake" +} diff --git a/docs/network_versioned_docs/version-v3.0.2/concepts/proof_of_stake/index.md b/docs/network_versioned_docs/version-v3.0.2/concepts/proof_of_stake/index.md new file mode 100644 index 000000000000..1815233c7d35 --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/concepts/proof_of_stake/index.md @@ -0,0 +1,8 @@ +--- +sidebar_position: 1 +title: Proof of Stake system +description: Learn about the proof of stake mechanism on the Aztec network. +draft: true +--- + +This doc will be updated soon. \ No newline at end of file diff --git a/docs/network_versioned_docs/version-v3.0.2/concepts/proof_of_stake/slashing.md b/docs/network_versioned_docs/version-v3.0.2/concepts/proof_of_stake/slashing.md new file mode 100644 index 000000000000..e196cb36e10c --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/concepts/proof_of_stake/slashing.md @@ -0,0 +1,53 @@ +--- +sidebar_position: 2 +title: Slashing +description: Learn about the slashing mechanism on the Aztec network. +draft: true +--- + +We need to make sure that the chain is always (eventually) finalizing new blocks. +The following conditions are required for the chain to finalize new blocks: + +1. More than 2/3 of the committee is making attestations +2. Provers are producing proofs. + +## Avoiding network halt + +There are some actions that impact the chainʼs ability to finalize new blocks: + +### Insufficient quorum + +In the event that a significant portion of the sequencer set goes offline (i.e. large internet outage) and proposers are unable to get enough attestations on block proposals, the Aztec Rollup will be unable to finalize new blocks. This will require the community to engage to fix the issue and make sure new blocks are being finalized. + +In the event of a prolonged period where the Aztec Rollup is not finalizing new blocks, it may enter Based Fallback mode. The conditions that lead to [Based Fallback (forum link)](https://forum.aztec.network/t/request-for-comments-aztecs-block-production-system/6155) mode are expected to be well defined by the community of sequencers, provers, client teams and all other Aztec Rollup stakeholders and participants. + +During Based Fallback mode, anyone can propose blocks if they supply proofs for these blocks alongside them. This is in contrast to the usual condition that only the sequencer assigned to a particular slot can propose blocks during that slot. This means that the inactive sequencer set is bypassed and anyone can advance the chain in the event of an inactive / non-participating sequencer set. + +But terminally inactive sequencers must be removed from the sequencer set or otherwise we end up in Based Fallback too often. Slashing is a method whereby the sequencer set votes to “slash” the stake of inactive sequencers down to a point where they are kicked off the sequencer set. For example, if we set `MINIMUM_STAKING_BALANCE=50%` then as soon as 50% or more of a sequencer's balance is slashed, they will be kicked out of the set. + +### Committee withholding data from the provers + +Provers need the transaction data (i.e. `TxObjects`) plus the client-side generated proofs to produce the final rollup proof, none of which are posted onchain. Client side proofs + transaction data are gossiped on the p2p instead so that committee members can re-execute block proposals and verify that the proposed state root is correct. + +Recall from the [RFC (forum link)](https://forum.aztec.network/t/request-for-comments-aztecs-block-production-system/6155) on block production that the committee is a subset of sequencers, randomly sampled from the entire sequencer set. Block proposers are sampled from this committee. ⅔ + 1 of this committee must attest to L2 block proposals before they are posted to the L1 by the block proposer. + +A malicious committee may not gossip the transaction data or proofs to the rest of the sequencer set, nor to the provers. As a result, no prover can produce the proof and the epoch in question will reorg by design. Recall from the RFC on block production that if no proof for epoch N is submitted to L1 by the end of epoch N+1, then epoch N + any blocks built in epoch N+1 are reorged. + +### Committee proposing an invalid state root + +Committee members who receive a block proposal from a proposer, must execute the block’s transaction to compare the resulting state root with that contained in the proposal. In theory, a committee member should only attest to a block proposal’s validity after checking for the correctness of the state root. + +A committee member could skip re-executing block proposals, for a number of reasons including saving compute, faulty client software or maliciousness. This opens up the possibility of a malicious proposer posting an invalid state transition to L1. Or a malicious entity that bribes ⅔ + 1 of the committee can obtain the required signatures to post an invalid state transition. +The epoch will not be proven and will be re-orged. + +### L1 congestion has made it impossible for provers to land proofs on time + +An honest prover who has funds at stake (i.e. posted a bond to produce the epoch proof), could be unable to post the proof on L1 due to congestion, an L1 reorg or just an inactivity of the L1 proposers (i.e. inactivity leak). + +## Slashing mechanism + +In all the previous cases, it is very hard to verify and automatically slash for these events onchain. This is mainly due to the fact that neither TxObjects nor client side proofs are posted onchain. Committee members also gossip attestations on the p2p and do not post them directly on chain. + +Therefore a slashing mechanism is required as a deterrence against the malicious behaviour by sequencers and to make sure that the Aztec Rollup retains liveness. The sequencer set votes to slash dishonest sequencers based on evidence that is collected onchain + offchain, and discussed and analyzed offchain (i.e. on a forum). + +A sequencer must aggregate BLS signatures on slashing proposals and post them to the L1 for slash execution. diff --git a/docs/network_versioned_docs/version-v3.0.2/concepts/provers-and-sequencers/_category_.json b/docs/network_versioned_docs/version-v3.0.2/concepts/provers-and-sequencers/_category_.json new file mode 100644 index 000000000000..24bb8c8ac104 --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/concepts/provers-and-sequencers/_category_.json @@ -0,0 +1,7 @@ +{ + "position": 4, + "collapsible": true, + "collapsed": true, + "label": "Provers and Sequencers" +} + diff --git a/docs/network_versioned_docs/version-v3.0.2/concepts/provers-and-sequencers/index.md b/docs/network_versioned_docs/version-v3.0.2/concepts/provers-and-sequencers/index.md new file mode 100644 index 000000000000..cc05c547bd66 --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/concepts/provers-and-sequencers/index.md @@ -0,0 +1,16 @@ +--- +sidebar_position: 0 +title: Provers and Sequencers +description: Learn about the roles of provers and sequencers on the Aztec network. +draft: true +--- + +## Block Production Overview + +Both sequencing and proving in the Aztec Network are intended to be fully decentralized. + +Sequencers will be chosen via a random election, while provers will be selected by sequencers via an out-of-protocol coordination mechanism. + +The proposers in the first `C=13` slots in epoch `N+1` will accept quotes to prove epoch N from provers. The winning prover will have until the end of epoch `N+1` to produce and submit the proof to L1. + +If you are interested in running a sequencer node or a prover node, you can refer to the [sequencer guide](../../setup/sequencer_management) or [prover guide](../../setup/running_a_prover.md). diff --git a/docs/network_versioned_docs/version-v3.0.2/concepts/provers-and-sequencers/proving_coordination_workflow.md b/docs/network_versioned_docs/version-v3.0.2/concepts/provers-and-sequencers/proving_coordination_workflow.md new file mode 100644 index 000000000000..2e03205b8230 --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/concepts/provers-and-sequencers/proving_coordination_workflow.md @@ -0,0 +1,107 @@ +--- +sidebar_position: 1 +title: Prover Coordination Workflow +description: Learn about the proving coordination workflow on the Aztec network. +draft: true +--- + +Proposers run RFQs to obtain quotes from provers. Quotes are binding promises from provers to prove an entire epoch. The exact channel over which provers send quotes to proposers is **NOT** enshrined by the protocol. + +However, Aztec Nodes will support two optional mechanisms that provers can use to submit quotes to proposers: + +- Gossip quotes via the P2P +- Send a quote directly via HTTP (i.e. http://aztec-node:8000) + +To send a quote via the P2P, do not set the environment variable `PROVER_COORDINATION_NODE_URL` and make sure that `P2P_ENABLED` is set to `true`. + +**For S&P Testnet:** Please make sure that you are gossiping quotes via the P2P. Set `P2P_ENABLED` to `true` and do not use `PROVER_COORDINATION_NODE_URL`. + + +```rust +struct EpochProofQuote { + Signature signature; + address prover; + uint256 epochNumber; + uint256 epochInitBlock; + uint256 epochFinalBlock; + uint256 totalFees; + address rollupAddress; + uint32 basisPointFee; + uint256 bondAmount; +} +``` + +To accomplish this coordination through the Aztec node software, we extend both the `P2PClient` and `ProverNode`. + +## P2P client + +The `P2PClient` will be extended by: + +```typescript +class P2PClient { + //... + + async addEpochProofQuote(quote: EpochProofQuote): Promise { + // Add quote to quote memory pool + this.epochProofQuotePool.addQuote(quote); + + // Propagate quote via P2P + this.broadcastEpochProofQuote(quote); + } +} +``` + +This is called by the Prover Node inside `ProverNode.sendEpochProofQuote()` after it detects an epoch has ended. + +## Prover Node + +As for the Prover Node, we add `QuoteProvider` and `BondManager` interfaces. Also an `EpochMonitor` which sits on the main start loop of the Prover Node. It fetches the most recent completed epochs and checks whether the proposer accepted an `EpochProofQuote`. + +If no quote has been accepted yet, the `EpochMonitor` will call on `BondManager` and `QuoteProvider` to provide a valid quote. If the claim detected belongs to the prover, the monitor will kick off a `handleCall()` to create proving jobs. + +```typescript +interface BondManager { + ensureBond(amount: number): Promise; +} +interface QuoteProvider { + getQuote(epoch: number): Promise; +} +``` + +When the prover node first starts up, it will call `BondManager.ensureBond` to ensure it has the minimum deposit amount `PROVER_MINIMUM_ESCROW_AMOUNT` deposited in the escrow contract. If it does not, it will top up to the target deposit amount `PROVER_TARGET_ESCROW_AMOUNT`. + +Both `PROVER_MINIMUM_ESCROW_AMOUNT` and `PROVER_TARGET_ESCROW_AMOUNT` are customizable environment variables. + +The `EpochMonitor` will then get the last completed, unproven epoch and will call the `QuoteProvider` to generate a quote if the epoch has not been claimed by any provers yet. The `QuoteProvider` will be provided with all the blocks in the unproven epoch so it could perform any custom logic to determine the quote parameters, i.e., `bondAmount`, `basisPointFee`, etc. + +Alternatively, the quote provider can issue an HTTP POST to a configurable `QUOTE_PROVIDER_URL` to get the quote. The request body is JSON-encoded and contains the following fields: + +- `epochNumber`: The epoch number to prove +- `fromBlock`: The first block number of the epoch to prove +- `endBlock`: The last block number (inclusive) of the epoch to prove +- `txCount`: The total number of txs in the epoch +- `totalFees`: The accumulated total fees across all txs in the epoch + +The response is also expected in JSON and to contain `basisPointFee` and `bondAmount` fields. Optionally, the request can include a `validUntilSlot` parameter, which specifies for how many slots the quote remains valid. For example, an `EpochProofQuote` with parameters `epochProofQuote#80` and `validUntilSlot#5` means that any of the first 5 proposers in epoch 101 can “claim” this quote. + +If no `QUOTE_PROVIDER_URL` is passed along to the Prover Node, then a `SimpleQuoteProvider` is used, which always returns the same `basisPointFee` and `bondAmount` as set in the `QUOTE_PROVIDER_BASIS_POINT_FEE` and `QUOTE_PROVIDER_BOND_AMOUNT` environment variables. + +:::warning Quote Requirements +If the `QuoteProvider` does not return a `bondAmount` or a `basisPointFee`, the Prover Node will not generate nor submit a quote to the proposer. +::: + +Separately, the Prover Node needs a watcher on L1 to detect if its quote has been selected. + +To this end, the `L1Publisher` will be extended with a new method to retrieve proof claims. + +```typescript +interface L1Publisher { + getProofClaim(): Promise; +} +``` + +The Prover Node will call this method at least once per L2 slot to check for unclaimed accepted quotes if its quotes have been accepted. You can update the polling interval using the environment variable `PROVER_NODE_POLLING_INTERVAL_MS`. + +## Run a prover + +Go to the [Prover Guide](../../setup/running_a_prover.md) to run a prover. diff --git a/docs/network_versioned_docs/version-v3.0.2/concepts/provers-and-sequencers/sequencer/index.md b/docs/network_versioned_docs/version-v3.0.2/concepts/provers-and-sequencers/sequencer/index.md new file mode 100644 index 000000000000..099b0e4f20f5 --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/concepts/provers-and-sequencers/sequencer/index.md @@ -0,0 +1,46 @@ +--- +title: Sequencer +tags: [protocol, sequencer] +draft: true +description: Understand the role of sequencers in Aztec, how they order transactions and produce blocks. +--- + +The sequencer is a module responsible for creating and publishing new rollup blocks. This involves fetching txs from the P2P pool, ordering them, executing any public functions, running them through the rollup circuits, assembling the L2 block, and posting it to the L1 rollup contract along with any contract deployment public data. + +On every new block assembled, it modifies the world state database to reflect the txs processed, but these changes are only committed once the world state synchronizer sees the new block on L1. + +## Components + +The **block builder** is responsible for assembling an L2 block out of a set of processed transactions (we say a tx has been processed if all its function calls have been executed). This involves running the txs through the base, merge, and rollup circuits, updating the world state trees, and building the L2 block object. + +The **prover** generates proofs for every circuit used. For the time being, no proofs are being actually generated, so the only implementation is an empty one. + +The **publisher** deals with sending L1 transactions to the rollup and contract deployment emitter contracts. It is responsible for assembling the Ethereum tx, choosing reasonable gas settings, and monitoring the tx until it gets mined. Note that the current implementation does not handle unstable network conditions (gas price spikes, reorgs, etc). + +The **public processor** executes any public function calls in the transactions. Unlike private function calls, which are resolved in the client, public functions require access to the latest data trees, so they are executed by the sequencer, much like in any non-private L2. + +The **simulator** is an interface to the wasm implementations of the circuits used by the sequencer. + +The **sequencer** pulls txs from the P2P pool, orchestrates all the components above to assemble and publish a block, and updates the world state database. + +## Circuits + +What circuits does the sequencer depend on? + +The **public circuit** is responsible for proving the execution of Brillig (public function bytecode). At the moment, we are using a fake version that actually runs ACIR (intermediate representation for private functions) and does not emit any proofs. + +The **public kernel circuit** then validates the output of the public circuit, and outputs a set of changes to the world state in the same format as the private kernel circuit, meaning we get a standard representation for all txs, regardless of whether public or private functions (or both) were run. The kernel circuits are run iteratively for every recursive call in the transaction. + +The **base rollup circuit** aggregates the changes from two txs (more precisely, the outputs from their kernel circuits once all call stacks are emptied) into a single output. + +The **merge rollup circuit** aggregates two outputs from base rollup circuits into a single one. This circuit is executed recursively until only two outputs are left. This setup means that an L2 block needs to contain always a power-of-two number of txs; if there are not enough, then empty txs are added. + +The **root rollup circuit** consumes two outputs from base or merge rollups and outputs the data to assemble an L2 block. The L1 rollup contract then verifies the proof from this circuit, which implies that all txs included in it were correct. + +## Source code + +You can view the current implementation on Github [here](https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/sequencer-client). + +## Further Reading + +- [Sequencer Selection](sequencer_selection.md) diff --git a/docs/network_versioned_docs/version-v3.0.2/concepts/provers-and-sequencers/sequencer/sequencer_selection.md b/docs/network_versioned_docs/version-v3.0.2/concepts/provers-and-sequencers/sequencer/sequencer_selection.md new file mode 100644 index 000000000000..f325bbae91be --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/concepts/provers-and-sequencers/sequencer/sequencer_selection.md @@ -0,0 +1,103 @@ +--- +title: Sequencer Selection +tags: [protocol, sequencer] +draft: true +description: Learn about the sequencer selection mechanism in Aztec and how sequencers are chosen for block production. +--- + +## Fernet + +_A protocol for random sequencer selection for the Aztec Network. Prior versions:_ + +- [Fernet 52 (Aug 2023)](https://hackmd.io/0cI_xVsaSVi7PToCJ9A2Ew?view) +- [Sequencer Selection: Fernet (Jun 2023)](https://hackmd.io/0FwyoEjKSUiHQsmowXnJPw?both) +- [Sequencer Selection: Fernet (Jun 2023, Forum)](https://discourse.aztec.network/t/proposal-sequencer-selection-fernet/533) + +## Introduction + +_Fair Election Randomized Natively on Ethereum Trustlessly_ (**Fernet**) is a protocol for random _sequencer_ selection. In each iteration, it relies on a VRF to assign a random score to each sequencer in order to rank them. The sequencer with the highest score can propose an ordering for transactions and the block they build upon, and then reveal its contents for the chain to advance under soft finality. _Provers_ must then assemble a proof for this block and submit it to L1 for the block to be finalized. + +## Staking + +Sequencers are required to stake on L1 in order to participate in the protocol. Each sequencer registers a public key when they stake, which will be used to verify their VRF submission. After staking, a sequencer needs to wait for an activation period of N L1 blocks until they can start proposing new blocks. Unstaking also requires a delay to allow for slashing of dishonest behavior. + +## Randomness + +We use a verifiable random function to rank each sequencer. We propose a SNARK of a hash over the sequencer private key and a public input, borrowing [this proposal from the Espresso team](https://discourse.aztec.network/t/proposal-sequencer-selection-irish-coffee/483#vrf-specification-4). The public input is the current block number and a random beacon value from RANDAO. The value sourced from RANDAO should be old enough to prevent L1 reorgs from affecting sequencer selection on L2. This approach allows each individual proposer to secretly calculate the likelihood of being elected for a given block with enough anticipation. + +Alternatively, we can compute the VRF over the _public_ key of each sequencer. This opens the door to DoS attacks, since the leader for each block becomes public in advance, but it also provides clarity to all sequencers as to who the expected leader is, and facilitates off-protocol PBS. + +## Protocol phases + +Each block goes through three main phases in L1: proposal, reveal, and proving. Transactions can achieve soft finality at the end of the reveal phase. + +![](https://hackmd.io/_uploads/SyReMn1An.png) + +### Proposal phase + +During the initial proposal phase, proposers submit to L1 a **block commitment**, which includes a commitment to the transaction ordering in the proposed block, the previous block being built upon, and any additional metadata required by the protocol. + +**Block commitment contents:** + +- Hash of the ordered list of transaction identifiers for the block (with an optional salt). +- Identifier of the previous block in the chain. +- The output of the VRF for this sequencer. + +At the end of the proposal phase, the sequencer with the highest score submitted becomes the leader for this cycle, and has exclusive rights to decide the contents of the block. Note that this plays nicely with private mempools, since having exclusive rights allows the leader to disclose private transaction data in the reveal phase. + +> _In the original version of Fernet, multiple competing proposals could enter the proving phase. Read more about the rationale for this change [here](https://hackmd.io/0cI_xVsaSVi7PToCJ9A2Ew?both#Mitigation-Elect-single-leader-after-proposal-phase)._ + +### Reveal phase + +The sequencer with the highest score in the proposal phase must then upload the block contents to either L1 or a verifiable DA layer. This guarantees that the next sequencer will have all data available to start building the next block, and clients will have the updated state to create new txs upon. It should be safe to assume that, in the happy path, this block would be proven and become final, so this provides early soft finality to transactions in the L2. + +> _This phase is a recent addition and a detour from the original version of Fernet. Read more about the rationale for this addition [here](https://hackmd.io/0cI_xVsaSVi7PToCJ9A2Ew?both#Mitigation-Block-reveal-phase)._ + +Should the leading sequencer fail to reveal the block contents, we flag that block as skipped, and the next sequencer is expected to build from the previous one. We could consider this to be a slashing condition for the sequencer. + +![](https://hackmd.io/_uploads/B1njcnJCn.png) + +### Proving phase + +During this phase, provers work to assemble an aggregated proof of the winning block. Before the end of this phase, it is expected for the block proof to be published to L1 for verification. + +> Prover selection is still being worked on and out of scope of this sequencer selection protocol. + +Once the proof for the winning block is submitted to L1, the block becomes final, assuming its parent block in the chain is also final. This triggers payouts to sequencer and provers (if applicable depending on the proving network design). + +**Canonical block selection:** + +- Has been proven during the proving phase. +- Its contents have been submitted to the DA layer in the reveal phase. +- It had the highest score on the proposal phase. +- Its referenced previous block is also canonical. + +## Next block + +The cycle for block N+1 (ie from the start of the proposal phase until the end of the proving phase) can start at the end of block N reveal phase, where the network has all data available on L1 or a DA to construct the next block. + +![](https://hackmd.io/_uploads/SJbPKJe0n.png) + +The only way to trigger an L2 reorg (without an L1 one) is if block N is revealed but doesn't get proven. In this case, all subsequent blocks become invalidated and the chain needs to restart from block N-1. + +![](https://hackmd.io/_uploads/HkMDHxxC2.png) + +To mitigate the effect of wasted effort by all sequencers from block N+1 until the reorg, we could implement uncle rewards for these sequencers. And if we are comfortable with slashing, take those rewards out of the pocket of the sequencer that failed to finalize their block. + +## Batching + +> _Read more approaches to batching [here](https://hackmd.io/0cI_xVsaSVi7PToCJ9A2Ew?both#Batching)._ + +As an extension to the protocol, we can bake in batching of multiple blocks. Rather than creating one proof per block, we can aggregate multiple blocks into a single proof, in order to amortize the cost of verifying the root rollup ZKP on L1, thus reducing fees. + +The tradeoff in batching is delayed finalization: if we are not posting proofs to L1 for every block, then the network needs to wait until the batch proof is submitted for finalization. This can also lead to deeper L2 reorgs. + +In a batching model, proving for each block happens immediately as the block is revealed, same as usual. But the resulting proof is not submitted to L1: instead, it is aggregated into the proof of the next block. + +![](https://hackmd.io/_uploads/H1Y61ABJT.png) + +Here all individual block proofs are valid as candidates to finalize the current batch. This opens the door to dynamic batch sizes, so the proof could be verified on L1 when it's economically convenient. + +## Resources + +- [Excalidraw diagrams](https://excalidraw.com/#json=DZcYDUKVImApNjj17KhAf,fMbieqJpOysX9obVitUDEA) diff --git a/docs/network_versioned_docs/version-v3.0.2/index.md b/docs/network_versioned_docs/version-v3.0.2/index.md new file mode 100644 index 000000000000..0bc07d4de2fa --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/index.md @@ -0,0 +1,91 @@ +--- +id: index +sidebar_position: 0 +title: Introduction +description: Learn about the Aztec network, node types, roles, best practices, and how to participate in the network. +--- + +## Overview + +The Aztec network is a decentralized privacy-focused rollup on Ethereum. Network nodes work together to process transactions, maintain state, and generate proofs that ensure rollup integrity. This guide provides an overview of node types, their roles, best practices, and how to get started. + +## Actors and Roles + +The Aztec network consists of several types of actors, each serving a specific purpose: + +### Full Nodes + +Full nodes provide users with the ability to connect and interact with the network. They maintain a complete copy of the blockchain state and allow users to send and receive transactions without relying on third parties. + +**Key responsibilities:** +- Maintain synchronized copy of the blockchain state +- Provide RPC interface for transaction submission +- Validate and relay transactions +- Offer privacy-preserving interaction with the network + +[Learn more about running a full node →](./setup/running_a_node.md) + +### Sequencer Nodes + +Sequencer nodes order transactions and produce blocks. Selected via a proof-of-stake mechanism, they play a critical role in the consensus process. + +**Key responsibilities:** +- Assemble unprocessed transactions and propose new blocks +- Execute public functions in transactions +- Attest to correct execution when part of the sequencer committee +- Submit successfully attested blocks to L1 + +Before publication, blocks must be validated by a committee of sequencer nodes who re-execute public transactions and verify private function proofs. Committee members attest to validity by signing the block header. Once sufficient attestations are collected (two-thirds of the committee plus one), the block can be submitted to L1. + +[Learn more about running a sequencer →](./setup/sequencer_management.md) + +### Provers + +Provers generate cryptographic proofs that attest to transaction correctness. They produce the final rollup proof submitted to Ethereum, ensuring rollup integrity. + +**Key components and responsibilities:** +- **Prover node**: Polls L1 for unproven epochs, creates prover jobs, and submits final proofs +- **Prover broker**: Manages job queues and distributes work to agents +- **Prover agents**: Execute proof generation jobs in a stateless manner + +Note that running provers require: +- High-performance hardware (typically data center-grade) +- Significant computational resources for proof generation +- Technical expertise in operating distributed systems + +[Learn more about running a prover →](./setup/running_a_prover.md) + +## How Nodes Work Together + +The Aztec network operates through the coordinated interaction of these different node types: + +1. **Transaction Flow**: Users submit transactions to full nodes, which validate and propagate them through the P2P network +2. **Block Production**: Sequencer nodes collect transactions from the mempool, order them, and propose new blocks +3. **Consensus**: The sequencer committee validates proposed blocks and provides attestations +4. **Proof Generation**: Prover nodes generate cryptographic proofs for epochs of blocks +5. **L1 Submission**: Sequencers submit attested blocks and provers submit epoch proofs to Ethereum + +## Using Your Own L1 Node + +For optimal performance and reliability, it's highly recommended to run your own Ethereum L1 node rather than relying on third-party RPC providers. + +**Benefits:** +- Better performance and lower latency +- No rate limiting or request throttling +- Greater reliability and uptime control +- Enhanced privacy for your node operations + +**Requirements:** +- Access to both execution and consensus client endpoints +- Endpoints must support high throughput +- Must be connected to Sepolia testnet for Aztec testnet + +See [Eth Docker's guide](https://ethdocker.com/Usage/QuickStart) for setting up your own L1 node. + +## Next Steps + +- **Check Prerequisites**: Review the [prerequisites guide](./prerequisites.md) to ensure you have everything needed +- **Run a Full Node**: Follow the [complete full node guide](./setup/running_a_node.md) for detailed setup instructions +- **Operate a Sequencer**: Learn how to [run a sequencer node](./setup/sequencer_management.md) and join the validator set +- **Operate a Prover**: Set up [prover infrastructure](./setup/running_a_prover.md) to generate rollup proofs +- **Join the Community**: Connect with other operators on [Discord](https://discord.gg/aztec) diff --git a/docs/network_versioned_docs/version-v3.0.2/operation/_category_.json b/docs/network_versioned_docs/version-v3.0.2/operation/_category_.json new file mode 100644 index 000000000000..2bf7015f1f6f --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/operation/_category_.json @@ -0,0 +1,6 @@ +{ + "position": 6, + "collapsible": true, + "collapsed": false, + "label": "Operation" +} diff --git a/docs/network_versioned_docs/version-v3.0.2/operation/grafana_setup.md b/docs/network_versioned_docs/version-v3.0.2/operation/grafana_setup.md new file mode 100644 index 000000000000..eb8eb4b5ce49 --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/operation/grafana_setup.md @@ -0,0 +1,170 @@ +--- +title: Grafana Setup +description: Configure Grafana to visualize Aztec node metrics and set up alerts for monitoring your node's health. +--- + +## Overview + +Grafana provides visualization and alerting for your metrics, allowing you to create custom dashboards and receive notifications when issues arise. + +## Prerequisites + +- Completed [Prometheus Setup](./prometheus_setup.md) +- Prometheus running and accessible at `http://prometheus:9090` + +## Setup Steps + +### Step 1: Add Grafana to Docker Compose + +Add Grafana to your `docker-compose.yml`: + +```yaml +services: + # ... existing services (otel-collector, prometheus, etc.) ... + grafana: + image: grafana/grafana:latest + container_name: aztec-grafana + ports: + - 3000:3000 + volumes: + - grafana-data:/var/lib/grafana + environment: + - GF_SECURITY_ADMIN_PASSWORD=admin + - GF_USERS_ALLOW_SIGN_UP=false + networks: + - aztec + restart: always + +volumes: + # ... existing volumes ... + grafana-data: + +networks: + aztec: + name: aztec +``` + +:::warning Admin Password Security +Change the default admin password (`GF_SECURITY_ADMIN_PASSWORD`) to a secure value for production deployments. +::: + +### Step 2: Start Grafana + +```bash +docker compose up -d grafana +``` + +### Step 3: Access Grafana + +1. Navigate to `http://localhost:3000` +2. Login with username `admin` and the password you set (default: `admin`) +3. You'll be prompted to change the password on first login + +### Step 4: Add Prometheus Data Source + +1. In the left sidebar, click **Connections** → **Data sources** +2. Click **Add data source** +3. Search for and select **Prometheus** +4. Configure: + - **Name**: Aztec Prometheus + - **URL**: `http://prometheus:9090` +5. Click **Save & Test** + +You should see a green success message confirming Grafana can connect to Prometheus. + +## Creating Dashboards + +### Option 1: Create a Basic Dashboard + +1. In the left sidebar, click **Dashboards** +2. Click **New** → **New Dashboard** +3. Click **Add visualization** +4. Select your **Aztec Prometheus** data source +5. In the query editor, enter a metric (explore available metrics using the autocomplete) +6. Customize the visualization type and settings +7. Click **Apply** +8. Click **Save dashboard** icon (top right) +9. Give your dashboard a name and click **Save** + +### Option 2: Import a Pre-built Dashboard + +If the Aztec community has created shared dashboards: + +1. Click **+** → **Import** +2. Enter dashboard ID or upload JSON file +3. Select **Aztec Prometheus** as the data source +4. Click **Import** + +### Recommended Dashboard Panels + +Example panels you can create (adjust metric names based on what's actually available): + +1. **Block Height Over Time**: Line graph tracking block sync progress +2. **Sync Rate**: Line graph showing blocks synced over time window (use `increase()` function) +3. **Peer Count**: Gauge showing P2P connections +4. **Memory Usage**: Line graph of `process_resident_memory_bytes` +5. **CPU Usage**: Line graph of `rate(process_cpu_seconds_total[5m])` + +## Setting Up Alerts + +Configure alerts to notify you of issues: + +### Step 1: Create an Alert Rule + +1. In the left sidebar, click **Alerting** (bell icon) +2. Click **Alert rules** → **New alert rule** +3. Configure your alert: + - **Query**: Select your Prometheus data source and metric (e.g., `aztec_archiver_block_height`) + - **Condition**: Define the threshold (e.g., `increase(aztec_archiver_block_height[15m]) == 0` to alert if no blocks in 15 minutes) + - **Evaluation interval**: How often to check (e.g., 1m) +4. Click **Save** + +### Step 2: Configure Contact Points + +1. Under **Alerting**, click **Contact points** +2. Click **Add contact point** +3. Choose your notification method: + - **Email**: Configure SMTP settings + - **Slack**: Add webhook URL + - **PagerDuty**: Add integration key + - **Webhook**: Custom HTTP endpoint +4. Click **Save** + +### Step 3: Create Notification Policies + +1. Under **Alerting**, click **Notification policies** +2. Click **New notification policy** +3. Define routing rules to send alerts to specific contact points +4. Click **Save** + +## Example Alert Rules + +### Node Sync Alert + +Alert if the node stops syncing blocks: + +- **Query**: `increase(aztec_archiver_block_height[15m])` +- **Condition**: `== 0` +- **Description**: Node has not synced any blocks in the last 15 minutes + +### High Memory Usage Alert + +Alert if memory usage exceeds threshold: + +- **Query**: `process_resident_memory_bytes` +- **Condition**: `> 8000000000` (8GB) +- **Description**: Node memory usage exceeds 8GB + +### Peer Connection Alert + +Alert if peer count drops too low: + +- **Query**: `aztec_peer_manager_peer_count_peers` +- **Condition**: `< 5` +- **Description**: Node has fewer than 5 peer connections + +## Next Steps + +- Explore the [Monitoring Overview](./monitoring.md) for troubleshooting and metrics reference +- Join the [Aztec Discord](https://discord.gg/aztec) to share dashboards with the community +- Configure additional notification channels for your alerts diff --git a/docs/network_versioned_docs/version-v3.0.2/operation/keystore/advanced_patterns.md b/docs/network_versioned_docs/version-v3.0.2/operation/keystore/advanced_patterns.md new file mode 100644 index 000000000000..aea97edde5bf --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/operation/keystore/advanced_patterns.md @@ -0,0 +1,288 @@ +--- +title: Sample configuration patterns +description: Learn about advanced keystore patterns including multiple publishers, multiple sequencers, and infrastructure provider scenarios. +--- + +## Overview + +This guide covers advanced keystore configuration patterns for complex deployments, including multi-publisher setups, running multiple sequencers, and infrastructure provider scenarios. + +## Multiple publishers + +Multiple publisher accounts provide: +- **Load distribution**: Spread L1 transaction costs across accounts +- **Parallelization**: Submit multiple transactions simultaneously +- **Resilience**: Continue operating if one publisher runs out of gas + +**Array of publishers:** + +```json +{ + "schemaVersion": 1, + "validators": [ + { + "attester": { + "eth": "0xATTESTER_ETH_PRIVATE_KEY", + "bls": "0xATTESTER_BLS_PRIVATE_KEY" + }, + "publisher": [ + "0xPUBLISHER_1_PRIVATE_KEY", + "0xPUBLISHER_2_PRIVATE_KEY", + "0xPUBLISHER_3_PRIVATE_KEY" + ], + "feeRecipient": "0x1234567890123456789012345678901234567890123456789012345678901234" + } + ] +} +``` + +**Mixed storage methods:** + +```json +{ + "schemaVersion": 1, + "remoteSigner": "https://signer1.example.com:8080", + "validators": [ + { + "attester": { + "eth": "0xATTESTER_ETH_PRIVATE_KEY", + "bls": "0xATTESTER_BLS_PRIVATE_KEY" + }, + "publisher": [ + "0xLOCAL_PRIVATE_KEY", + "0xREMOTE_SIGNER_ADDRESS_1", + { + "address": "0xREMOTE_SIGNER_ADDRESS_2", + "remoteSignerUrl": "https://signer2.example.com:8080" + }, + { + "mnemonic": "test test test test test test test test test test test junk", + "addressCount": 2 + } + ], + "feeRecipient": "0x1234567890123456789012345678901234567890123456789012345678901234" + } + ] +} +``` + +This creates 5 publishers: +1. Local private key +2. Address in default remote signer (signer1.example.com) +3. Address in alternative remote signer (signer2.example.com) +4. Two mnemonic-derived addresses + +:::warning Publisher Funding Required +All publisher accounts must be funded with ETH. Monitor balances to avoid missed proposals or proofs. +::: + +## Multiple sequencers + +Run multiple sequencer identities in a single node. This is useful when you operate multiple sequencers but want to consolidate infrastructure. + +:::info High Availability Across Nodes +If you want to run the **same** sequencer across multiple nodes for redundancy and high availability, see the [High Availability Sequencers guide](../../setup/high_availability_sequencers.md). That guide covers running one sequencer identity on multiple physical nodes. + +This section covers running **multiple different sequencer identities** on a single node. +::: + +**When to use multiple sequencers per node:** +- You have multiple sequencer identities (different attester addresses) +- You want to consolidate infrastructure and reduce operational overhead +- You're running sequencers for multiple entities or clients +- You want to simplify management of several sequencers + +**Use two approaches:** + +**Option 1: Shared configuration** + +Multiple attesters sharing the same publisher, coinbase, and fee recipient: + +```json +{ + "schemaVersion": 1, + "validators": [ + { + "attester": [ + { + "eth": "0xSEQUENCER_1_ETH_KEY", + "bls": "0xSEQUENCER_1_BLS_KEY" + }, + { + "eth": "0xSEQUENCER_2_ETH_KEY", + "bls": "0xSEQUENCER_2_BLS_KEY" + } + ], + "publisher": ["0xSHARED_PUBLISHER"], + "coinbase": "0xSHARED_COINBASE", + "feeRecipient": "0xSHARED_FEE_RECIPIENT" + } + ] +} +``` + +**Option 2: Separate configurations** + +Each sequencer with its own publisher, coinbase, and fee recipient: + +```json +{ + "schemaVersion": 1, + "validators": [ + { + "attester": { + "eth": "0xSEQUENCER_1_ETH_KEY", + "bls": "0xSEQUENCER_1_BLS_KEY" + }, + "publisher": ["0xPUBLISHER_1"], + "coinbase": "0xCOINBASE_1", + "feeRecipient": "0xFEE_RECIPIENT_1" + }, + { + "attester": { + "eth": "0xSEQUENCER_2_ETH_KEY", + "bls": "0xSEQUENCER_2_BLS_KEY" + }, + "publisher": ["0xPUBLISHER_2"], + "coinbase": "0xCOINBASE_2", + "feeRecipient": "0xFEE_RECIPIENT_2" + } + ] +} +``` + +For high availability configurations where you run the same sequencer across multiple nodes, see the [High Availability Sequencers guide](../../setup/high_availability_sequencers.md). + +## Infrastructure provider scenarios + +### Scenario 1: Multiple sequencers with isolation + +For sequencers requiring complete separation, use separate keystore files: + +**keystore-sequencer-a.json:** +```json +{ + "schemaVersion": 1, + "validators": [ + { + "attester": { + "eth": "0xSEQUENCER_A_ETH_KEY", + "bls": "0xSEQUENCER_A_BLS_KEY" + }, + "feeRecipient": "0xFEE_RECIPIENT_A" + } + ] +} +``` + +**keystore-sequencer-b.json:** +```json +{ + "schemaVersion": 1, + "validators": [ + { + "attester": { + "eth": "0xSEQUENCER_B_ETH_KEY", + "bls": "0xSEQUENCER_B_BLS_KEY" + }, + "feeRecipient": "0xFEE_RECIPIENT_B" + } + ] +} +``` + +Point `KEY_STORE_DIRECTORY` to the directory containing both files. + +### Scenario 2: Shared publisher infrastructure + +Multiple sequencers sharing a publisher pool for simplified gas management: + +```json +{ + "schemaVersion": 1, + "validators": [ + { + "attester": { + "eth": "0xSEQUENCER_1_ETH_KEY", + "bls": "0xSEQUENCER_1_BLS_KEY" + }, + "publisher": ["0xPUBLISHER_1", "0xPUBLISHER_2"], + "feeRecipient": "0xFEE_RECIPIENT_1" + }, + { + "attester": { + "eth": "0xSEQUENCER_2_ETH_KEY", + "bls": "0xSEQUENCER_2_BLS_KEY" + }, + "publisher": ["0xPUBLISHER_1", "0xPUBLISHER_2"], + "feeRecipient": "0xFEE_RECIPIENT_2" + } + ] +} +``` + +Both sequencers share publishers while maintaining separate identities and fee recipients. + +## Prover configurations + +**Simple prover** (uses same key for identity and publishing): + +```json +{ + "schemaVersion": 1, + "prover": "0xPROVER_PRIVATE_KEY" +} +``` + +**Prover with dedicated publishers:** + +```json +{ + "schemaVersion": 1, + "prover": { + "id": "0xPROVER_IDENTITY_ADDRESS", + "publisher": [ + "0xPUBLISHER_1_PRIVATE_KEY", + "0xPUBLISHER_2_PRIVATE_KEY" + ] + } +} +``` + +The `id` receives prover rewards while `publisher` accounts submit proofs. + +## Complete Configuration Examples + +### High Availability Sequencer Setup + +Creating keystores for running the same sequencer across multiple nodes: + +```bash +# Step 1: Generate a base keystore with your attester and multiple publishers +aztec validator-keys new \ + --fee-recipient [YOUR_FEE_RECIPIENT] \ + --mnemonic "your shared mnemonic..." \ + --address-index 0 \ + --publisher-count 3 \ + --data-dir ~/keys-temp + +# This generates ONE keystore with: +# - Attester keys (ETH and BLS) at derivation index 0 +# - Three publisher keys at indices 1, 2, and 3 +``` + +After generation, you'll have a keystore with one attester and multiple publishers. Create separate keystores for each node by copying the base keystore and editing each to use only one publisher: + +**Node 1** - Uses publisher at index 1 +**Node 2** - Uses publisher at index 2 +**Node 3** - Uses publisher at index 3 + +Each node's keystore will have the **same attester keys** (both ETH and BLS) but a **different publisher key**. + +For detailed step-by-step HA setup instructions, see the [High Availability Sequencers guide](../../setup/high_availability_sequencers.md). + +## Next steps + +- See [Troubleshooting](./troubleshooting.md) for common issues +- Return to [Key Storage Methods](./storage_methods.md) for more options +- Start with basics at [Creating Keystores](./creating_keystores.md) diff --git a/docs/network_versioned_docs/version-v3.0.2/operation/keystore/creating_keystores.md b/docs/network_versioned_docs/version-v3.0.2/operation/keystore/creating_keystores.md new file mode 100644 index 000000000000..01479f92e785 --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/operation/keystore/creating_keystores.md @@ -0,0 +1,440 @@ +--- +id: creating_keystores +sidebar_position: 0 +title: Creating Sequencer Keystores +description: Learn how to create sequencer keystores for running validators on the Aztec network using the Aztec CLI. +--- + +## Overview + +Keystores are configuration files that store the cryptographic keys and addresses your sequencer node needs to operate on the Aztec network. This guide shows you how to create keystores using the Aztec CLI's `validator-keys` commands. + +A keystore contains: +- **Attester keys**: Your sequencer's identity (Ethereum and BLS keys for signing proposals and attestations) +- **Publisher keys**: Keys used to submit blocks to L1 (requires ETH for gas) +- **Fee recipient**: Aztec address for L2 transaction fees (currently not used) +- **Coinbase address**: Ethereum address receiving L1 block rewards (optional, defaults to attester address) + +## Prerequisites + +Before creating keystores, ensure you have: + +- Basic understanding of Ethereum addresses and private keys +- Access to an Ethereum L1 RPC endpoint +- Foundry toolkit installed (for creating publisher addresses) + +## Installing the Aztec CLI + +First, install the Aztec CLI using the official installer: + +```bash +bash -i <(curl -s https://install.aztec.network) +``` + +Then install the correct version for the current network: + +```bash +aztec-up 2.1.7 +``` + +Verify your CLI installation: + +```bash +aztec --version +``` + +## Recommended Setup: Multiple Validators with Shared Publisher + +This approach creates multiple sequencer identities (validators) that share a single publisher address for submitting transactions to L1. This is the recommended configuration for production deployments. + +### Step 1: Create Publisher Address and Set RPC Endpoint + +First, set your Ethereum mainnet L1 RPC endpoint: + +```bash +export ETH_RPC=https://ethereum-rpc.publicnode.com +``` + +Or use your preferred Ethereum RPC provider (Infura, Alchemy, etc.). + +Then generate a separate address for publishing transactions to L1 using the Foundry toolkit: + +```bash +cast wallet new-mnemonic --words 24 +``` + +**Example output:** + +``` +Successfully generated a new mnemonic. +Phrase: +word1 word2 word3 word4 word5 word6 word7 word8 word9 word10 word11 word12 word13 word14 word15 word16 word17 word18 word19 word20 word21 word22 word23 word24 + +Accounts: +- Account 0: +Address: 0xE434A95e816991E66bF7052955FD699aEf8a286b +Private key: 0x7988a4a7...79f058a0 +``` + +:::warning Critical: Save Your Publisher Mnemonic +The 24-word mnemonic is the **only way** to recover your publisher private key. Store it securely offline (not on the server running the node). +::: + +**Save from the output:** +- ✅ The 24-word mnemonic (for recovery) +- ✅ The private key (you'll use this in the next step) +- ✅ The address (you'll fund this with ETH) + +### Step 2: Generate Your Keystores with Publisher + +Generate 5 validators with the publisher private key from Step 1: + +```bash +aztec validator-keys new \ + --fee-recipient 0x0000000000000000000000000000000000000000000000000000000000000000 \ + --staker-output \ + --gse-address 0xa92ecFD0E70c9cd5E5cd76c50Af0F7Da93567a4f \ + --l1-rpc-urls $ETH_RPC \ + --count 5 \ + --publishers 0x7988a4a779f058a0 +``` + +Replace `0x7988a4a779f058a0` with your actual publisher private key from Step 1. + +**What this command does:** +- Generates a new mnemonic for your validator keys (save this securely!) +- Creates 5 sequencer identities (validators) with Ethereum and BLS keys +- Configures all validators to use the same publisher address for L1 submissions +- Generates public keystore data for the staking dashboard +- Saves files to `~/.aztec/keystore/` + +**Example output:** + +``` +No mnemonic provided, generating new one... +Using new mnemonic: + +absent city nephew garment million badge front text memory grape two lizard + +Wrote validator keystore to /Users/your-name/.aztec/keystore/key1.json +Wrote staker output for 5 validator(s) to /Users/your-name/.aztec/keystore/key1_staker_output.json + +acc1: + attester: + eth: 0x8E76a8B8D66E0A56E241F2768fD2ad4eba07E565 + bls: 0x29eaf46e4699e33a1abe7300258567c624a7304a2134e31aa2609437f281d81d + publisher: + - 0x7988a4a779f058a0 +acc2: + attester: + eth: 0x2037b472537a4246B1A7325f327028EF450ba0Ef + bls: 0x8d7eb7d9436ac6cb9b8f1c211673ea228c7f438882e6438b2caefca753df28e8 + publisher: + - 0x7988a4a779f058a0 +acc3: + attester: + eth: 0x0c14593f7465DeDbb86d68982374BB05F4C60386 + bls: 0xad1cccf512d2f180238af795831344445f7ac47e2d623f3dac854e93e5b1e76d + publisher: + - 0x7988a4a779f058a0 +acc4: + attester: + eth: 0x4D213928988f0123f6b3B4A377F856812F08E831 + bls: 0xa90f5889dddd4cd6bc5a28db5e0db60d3cbf5147eb6e82b313024b2d0634110e + publisher: + - 0x7988a4a779f058a0 +acc5: + attester: + eth: 0x29f147Da38d5F66bB84e791969b365c796829c92 + bls: 0x0d683001c2ce866e322f0c7509f087a909508787d125336931aa9168d2a1f95b + publisher: + - 0x7988a4a779f058a0 + +Note: The publisher value shown is the private key (truncated in this example). All validators share the same publisher private key. + +Staker outputs: +[ + { + "attester": "0x8E76a8B8D66E0A56E241F2768fD2ad4eba07E565", + "publicKeyG1": { "x": "0x...", "y": "0x..." }, + "publicKeyG2": { "x0": "0x...", "x1": "0x...", "y0": "0x...", "y1": "0x..." }, + "proofOfPossession": { "x": "0x...", "y": "0x..." } + }, + ... (4 more validators) +] +``` + +:::warning Critical: Save Both Mnemonics +You now have **two separate mnemonics** to secure: + +1. **Validator mnemonic** (shown above, 12 words) - Regenerates your attester keys +2. **Publisher mnemonic** (from Step 1, 24 words) - Regenerates your publisher key + +Both must be stored securely offline. Losing either mnemonic means losing access to those keys. +::: + +**Files created:** +- `~/.aztec/keystore/key1.json` - Private keystore with all 5 validators and publisher configured +- `~/.aztec/keystore/key1_staker_output.json` - Public keystore for staking dashboard + +### Step 3: Fund the Publisher Address + +Your publisher address needs ETH to pay for L1 gas when submitting proposals. + +**Funding requirement:** At least **0.3 ETH** for 5 validators (rule of thumb: 0.1 ETH per validator) + +Transfer ETH to the publisher address from Step 1. You can check the balance with: + +```bash +cast balance 0xE434A95e816991E66bF7052955FD699aEf8a286b --rpc-url $ETH_RPC +``` + +Replace the address with your actual publisher address. + +:::warning Monitor Publisher Balance +Set up monitoring to alert when the publisher balance falls below 0.5 ETH to prevent failed block publications. +::: + +### Step 4: Upload Keystore to Your Node + +Now you're ready to spin up your sequencer node! + +**Upload the private keystore to your server:** + +The `key1.json` file contains your private keys and must be uploaded to your sequencer node. + +**For standard server deployments:** +```bash +# Upload to your server's keystore directory +scp ~/.aztec/keystore/key1.json user@your-server:/path/to/aztec-sequencer/keys/keystore.json +``` + +**For dAppNode deployments:** +- Upload `key1.json` to the dAppNode keystore folder +- Rename it to `keystore.json` + +:::tip Keep the Public Keystore Local +Keep `key1_staker_output.json` on your local machine - you'll need it for registration on the staking dashboard. **Do not upload this to your server.** +::: + +### Step 5: Start Your Node + +Start your sequencer node following the [Sequencer Management guide](../../setup/sequencer_management.md). + +When your node starts successfully, you'll see output similar to: + +``` +Started validator with addresses: 0x8E76a8B8D66E0A56E241F2768fD2ad4eba07E565, 0x2037b472537a4246B1A7325f327028EF450ba0Ef, 0x0c14593f7465DeDbb86d68982374BB05F4C60386, 0x4D213928988f0123f6b3B4A377F856812F08E831, 0x29f147Da38d5F66bB84e791969b365c796829c92 +``` + +These are your validator attester addresses - they match the addresses shown when you generated your keys. + +### Step 6: Register Your Validators + +Use the public keystore (`key1_staker_output.json`) to register your validators on the staking dashboard. See [Registering a Sequencer](../../setup/sequencer_management.md#next-steps-registering-your-sequencer) for details. + +--- + +### Quick Setup Summary + +By following the recommended setup, you've accomplished: + +✅ **Generated a dedicated publisher address** with its own 24-word mnemonic +✅ **Created 5 validator identities** with a separate 12-word mnemonic +✅ **Configured all validators** to use the shared publisher for L1 transactions +✅ **Funded the publisher** with at least 0.3 ETH for gas costs +✅ **Uploaded the private keystore** (`key1.json`) to your sequencer node +✅ **Started your node** and verified validator addresses in the output +✅ **Ready to register** using the public keystore (`key1_staker_output.json`) + +**Two mnemonics to keep secure:** +1. **Publisher mnemonic** (24 words) - Recovers publisher private key +2. **Validator mnemonic** (12 words) - Recovers all 5 validator attester keys + +## Alternative: Single Validator Setup + +For testing or simpler setups, you can create a single validator that uses its attester key as the publisher. + +### Basic Single Validator + +```bash +aztec validator-keys new \ + --fee-recipient 0x0000000000000000000000000000000000000000000000000000000000000000 \ + --staker-output \ + --gse-address 0xa92ecFD0E70c9cd5E5cd76c50Af0F7Da93567a4f \ + --l1-rpc-urls $ETH_RPC +``` + +This creates: +- One validator with attester keys +- No separate publisher (attester key used for publishing) +- Private keystore at `~/.aztec/keystore/keyN.json` +- Public keystore at `~/.aztec/keystore/keyN_staker_output.json` + +:::info When to Use Single Validator +Use single validator setup for: +- Testing and development +- Simple deployments with one sequencer identity +- When you don't need to isolate attester and publisher keys +::: + +## Understanding Keystore Structure + +### Private Keystore Format + +The private keystore (`key1.json`) contains sensitive private keys: + +```json +{ + "schemaVersion": 1, + "validators": [ + { + "attester": { + "eth": "0x...", // Ethereum private key - sequencer identifier + "bls": "0x..." // BLS private key - signs proposals and attestations + }, + "publisher": ["0x..."], // Publisher private key(s) for L1 submissions + "feeRecipient": "0x0000000000000000000000000000000000000000000000000000000000000000", + "coinbase": "0x..." // Optional: custom address for L1 rewards + } + ] +} +``` + +**Field descriptions:** + +- **attester.eth**: Derives the address that serves as your sequencer's unique identifier +- **attester.bls**: Signs proposals and attestations, used for staking operations +- **publisher**: Array of private keys for submitting signed messages to L1 (pays gas) +- **feeRecipient**: L2 fee recipient (not currently used, set to all zeros) +- **coinbase**: L1 block reward recipient (optional, defaults to attester address) + +### Public Keystore Format + +The public keystore (`key1_staker_output.json`) contains only public information safe to share: + +```json +[ + { + "attester": "0xYOUR_ATTESTER_ADDRESS", + "publicKeyG1": { + "x": "0x...", + "y": "0x..." + }, + "publicKeyG2": { + "x0": "0x...", + "x1": "0x...", + "y0": "0x...", + "y1": "0x..." + }, + "proofOfPossession": { + "x": "0x...", + "y": "0x..." + } + } +] +``` + +This file is used for registration on the staking dashboard and contains no private keys. + +## Advanced Options + +### Providing Your Own Mnemonic + +For deterministic key generation or to recreate keys from an existing mnemonic: + +```bash +aztec validator-keys new \ + --fee-recipient 0x0000000000000000000000000000000000000000000000000000000000000000 \ + --staker-output \ + --gse-address 0xa92ecFD0E70c9cd5E5cd76c50Af0F7Da93567a4f \ + --l1-rpc-urls $ETH_RPC \ + --mnemonic "your existing twelve word mnemonic phrase here" \ + --count 5 \ + --publishers 0x7988a4a779f058a0 +``` + +This regenerates the same validators if you've used this mnemonic before, or creates new ones at the next derivation indices. + +### Custom Output Location + +Specify custom directory and filename: + +```bash +aztec validator-keys new \ + --fee-recipient 0x0000000000000000000000000000000000000000000000000000000000000000 \ + --staker-output \ + --gse-address 0xa92ecFD0E70c9cd5E5cd76c50Af0F7Da93567a4f \ + --l1-rpc-urls $ETH_RPC \ + --count 5 \ + --publishers 0x7988a4a779f058a0 \ + --data-dir ~/my-sequencer/keys \ + --file sequencer1.json +``` + +This creates keystores at: +- `~/my-sequencer/keys/sequencer1.json` (private keystore) +- `~/my-sequencer/keys/sequencer1_staker_output.json` (public keystore) + +**Default behavior** (if you don't specify `--data-dir` or `--file`): +- **Directory**: `~/.aztec/keystore/` +- **Filename**: `key1.json`, `key2.json`, etc. (auto-increments) + +## Verifying Your Keystore + +Verify the keystore is valid JSON: + +```bash +cat ~/.aztec/keystore/key1.json | jq . +``` + +Check validator count: + +```bash +jq '.validators | length' ~/.aztec/keystore/key1.json +``` + +Verify BLS keys are present: + +```bash +jq '.validators[0].attester.bls' ~/.aztec/keystore/key1.json +``` + +Extract attester addresses: + +```bash +# Get attester ETH private key (to derive address) +jq -r '.validators[0].attester.eth' ~/.aztec/keystore/key1.json +``` + +## Troubleshooting + +If you encounter issues during keystore creation or management, see the **[Troubleshooting and Best Practices Guide](./troubleshooting.md)** for: + +- Keystore creation issues (RPC, permissions, invalid JSON, legacy BLS keys) +- Runtime and operational issues (node startup, remote signers, nonce conflicts) +- Comprehensive security best practices +- Complete CLI reference + +## Next Steps + +Now that you've created your keystores: + +### For Sequencer Operators + +1. **Fund publisher addresses** - At least 0.1 ETH per validator +2. **Set up your node** - See [Sequencer Management](../../setup/sequencer_management.md) +3. **Register validators** - Use the public keystore with the staking dashboard +4. **Monitor operations** - Track attestations and publisher balance + +### Advanced Configurations + +- **[Advanced Keystore Patterns](./advanced_patterns.md)** - Multiple validators, high availability, remote signers +- **[Key Storage Methods](./storage_methods.md)** - Encrypted keystores, HSMs, key management systems +- **[Troubleshooting and Best Practices](./troubleshooting.md)** - Common issues, security best practices, and CLI reference + +### Getting Help + +- Review the [Operator FAQ](../operator_faq.md) for common questions +- Join the [Aztec Discord](https://discord.gg/aztec) for operator support +- Check the [CLI reference](../../reference/cli_reference.md) for all available commands diff --git a/docs/network_versioned_docs/version-v3.0.2/operation/keystore/examples.md b/docs/network_versioned_docs/version-v3.0.2/operation/keystore/examples.md new file mode 100644 index 000000000000..72ba173bd0c7 --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/operation/keystore/examples.md @@ -0,0 +1,320 @@ +--- +draft: true +title: Complete examples +description: Real-world keystore configuration examples for common deployment scenarios. +--- + +## Overview + +This page provides complete, ready-to-use keystore configurations for common deployment scenarios. + +## Development and testing + +**Simple local setup** - Single sequencer with inline keys: + +```json +{ + "schemaVersion": 1, + "validators": [ + { + "attester": { + "eth": "0xef17bcb86452f3f6a73678c01bee757e9d46d1cd0050f043c10cfc953b17bad2", + "bls": "0x20f2f5989b66462b39229900948c7846403768fec5b76d1c2937d64e04aac4b9" + }, + "feeRecipient": "0x0987654321098765432109876543210987654321098765432109876543210987" + } + ] +} +``` + +**Development with mnemonic** - Use test mnemonic for local development: + +```json +{ + "schemaVersion": 1, + "validators": [ + { + "attester": { + "mnemonic": "test test test test test test test test test test test junk", + "addressIndex": 0 + }, + "publisher": { + "mnemonic": "test test test test test test test test test test test junk", + "addressIndex": 1 + }, + "feeRecipient": "0x0987654321098765432109876543210987654321098765432109876543210987" + } + ] +} +``` + +## Production configurations + +**Small sequencer** - Remote signer with dedicated publisher: + +```json +{ + "schemaVersion": 1, + "remoteSigner": "https://signer.example.com:8080", + "validators": [ + { + "attester": { + "eth": "0x1234567890123456789012345678901234567890", + "bls": "0x2345678901234567890123456789012345678901" + }, + "publisher": "0x3456789012345678901234567890123456789012", + "coinbase": "0x4567890123456789012345678901234567890123", + "feeRecipient": "0x0987654321098765432109876543210987654321098765432109876543210987" + } + ] +} +``` + +**Medium sequencer** - Multiple publishers for resilience: + +```json +{ + "schemaVersion": 1, + "remoteSigner": "https://signer.example.com:8080", + "validators": [ + { + "attester": { + "eth": "0x1234567890123456789012345678901234567890", + "bls": "0x2345678901234567890123456789012345678901" + }, + "publisher": [ + "0x3456789012345678901234567890123456789012", + "0x4567890123456789012345678901234567890123", + "0x5678901234567890123456789012345678901234" + ], + "coinbase": "0x6789012345678901234567890123456789012345", + "feeRecipient": "0x0987654321098765432109876543210987654321098765432109876543210987" + } + ] +} +``` + +**Large sequencer** - Multiple sequencers with shared infrastructure: + +```json +{ + "schemaVersion": 1, + "remoteSigner": "https://signer.example.com:8080", + "validators": [ + { + "attester": [ + "0x1111111111111111111111111111111111111111", + "0x2222222222222222222222222222222222222222", + "0x3333333333333333333333333333333333333333" + ], + "publisher": [ + "0x4444444444444444444444444444444444444444", + "0x5555555555555555555555555555555555555555", + "0x6666666666666666666666666666666666666666" + ], + "coinbase": "0x7777777777777777777777777777777777777777", + "feeRecipient": "0x0987654321098765432109876543210987654321098765432109876543210987" + } + ] +} +``` + +## Prover configurations + +**Simple prover** - Single key for identity and publishing: + +```json +{ + "schemaVersion": 1, + "prover": "0x1234567890123456789012345678901234567890123456789012345678901234" +} +``` + +**Production prover** - Dedicated publishers: + +```json +{ + "schemaVersion": 1, + "remoteSigner": "https://signer.example.com:8080", + "prover": { + "id": "0x1234567890123456789012345678901234567890", + "publisher": [ + "0x2345678901234567890123456789012345678901", + "0x3456789012345678901234567890123456789012" + ] + } +} +``` + +**High-throughput prover** - Many publishers for parallel submission: + +```json +{ + "schemaVersion": 1, + "remoteSigner": "https://signer.example.com:8080", + "prover": { + "id": "0x1234567890123456789012345678901234567890", + "publisher": [ + "0x2345678901234567890123456789012345678901", + "0x3456789012345678901234567890123456789012", + "0x4567890123456789012345678901234567890123", + "0x5678901234567890123456789012345678901234", + "0x6789012345678901234567890123456789012345" + ] + } +} +``` + +## Infrastructure provider setups + +**Managed sequencers** - Separate keystores per client: + +Directory structure: +``` +/etc/aztec/keystores/ +├── client-a.json +├── client-b.json +└── client-c.json +``` + +**client-a.json:** +```json +{ + "schemaVersion": 1, + "validators": [ + { + "attester": { + "eth": "0xCLIENT_A_ATTESTER_ETH_KEY", + "bls": "0xCLIENT_A_ATTESTER_BLS_KEY" + }, + "publisher": ["0xPUBLISHER_1", "0xPUBLISHER_2"], + "coinbase": "0xCLIENT_A_COINBASE", + "feeRecipient": "0xCLIENT_A_FEE_RECIPIENT" + } + ] +} +``` + +**client-b.json:** +```json +{ + "schemaVersion": 1, + "validators": [ + { + "attester": { + "eth": "0xCLIENT_B_ATTESTER_ETH_KEY", + "bls": "0xCLIENT_B_ATTESTER_BLS_KEY" + }, + "publisher": ["0xPUBLISHER_1", "0xPUBLISHER_2"], + "coinbase": "0xCLIENT_B_COINBASE", + "feeRecipient": "0xCLIENT_B_FEE_RECIPIENT" + } + ] +} +``` + +Set `KEY_STORE_DIRECTORY=/etc/aztec/keystores/` to load all configurations. + +**Shared publisher pool:** + +```json +{ + "schemaVersion": 1, + "remoteSigner": "https://signer.example.com:8080", + "validators": [ + { + "attester": { + "eth": "0xSEQUENCER_1_ETH", + "bls": "0xSEQUENCER_1_BLS" + }, + "publisher": { + "mnemonic": "provider mnemonic phrase here...", + "addressCount": 10 + }, + "feeRecipient": "0xSEQUENCER_1_FEE_RECIPIENT" + }, + { + "attester": { + "eth": "0xSEQUENCER_2_ETH", + "bls": "0xSEQUENCER_2_BLS" + }, + "publisher": { + "mnemonic": "provider mnemonic phrase here...", + "addressCount": 10 + }, + "feeRecipient": "0xSEQUENCER_2_FEE_RECIPIENT" + } + ] +} +``` + +This derives 10 publisher addresses from a mnemonic, shared by all sequencers. + +## Mixed storage methods + +**Security-tiered setup** - Critical keys in remote signer, publishers local: + +```json +{ + "schemaVersion": 1, + "remoteSigner": "https://signer.example.com:8080", + "validators": [ + { + "attester": { + "eth": "0x1234567890123456789012345678901234567890", + "bls": "0x2345678901234567890123456789012345678901" + }, + "publisher": [ + "0x3456789012345678901234567890123456789012345678901234567890123456", + "0x4567890123456789012345678901234567890123456789012345678901234567" + ], + "coinbase": "0x5678901234567890123456789012345678901234", + "feeRecipient": "0x0987654321098765432109876543210987654321098765432109876543210987" + } + ] +} +``` + +Attester (critical) uses remote signer; publishers (operational) use inline keys. + +**Multi-region deployment** - Different remote signers per region: + +```json +{ + "schemaVersion": 1, + "validators": [ + { + "attester": { + "address": "0x1111111111111111111111111111111111111111", + "remoteSignerUrl": "https://us-signer.example.com:8080" + }, + "publisher": [ + { + "address": "0x2222222222222222222222222222222222222222", + "remoteSignerUrl": "https://us-signer.example.com:8080" + } + ], + "feeRecipient": "0x0987654321098765432109876543210987654321098765432109876543210987" + }, + { + "attester": { + "address": "0x3333333333333333333333333333333333333333", + "remoteSignerUrl": "https://eu-signer.example.com:8080" + }, + "publisher": [ + { + "address": "0x4444444444444444444444444444444444444444", + "remoteSignerUrl": "https://eu-signer.example.com:8080" + } + ], + "feeRecipient": "0x1234567890123456789012345678901234567890123456789012345678901234" + } + ] +} +``` + +## Next steps + +- See [Troubleshooting](./troubleshooting.md) for common issues +- Return to [Advanced Configuration Patterns](./advanced_patterns.md) for more details +- Review [Key Storage Methods](./storage_methods.md) for storage options diff --git a/docs/network_versioned_docs/version-v3.0.2/operation/keystore/index.md b/docs/network_versioned_docs/version-v3.0.2/operation/keystore/index.md new file mode 100644 index 000000000000..3aacf5a60883 --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/operation/keystore/index.md @@ -0,0 +1,89 @@ +--- +id: advanced_keystore_guide +sidebar_position: 2 +title: Advanced Keystore Usage +description: Learn how to configure keystores with remote signers, mnemonics, JSON V3 keystores, and multiple publishers for enhanced security and flexibility. +--- + +## Overview + +The keystore manages private keys and addresses for your Aztec sequencer or prover. This guide covers advanced keystore configurations including secure key storage methods, multi-account setups, and production deployment patterns. + +## Prerequisites + +Before proceeding, you should: + +- Be familiar with running a sequencer or prover node +- Understand the basic keystore structure from the [sequencer setup guide](../../setup/sequencer_management.md) +- Have access to appropriate key management infrastructure (if using remote signers) + +## Understanding Keystore Roles + +The keystore manages different types of keys depending on your node type. Understanding these roles helps you configure the right keys for your needs. + +### Sequencer Keys + +When running a sequencer, you configure these keys and addresses: + +- **Attester** (required): Your sequencer's identity. This key signs block proposals and attestations. The corresponding Ethereum address uniquely identifies your sequencer on the network. +- **Publisher** (optional): Submits block proposals to L1. Defaults to using the attester key if not specified. Must be funded with at least 0.1 ETH. +- **Coinbase** (optional): Ethereum address that receives L2 block rewards on L1. Defaults to the attester address if not set. +- **Fee Recipient** (required): Aztec address that receives unburnt L2 transaction fees from blocks you produce. + +### Prover Keys + +Prover nodes use a simpler configuration: + +- **Prover ID**: Ethereum address identifying your prover and receiving rewards. +- **Publisher**: Submits proof transactions to L1. Must be funded with ETH for gas costs. + +### Slasher Keys + +If you're running a slasher to monitor the network: + +- **Slasher**: Key used to create slash payloads on L1 when detecting sequencer misbehavior. + +## What This Guide Covers + +This guide walks you through advanced keystore configurations in three parts: + +### 1. Key Storage Methods + +Learn about different ways to store and access private keys: + +- Inline private keys (for testing) +- Remote signers with Web3Signer (recommended for production) +- JSON V3 encrypted keystores +- BIP44 mnemonic derivation + +See [Key Storage Methods](./storage_methods.md) for detailed instructions. + +### 2. Advanced Configuration Patterns + +Explore complex deployment scenarios: + +- Using multiple publisher accounts for load distribution +- Running multiple sequencers on a single node +- Infrastructure provider configurations +- High availability setups + +See [Advanced Configuration Patterns](./advanced_patterns.md) for examples. + +### 3. Troubleshooting + +Get help with common issues: + +- Keystore loading failures +- Key format validation +- Security best practices +- Permission problems + +See [Troubleshooting](./troubleshooting.md) for solutions. + +## Getting Started + +**First time creating a keystore?** Start with the [Creating Validator Keystores guide](./creating_keystores.md) to learn how to use the Aztec CLI to generate keystores for sequencers and provers. + +Once you have a basic keystore, explore the [Key Storage Methods](./storage_methods.md) guide to understand advanced options like remote signers and encrypted keystores. Then check out [Advanced Configuration Patterns](./advanced_patterns.md) for complex deployment scenarios. + +For production deployments, we strongly recommend using remote signers or encrypted keystores instead of inline private keys. diff --git a/docs/network_versioned_docs/version-v3.0.2/operation/keystore/storage_methods.md b/docs/network_versioned_docs/version-v3.0.2/operation/keystore/storage_methods.md new file mode 100644 index 000000000000..2429eac2e56b --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/operation/keystore/storage_methods.md @@ -0,0 +1,213 @@ +--- +title: Key storage methods +description: Learn about different methods for storing and accessing private keys in Aztec keystores, including inline keys, remote signers, JSON V3 keystores, and mnemonics. +--- + +## Overview + +The keystore supports four methods for storing and accessing private keys. These methods can be mixed within a single configuration. + +## Private keys (inline) + +The simplest method is to include private keys directly in the keystore. The `validator-keys new` command generates keystores in this format by default: + +```json +{ + "schemaVersion": 1, + "validators": [ + { + "attester": { + "eth": "0xef17bcb86452f3f6a73678c01bee757e9d46d1cd0050f043c10cfc953b17bad2", + "bls": "0x20f2f5989b66462b39229900948c7846403768fec5b76d1c2937d64e04aac4b9" + }, + "feeRecipient": "0x0000000000000000000000000000000000000000000000000000000000000000" + } + ] +} +``` + +Note that the attester field now contains both Ethereum (`eth`) and BLS (`bls`) private keys. Both are required for sequencer operation. + +:::warning Not for Production Use +Inline private keys are convenient for testing but should be avoided in production. Use remote signers or encrypted keystores for production deployments. +::: + +## Remote signers (Web3Signer) + +Remote signers keep private keys in a separate, secure signing service. This is the recommended approach for production environments. + +The keystore supports [Web3Signer](https://docs.web3signer.consensys.io/) endpoints configured at three levels: + +**Global level** (applies to all accounts): + +```json +{ + "schemaVersion": 1, + "remoteSigner": "https://signer.example.com:8080", + "validators": [ + { + "attester": { + "eth": "0x1234567890123456789012345678901234567890", + "bls": "0x2345678901234567890123456789012345678901" + }, + "feeRecipient": "0x1234567890123456789012345678901234567890123456789012345678901234" + } + ] +} +``` + +In this example, both the Ethereum and BLS attester addresses are managed by the remote signer. + +**Validator (sequencer) block level** (applies to all accounts in a sequencer configuration): + +```json +{ + "schemaVersion": 1, + "validators": [ + { + "attester": { + "eth": "0x1234567890123456789012345678901234567890", + "bls": "0x2345678901234567890123456789012345678901" + }, + "feeRecipient": "0x1234567890123456789012345678901234567890123456789012345678901234", + "remoteSigner": "https://signer.example.com:8080" + } + ] +} +``` + +**Account level** (applies to a specific key): + +```json +{ + "schemaVersion": 1, + "validators": [ + { + "attester": { + "address": "0x1234567890123456789012345678901234567890", + "remoteSignerUrl": "https://signer.example.com:8080" + }, + "feeRecipient": "0x1234567890123456789012345678901234567890123456789012345678901234" + } + ] +} +``` + +### Client certificate authentication + +For remote signers requiring client certificates: + +```json +{ + "schemaVersion": 1, + "remoteSigner": { + "remoteSignerUrl": "https://signer.example.com:8080", + "certPath": "/path/to/client-cert.p12", + "certPass": "certificate-password" + }, + "validators": [...] +} +``` + +## JSON V3 encrypted keystores + +JSON V3 keystores provide standard Ethereum-compatible encrypted key storage. + +**Single file:** + +```json +{ + "schemaVersion": 1, + "validators": [ + { + "attester": { + "path": "/path/to/keystore.json", + "password": "keystore-password" + }, + "feeRecipient": "0x1234567890123456789012345678901234567890123456789012345678901234" + } + ] +} +``` + +**Directory of keystores:** + +```json +{ + "schemaVersion": 1, + "validators": [ + { + "attester": { + "eth": "0x1234567890123456789012345678901234567890123456789012345678901234", + "bls": "0x2345678901234567890123456789012345678901234567890123456789012345" + }, + "publisher": { + "path": "/path/to/keystores/", + "password": "shared-password" + }, + "feeRecipient": "0x1234567890123456789012345678901234567890123456789012345678901234" + } + ] +} +``` + +All `.json` files in the directory will be loaded using the provided password. + +## Mnemonics (BIP44 derivation) + +Mnemonics derive multiple keys from a single seed phrase using [BIP44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) paths. + +**Single key** (default path `m/44'/60'/0'/0/0`): + +```json +{ + "schemaVersion": 1, + "validators": [ + { + "attester": { + "eth": "0x1234567890123456789012345678901234567890123456789012345678901234", + "bls": "0x2345678901234567890123456789012345678901234567890123456789012345" + }, + "publisher": { + "mnemonic": "test test test test test test test test test test test junk" + }, + "feeRecipient": "0x1234567890123456789012345678901234567890123456789012345678901234" + } + ] +} +``` + +**Multiple sequential keys:** + +```json +{ + "publisher": { + "mnemonic": "test test test test test test test test test test test junk", + "addressCount": 4 + } +} +``` + +Generates 4 keys at paths `m/44'/60'/0'/0/0` through `m/44'/60'/0'/0/3`. + +**Custom derivation paths:** + +```json +{ + "publisher": { + "mnemonic": "test test test test test test test test test test test junk", + "accountIndex": 5, + "addressIndex": 3, + "addressCount": 2 + } +} +``` + +:::warning Not for Production Use +Mnemonics are convenient for testing but should be avoided in production. Use remote signers or encrypted keystores for production deployments. +::: + +## Next steps + +- Learn about [Advanced Configuration Patterns](./advanced_patterns.md) +- See [Troubleshooting](./troubleshooting.md) if you encounter issues diff --git a/docs/network_versioned_docs/version-v3.0.2/operation/keystore/troubleshooting.md b/docs/network_versioned_docs/version-v3.0.2/operation/keystore/troubleshooting.md new file mode 100644 index 000000000000..48667b0730ae --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/operation/keystore/troubleshooting.md @@ -0,0 +1,416 @@ +--- +title: Troubleshooting and Best Practices +description: Common issues, troubleshooting steps, security best practices, and CLI reference for keystore configuration and operation on the Aztec network. +--- + +## Keystore Creation Issues + +### Missing fee-recipient Flag + +**Error message:** +``` +error: required option '--fee-recipient
' not specified +``` + +**Solution:** The CLI requires the `--fee-recipient` flag. Use the zero address: + +```bash +--fee-recipient 0x0000000000000000000000000000000000000000000000000000000000000000 +``` + +### RPC Connection Issues + +**Error message:** +``` +Error: HTTP request failed +``` + +**Solutions:** +- Verify `$ETH_RPC` is set correctly: `echo $ETH_RPC` +- Test RPC connectivity: `cast block-number --rpc-url $ETH_RPC` +- Try a different RPC provider if the current one is rate-limited + +### Permission Denied + +**Error message:** +``` +Error: permission denied +``` + +**Solution:** Ensure you have write permissions for the target directory: + +```bash +mkdir -p ~/.aztec/keystore +chmod 755 ~/.aztec/keystore +``` + +### Invalid Keystore JSON + +**Error:** Node fails to load keystore or CLI rejects keystore file + +**Solutions:** +- Validate JSON syntax: `jq . ~/.aztec/keystore/key1.json` +- Ensure all required fields are present +- Check that publisher is an array: `["0x..."]` not `"0x..."` +- Verify private keys are 64-character hex strings (with or without `0x` prefix) + +### Legacy BLS Key Derivation (2.1.4 Users) + +**Issue:** Need to regenerate keys that were created with CLI version 2.1.4 or earlier + +Version 2.1.5 changed the BLS key derivation path, which means keys generated from the same mnemonic produce different results. This affects users who: +- Generated keys with version 2.1.4 using `--count` parameter +- Used `--account-index` explicitly in version 2.1.4 +- Need to regenerate keys from mnemonic that are already registered in the GSE contract + +**The derivation path change:** +- **2.1.4**: `m/12381/3600/0/0/0`, `m/12381/3600/1/0/0`, `m/12381/3600/2/0/0` +- **2.1.5+**: `m/12381/3600/0/0/0`, `m/12381/3600/0/0/1`, `m/12381/3600/0/0/2` + +**Solution: Use the --legacy flag** + +If you generated keys with version 2.1.4 and need to regenerate them from your mnemonic, use the `--legacy` flag: + +```bash +aztec validator-keys new \ + --fee-recipient 0x0000000000000000000000000000000000000000000000000000000000000000 \ + --staker-output \ + --gse-address 0xa92ecFD0E70c9cd5E5cd76c50Af0F7Da93567a4f \ + --l1-rpc-urls $ETH_RPC \ + --mnemonic "your twelve word mnemonic phrase here" \ + --count 5 \ + --legacy +``` + +The `--legacy` flag uses the 2.1.4 derivation path to reproduce your original keys. + +:::warning When NOT to Use --legacy +Do NOT use the `--legacy` flag if: +- You're generating keys for the first time +- You generated keys with version 2.1.5 or later +- You didn't use `--count` or `--account-index` in version 2.1.4 + +Using `--legacy` unnecessarily will create keys with the old derivation path that won't match your newer registrations. +::: + +:::info Why This Matters +BLS keys are registered in the GSE (Governance Staking Escrow) contract and cannot be easily updated. If you regenerate keys with a different derivation path, they won't match what's registered on chain, and your sequencer won't be able to attest properly. +::: + +## Runtime and Operational Issues + +### "No validators found in keystore" + +**Symptoms**: Node fails to start with no sequencer configurations loaded + +**Causes**: +- Keystore file not found at specified path +- Invalid JSON syntax +- Missing required fields +- File permissions prevent reading + +**Solutions**: + +1. Verify keystore path: +```bash +ls -la $KEY_STORE_DIRECTORY +``` + +2. Validate JSON syntax: +```bash +cat keystore.json | jq . +``` + +3. Check required fields: +```json +{ + "schemaVersion": 1, + "validators": [ + { + "attester": { + "eth": "REQUIRED - Ethereum private key", + "bls": "REQUIRED - BLS private key" + }, + "feeRecipient": "REQUIRED - Aztec address" + } + ] +} +``` + +4. Fix file permissions: +```bash +chmod 600 keystore.json +chown aztec:aztec keystore.json +``` + +### "Failed to connect to remote signer" + +**Symptoms**: Node cannot reach Web3Signer endpoint + +**Causes**: +- Incorrect URL or port +- Network connectivity issues +- Certificate validation failures +- Remote signer not running + +**Solutions**: + +1. Test connectivity: +```bash +curl https://signer.example.com:8080/upcheck +``` + +2. Verify certificate: +```bash +openssl s_client -connect signer.example.com:8080 -showcerts +``` + +3. Check remote signer logs for authentication errors + +4. For self-signed certificates, ensure proper certificate configuration in keystore + +### "Insufficient funds for gas" + +**Symptoms**: Transactions fail with insufficient balance errors + +**Causes**: +- Publisher accounts not funded +- ETH balance depleted + +**Solutions**: + +1. Check publisher balances: +```bash +cast balance 0xPUBLISHER_ADDRESS --rpc-url $ETHEREUM_HOST +``` + +2. Fund publisher accounts with ETH + +3. Set up automated balance monitoring and alerts + +### "Nonce too low" or "Replacement transaction underpriced" + +**Symptoms**: Transaction submission failures related to nonces + +**Causes**: +- Multiple nodes using same publisher key +- Publisher key reused across keystores +- Transaction pool issues + +**Solutions**: + +1. **Never share publisher keys across multiple running nodes** + +2. If you must use the same key, ensure only one node is active at a time + +3. Clear pending transactions if safe to do so + +### "Keystore file not loaded" + +**Symptoms**: Only some keystores load from a directory + +**Causes**: +- Invalid JSON in some files +- Incorrect file extensions +- Schema version mismatch + +**Solutions**: + +1. Check all files in directory: +```bash +for file in /path/to/keystores/*.json; do + echo "Checking $file" + jq . "$file" || echo "Invalid JSON in $file" +done +``` + +2. Ensure all files use `.json` extension + +3. Verify `schemaVersion: 1` in all keystores + +### "Cannot decrypt JSON V3 keystore" + +**Symptoms**: Failed to load encrypted keystore files + +**Causes**: +- Incorrect password +- Corrupted keystore file +- Unsupported encryption algorithm + +**Solutions**: + +1. Verify password is correct + +2. Test decryption manually: +```bash +# Using ethereumjs-wallet or similar tool +``` + +3. Re-generate keystore if corrupted + +4. Ensure keystore was generated using standard tools (geth, web3.py, ethers.js) + +## Security Best Practices + +### Protecting Private Keys + +1. **Never commit keystores to version control** + - Add `keystore.json` to `.gitignore` + - Store keystores outside your project directory + +2. **Backup your mnemonic securely** + - Write it down offline + - Store in a secure location (not on the server) + - Consider using a hardware wallet or password manager + +3. **Limit keystore access** + ```bash + chmod 600 ~/.aztec/keystore/key1.json + ``` + +4. **Separate publisher from attester** + - Use dedicated publisher keys + - Keep attester keys offline when possible + - Use remote signers for production + +### Key Storage + +**DO:** +- Use remote signers (Web3Signer) for production deployments +- Store keystores in encrypted volumes +- Use JSON V3 keystores with strong passwords +- Restrict file permissions to 600 (owner read/write only) +- Keep backups of keystores in secure, encrypted locations + +**DON'T:** +- Commit keystores or private keys to version control +- Store unencrypted private keys on disk +- Share private keys between nodes +- Use the same keys across test and production environments +- Log private keys or keystore passwords + +### Publisher Key Management + +**DO:** +- Use separate publisher keys for each sequencer if possible +- Monitor publisher account balances with alerting +- Rotate publisher keys periodically +- Maintain multiple funded publishers for resilience +- Keep publisher keys separate from attester keys + +**DON'T:** +- Reuse publisher keys across multiple nodes +- Run out of gas in publisher accounts +- Use sequencer attester keys as publishers if avoidable +- Share publisher keys between sequencers + +### Remote Signer Security + +**DO:** +- Use TLS/HTTPS for all remote signer connections +- Implement client certificate authentication +- Run remote signers on isolated networks +- Monitor remote signer access logs +- Use firewall rules to restrict access + +**DON'T:** +- Use unencrypted HTTP connections +- Expose remote signers to the public internet +- Share remote signer endpoints between untrusted parties +- Disable certificate verification + +### Operational Security + +**DO:** +- Implement principle of least privilege for file access +- Use hardware security modules (HSMs) for high-value sequencers +- Maintain audit logs of key access and usage +- Test keystore configurations in non-production environments first +- Document your key management procedures + +**DON'T:** +- Run nodes as root user +- Store passwords in shell history or scripts +- Share attester keys between sequencers +- Neglect monitoring and alerting + +### Production Deployments + +For production, consider: +- **Hardware Security Modules (HSMs)** for key storage +- **Remote signers** to keep keys off the node +- **Encrypted keystores** with password protection +- **Key management systems** (HashiCorp Vault, AWS Secrets Manager) + +See [Key Storage Methods](./storage_methods.md) for advanced security patterns. + +## CLI Reference + +### validator-keys new + +Create a new keystore with validators: + +```bash +aztec validator-keys new [options] +``` + +**Common Options:** + +| Option | Description | Default | +|--------|-------------|---------| +| `--fee-recipient
` | L2 fee recipient (required) | None | +| `--mnemonic ` | 12 or 24 word mnemonic | Auto-generated | +| `--count ` | Number of validators to create | `1` | +| `--publisher-count ` | Publishers per validator | `0` | +| `--staker-output` | Generate public keystore for staking | `false` | +| `--gse-address
` | GSE contract address (required with --staker-output) | None | +| `--l1-rpc-urls ` | L1 RPC endpoints (required with --staker-output) | None | +| `--legacy` | Use 2.1.4 BLS derivation path (only for regenerating old keys) | `false` | +| `--data-dir ` | Output directory | `~/.aztec/keystore` | +| `--file ` | Keystore filename | `key1.json` | + +For the complete list: + +```bash +aztec validator-keys new --help +``` + +### validator-keys add + +Add validators to an existing keystore: + +```bash +aztec validator-keys add [options] +``` + +### validator-keys staker + +Generate staker output from an existing keystore: + +```bash +aztec validator-keys staker \ + --from \ + --gse-address
\ + --l1-rpc-urls \ + --output +``` + +## Getting Help + +If you encounter issues not covered here: + +- Review the [Operator FAQ](../operator_faq.md) for common questions +- Join the [Aztec Discord](https://discord.gg/aztec) for operator support +- Check the [CLI reference](../../reference/cli_reference.md) for all available commands +- Review node logs for specific error messages (redact private keys!) +- When asking for help, provide: + - Error messages (with private keys redacted) + - Keystore structure (anonymized) + - Node version and deployment environment + +## Related Documentation + +- **[Creating Keystores](./creating_keystores.md)** - Main guide for generating keystores +- **[Advanced Keystore Patterns](./advanced_patterns.md)** - Multiple validators, high availability, remote signers +- **[Key Storage Methods](./storage_methods.md)** - Encrypted keystores, HSMs, key management systems +- **[Sequencer Management](../../setup/sequencer_management.md)** - Operational guidance for running sequencers diff --git a/docs/network_versioned_docs/version-v3.0.2/operation/metrics_reference.md b/docs/network_versioned_docs/version-v3.0.2/operation/metrics_reference.md new file mode 100644 index 000000000000..2e65e415e3fd --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/operation/metrics_reference.md @@ -0,0 +1,464 @@ +--- +title: Key Metrics Reference +description: Comprehensive guide to understanding and using the metrics exposed by your Aztec node for monitoring and observability. +--- + +## Overview + +Your Aztec node exposes metrics through OpenTelemetry to help you monitor performance, health, and operational status. This guide covers key metrics across node types and how to use them effectively. + +:::tip Discovering Metrics +Once your monitoring stack is running, you can discover available metrics in the Prometheus UI at `http://localhost:9090/graph`. Start typing in the query box to see autocomplete suggestions for metrics exposed by your node. +::: + +## Prerequisites + +- Complete monitoring stack setup following the [Monitoring Overview](./monitoring.md) +- Ensure Prometheus is running and scraping metrics from your OTEL collector +- Verify access to Prometheus UI at `http://localhost:9090` + +:::warning Metric Names May Vary +The exact metric names and labels in this guide depend on your node type, version, and configuration. Always verify the actual metrics exposed by your node using the Prometheus UI metrics explorer at `http://localhost:9090/graph`. Common prefixes: `aztec_archiver_*`, `aztec_sequencer_*`, `aztec_prover_*`, `process_*`. +::: + +## Querying with PromQL + +Use Prometheus Query Language (PromQL) to query and analyze your metrics. Understanding these basics will help you read the alert rules throughout this guide. + +### Basic Queries + +```promql +# Instant vector - current value +aztec_archiver_block_height + +# Range vector - values over time +aztec_archiver_block_height[5m] +``` + +### Rate and Increase + +```promql +# Rate of change per second (for counters) +rate(process_cpu_seconds_total[5m]) + +# Blocks synced over time window (for gauges) +increase(aztec_archiver_block_height[1h]) + +# Derivative - per-second change rate of gauges +deriv(process_resident_memory_bytes[30m]) +``` + +### Arithmetic Operations + +Calculate derived metrics using basic math operators: + +```promql +# Calculate percentage (block proposal failure rate) +(increase(aztec_sequencer_slot_count[15m]) - increase(aztec_sequencer_slot_filled_count[15m])) +/ increase(aztec_sequencer_slot_count[15m]) + +# Convert to percentage scale +rate(process_cpu_seconds_total[5m]) * 100 +``` + +### Comparison Operators + +Filter and alert based on thresholds: + +```promql +# Greater than +rate(process_cpu_seconds_total[5m]) > 2.8 + +# Less than +aztec_peer_manager_peer_count_peers < 5 + +# Equal to +increase(aztec_archiver_block_height[15m]) == 0 + +# Not equal to +aztec_sequencer_current_state != 1 +``` + +### Time Windows + +Choose time windows based on metric behavior and alert sensitivity: + +- **Short windows** (`[5m]`, `[10m]`) - Detect immediate issues, sensitive to spikes +- **Medium windows** (`[15m]`, `[30m]`) - Balance between responsiveness and stability, recommended for most alerts +- **Long windows** (`[1h]`, `[2h]`) - Trend analysis, capacity planning, smooth out temporary fluctuations + +Example: `increase(aztec_archiver_block_height[15m])` checks if blocks were processed in the last 15 minutes - long enough to avoid false alarms from brief delays, short enough to catch real problems quickly. + +## Core Node Metrics + +Your node exposes these foundational metrics for monitoring blockchain synchronization and network health. Configure immediate alerting for these metrics in all deployments. + +### L2 Block Height Progress + +Track whether your node is actively processing new L2 blocks: + +- **Metric**: `aztec_archiver_block_height` +- **Description**: Current L2 block number the node has synced to + +**Alert rule**: +```yaml +- alert: L2BlockHeightNotIncreasing + expr: increase(aztec_archiver_block_height{aztec_status=""}[15m]) == 0 + for: 5m + labels: + severity: critical + annotations: + summary: "Aztec node not processing L2 blocks" + description: "No L2 blocks processed in the last 15 minutes. Node may be stuck or out of sync." +``` + +### Peer Connectivity + +Track the number of active P2P peers connected to your node: + +- **Metric**: `aztec_peer_manager_peer_count_peers` +- **Description**: Number of outbound peers currently connected to the node + +**Alert rule**: +```yaml +- alert: LowPeerCount + expr: aztec_peer_manager_peer_count_peers < 5 + for: 10m + labels: + severity: warning + annotations: + summary: "Low peer count detected" + description: "Node has only {{ $value }} peers connected. Risk of network isolation." +``` + +### L1 Block Height Progress + +Monitor whether your node is seeing new L1 blocks: + +- **Metric**: `aztec_l1_block_height` +- **Description**: Latest L1 (Ethereum) block number seen by the node + +**Alert rule**: +```yaml +- alert: L1BlockHeightNotIncreasing + expr: increase(aztec_l1_block_height[15m]) == 0 + for: 10m + labels: + severity: warning + annotations: + summary: "Node not seeing new L1 blocks" + description: "No L1 block updates in 15 minutes. Check L1 RPC connection." +``` + +## Sequencer Metrics + +If you're running a sequencer node, monitor these metrics for consensus participation, block production, and L1 publishing. Configure alerting for critical operations. + +### L1 Publisher ETH Balance + +Monitor the ETH balance used for publishing to L1 to prevent transaction failures: + +- **Metric**: `aztec_l1_publisher_balance_eth` +- **Description**: Current ETH balance of the L1 publisher account + +**Alert rule**: +```yaml +- alert: LowL1PublisherBalance + expr: aztec_l1_publisher_balance_eth < 0.5 + for: 5m + labels: + severity: critical + annotations: + summary: "L1 publisher ETH balance critically low" + description: "Publisher balance is {{ $value }} ETH. Refill immediately to avoid transaction failures." +``` + +### Sequencer State + +Monitor the operational state of the sequencer module: + +- **Metric**: `aztec_sequencer_current_state` +- **Description**: Current state of the sequencer module (1 = OK/running, 0 = stopped/error) + +**Alert rule**: +```yaml +- alert: SequencerNotHealthy + expr: aztec_sequencer_current_state != 1 + for: 2m + labels: + severity: critical + annotations: + summary: "Sequencer module not in healthy state" + description: "Sequencer state is {{ $value }} (expected 1). Check sequencer logs immediately." +``` + +### Block Proposal Failures + +Track failed block proposals by comparing slots to filled slots: + +- **Metrics**: `aztec_sequencer_slot_count` and `aztec_sequencer_slot_filled_count` +- **Description**: Tracks slots assigned to your sequencer versus slots successfully filled. Alert triggers when the failure rate exceeds 5% over 15 minutes. + +**Alert rule**: +```yaml +- alert: HighBlockProposalFailureRate + expr: | + (increase(aztec_sequencer_slot_count[15m]) - increase(aztec_sequencer_slot_filled_count[15m])) + / increase(aztec_sequencer_slot_count[15m]) > 0.05 + for: 5m + labels: + severity: warning + annotations: + summary: "High block proposal failure rate" + description: "{{ $value | humanizePercentage }} of block proposals are failing in the last 15 minutes." +``` + +### Blob Publishing Failures + +Track failures when publishing blobs to L1: + +- **Metric**: `aztec_l1_publisher_blob_tx_failure` +- **Description**: Number of failed blob transaction submissions to L1 + +**Alert rule**: +```yaml +- alert: BlobPublishingFailures + expr: increase(aztec_l1_publisher_blob_tx_failure[15m]) > 0 + for: 5m + labels: + severity: warning + annotations: + summary: "Blob publishing failures detected" + description: "{{ $value }} blob transaction failures in the last 15 minutes. Check L1 gas prices and publisher balance." +``` + +### Attestation Activity + +Track your sequencer's participation in the consensus protocol: + +- **Metrics**: Attestations submitted, attestation success rate, attestation timing +- **Use cases**: + - Verify your sequencer is actively participating + - Monitor attestation success rate + - Detect missed attestation opportunities + +### Block Proposals + +Monitor block proposal activity and success: + +- **Metrics**: Blocks proposed, proposal success rate, proposal timing +- **Use cases**: + - Track block production performance + - Identify proposal failures and causes + - Monitor proposal timing relative to slot schedule + +### Committee Participation + +Track your sequencer's involvement in consensus committees: + +- **Metrics**: Committee assignments, participation rate, duty execution +- **Use cases**: + - Verify your sequencer is assigned to committees + - Monitor duty execution completion rate + - Track committee participation over time + +### Performance Metrics + +Measure block production efficiency: + +- **Metrics**: Block production time, validation latency, processing throughput +- **Use cases**: + - Optimize block production pipeline + - Identify performance bottlenecks + - Compare performance against network averages + +## Prover Metrics + +If you're running a prover node, track these metrics for proof generation workload and resource utilization. + +### Job Queue + +Monitor pending proof generation work: + +- **Metrics**: Queue depth, queue wait time, job age +- **Use cases**: + - Detect proof generation backlogs + - Capacity planning for prover resources + - Monitor job distribution across agents + +### Proof Generation + +Track proof completion metrics: + +- **Metrics**: Proofs completed, completion time, success rate, failure reasons +- **Use cases**: + - Monitor proof generation throughput + - Identify failing proof types + - Track generation time trends + +### Agent Utilization + +Monitor resource usage per proof agent: + +- **Metrics**: CPU usage per agent, memory allocation, GPU utilization (if applicable) +- **Use cases**: + - Optimize agent allocation + - Detect resource constraints + - Load balancing across agents + +### Throughput + +Measure proof generation capacity: + +- **Metrics**: Jobs completed per time period, proofs per second, utilization rate +- **Use cases**: + - Capacity planning + - Performance optimization + - SLA monitoring + +## System Metrics + +Your node exposes standard infrastructure metrics through OpenTelemetry and the runtime environment. + +### CPU Usage + +Monitor process and system CPU utilization: + +- **Metric**: `process_cpu_seconds_total` +- **Description**: Cumulative CPU time consumed by the process in seconds + +**Alert rules**: +```yaml +# Note: Adjust thresholds based on your system's CPU core count. +# Example below assumes a 4-core system (70% = 2.8 cores, 85% = 3.4 cores) +- alert: HighCPUUsage + expr: rate(process_cpu_seconds_total[5m]) > 2.8 + for: 10m + labels: + severity: warning + annotations: + summary: "High CPU usage detected" + description: "Node using {{ $value }} CPU cores (above 2.8 threshold). Consider scaling resources." +``` + +### Memory Usage + +Track RAM consumption: + +- **Metric**: `process_resident_memory_bytes` +- **Description**: Resident memory size in bytes + +**Alert rules**: +```yaml +- alert: HighMemoryUsage + expr: process_resident_memory_bytes > 8000000000 + for: 5m + labels: + severity: warning + annotations: + summary: "High memory usage detected" + description: "Memory usage is {{ $value | humanize1024 }}B. Consider increasing available RAM or investigating memory leaks." +``` + +**Additional monitoring**: +- Track memory growth rate to detect leaks +- Monitor garbage collection metrics for runtime efficiency + +### Disk I/O + +Monitor storage operations: + +- **Metrics**: Disk read/write rates, I/O latency, disk utilization +- **Use cases**: + - Identify I/O bottlenecks + - Plan storage upgrades + - Detect disk performance degradation + +### Network Bandwidth + +Track network throughput: + +- **Metrics**: Bytes sent/received, packet rates, connection counts +- **Use cases**: + - Monitor P2P bandwidth usage + - Capacity planning for network resources + - Detect unusual traffic patterns + +## Creating Dashboards in Grafana + +Organize your Grafana dashboards by operational focus to make monitoring efficient and actionable. For specific panel configurations and queries, see the [Grafana Setup](./grafana_setup.md) guide. + +### Dashboard Organization Strategy + +**Overview Dashboard** - At-a-glance health check +- L2 and L1 block height progression +- Peer connectivity status +- Critical alerts summary +- Resource utilization (CPU, memory) +- Use stat panels and gauges for current values +- Include time-series graphs for trends + +**Performance Dashboard** - Deep-dive into operational metrics +- Block processing rates and latencies +- Transaction throughput +- Network bandwidth utilization +- Query response times +- Use percentile graphs (p50, p95, p99) for latency metrics +- Compare current performance against historical baselines + +**Resource Dashboard** - Infrastructure monitoring +- CPU usage per core +- Memory allocation and garbage collection +- Disk I/O rates and latency +- Network packet rates +- Set threshold warning lines at 70-80% utilization +- Include growth trend projections + +**Role-Specific Dashboards** - Specialized metrics by node type +- **Sequencer Dashboard**: Block proposals, attestations, committee participation, L1 publisher balance +- **Prover Dashboard**: Job queue depth, proof generation rates, agent utilization, success rates +- Focus on metrics unique to the role's responsibilities +- Include SLA tracking and performance benchmarks + +## Best Practices + +### Metric Collection + +1. **Appropriate Scrape Intervals**: Balance data granularity against storage costs + - Standard: 15s for most metrics + - High-frequency: 5s for critical real-time metrics + - Low-frequency: 60s for slow-changing metrics + +2. **Retention Policy**: Configure based on operational needs + - Short-term: 7-15 days for detailed troubleshooting + - Long-term: 30-90 days for trend analysis + - Archive: Consider downsampling for longer retention + +3. **Label Cardinality**: Avoid high-cardinality labels that explode metric storage + - Good: `instance`, `node_type`, `region` + - Avoid: `user_id`, `transaction_hash`, `timestamp` + +### Monitoring Strategy + +1. **Layered Monitoring**: Monitor at multiple levels + - Infrastructure: CPU, memory, disk, network + - Application: Block height, peers, throughput + - Business: Transaction success rate, user activity + +2. **Proactive Alerts**: Set alerts before problems become critical + - Use warning and critical thresholds + - Alert on trends, not just absolute values + - Reduce alert fatigue with proper tuning + +3. **Dashboard Discipline**: Keep dashboards focused and actionable + - Separate dashboards by role and concern + - Include relevant context in panel titles + - Add threshold lines and annotations + +## Next Steps + +- Explore advanced PromQL queries in the [Prometheus documentation](https://prometheus.io/docs/prometheus/latest/querying/basics/) +- Set up alerting rules following the [Prometheus alerting guide](https://prometheus.io/docs/alerting/latest/overview/) +- Configure notification channels in [Grafana](./grafana_setup.md) +- Return to [Monitoring Overview](./monitoring.md) +- Join the [Aztec Discord](https://discord.gg/aztec) to share dashboards with the community diff --git a/docs/network_versioned_docs/version-v3.0.2/operation/monitoring.md b/docs/network_versioned_docs/version-v3.0.2/operation/monitoring.md new file mode 100644 index 000000000000..9f9d2459f58c --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/operation/monitoring.md @@ -0,0 +1,61 @@ +--- +sidebar_position: 0 +id: monitoring +title: Monitoring and Observability +description: Learn how to monitor your Aztec node with metrics, OpenTelemetry, Prometheus, and Grafana. +--- + +## Overview + +This guide shows you how to set up monitoring and observability for your Aztec node using OpenTelemetry, Prometheus, and Grafana. Monitoring helps you maintain healthy node operations, diagnose issues quickly, and track performance over time. + +:::info Docker Compose Setup +This monitoring setup is designed to work with Docker Compose deployments of Aztec nodes. +::: + +## Architecture + +The monitoring stack uses three components working together: + +- **OpenTelemetry Collector**: Receives metrics from your Aztec node via OTLP protocol +- **Prometheus**: Stores and queries time-series metrics data +- **Grafana**: Visualizes metrics with dashboards and alerts + +Your Aztec node exports metrics to the OpenTelemetry Collector, which processes and exposes them in a format Prometheus can scrape. Prometheus stores the metrics as time-series data, and Grafana queries Prometheus to create visualizations and alerts. + +## Getting Started + +Follow these guides in order to set up your complete monitoring stack: + +1. [OpenTelemetry Collector Setup](./otel_setup.md) - Configure OTEL to receive metrics from your node +2. [Prometheus Setup](./prometheus_setup.md) - Set up Prometheus to store and query metrics +3. [Grafana Setup](./grafana_setup.md) - Configure Grafana for visualization and alerting +4. [Key Metrics Reference](./metrics_reference.md) - Understand the metrics your node exposes and create custom dashboards +5. [Complete Example and Troubleshooting](./monitoring_example_troubleshooting.md) - Full Docker Compose configuration and troubleshooting help + +## Available Metrics Overview + +Your Aztec node exposes metrics through OpenTelemetry to help you monitor performance and health. The metrics available depend on your node type (full node, sequencer, or prover) and version. + +### Metric Categories + +Your node exposes metrics in these categories: + +- **Node Metrics**: Block height, sync status, peer count, and transaction processing +- **Sequencer Metrics**: Attestation activity, block proposals, and committee participation (sequencer nodes only) +- **Prover Metrics**: Job queue, proof generation, and agent utilization (prover nodes only) +- **System Metrics**: CPU, memory, disk I/O, and network bandwidth + +For detailed information about each metric, PromQL queries, and dashboard creation, see the [Key Metrics Reference](./metrics_reference.md). + +## Next Steps + +Once your monitoring stack is running: + +- Review the [Key Metrics Reference](./metrics_reference.md) to understand available metrics and PromQL queries +- Set up alerting rules in Prometheus for critical conditions +- Create custom dashboards tailored to your operational needs +- Configure notification channels (Slack, PagerDuty, email) in Grafana +- Join the [Aztec Discord](https://discord.gg/aztec) to share dashboards with the community + +For troubleshooting common monitoring issues, see the [Complete Example and Troubleshooting](./monitoring_example_troubleshooting.md) guide. diff --git a/docs/network_versioned_docs/version-v3.0.2/operation/monitoring_example_troubleshooting.md b/docs/network_versioned_docs/version-v3.0.2/operation/monitoring_example_troubleshooting.md new file mode 100644 index 000000000000..3edebb4200a3 --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/operation/monitoring_example_troubleshooting.md @@ -0,0 +1,153 @@ +--- +sidebar_position: 4 +title: Complete Example and Troubleshooting +description: Complete Docker Compose example with all monitoring components and troubleshooting guide for common monitoring issues. +--- + +## Complete Docker Compose Example + +Here's a complete example with all monitoring components integrated with your Aztec node: + +```yaml +services: + # Your Aztec node (example for full node) + aztec-node: + image: "aztecprotocol/aztec:2.1.9" + container_name: "aztec-node" + ports: + - ${AZTEC_PORT}:${AZTEC_PORT} + - ${P2P_PORT}:${P2P_PORT} + - ${P2P_PORT}:${P2P_PORT}/udp + volumes: + - ${DATA_DIRECTORY}:/var/lib/data + environment: + DATA_DIRECTORY: /var/lib/data + LOG_LEVEL: ${LOG_LEVEL} + ETHEREUM_HOSTS: ${ETHEREUM_HOSTS} + L1_CONSENSUS_HOST_URLS: ${L1_CONSENSUS_HOST_URLS} + P2P_IP: ${P2P_IP} + P2P_PORT: ${P2P_PORT} + AZTEC_PORT: ${AZTEC_PORT} + OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: http://otel-collector:4318/v1/metrics + entrypoint: >- + node + --no-warnings + /usr/src/yarn-project/aztec/dest/bin/index.js + start + --node + --archiver + --network testnet + networks: + - aztec + restart: always + + # OpenTelemetry Collector + otel-collector: + image: otel/opentelemetry-collector + container_name: aztec-otel + ports: + - 8888:8888 + - 8889:8889 + - 4317:4317 + - 4318:4318 + volumes: + - ./otel-collector-config.yaml:/etc/otel-collector-config.yaml + command: >- + --config=/etc/otel-collector-config.yaml + networks: + - aztec + restart: always + + # Prometheus + prometheus: + image: prom/prometheus:latest + container_name: aztec-prometheus + ports: + - 9090:9090 + volumes: + - ./prometheus.yml:/etc/prometheus/prometheus.yml + - prometheus-data:/prometheus + command: + - "--config.file=/etc/prometheus/prometheus.yml" + - "--storage.tsdb.path=/prometheus" + - "--storage.tsdb.retention.time=30d" + networks: + - aztec + restart: always + + # Grafana + grafana: + image: grafana/grafana:latest + container_name: aztec-grafana + ports: + - 3000:3000 + volumes: + - grafana-data:/var/lib/grafana + environment: + - GF_SECURITY_ADMIN_PASSWORD=your-secure-password + - GF_USERS_ALLOW_SIGN_UP=false + networks: + - aztec + restart: always + +volumes: + prometheus-data: + grafana-data: + +networks: + aztec: + name: aztec +``` + +This configuration includes: + +- Your Aztec node configured to export metrics to the OTEL collector +- OpenTelemetry Collector to receive and process metrics +- Prometheus to store time-series data with 30-day retention +- Grafana for visualization and alerting +- Persistent volumes for Prometheus and Grafana data +- All services on the same Docker network for easy communication + +## Troubleshooting + +### Metrics not appearing + +**Issue**: No metrics showing in Prometheus or Grafana. + +**Solutions**: + +- Verify OTEL collector is running: `docker compose ps otel-collector` +- Check OTEL collector logs: `docker compose logs otel-collector` +- Verify node is configured with correct OTEL endpoints +- Test OTEL collector endpoint: `curl http://localhost:8889/metrics` +- Ensure all containers are on the same Docker network + +### Prometheus target down + +**Issue**: Prometheus shows target as "down" in Status → Targets. + +**Solutions**: + +- Verify OTEL collector is running and exposing port 8889 +- Check Prometheus configuration in `prometheus.yml` +- Ensure target address is correct (use service name if in same Docker network) +- Review Prometheus logs: `docker compose logs prometheus` + +### Grafana cannot connect to Prometheus + +**Issue**: Grafana shows "Bad Gateway" or cannot query Prometheus. + +**Solutions**: + +- Verify Prometheus is running: `docker compose ps prometheus` +- Check data source URL in Grafana (should be `http://prometheus:9090`) +- Test Prometheus endpoint: `curl http://localhost:9090/api/v1/query?query=up` +- Ensure Grafana and Prometheus are on the same Docker network + +## Next Steps + +- Set up alerting rules in Prometheus for critical conditions +- Create custom dashboards for your specific monitoring needs +- Configure notification channels (Slack, PagerDuty, email) in Grafana +- Explore advanced PromQL queries for deeper insights +- Join the [Aztec Discord](https://discord.gg/aztec) to share dashboards with the community diff --git a/docs/network_versioned_docs/version-v3.0.2/operation/operator_faq.md b/docs/network_versioned_docs/version-v3.0.2/operation/operator_faq.md new file mode 100644 index 000000000000..bac29e3e7e3c --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/operation/operator_faq.md @@ -0,0 +1,436 @@ +--- +sidebar_position: 4 +title: FAQs & Common Issues +description: Troubleshooting guide for common Aztec node operator issues including sync errors, RPC limits, and update procedures. +keywords: [aztec, sequencer, node, validator, setup] +tags: + - sequencer + - node + - tutorial + - infrastructure +--- + +## Overview + +This guide addresses common issues node operators encounter when running Aztec nodes. Each entry includes the issue symptoms, possible causes, and step-by-step solutions. + +If your issue isn't listed here, visit the [Aztec Discord](https://discord.gg/aztec) in the `#operator-faq` channel for community support. + +## Node Sync Issues + +### SYNC_BLOCK Failed Error + +**Symptom**: You see this error in your node logs: + +``` +ERROR: world-state:database Call SYNC_BLOCK failed: Error: Can't synch block: block state does not match world state +``` + +**Cause**: Your local database state is corrupted or out of sync with the network. + +**Solution**: + +1. Stop your node: + + ```bash + docker compose down + ``` + +2. Remove the archiver data directory: + + ```bash + rm -rf ~/.aztec/v2.1.9/data/archiver + ``` + +3. Restart your node: + + ```bash + docker compose up -d + ``` + +:::warning Data Loss and Resync +This process removes local state and requires full resynchronization. Consider using snapshot sync mode (`SYNC_MODE=snapshot`) to speed up recovery. See the [syncing best practices guide](../setup/syncing_best_practices.md) for more information. +::: + +### Error Getting Slot Number + +**Symptom**: Your logs show "Error getting slot number" related to beacon or execution endpoints. + +**Cause**: + +- **Beacon-related errors**: Failed to connect to your L1 consensus (beacon) RPC endpoint +- **Execution-related errors**: Failed to connect to your L1 execution RPC endpoint or reporting routine issue + +**Solutions**: + +1. **Verify L1 endpoint configuration**: + + - Check your `L1_CONSENSUS_HOST_URLS` setting points to your beacon node + - Check your `ETHEREUM_HOSTS` setting points to your execution client + - Ensure URLs are formatted correctly (e.g., `http://localhost:5052` for beacon) + +2. **Test endpoint connectivity**: + + ```bash + # Test beacon endpoint + curl [YOUR_BEACON_ENDPOINT]/eth/v1/beacon/headers + + # Test execution endpoint + curl -X POST -H "Content-Type: application/json" \ + --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \ + [YOUR_EXECUTION_ENDPOINT] + ``` + +3. **Verify L1 clients are synced**: + + - Check that your beacon node is fully synced + - Check that your execution client is fully synced + - Use `docker compose logs` or check L1 client logs for sync status + +4. **Check for rate limiting** (if using third-party RPC): + - See the "RPC and Rate Limiting" section below + - Consider using your own L1 node for better reliability + +## RPC and Rate Limiting + +### RPC Rate Limit or Quota Exceeded + +**Symptom**: Your logs show errors like: + +``` +Error: quota limit exceeded +Error: rate limit exceeded +Error: too many requests +``` + +**Cause**: Your RPC provider is throttling requests due to rate limits or quota restrictions. + +**Solutions**: + +1. **Register for an API key with your RPC provider**: + + - Most providers (Infura, Alchemy, QuickNode) offer higher limits with authenticated requests + - Update your configuration to include the API key in your RPC URL + - Example: `https://mainnet.infura.io/v3/YOUR_API_KEY` + +2. **Use your own L1 node** (recommended for sequencers): + + - Running your own Ethereum node eliminates rate limits entirely + - Provides better performance, reliability, and privacy + - See [Eth Docker's guide](https://ethdocker.com/Usage/QuickStart) for setup instructions + - Ensure you're running both execution and consensus clients + +3. **Configure multiple RPC endpoints for failover**: + - Aztec nodes support comma-separated RPC URLs + - Example: `ETHEREUM_HOSTS=https://rpc1.example.com,https://rpc2.example.com` + - The node will automatically fail over if one endpoint is unavailable + +:::tip Run Your Own L1 Infrastructure +Sequencer operators should always run their own L1 infrastructure to ensure reliability, avoid rate limits, and maintain optimal performance. Third-party RPC providers are suitable for testing but not recommended for production sequencer operations. +::: + +### Blob Retrieval Errors + +**Symptom**: Your logs show errors like: + +``` +Error: No blob bodies found +Error: Unable to get blob sidecar, Gateway Time-out (504) +``` + +**Cause**: Your beacon node endpoint is slow, overloaded, rate-limited, or not synced properly. + +**Solutions**: + +1. **Verify beacon endpoint configuration**: + + ```bash + # Check L1_CONSENSUS_HOST_URLS in your configuration + # Should point to your beacon node's API endpoint + ``` + +2. **Test beacon endpoint health**: + + ```bash + # Check if beacon node is responding + curl [YOUR_BEACON_ENDPOINT]/eth/v1/node/health + + # Check sync status + curl [YOUR_BEACON_ENDPOINT]/eth/v1/node/syncing + ``` + +3. **Ensure beacon node is fully synced**: + + - Check your beacon client logs + - Verify the sync status shows as synced + - Blob data is only available for recent blocks (typically 18 days) + +4. **Run your own beacon node** (recommended): + - Using a third-party beacon endpoint may have rate limits + - Running your own provides better reliability and eliminates timeouts + - See the [prerequisites guide](../prerequisites.md) for L1 infrastructure setup + +## Funding and Resources + +### Insufficient L1 Funds + +**Symptom**: Your sequencer cannot publish blocks, and logs show: + +``` +Error: Insufficient L1 funds +Error: insufficient funds for gas * price + value +``` + +**Cause**: Your publisher address doesn't have enough Sepolia ETH to pay for L1 gas fees. + +**Solutions**: + +1. **Get Sepolia ETH from a faucet**: + + - [Sepolia Faucet](https://sepoliafaucet.com/) + - [Alchemy Sepolia Faucet](https://www.alchemy.com/faucets/ethereum-sepolia) + - [Infura Sepolia Faucet](https://www.infura.io/faucet/sepolia) + +2. **Maintain sufficient balance**: + + - Keep at least **0.1 ETH** in your publisher account at all times + - Monitor your balance regularly to avoid running out + - Falling below the minimum balance may result in slashing + +3. **Set up balance monitoring**: + + ```bash + # Check your publisher balance + cast balance [YOUR_PUBLISHER_ADDRESS] --rpc-url [YOUR_RPC_URL] + ``` + +4. **Configure alerts**: + - Set up monitoring to alert you when balance drops below 0.15 ETH + - This gives you time to top up before hitting the critical threshold + +:::warning Slashing Risk +Sequencers with insufficient funds in their publisher account risk being slashed. Always maintain at least 0.1 ETH to ensure uninterrupted operation and avoid penalties. +::: + +## Updates and Maintenance + +#### Version-Specific Updates: + +To update to a specific version: + +```yaml +# Change the image tag from: +image: "aztecprotocol/aztec:latest" +# To: +image: "aztecprotocol/aztec:2.1.9" +``` + +Then run: + +```bash +docker compose pull +docker compose down +docker compose up -d +``` + +:::tip Stay Informed About Updates +Join the [Aztec Discord](https://discord.gg/aztec) and follow the announcements channel to stay informed about new releases and required updates. +::: + +## Network and Connectivity + +### Port Forwarding Not Working + +**Symptom**: Your node cannot discover peers or shows "0 peers connected" in logs. + +**Cause**: Firewall rules or router configuration are blocking P2P connections. + +**Solutions**: + +1. **Verify your external IP address**: + + ```bash + curl ipv4.icanhazip.com + ``` + + Confirm this matches your `P2P_IP` configuration. + +2. **Test port connectivity**: + + ```bash + # From another machine, test if your P2P port is accessible + nc -zv [YOUR_EXTERNAL_IP] 40400 + ``` + +3. **Configure router port forwarding**: + + - Log into your router's admin interface + - Forward port 40400 (TCP and UDP) to your node's local IP address + - Save and restart router if needed + +4. **Check local firewall rules**: + + ```bash + # Linux: Allow P2P port through firewall + sudo ufw allow 40400/tcp + sudo ufw allow 40400/udp + + # Verify rules + sudo ufw status + ``` + +5. **Verify Docker network settings**: + - Ensure ports are properly mapped in docker-compose.yml + - Check that `P2P_PORT` environment variable matches the exposed ports + +## Other Common Issues + +### CodeError: Stream Reset + +**Symptom**: You occasionally see this error in logs: + +``` +CodeError: stream reset +``` + +**Cause**: Temporary P2P connection disruption. This is normal network behavior and occurs when peer connections are interrupted. + +**Impact**: This is safe to ignore. Your node automatically reconnects to peers and maintains network connectivity. + +**Action Required**: None. This is expected behavior in P2P networks. + +### Keystore Not Loading + +**Symptom**: Your sequencer fails to start with errors about invalid keys or missing keystore. + +**Cause**: Keystore file is improperly formatted, missing, or has incorrect permissions. + +**Solutions**: + +1. **Verify keystore.json format**: + + ```json + { + "schemaVersion": 1, + "validators": [ + { + "attester": { + "eth": "0xYOUR_ETH_PRIVATE_KEY_HERE", + "bls": "0xYOUR_BLS_PRIVATE_KEY_HERE" + }, + "publisher": ["0xYOUR_PUBLISHER_KEY_HERE"], + "coinbase": "0xYOUR_COINBASE_ADDRESS", + "feeRecipient": "0xYOUR_AZTEC_ADDRESS" + } + ] + } + ``` + +2. **Validate private key format**: + + - Keys should start with `0x` + - Keys should be 64 hexadecimal characters (plus the `0x` prefix) + - No spaces or extra characters + - The attester must contain both `eth` and `bls` keys + +3. **Check file permissions**: + + ```bash + # Ensure keystore is readable + chmod 600 ~/.aztec/keys/keystore.json + + # Verify ownership + ls -la ~/.aztec/keys/ + ``` + +4. **Verify keystore directory path**: + - Ensure `KEY_STORE_DIRECTORY` environment variable is set in your `.env` file + - Verify the volume mount in `docker-compose.yml` points to the correct directory + +For more information on keystore configuration and creation, see the [Creating Validator Keystores guide](./keystore/creating_keystores.md) and the [Advanced Keystore Usage guide](./keystore/index.md). + +### Docker Container Won't Start + +**Symptom**: Docker container crashes immediately after starting or won't start at all. + +**Cause**: Various issues including configuration errors, insufficient resources, or port conflicts. + +**Solutions**: + +1. **Check container logs**: + + ```bash + docker compose logs aztec-sequencer + ``` + + Look for specific error messages that indicate the problem. + +2. **Verify Docker resources**: + + - Ensure sufficient disk space: `df -h` + - Check Docker has adequate memory allocated (16GB+ recommended) + - Verify CPU resources are available + +3. **Check environment file format**: + + ```bash + # Verify .env file exists and is properly formatted + cat .env + + # No spaces around = signs + # No quotes around values (unless necessary) + ``` + +4. **Verify port availability**: + + ```bash + # Check if ports are already in use + lsof -i :8080 + lsof -i :40400 + ``` + +5. **Update Docker and Docker Compose**: + + ```bash + # Check versions + docker --version + docker compose version + + # Update if needed + sudo apt-get update && sudo apt-get upgrade docker-ce docker-compose-plugin + ``` + +6. **Try a clean restart**: + ```bash + docker compose down + docker compose pull + docker compose up -d + ``` + +## Getting Additional Help + +If you've tried the solutions above and are still experiencing issues: + +1. **Gather diagnostic information**: + + - Recent log output from your node + - Your configuration (remove private keys!) + - Aztec version you're running + - Operating system and hardware specs + +2. **Check existing issues**: + + - Browse the [Aztec GitHub issues](https://github.com/AztecProtocol/aztec-packages/issues) + - Search for similar problems and solutions + +3. **Ask for help**: + - Join the [Aztec Discord](https://discord.gg/aztec) + - Post in the `#operator-faq` or `#operator-support` channel + - Include your diagnostic information + - Be specific about what you've already tried + +## Next Steps + +- Review [monitoring setup](./monitoring.md) to catch issues early with metrics and alerts +- Check the [CLI reference](../reference/cli_reference.md) for all configuration options +- Join the [Aztec Discord](https://discord.gg/aztec) for real-time operator support diff --git a/docs/network_versioned_docs/version-v3.0.2/operation/otel_setup.md b/docs/network_versioned_docs/version-v3.0.2/operation/otel_setup.md new file mode 100644 index 000000000000..952553cb95b1 --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/operation/otel_setup.md @@ -0,0 +1,126 @@ +--- +title: OpenTelemetry Collector Setup +description: Configure OpenTelemetry Collector to receive metrics from your Aztec node and export them to Prometheus. +--- + +## Overview + +The OpenTelemetry Collector receives metrics from your Aztec node and exports them to Prometheus for storage and analysis. + +## Prerequisites + +- A running Aztec node with Docker Compose +- Basic understanding of Docker networking + +## Setup Steps + +### Step 1: Create Configuration File + +Create an `otel-collector-config.yml` file in the same directory as your existing `docker-compose.yml`: + +```yaml +receivers: + otlp: + protocols: + http: + endpoint: 0.0.0.0:4318 + grpc: + endpoint: 0.0.0.0:4317 + +exporters: + prometheus: + endpoint: "0.0.0.0:8889" + metric_expiration: 5m + +processors: + batch: + +service: + pipelines: + metrics: + receivers: [otlp] + exporters: + - prometheus +``` + +This configuration: +- Receives metrics via OTLP (OpenTelemetry Protocol) on ports 4317 (gRPC) and 4318 (HTTP) +- Exports metrics to Prometheus format on port 8889 +- Uses batch processing for efficiency + +### Step 2: Add OTEL Collector to Docker Compose + +Add the following to your existing `docker-compose.yml` file: + +```yaml +services: + # ... existing services ... + otel-collector: + image: otel/opentelemetry-collector + container_name: aztec-otel + ports: + - 8888:8888 # OTEL collector metrics endpoint + - 8889:8889 # Prometheus exporter endpoint + - 4317:4317 # OTLP gRPC receiver + - 4318:4318 # OTLP HTTP receiver + volumes: + - ./otel-collector-config.yml:/etc/otel-collector-config.yml + command: >- + --config=/etc/otel-collector-config.yml + networks: + - aztec + restart: always +``` + +### Step 3: Configure Your Node to Export Metrics + +Configure your Aztec node to export metrics to the OTEL collector. + +**Step 3a: Add to .env file** + +Add these variables to your `.env` file: + +```bash +OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://otel-collector:4318/v1/metrics +``` + +**Step 3b: Update docker-compose.yml** + +Add these environment variables to your node's service in `docker-compose.yml`: + +```yaml +services: + aztec-node: # or aztec-sequencer, prover-node, etc. + # ... existing configuration ... + environment: + # ... existing environment variables ... + OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: ${OTEL_EXPORTER_OTLP_METRICS_ENDPOINT} +``` + +**Network configuration:** Since your node and OTEL collector share the same Docker Compose file and `aztec` network, use the service name `otel-collector` in the endpoint URL as shown above. + +### Step 4: Start Services + +```bash +# Start or restart all services +docker compose up -d +``` + +### Step 5: Verify Metrics Collection + +Check that metrics are being collected: + +```bash +# View OTEL collector logs +docker compose logs -f otel-collector + +# Query Prometheus endpoint +curl http://localhost:8889/metrics +``` + +You should see metrics in Prometheus format. + +## Next Steps + +- Proceed to [Prometheus Setup](./prometheus_setup.md) to configure metric storage and querying +- Return to [Monitoring Overview](./monitoring.md) diff --git a/docs/network_versioned_docs/version-v3.0.2/operation/prometheus_setup.md b/docs/network_versioned_docs/version-v3.0.2/operation/prometheus_setup.md new file mode 100644 index 000000000000..294e4fa2816e --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/operation/prometheus_setup.md @@ -0,0 +1,106 @@ +--- +title: Prometheus Setup +description: Configure Prometheus to scrape and store metrics from your Aztec node's OpenTelemetry Collector. +--- + +## Overview + +Prometheus scrapes and stores the metrics exposed by the OTEL collector, providing a time-series database for querying and analysis. + +## Prerequisites + +- Completed [OpenTelemetry Collector Setup](./otel_setup.md) +- OTEL collector running and exposing metrics on port 8889 + +## Setup Steps + +### Step 1: Create Prometheus Configuration + +Create a `prometheus.yml` file: + +```yaml +global: + scrape_interval: 15s + evaluation_interval: 15s + +scrape_configs: + - job_name: 'aztec-node' + static_configs: + - targets: ['otel-collector:8889'] + labels: + instance: 'aztec-node-1' +``` + +If you're running multiple nodes, adjust the `instance` label to uniquely identify each node. + +### Step 2: Add Prometheus to Docker Compose + +Add Prometheus to your `docker-compose.yml`: + +```yaml +services: + # ... existing services (otel-collector, etc.) ... + + prometheus: + image: prom/prometheus:latest + container_name: aztec-prometheus + ports: + - 9090:9090 + volumes: + - ./prometheus.yml:/etc/prometheus/prometheus.yml + - prometheus-data:/prometheus + command: + - '--config.file=/etc/prometheus/prometheus.yml' + - '--storage.tsdb.path=/prometheus' + - '--storage.tsdb.retention.time=30d' + networks: + - aztec + restart: always + +volumes: + prometheus-data: +``` + +### Step 3: Start Prometheus + +```bash +docker compose up -d +``` + +### Step 4: Verify Prometheus + +Access Prometheus UI at `http://localhost:9090` and verify: +1. Go to **Status → Targets** to check that the `aztec-node` target is up +2. Go to **Graph** and query a metric (e.g., `aztec_archiver_block_height`) + +## Using Prometheus + +### Query Metrics + +Use the Prometheus UI to explore and query metrics: + +1. Navigate to `http://localhost:9090/graph` +2. Enter a metric name in the query box (use autocomplete to discover available metrics) +3. Click **Execute** to see the results +4. Switch between **Table** and **Graph** views + +### Example Queries + +```promql +# Current block height +aztec_archiver_block_height + +# Blocks synced over time window +increase(aztec_archiver_block_height[5m]) + +# Memory usage +process_resident_memory_bytes + +# CPU usage rate +rate(process_cpu_seconds_total[5m]) +``` + +## Next Steps + +- Proceed to [Grafana Setup](./grafana_setup.md) to configure visualization and alerting +- Return to [Monitoring Overview](./monitoring.md) diff --git a/docs/network_versioned_docs/version-v3.0.2/operation/sequencer_management/_category_.json b/docs/network_versioned_docs/version-v3.0.2/operation/sequencer_management/_category_.json new file mode 100644 index 000000000000..b4c6f72d1de9 --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/operation/sequencer_management/_category_.json @@ -0,0 +1,6 @@ +{ + "label": "Sequencer Management", + "position": 2, + "collapsible": true, + "collapsed": false +} diff --git a/docs/network_versioned_docs/version-v3.0.2/operation/sequencer_management/claiming_rewards.md b/docs/network_versioned_docs/version-v3.0.2/operation/sequencer_management/claiming_rewards.md new file mode 100644 index 000000000000..7afce86abcd7 --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/operation/sequencer_management/claiming_rewards.md @@ -0,0 +1,243 @@ +--- +sidebar_position: 4 +title: Claiming Rewards +description: Learn how to claim your sequencer rewards from the Aztec Rollup contract using cast commands. +--- + +## Overview + +Sequencer rewards accumulate in the Rollup contract but are not automatically distributed. You must manually claim them by calling the Rollup contract. This guide shows you how to check pending rewards and claim them using Foundry's `cast` command. + +## Prerequisites + +Before proceeding, you should: + +- Have a running sequencer that earned rewards (see [Sequencer Setup Guide](../../setup/sequencer_management.md)) +- Have Foundry installed with the `cast` command available ([installation guide](https://book.getfoundry.sh/getting-started/installation)) +- Know your Rollup contract address (see [Useful Commands](./useful_commands.md#get-the-rollup-contract-address)) +- Have your sequencer's coinbase address +- Have an Ethereum RPC endpoint for the network you're querying + +## Understanding Reward Claiming + +### How Rewards Accumulate + +When your sequencer proposes blocks and participates in consensus, rewards accumulate in the Rollup contract under your coinbase address. These rewards come from: + +- Block rewards distributed by the protocol +- Transaction fees from processed transactions + +Rewards are tracked per coinbase address in the Rollup contract's storage but remain in the contract until you claim them. + +### Manual vs Automatic + +Rewards are not automatically sent to your coinbase address. You must explicitly claim them by calling the `claimSequencerRewards` function on the Rollup contract. + +### Claim Requirements + +Before claiming, verify these conditions: + +1. **Rewards must be claimable**: A governance vote must pass to enable the claiming of rewards (only possible after a minimum configured timestamp) and governance must have called `setRewardsClaimable(true)` on the rollup contract. +2. **Rewards have accumulated**: Query your pending rewards before attempting to claim. +3. **Sufficient gas**: Ensure you have ETH to pay transaction gas costs. + +## Checking Reward Status + +### Set Up Your Environment + +For convenience, set your RPC URL as an environment variable: + +```bash +export RPC_URL="https://your-ethereum-rpc-endpoint.com" +export ROLLUP_ADDRESS="[YOUR_ROLLUP_CONTRACT_ADDRESS]" +``` + +Replace `[YOUR_ROLLUP_CONTRACT_ADDRESS]` with your actual Rollup contract address. + +### Check if Rewards Are Claimable + +Verify reward claiming is enabled before attempting to claim: + +```bash +cast call $ROLLUP_ADDRESS "isRewardsClaimable()" --rpc-url $RPC_URL +``` + +**Expected output:** +- `0x0000000000000000000000000000000000000000000000000000000000000001` - Rewards are claimable (true) +- `0x0000000000000000000000000000000000000000000000000000000000000000` - Rewards are not yet claimable (false) + +If rewards are not claimable, check when they will become claimable: + +```bash +cast call $ROLLUP_ADDRESS "getEarliestRewardsClaimableTimestamp()" --rpc-url $RPC_URL +``` + +This returns a Unix timestamp indicating the earliest time when governance can enable reward claiming. + +### Query Your Pending Rewards + +Check accumulated rewards: + +```bash +cast call $ROLLUP_ADDRESS "getSequencerRewards(address)" [COINBASE_ADDRESS] --rpc-url $RPC_URL +``` + +Replace `[COINBASE_ADDRESS]` with your sequencer's coinbase address. + +**Example:** +```bash +# Query and convert to decimal tokens (assuming 18 decimals) +cast call $ROLLUP_ADDRESS "getSequencerRewards(address)" 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb --rpc-url $RPC_URL | cast --to-dec | cast --from-wei +# Output: 0.1 +``` + +## Claiming Your Rewards + +The `claimSequencerRewards` function is permissionless - anyone can call it for any address. Rewards are always sent to the `coinbase` address, regardless of who submits the transaction. + +### Basic Claim Command + +Use `cast send` to claim rewards: + +```bash +cast send $ROLLUP_ADDRESS \ + "claimSequencerRewards(address)" \ + [COINBASE_ADDRESS] \ + --rpc-url $RPC_URL \ + --private-key [YOUR_PRIVATE_KEY] +``` + +Replace: +- `[COINBASE_ADDRESS]` - The coinbase address whose rewards you want to claim +- `[YOUR_PRIVATE_KEY]` - The private key of the account paying for gas + +**Example:** +```bash +cast send $ROLLUP_ADDRESS \ + "claimSequencerRewards(address)" \ + 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb \ + --rpc-url $RPC_URL \ + --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 +``` + +### Using a Keystore File + +For better security, use a keystore file instead of exposing your private key: + +```bash +cast send $ROLLUP_ADDRESS \ + "claimSequencerRewards(address)" \ + [COINBASE_ADDRESS] \ + --rpc-url $RPC_URL \ + --keystore [PATH_TO_KEYSTORE] \ + --password [KEYSTORE_PASSWORD] +``` + +### Using a Hardware Wallet + +If you're using a Ledger wallet: + +```bash +cast send $ROLLUP_ADDRESS \ + "claimSequencerRewards(address)" \ + [COINBASE_ADDRESS] \ + --rpc-url $RPC_URL \ + --ledger +``` + +This will prompt you to confirm the transaction on your Ledger device. + +## Verifying Your Claim + +Check that the transaction succeeded and your pending rewards were reset to zero: + +```bash +# Check transaction succeeded (look for status: 1) +cast receipt [TRANSACTION_HASH] --rpc-url $RPC_URL + +# Verify pending rewards are now zero +cast call $ROLLUP_ADDRESS "getSequencerRewards(address)" [COINBASE_ADDRESS] --rpc-url $RPC_URL +``` + +## Troubleshooting + +### "Rewards not claimable" Error + +**Symptom**: Transaction reverts with "Rewards not claimable" error. + +**Solution**: +1. Check if rewards are claimable using `isRewardsClaimable()` +2. If `false`, wait until governance enables claiming via `setRewardsClaimable(true)` +3. Check the earliest claimable timestamp using `getEarliestRewardsClaimableTimestamp()` + +### No Pending Rewards + +**Symptom**: `getSequencerRewards()` returns zero. + +**Possible causes**: +1. Your sequencer has not proposed any blocks yet +2. You already claimed all available rewards +3. Your coinbase address is configured incorrectly + +**Solutions**: +1. Verify your sequencer is active and proposing blocks (check [monitoring](../monitoring.md)) +2. Check your sequencer logs for block proposals +3. Verify the coinbase address in your sequencer configuration matches the address you're querying +4. Check if blocks you proposed have been proven (rewards are distributed after proof submission) + +### Transaction Fails with "Out of Gas" + +**Symptom**: Transaction reverts due to insufficient gas. + +**Solution**: +1. Increase the gas limit when sending the transaction using `--gas-limit`: + ```bash + cast send $ROLLUP_ADDRESS \ + "claimSequencerRewards(address)" \ + [COINBASE_ADDRESS] \ + --rpc-url $RPC_URL \ + --private-key [YOUR_PRIVATE_KEY] \ + --gas-limit 200000 + ``` +2. Ensure your account has sufficient ETH to cover gas costs + +### Insufficient Funds for Gas + +**Symptom**: Transaction fails because the sending account has insufficient ETH. + +**Solution**: +1. Check your account balance: + ```bash + cast balance [YOUR_ADDRESS] --rpc-url $RPC_URL + ``` +2. Send ETH to your account to cover gas costs (recommended: at least 0.005 ETH) + +### Wrong Network + +**Symptom**: Transaction fails or contract calls return unexpected results. + +**Solution**: +1. Verify your RPC URL points to the correct network (Sepolia for testnet) +2. Verify the Rollup contract address matches your target network +3. Check your account has ETH on the correct network + +## Best Practices + +**Claim Regularly**: Claim rewards periodically to reduce accumulated balances in the Rollup contract. This minimizes risk and simplifies accounting. + +**Monitor Pending Rewards**: Set up automated scripts to query pending rewards and alert you when they exceed a threshold. + +**Use Keystore Files**: Avoid exposing private keys in command history. Use keystore files or hardware wallets for production operations. + +**Verify Before Claiming**: Check pending rewards before claiming to ensure the transaction justifies the gas cost. + +**Track Claim History**: Keep records of claim transactions for accounting purposes using transaction hashes on blockchain explorers. + +**Coordinate with Delegators**: If operating with delegated stake, communicate with delegators about claiming and distribution schedules. + +## Next Steps + +- Set up [monitoring](../monitoring.md) to track reward accumulation automatically +- Learn about [delegated stake management](./running_delegated_stake.md) if operating with delegators +- Review [useful commands](./useful_commands.md) for other sequencer queries +- Join the [Aztec Discord](https://discord.gg/aztec) for operator support and community discussions diff --git a/docs/network_versioned_docs/version-v3.0.2/operation/sequencer_management/creating_and_voting_on_proposals.md b/docs/network_versioned_docs/version-v3.0.2/operation/sequencer_management/creating_and_voting_on_proposals.md new file mode 100644 index 000000000000..04faab47712f --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/operation/sequencer_management/creating_and_voting_on_proposals.md @@ -0,0 +1,380 @@ +--- +id: creating_and_voting_on_proposals +sidebar_position: 1 +title: Governance and Proposal Process +description: Learn how to participate in protocol governance as a sequencer, including signaling support, creating proposals, and voting +--- + +## Overview + +This guide shows you how to participate in protocol governance as a sequencer. You'll learn how to signal support for protocol upgrades, create proposals, and vote on governance decisions that shape the Aztec network. + +## Prerequisites + +Before proceeding, you should: + +- Have a running sequencer node (see [Sequencer Setup Guide](../../setup/sequencer_management)) +- Have a basic understanding of Aztec's governance model and voting mechanisms + +## Understanding Governance Components + +### Payloads + +Protocol upgrades consist of a series of commands that execute on protocol contracts or replace contract references. You define these steps in a contract called a **payload** that you deploy on Ethereum. + +This guide assumes the payload already exists at a known address. You'll participate in the payload's journey through signaling, proposal creation, voting, and execution. + +:::warning Always Verify Payloads +Before signaling support or voting, always: +1. Verify the payload address on Etherscan or your preferred block explorer +2. Review the `getActions()` function to understand what changes the payload will make +3. Check if the payload has been audited (if applicable) +4. Discuss the proposal with the community on [Aztec Discord](https://discord.gg/aztec) + +Never signal or vote for a payload you haven't personally verified. +::: + +Here's an example payload structure: + +```solidity +contract UpgradePayload is IPayload { + IRegistry public immutable REGISTRY; + address public NEW_ROLLUP = address(new FakeRollup()); + + constructor(IRegistry _registry) { + REGISTRY = _registry; + } + + function getActions() external view override(IPayload) returns (IPayload.Action[] memory) { + IPayload.Action[] memory res = new IPayload.Action[](1); + + res[0] = Action({ + target: address(REGISTRY), + data: abi.encodeWithSelector(REGISTRY.addRollup.selector, NEW_ROLLUP) + }); + + return res; + } + + function getURI() external pure override(IPayload) returns (string memory) { + return "UpgradePayload"; + } +} +``` + +If this payload's proposal passes governance voting, the governance contract executes `addRollup` on the `Registry` contract. + +### Contract Addresses + +Key contracts you'll use: +- **Governance Proposer**: Handles payload signaling and proposal creation +- **Governance Staking Escrow (GSE)**: Manages stake delegation and voting +- **Governance**: Executes approved proposals +- **Rollup**: Your sequencer stakes here and defaults to delegating voting power here + +**To obtain these contract addresses:** Check your sequencer logs at startup for the line beginning with `INFO: node Aztec Node started on chain...` + +### Governance Lifecycle Overview + +The governance process follows these stages: + +1. **Signaling**: Sequencers signal support for a payload when proposing blocks. A payload needs a quorum of support to be promoted to a proposal. Signaling can start any time from the moment a payload is deployed. +2. **Proposal Creation**: After reaching quorum, anyone can submit the payload as an official proposal. +3. **Voting Delay** (12 hours): A mandatory waiting period before voting opens (allows time for community review). +4. **Voting Period** (24 hours): Users who hold stake in the network vote on the proposal using their staked tokens. +5. **Execution Delay** (12 hours): After passing the vote, another mandatory delay before execution (allows time for node upgrades). +6. **Execution**: Anyone can execute the proposal, which applies the changes. + +**Note:** These timeline values are specific to testnet and are subject to change for future network phases. + +## Signaling Support for a Payload + +As a sequencer, you initiate proposals through signaling. When you propose a block, you can automatically signal support for a specific payload. Once enough sequencers signal support within a round, the payload qualifies to become an official proposal. + +### How Signaling Works + +- Only you can signal during slots when you're the block proposer +- Your sequencer node automatically calls `signal` on the `GovernanceProposer` contract when proposing a block (if you've configured a payload address) +- Rounds consist of 300 slots each (180 minutes at 36 seconds per slot). At every 300-block boundary, the system checks if any payload has received 151 or more signals (the quorum threshold, which is >50% of the round size) +- Payloads that reach quorum can be submitted as official proposals by anyone + +**Note:** Round size and quorum threshold will change between testnet and ignition. These values and any further references to these values are relevant for testnet only. + +### Configure Your Signaling Preference + +Use the `setConfig` method on your node's admin interface to specify which payload address you want to signal support for. + +**CLI Method**: + +```bash +curl -X POST http://localhost:8880 \ + -H 'Content-Type: application/json' \ + -d '{ + "jsonrpc":"2.0", + "method":"nodeAdmin_setConfig", + "params":[{"governanceProposerPayload":"0x1234567890abcdef1234567890abcdef12345678"}], + "id":1 + }' +``` + +**Docker Method**: + +```bash +docker exec -it aztec-sequencer curl -X POST http://localhost:8880 \ + -H 'Content-Type: application/json' \ + -d '{ + "jsonrpc":"2.0", + "method":"nodeAdmin_setConfig", + "params":[{"governanceProposerPayload":"0x1234567890abcdef1234567890abcdef12345678"}], + "id":1 + }' +``` + +Replace `0x1234567890abcdef1234567890abcdef12345678` with your actual payload contract address and `aztec-sequencer` with your container name. + +Expected response: +```json +{"jsonrpc":"2.0","id":1} +``` + +### Verify Your Configuration + +Use the `getConfig` method to verify the payload address: + +**CLI Method**: + +```bash +curl -X POST http://localhost:8880 \ + -H 'Content-Type: application/json' \ + -d '{ + "jsonrpc":"2.0", + "method":"nodeAdmin_getConfig", + "id":1 + }' +``` + +**Docker Method**: + +```bash +docker exec -it aztec-sequencer curl -X POST http://localhost:8880 \ + -H 'Content-Type: application/json' \ + -d '{ + "jsonrpc":"2.0", + "method":"nodeAdmin_getConfig", + "id":1 + }' +``` + +Search for `governanceProposerPayload` in the response to confirm it matches your configured address. + +Once configured, your sequencer automatically signals support for this payload each time you propose a block. Each signal counts toward the quorum requirement. + +## Creating a Proposal + +Once a payload receives the required quorum (151 signals in a 300-slot round), you or any user can call `submitRoundWinner` on the `GovernanceProposer` contract to officially create the proposal. + +### Submit the Payload + +```bash +cast send [GOVERNANCE_PROPOSER_ADDRESS] \ + "submitRoundWinner(uint256)" [ROUND_NUMBER] \ + --rpc-url [YOUR_RPC_URL] \ + --private-key [YOUR_PRIVATE_KEY] +``` + +To find the current round number: +```bash +# Get the current round from the GovernanceProposer contract +cast call [GOVERNANCE_PROPOSER_ADDRESS] \ + "getCurrentRound()" \ + --rpc-url [YOUR_RPC_URL] +``` + +### Verify the Created Proposal + +After creation, you can query the proposal in the governance contract: + +```bash +# Get the total proposal count +cast call [GOVERNANCE_CONTRACT_ADDRESS] \ + "proposalCount()" \ + --rpc-url [YOUR_RPC_URL] + +# Query the latest proposal (count - 1, since proposals are zero-indexed) +cast call [GOVERNANCE_CONTRACT_ADDRESS] \ + "proposals(uint256)" $((PROPOSAL_COUNT - 1)) \ + --rpc-url [YOUR_RPC_URL] +``` + +This returns the `CompressedProposal` struct data, which includes: +- The payload address +- Creation timestamp +- Voting start and end times +- Current vote tallies + +## Voting on Proposals + +Once a payload becomes a proposal, there's a mandatory waiting period before voting opens. You can vote in two ways: through default delegation to the rollup contract, or by delegating to an address you control for custom voting. + +### Default Voting Through the Rollup + +By default, when you stake as a sequencer, you delegate your voting power to the rollup contract through the GSE (Governance Staking Escrow). The rollup automatically votes "yea" on proposals created through the `GovernanceProposer` using **all** delegated stake from **all** sequencers in that rollup. + +**Key points:** +- If you signaled for a payload, your stake votes "yea" automatically—no additional action needed +- If you didn't signal but other sequencers did, your stake still votes "yea" when the rollup votes +- To vote differently, you must change your delegation before voting opens (see Custom Voting below) + +Anyone can trigger the rollup vote: + +```bash +cast send [ROLLUP_ADDRESS] \ + "vote(uint256)" [PROPOSAL_ID] \ + --rpc-url [YOUR_RPC_URL] \ + --private-key [YOUR_PRIVATE_KEY] +``` + +### Custom Voting: Delegating to Your Own Address + +If you want to vote differently on a proposal (for example, to vote "nay" or to split your voting power), you can delegate your stake to an address you control. This removes your stake's voting power from the rollup's control and gives it to your chosen address. + +:::warning Voting Power Timestamp +Voting power is timestamped at the moment a proposal becomes "active" (when the voting period opens). You must complete delegation **before** the voting period begins to use your voting power for that proposal. + +Check the proposal's voting start time and delegate well in advance. +::: + +#### Step 1: Delegate Your Stake + +Use the GSE contract to delegate to an address you control: + +```bash +cast send [GSE_ADDRESS] \ + "delegate(address,address,address)" \ + [ROLLUP_ADDRESS] \ + [YOUR_ATTESTER_ADDRESS] \ + [YOUR_DELEGATEE_ADDRESS] \ + --rpc-url [YOUR_RPC_URL] \ + --private-key [YOUR_WITHDRAWER_PRIVATE_KEY] +``` + +- `[ROLLUP_ADDRESS]`: The rollup contract where you staked +- `[YOUR_ATTESTER_ADDRESS]`: Your sequencer's attester address +- `[YOUR_DELEGATEE_ADDRESS]`: The address that will vote (often the same as your attester address, or another address you control) +- You must sign this transaction with your **withdrawer** private key (the withdrawer that you specified when you initially deposited to the rollup) + +#### Step 2: Vote Through GSE + +Once you've delegated to an address you control, that address can vote directly on proposals: + +```bash +# Vote "yea" with your voting power +cast send [GSE_ADDRESS] \ + "vote(uint256,uint256,bool)" \ + [PROPOSAL_ID] \ + [AMOUNT] \ + true \ + --rpc-url [YOUR_RPC_URL] \ + --private-key [YOUR_DELEGATEE_PRIVATE_KEY] +``` + +- `[AMOUNT]`: The amount of voting power to use (can be your full stake or a partial amount) +- You can vote multiple times with different amounts to split your voting power between "yea" and "nay" if desired +- To vote "nay" with your voting power, set the boolean in the code above to false + +#### Step 3: Verify Your Vote + +Check that your vote was recorded: + +```bash +# Check vote counts for a proposal +# Note: This returns the proposal's vote tallies from the Governance contract, not GSE +cast call [GOVERNANCE_CONTRACT_ADDRESS] \ + "getProposal(uint256)" [PROPOSAL_ID] \ + --rpc-url [YOUR_RPC_URL] +``` + +This returns the current "yea" and "nay" vote tallies. + +## Executing Proposals + +When a proposal receives sufficient support, it passes. After passing, there's another mandatory delay before the proposal becomes executable. Once executable, anyone can trigger execution. + +### Execute the Proposal + +Once the proposal state is Executable, anyone can execute it: + +```bash +cast send [GOVERNANCE_CONTRACT_ADDRESS] \ + "execute(uint256)" [PROPOSAL_ID] \ + --rpc-url [YOUR_RPC_URL] \ + --private-key [YOUR_PRIVATE_KEY] +``` + +After execution, the governance contract performs all actions defined in the payload. The protocol changes become effective immediately. + +### Upgrade Your Node + +**Critical**: Once a proposal executes, you must upgrade your node software to track the protocol changes. + +Monitor proposals closely from the signaling stage through execution. When a vote passes, prepare to upgrade your node software during the execution delay period, so you're ready when the proposal becomes effective. In practice, this often means running multiple nodes, with one node being on the version upgraded from, and one being on the version being upgraded to. + +## Troubleshooting + +### My Signal Isn't Being Recorded + +**Symptoms**: You configured a payload address, but the signal count isn't increasing. + +**Solutions**: +1. Verify you're actually proposing blocks in slots assigned to you +2. Check your node logs for errors related to governance signaling +3. Verify the payload address is correct and matches the format (0x...) +4. Confirm the `GovernanceProposer` contract address is correct for your network + +### I Can't Delegate My Voting Power + +**Symptoms**: Delegation transaction fails or reverts. + +**Solutions**: +1. Verify you're using your **withdrawer** private key, not your attester key +2. Confirm you have stake deposited in the rollup +3. Check that the addresses are correct (rollup, attester, delegatee) +4. Ensure the rollup address matches where you actually staked + +### My Vote Transaction Fails + +**Symptoms**: Vote transaction reverts or fails. + +**Solutions**: +1. Check the proposal is in the "Active" state (voting period is open) +2. Verify you delegated before the voting period started (voting power is timestamped) +3. Confirm you have sufficient voting power (check your stake amount) +4. Ensure you're not trying to vote with more power than you have +5. Check you're using the correct private key (delegatee key, not withdrawer) + +### How Do I Check When Voting Opens? + +Query the proposal to see the voting timeline: + +```bash +cast call [GOVERNANCE_CONTRACT_ADDRESS] \ + "proposals(uint256)" [PROPOSAL_ID] \ + --rpc-url [YOUR_RPC_URL] +``` + +The returned data includes timestamps for: +- Voting start time +- Voting end time + +## Summary + +As a sequencer participating in governance: + +1. **Signal support**: Configure your node with a payload address. Your node automatically signals when proposing blocks. +2. **Vote**: Your delegated stake automatically votes "yea" on proposals created through sequencer signaling. You don't need to take additional action if you support the proposal. To vote differently, delegate your stake to an address you control before voting opens, then vote directly through the GSE contract. +3. **Upgrade promptly**: Monitor proposals and upgrade your node software after execution to stay in sync with protocol changes. + +## Next Steps + +- Learn about [sequencer management](../../setup/sequencer_management) for operating your node +- Join the [Aztec Discord](https://discord.gg/aztec) to participate in governance discussions and stay informed about upcoming proposals diff --git a/docs/network_versioned_docs/version-v3.0.2/operation/sequencer_management/index.md b/docs/network_versioned_docs/version-v3.0.2/operation/sequencer_management/index.md new file mode 100644 index 000000000000..d24f718716d2 --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/operation/sequencer_management/index.md @@ -0,0 +1,109 @@ +--- +sidebar_position: 3 +id: sequencer_management_overview +title: Sequencer Management +description: Learn how to manage your sequencer operations including governance participation, delegated stake, and contract queries. +--- + +## Overview + +Once your sequencer is running, you need to manage its ongoing operations. This guide covers sequencer management tasks including participating in governance, running with delegated stake, and querying contract state to monitor your sequencer's health and performance. + +## Prerequisites + +Before proceeding, you should: + +- Have a running sequencer node (see [Sequencer Setup Guide](../../setup/sequencer_management.md)) +- Be familiar with basic sequencer operations +- Have access to Foundry's `cast` tool for contract queries +- Understand your sequencer's role in the network + +## Understanding Sequencer Operations + +As a sequencer operator, your responsibilities extend beyond simply running a node. You participate in network governance, manage your stake (whether self-funded or delegated), and monitor your sequencer's performance and status on the network. + +### Key Management Areas + +**Governance Participation**: Sequencers play a crucial role in protocol governance. You signal support for protocol upgrades, vote on proposals, and help shape the network's evolution. Active participation ensures your voice is heard in decisions that affect the protocol. + +**Stake Management**: Whether you're using your own stake or operating with delegated stake from others, you need to understand how staking works, monitor your balances, and ensure you maintain sufficient funds for operations. + +**Operational Monitoring**: Regular monitoring of your sequencer's status, performance metrics, and onchain state helps you catch issues early and maintain optimal operations. + +## What This Guide Covers + +This guide walks you through sequencer management in four parts: + +### 1. Governance and Proposal Process + +Learn how to participate in protocol governance: + +- Understanding payloads and the governance lifecycle +- Signaling support for protocol upgrades +- Creating and voting on proposals +- Executing approved changes +- Upgrading your node after governance changes + +See [Governance and Proposal Process](./creating_and_voting_on_proposals.md) for detailed instructions. + +### 2. Running Delegated Stake + +If you're operating a sequencer with delegated stake: + +- Understanding the delegated stake model +- Registering as a provider with the Staking Registry +- Managing sequencer identities for delegation +- Updating provider configuration and commission rates +- Monitoring delegator relationships + +See [Running Delegated Stake](./running_delegated_stake.md) for setup instructions. + +### 3. Claiming Rewards + +Learn how to claim your sequencer rewards: + +- Understanding how rewards accumulate in the Rollup contract +- Checking reward claimability status and pending rewards +- Claiming rewards to your coinbase address +- Troubleshooting common claiming issues + +See [Claiming Rewards](./claiming_rewards.md) for detailed instructions. + +### 4. Useful Commands + +Essential contract query commands for operators: + +- Finding contract addresses (Registry, Rollup, Governance) +- Querying the sequencer set and individual sequencer status +- Checking governance signals and proposal counts +- Monitoring stake balances and voting power +- Troubleshooting common query issues + +See [Useful Commands](./useful_commands.md) for a complete reference. + +## Getting Started + +Start with the [Useful Commands](./useful_commands.md) guide to learn how to query your sequencer's status and verify it's operating correctly. This helps you establish a baseline for monitoring. + +If you're participating in governance, review the [Governance and Proposal Process](./creating_and_voting_on_proposals.md) guide to understand how to signal, vote, and execute proposals. + +For operators running with delegated stake, the [Running Delegated Stake](./running_delegated_stake.md) guide walks you through provider registration and management. + +## Best Practices + +**Monitor Regularly**: Check your sequencer's status, balance, and attestation activity regularly. Set up alerts for critical thresholds like low balances or missed attestations. + +**Participate in Governance**: Stay informed about governance proposals and participate in votes that affect your operations. Join the community discussions on Discord to understand proposed changes. + +**Maintain Adequate Balances**: Ensure your publisher account always has sufficient ETH (at least 0.1 ETH) to avoid being slashed. Monitor balances and set up automated top-ups if possible. + +**Keep Your Node Updated**: When governance proposals pass that require node upgrades, prepare during the execution delay period. Have a plan for coordinated upgrades to minimize downtime. + +**Communicate with Delegators**: If you're running with delegated stake, maintain open communication with your delegators about performance, commission changes, and planned maintenance. + +## Next Steps + +- Query your sequencer status using the [Useful Commands](./useful_commands.md) +- Learn about [governance participation](./creating_and_voting_on_proposals.md) to vote on protocol changes +- Set up [monitoring](../monitoring.md) to track your sequencer's performance +- Join the [Aztec Discord](https://discord.gg/aztec) for operator support and community discussions diff --git a/docs/network_versioned_docs/version-v3.0.2/operation/sequencer_management/registering_sequencer.md b/docs/network_versioned_docs/version-v3.0.2/operation/sequencer_management/registering_sequencer.md new file mode 100644 index 000000000000..570689e51a60 --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/operation/sequencer_management/registering_sequencer.md @@ -0,0 +1,197 @@ +--- +id: registering_sequencer +sidebar_position: 3 +title: Registering a Sequencer +description: Learn how to register your sequencer on the Aztec network using the staking dashboard for self-staking. +--- + +## Overview + +This guide covers registering your sequencer on the Aztec network through the staking dashboard for **self-staking**. This is one of two ways to participate as a sequencer: + +1. **Self-staking** (this guide): You provide your own stake via the staking dashboard +2. **Delegated staking**: You receive stake from delegators (see [Running with Delegated Stake](./running_delegated_stake.md)) + +Before proceeding, ensure you have completed the [Sequencer Setup Guide](../../setup/sequencer_management.md) and your node is running. + +## Prerequisites + +- Completed sequencer node setup with keystore generated +- Access to your **public keystore** file (`keyN_staker_output.json`) +- Sufficient ATP/ATV tokens for staking +- Wallet with ETH for gas fees +- Web browser for accessing the staking dashboard + +## Understanding Your Keystore + +When you generated your sequencer keys, two files were automatically created: + +1. **Private keystore** (`~/.aztec/keystore/keyN.json`) - Contains private keys, used by your sequencer node. Keep this secure and never share it. +2. **Public keystore** (`~/.aztec/keystore/keyN_staker_output.json`) - Contains only public information, used for registration via the staking dashboard. + +### Public Keystore Structure + +The public keystore contains the following information needed for registration: + +```json +[ + { + "attester": "0xYOUR_ATTESTER_ADDRESS", + "publicKeyG1": { + "x": "FIELD_ELEMENT_AS_DECIMAL_STRING", + "y": "FIELD_ELEMENT_AS_DECIMAL_STRING" + }, + "publicKeyG2": { + "x0": "FIELD_ELEMENT_AS_DECIMAL_STRING", + "x1": "FIELD_ELEMENT_AS_DECIMAL_STRING", + "y0": "FIELD_ELEMENT_AS_DECIMAL_STRING", + "y1": "FIELD_ELEMENT_AS_DECIMAL_STRING" + }, + "proofOfPossession": { + "x": "FIELD_ELEMENT_AS_DECIMAL_STRING", + "y": "FIELD_ELEMENT_AS_DECIMAL_STRING" + } + } +] +``` + +**Fields explained:** +- **`attester`**: Your Ethereum attester address (sequencer identifier) +- **`publicKeyG1`**: BLS public key on the G1 curve (x, y coordinates) +- **`publicKeyG2`**: BLS public key on the G2 curve (x0, x1, y0, y1 coordinates) +- **`proofOfPossession`**: Cryptographic proof to prevent rogue key attacks + +:::tip +The public keystore contains no private keys and is safe to share with the staking dashboard or other parties. +::: + +## Preparing Your Keystore File + +### Single Sequencer + +If you're registering one sequencer, simply use the `keyN_staker_output.json` file that was generated when you created your keys. + +### Multiple Sequencers + +If you're registering multiple sequencers in a single transaction, combine the individual keystore files into a single JSON array. Each object in the array represents one sequencer. + +**Example for two sequencers:** + +```json +[ + { + "attester": "0xATTESTER_ADDRESS_1", + "publicKeyG1": { + "x": "0x...", + "y": "0x..." + }, + "publicKeyG2": { + "x0": "0x...", + "x1": "0x...", + "y0": "0x...", + "y1": "0x..." + }, + "proofOfPossession": { + "x": "0x...", + "y": "0x..." + } + }, + { + "attester": "0xATTESTER_ADDRESS_2", + "publicKeyG1": { + "x": "0x...", + "y": "0x..." + }, + "publicKeyG2": { + "x0": "0x...", + "x1": "0x...", + "y0": "0x...", + "y1": "0x..." + }, + "proofOfPossession": { + "x": "0x...", + "y": "0x..." + } + } +] +``` + +Simply copy the contents of each `keyN_staker_output.json` file and combine them into a single array. + +## Registration Steps + +Follow these steps to register your sequencer(s) through the staking dashboard: + +1. **Navigate to the staking dashboard** at https://stake.aztec.network + +2. **Connect your wallet** with the account that holds your ATP/ATV tokens + +3. **Click "Stake"** + + ![Staking dashboard home](/img/staking_dashboard_1.png) + +4. **Select "Run your own Sequencer"** + + ![Select sequencer option](/img/staking_dashboard_2.png) + +5. **Click through "Start Registration"** after reviewing the requirements + +6. **Select the ATP/ATV tokens you want to stake** + +7. **Upload your keystore JSON file** (either single or combined multi-sequencer file) + + ![Upload keystore file](/img/staking_dashboard_3.png) + +8. **Confirm your attester/sequencer addresses** + + ![Confirm addresses](/img/staking_dashboard_4.png) + +9. **Approve token spend** in your wallet + + ![Approve tokens](/img/staking_dashboard_5.png) + +10. **Add staking for all sequencers to the queue** + + ![Add to queue](/img/staking_dashboard_6.png) + +11. **Execute transactions** in the dashboard + + ![Execute transactions](/img/staking_dashboard_7.png) + +12. **Confirm each transaction** in your wallet + +13. **Click "Complete"** when all transactions are confirmed + +14. **Verification**: Your sequencers have entered the queue. You can verify this at https://dashtec.xyz/queue + +## Verification + +After registration, verify your sequencer is properly registered: + +### Via Staking Dashboard + +Use the staking dashboard to: +- View your sequencer's registration status +- Monitor your stake amount +- Track sequencer performance metrics + +### Via Blockchain Explorer + +You can verify your sequencers are in the queue at https://dashtec.xyz/queue + +### Via Smart Contract + +You can also query the status directly using the Rollup contract. See [Monitoring Sequencer Status](../../setup/sequencer_management.md#monitoring-sequencer-status) for detailed instructions. + +## Next Steps + +After registering your sequencer: + +1. **Monitor performance**: Track your sequencer's attestation rate and block proposals via the staking dashboard +2. **Maintain uptime**: Keep your sequencer node running with high availability +3. **Monitor your stake**: Ensure your stake remains above the ejection threshold +4. **Stay informed**: Join the [Aztec Discord](https://discord.gg/aztec) for operator support and network updates + +## Alternative: Running with Delegated Stake + +If you prefer to run a sequencer backed by delegated stake instead of self-staking, see the [Running with Delegated Stake](./running_delegated_stake.md) guide. diff --git a/docs/network_versioned_docs/version-v3.0.2/operation/sequencer_management/running_delegated_stake.md b/docs/network_versioned_docs/version-v3.0.2/operation/sequencer_management/running_delegated_stake.md new file mode 100644 index 000000000000..1985a82a376e --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/operation/sequencer_management/running_delegated_stake.md @@ -0,0 +1,587 @@ +--- +id: become_a_staking_provider +sidebar_position: 2 +title: Become a Staking Provider +description: Learn how to run a sequencer with delegated stake on the Aztec network, including provider registration and sequencer identity management. +--- + +## Overview + +This guide covers running a sequencer with delegated stake on the Aztec network. Unlike conventional setups where you must have your own stake, delegated stake lets you (the "provider") operate sequencers backed by tokens from delegators. + +**This is a non-custodial system**: Delegators retain full control and ownership of their tokens at all times. You never take custody of the delegated tokens—they remain in the delegator's control while providing economic backing for your sequencer operations. + +## Prerequisites + +Before proceeding, ensure you have: + +- Knowledge of running a sequencer node (see [Sequencer Setup Guide](../../setup/sequencer_management)) +- An Ethereum wallet with sufficient ETH for gas fees +- Understanding of basic Aztec staking mechanics +- Foundry installed for `cast` commands +- Aztec CLI v2.1.4 or later installed: + +```bash +bash -i <(curl -s https://install.aztec.network) +aztec-up --version 2.1.4 +``` + +### Contract Addresses + +**Testnet (Sepolia):** +- Staking Registry: `0xc3860c45e5F0b1eF3000dbF93149756f16928ADB` +- GSE (Governance Staking Escrow): `0xfb243b9112bb65785a4a8edaf32529accf003614` + +**Mainnet:** +- Staking Registry: `0x042dF8f42790d6943F41C25C2132400fd727f452` +- GSE: `0xa92ecFD0E70c9cd5E5cd76c50Af0F7Da93567a4f` + +## How Delegated Stake Works + +You register with the StakingRegistry contract and add sequencer identities (keystores) to a queue. When delegators stake to your provider, the system: + +1. Dequeues one keystore from your provider queue +2. Creates a [Split contract](https://docs.splits.org/core/split) for reward distribution +3. Registers the sequencer into the staking queue using the dequeued keystore + +### Reward Distribution + +When a delegator stakes to your provider, a Split contract is automatically created to manage reward distribution. You configure your sequencer to use the Split contract address as the coinbase (see [After Delegation: Configure Sequencer Coinbase](#after-delegation-configure-sequencer-coinbase)). + +Rewards are distributed according to your agreed commission rate: +- **Provider commission**: Your `providerRewardsRecipient` address receives your commission rate (e.g., 5% for 500 basis points) +- **Delegator rewards**: The delegator's Aztec Token Vault (ATV) receives the remaining percentage + +**Rewards flow:** +1. Rewards accumulate in the rollup under the coinbase address (the Split contract) +2. After governance unlocks rewards, anyone can release them from the rollup to the `coinbase` address. +3. Anyone can then disperse the rewards from the Split contract to both the ATV and your `providerRewardsRecipient` + +This design ensures delegators maintain control of their rewards while you earn commission for operating the sequencer infrastructure. + +## Setup Process + +Before starting these steps, ensure your sequencer node infrastructure is set up (see [Prerequisites](#prerequisites)). + +Follow these steps to set up delegated stake: + +1. Register your provider with the Staking Registry +2. Add sequencer identities to your provider queue +3. Set your metadata in the GitHub repo (or via email) + +**After a delegator stakes:** Configure your sequencer's coinbase (see [After Delegation](#after-delegation-configure-sequencer-coinbase)) + +### Step 1: Register Your Provider + +Register with the `StakingRegistry` contract as a provider for delegated staking. Registration is permissionless and open to anyone. + +**Function signature:** + +```solidity +function registerProvider( + address _providerAdmin, + uint16 _providerTakeRate, + address _providerRewardsRecipient +) external returns (uint256); +``` + +**Parameters:** +- `_providerAdmin`: Address that can update provider configuration +- `_providerTakeRate`: Commission rate in basis points (500 = 5%) +- `_providerRewardsRecipient`: Address receiving commission payments + +**Returns:** Your unique `providerIdentifier`. Save this—you'll need it for all provider operations. + +**Example:** + +```bash +# Register a provider with 5% commission rate +cast send $STAKING_REGISTRY_ADDRESS \ + "registerProvider(address,uint16,address)" \ + $PROVIDER_ADMIN_ADDRESS \ + 500 \ + $REWARDS_RECIPIENT_ADDRESS \ + --rpc-url $RPC_URL \ + --private-key $YOUR_PRIVATE_KEY +``` + +### Extracting Your Provider ID + +Once the transaction is confirmed, you need to extract your `providerIdentifier` from the transaction logs. The provider ID is emitted as the second topic in the registration event log. + +**Method 1: Using cast receipt** + +```bash +cast receipt [TX_HASH] --rpc-url $RPC_URL | grep "return" | awk '{print $2}' | xargs cast to-dec +``` + +**Method 2: From transaction logs** + +The transaction receipt will contain one log where the second topic is your `providerId` in hex format: + +```bash +# Example log output +logs [{"address":"0xc3860c45e5f0b1ef3000dbf93149756f16928adb", + "topics":["0x43fe1b4477c9a580955f586c904f4670929e184ef4bef4936221c52d0a79a75b", + "0x0000000000000000000000000000000000000000000000000000000000000002", # This is your providerId + "0x000000000000000000000000efdb4c5f3a2f04e0cb393725bcae2dd675cc3718", + "0x00000000000000000000000000000000000000000000000000000000000001f4"], + ... + }] +``` + +Convert the hex value to decimal: + +```bash +cast to-dec 0x0000000000000000000000000000000000000000000000000000000000000002 +# Output: 2 +``` + +**Save your `providerIdentifier`**—you'll need it for all subsequent provider operations. + +### Step 2: Add Sequencer Identities + +Add sequencer identities (keystores) to your provider queue. Each keystore represents one sequencer that can be activated when a delegator stakes to you. + +**Function signature:** + +```solidity +function addKeysToProvider( + uint256 _providerIdentifier, + KeyStore[] calldata _keyStores +) external; +``` + +**Parameters:** +- `_providerIdentifier`: Your provider identifier from registration +- `_keyStores`: Array of keystore structures (max 100 per transaction) + +**KeyStore structure:** + +```solidity +struct KeyStore { + address attester; // Sequencer's address + BN254Lib.G1Point publicKeyG1; // BLS public key (G1) + BN254Lib.G2Point publicKeyG2; // BLS public key (G2) + BN254Lib.G1Point proofOfPossession; // BLS signature (prevents rogue key attacks) +} +``` + +:::warning Critical: Key Management for Delegated Staking + +**⚠️ If you run out of keys, users cannot delegate tokens to you.** + +The Staking Registry **DOES NOT** check for duplicate keys. Please take **EXTREME** care when registering keys: +- Duplicate keys will cause delegation failures when that duplicate is at the top of your queue +- The only way to fix this is by calling `dripProviderQueue(_providerIdentifier, _numberOfKeysToDrip)` to remove the duplicate +- Always verify keys before registration to avoid user experience issues +::: + +### Generating Keys for Registration + +Use the `aztec validator-keys` command with the `--staker-output` flag to automatically generate properly formatted registration data: + +```bash +aztec validator-keys new \ + --fee-recipient 0x0000000000000000000000000000000000000000000000000000000000000000 \ + --staker-output \ + --gse-address 0xa92ecFD0E70c9cd5E5cd76c50Af0F7Da93567a4f \ + --l1-rpc-urls $ETH_RPC \ + --l1-chain-id 1 +``` + +**For testnet (Sepolia):** Use `--gse-address 0xfb243b9112bb65785a4a8edaf32529accf003614` and `--l1-chain-id 11155111` + +This command automatically: +1. Generates the private keystore with ETH and BLS keys +2. Generates the public keystore with G1 and G2 public keys +3. Generates the proof of possession signature +4. Outputs the data in the correct format for the `addKeysToProvider` function + +The public keystore file (`keyN_staker_output.json`) contains the data you'll use for provider registration. + +For more details on keystore creation, see the [Sequencer Setup Guide](../../setup/sequencer_management.md#generating-keys). + +### Building the Registration Command + +You have two options for constructing the `addKeysToProvider` command: + +**Option 1: Use the helper script (Recommended)** + +Use this helper script to automatically build the command from your `validator-keys` output: + +https://gist.github.com/koenmtb1/1b665d055fbc22581c288f90cdc60d88 + +The script reads the JSON output from `validator-keys staker` and constructs the properly formatted `cast send` command. + +**Option 2: Manual construction** + +If you need to manually construct the command, the function signature is: + +```solidity +addKeysToProvider(uint256,(address,(uint256,uint256),(uint256,uint256,uint256,uint256),(uint256,uint256))[]) +``` + +**Parameters:** +- First `uint256`: Your provider identifier (from registration in Step 1) +- Tuple array: `KeyStore[]` where each element contains: + - `address`: Sequencer address + - `(uint256,uint256)`: publicKeyG1 (x, y coordinates) + - `(uint256,uint256,uint256,uint256)`: publicKeyG2 (x0, x1, y0, y1 coordinates) + - `(uint256,uint256)`: proofOfPossession (x, y coordinates) + +Example with placeholder values: + +```bash +cast send $STAKING_REGISTRY_ADDRESS \ + "addKeysToProvider(uint256,(address,(uint256,uint256),(uint256,uint256,uint256,uint256),(uint256,uint256))[])" \ + $YOUR_PROVIDER_IDENTIFIER \ + "[(0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb,(12345,67890),(11111,22222,33333,44444),(98765,43210))]" \ + --rpc-url $RPC_URL \ + --private-key $ADMIN_PRIVATE_KEY +``` + +**Important:** +- Replace all values above with actual data from `aztec validator-keys new --staker-output` +- Add a maximum of 100 keystores per transaction to avoid gas limit issues +- Verify each keystore is unique before adding to prevent duplicate key issues + +### Step 3: Set Your Metadata + +To be featured on the staking dashboard, submit metadata about your provider. + +**Required metadata:** +- Provider name and description +- Contact email +- Logo image (PNG or SVG, recommended size: 256x256px) +- Website URL +- Discord username +- Your `providerIdentifier` + +**Submission process:** + +Once made public, you'll create a pull request to the [staking-dashboard-external GitHub repository](https://github.com/AztecProtocol/staking-dashboard-external/tree/master/providers). + +For now, email your provider metadata to [koen@aztec.foundation](mailto:koen@aztec.foundation) in the following JSON format. **Make sure to specify if it's for testnet or mainnet!** + +```json +{ + "providerId": 1, + "providerName": "Example provider", + "providerDescription": "Brief description of the provider", + "providerEmail": "contact@provider.com", + "providerWebsite": "https://provider.com", + "providerLogoUrl": "https://provider.com/logo.png", + "discordUsername": "username" +} +``` + +Good metadata helps delegators understand your offering and builds trust. + +## After Delegation: Configure Sequencer Coinbase + +Once a delegator stakes to your provider, the system creates a Split contract for that delegation and activates the corresponding sequencer. **Configure the sequencer to use the Split contract address as the coinbase.** + +### Why This Matters + +The coinbase address determines where your sequencer's block rewards are sent. Setting it to the Split contract address ensures rewards are distributed according to your agreed commission rate, which is critical for maintaining trust with your delegators. + +### How to Configure the Coinbase + +Update the `coinbase` field in your sequencer node's keystore configuration to the Split contract address created for this delegation. + +**Example keystore configuration:** + +```json +{ + "schemaVersion": 1, + "validators": [ + { + "attester": { + "eth": "0x...", // Your Ethereum sequencer private key + "bls": "0x..." // Your BLS sequencer private key + }, + "publisher": ["0x..."], // Address that submits blocks to L1 + "coinbase": "0x[SPLIT_CONTRACT_ADDRESS]", // Split contract for this delegation + "feeRecipient": "0x0000000000000000000000000000000000000000000000000000000000000000" // Not currently used, set to all zeros + } + ] +} +``` + +Replace `[SPLIT_CONTRACT_ADDRESS]` with the actual Split contract address created for this delegation. You can find this address in the staking dashboard (see "Finding Your Split Contract Address" below). + +For detailed information about keystore configuration, including different storage methods and advanced patterns, see the [Advanced Keystore Guide](../keystore/index.md). + +### Finding Your Split Contract Address + +**You have to manually monitor the delegations you receive and update the `coinbase` address to the correct Split contract!** + +You can retrieve the Split contract address for a specific delegation through the **Staking Dashboard**: + +1. Navigate to your provider dashboard on the staking dashboard +2. Look for the dropdown called **"Sequencer Registered (x)"** where x is the number of registered sequencers +3. Click on the dropdown to expand it +4. This shows the Sequencer address → Split contract relation +5. Set the Split contract as the `coinbase` for the respective Sequencer address on your node + +The dropdown will display a table showing which Split contract corresponds to each of your sequencer addresses, making it easy to configure the correct coinbase for each sequencer. + +**Manual monitoring approach:** + +Since coinbase configuration must be done manually, you should: +- Regularly check the staking dashboard for new delegations +- Set up alerts or scheduled checks (daily or more frequently during high activity) +- Update keystore configurations promptly when new delegations appear +- Maintain a record of which Split contracts map to which keystores + +### Important Notes + +- **Monitor delegations actively**: The system does not automatically notify you of new delegations +- Configure the coinbase immediately after each delegation to ensure rewards flow correctly from the start +- Each delegation creates a unique Split contract—configure each sequencer with its specific Split contract address +- Restart your sequencer node after updating the keystore for changes to take effect +- Keep a mapping of sequencer addresses to Split contracts for operational tracking + +## Monitoring Keystore Availability + +As a provider, you must maintain sufficient sequencer identities (keystores) in your queue to handle incoming delegations. When a delegator stakes to your provider and your queue is empty, they cannot activate a sequencer—this results in a poor delegator experience and lost opportunity. + +### Why Monitoring Matters + +Each time a delegator stakes to your provider: +1. One keystore is dequeued from your provider queue +2. A sequencer is activated using that keystore +3. Your available keystore count decreases by one + +If your queue runs empty, new delegations cannot activate sequencers until you add more keystores. This could cause delegators to choose other providers. + +### Checking Available Keystores + +Check your current keystore queue with this call: + +```bash +# Check provider queue length +cast call [STAKING_REGISTRY_ADDRESS] \ + "getProviderQueueLength(uint256) (uint256)" \ + [YOUR_PROVIDER_IDENTIFIER] \ + --rpc-url [RPC_URL] + +This returns your provider's queue length, which is the number of keystores currently available. + +### Setting Up Automated Monitoring + +Implement automated monitoring to alert you when your keystore queue runs low. + +#### Cron Job Example + +The following script monitors your keystore queue and alerts when it drops below a threshold. Replace the placeholder values and uncomment your preferred alert method (webhook or email): + +```bash +#!/bin/bash +# check-keystores.sh + +THRESHOLD=5 # Alert when fewer than 5 keystores remain +REGISTRY_ADDRESS="[STAKING_REGISTRY_ADDRESS]" +PROVIDER_ID="[YOUR_PROVIDER_IDENTIFIER]" +RPC_URL="[YOUR_RPC_URL]" +WEBHOOK_URL="[YOUR_WEBHOOK_URL]" # Optional: for Slack/Discord notifications + +# Gets current queue length +QUEUE_LENGTH=$(cast call "$REGISTRY_ADDRESS" \ + "getProviderQueueLength(uint256)" \ + "$PROVIDER_ID" \ + --rpc-url "$RPC_URL") + +echo "Queue length: $QUEUE_LENGTH" + +# Check if queue is running low +if [ "$QUEUE_LENGTH" -lt "$THRESHOLD" ]; then + echo "WARNING: Keystore queue running low! Only $QUEUE_LENGTH keystores remaining." + + # Send alert (uncomment and configure your preferred method) + # Slack/Discord webhook: + # curl -X POST "$WEBHOOK_URL" -H "Content-Type: application/json" \ + # -d "{\"text\":\"⚠️ Keystore queue low: $QUEUE_LENGTH remaining (threshold: $THRESHOLD)\"}" + + # Email via mail command: + # echo "Keystore queue has $QUEUE_LENGTH keys remaining" | mail -s "Low Keystore Alert" your-email@example.com +fi +``` + +Make the script executable and schedule it with cron: + +```bash +# Make the script executable +chmod +x /path/to/check-keystores.sh + +# Edit crontab +crontab -e + +# Add this line to check every 4 hours +0 */4 * * * /path/to/check-keystores.sh >> /var/log/keystore-monitor.log 2>&1 +``` + +### When to Add More Keystores + +Add keystores proactively before running out: +- Monitor your delegation growth rate +- Add in batches (max 100 per transaction) +- Stay ahead of demand during high-activity periods + +See [Step 2: Add Sequencer Identities](#step-2-add-sequencer-identities) for instructions. + +## Managing Your Provider + +Update your provider configuration using these functions. All must be called from your `providerAdmin` address. + +### Update Admin Address + +Transfer provider administration to a new address: + +```bash +cast send [STAKING_REGISTRY_ADDRESS] \ + "updateProviderAdmin(uint256,address)" \ + [YOUR_PROVIDER_IDENTIFIER] \ + [NEW_ADMIN_ADDRESS] \ + --rpc-url [RPC_URL] \ + --private-key [CURRENT_ADMIN_PRIVATE_KEY] +``` + +### Update Rewards Recipient + +Change the address receiving commission payments: + +```bash +cast send [STAKING_REGISTRY_ADDRESS] \ + "updateProviderRewardsRecipient(uint256,address)" \ + [YOUR_PROVIDER_IDENTIFIER] \ + [NEW_REWARDS_RECIPIENT_ADDRESS] \ + --rpc-url [RPC_URL] \ + --private-key [ADMIN_PRIVATE_KEY] +``` + +### Update Commission Rate + +Modify your commission rate (applies only to new delegations): + +```bash +cast send [STAKING_REGISTRY_ADDRESS] \ + "updateProviderTakeRate(uint256,uint16)" \ + [YOUR_PROVIDER_IDENTIFIER] \ + [NEW_RATE_BASIS_POINTS] \ + --rpc-url [RPC_URL] \ + --private-key [ADMIN_PRIVATE_KEY] +``` + +:::warning Commission Changes Only Apply to New Delegations +When you update your commission rate, only **new delegations** will use the updated rate. **Existing delegations cannot be changed**—they permanently retain the original commission rate that was agreed upon when the delegation was created. +::: + +## Verification + +Verify your setup is working correctly. + +### Check Provider Registration + +Query the StakingRegistry to confirm your provider details: + +```bash +cast call [STAKING_REGISTRY_ADDRESS] \ + "providerConfigurations(uint256) (address,uint16,address)" \ + [YOUR_PROVIDER_IDENTIFIER] \ + --rpc-url [RPC_URL] +``` + +This returns: +1. The provider's admin address +2. The provider's commission rate in bps +3. The provider's rewards recipient + +### Verify Queue Length + +Check your provider queue length: + +```bash +cast call [STAKING_REGISTRY_ADDRESS] \ + "getProviderQueueLength(uint256)" \ + [YOUR_PROVIDER_IDENTIFIER] \ + --rpc-url [RPC_URL] +``` + +### Monitor Delegations + +View these metrics on the staking dashboard: +- Total stake delegated to your provider +- Number of active sequencers +- Commission earned +- Provider performance metrics + +### Confirm Node Operation + +Ensure your sequencer nodes are running and synced. See [Useful Commands](./useful_commands.md) for commands to check sequencer status. + +## Troubleshooting + +### Registration transaction fails + +**Issue**: The `registerProvider` transaction reverts or fails. + +**Solutions**: +- Ensure your wallet has sufficient ETH for gas fees +- Verify the StakingRegistry contract address is correct +- Check that the commission rate is within acceptable bounds (typically 0-10000 basis points) +- Review transaction logs for specific error messages using a block explorer + +### Cannot add sequencer identities + +**Issue**: The `addKeysToProvider` function fails. + +**Solutions**: +- Confirm you're calling from the `providerAdmin` address +- Verify your `providerIdentifier` is correct +- Ensure BLS signatures in `KeyStore` are properly formatted (use the keystore creation utility) +- Check that the sequencer addresses aren't already registered elsewhere +- Reduce batch size if hitting gas limits (max 100 keystores per transaction) + +### No delegators appearing + +**Issue**: No delegators are staking to your provider. + +**Solutions**: +- Verify your provider is visible on the staking dashboard +- Complete all metadata fields to build trust +- Ensure your commission rate is competitive with other providers +- Confirm your sequencer nodes are operational and performing well +- Engage with the community on Discord to build your reputation + +### Commission not being received + +**Issue**: Commission payments aren't arriving at the rewards recipient address. + +**Solutions**: +- Verify the `providerRewardsRecipient` address is correct +- Check that delegations are active and generating fees +- Confirm your sequencers are producing blocks and earning fees +- Allow time for reward distribution (may not be immediate) +- Check the contract for pending distributions that need to be claimed + +## Best Practices + +**Maintain Sufficient Keystores**: Set up automated monitoring to ensure your keystore queue never runs empty. See [Monitoring Keystore Availability](#monitoring-keystore-availability) for guidance on implementing alerts. + +**Communicate Changes**: Inform delegators about commission rate changes, planned maintenance, or infrastructure updates. Good communication builds trust. + +**Monitor Performance**: Track your sequencers' attestation rates, block proposals, and uptime. Poor performance may cause delegators to withdraw. + +**Secure Your Keys**: The `providerAdmin` key controls your provider configuration. Store it securely and consider using a hardware wallet or multisig. + +## Next Steps + +After completing this setup: + +1. Monitor your provider's performance through the staking dashboard +2. Maintain high uptime for your sequencer nodes +3. Keep open communication with delegators +4. Regularly add new keystores to your provider queue (see [Monitoring Keystore Availability](#monitoring-keystore-availability)) +5. Join the [Aztec Discord](https://discord.gg/aztec) for provider support and community discussions diff --git a/docs/network_versioned_docs/version-v3.0.2/operation/sequencer_management/slashing_and_offenses.md b/docs/network_versioned_docs/version-v3.0.2/operation/sequencer_management/slashing_and_offenses.md new file mode 100644 index 000000000000..e706f97f1bf2 --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/operation/sequencer_management/slashing_and_offenses.md @@ -0,0 +1,420 @@ +--- +id: slashing_and_offenses +sidebar_position: 2 +title: Slashing and Offenses +description: Learn how the slashing mechanism works, what offenses are detected, and how to configure your sequencer to participate in consensus-based slashing +--- + +## Overview + +This guide explains how the Aztec network's slashing mechanism works and how your sequencer automatically participates in detecting and voting on validator offenses. You'll learn about the Tally Model of slashing, the types of offenses that are automatically detected, and how to configure your sequencer's slashing behavior. + +## Prerequisites + +Before proceeding, you should: + +- Have a running sequencer node (see [Sequencer Setup Guide](../../setup/sequencer_management)) +- Understand that slashing actions are executed automatically when you propose blocks +- Have the Sentinel enabled if you want to detect inactivity offenses + +## Understanding the Tally Model of Slashing + +The Aztec network uses a consensus-based slashing mechanism where validators vote on individual validator offenses during block proposal. + +### How Slashing Works + +**Automatic Detection**: Your sequencer runs watchers that continuously monitor the network and automatically detect slashable offenses committed by other validators. + +**Voting Through Proposals**: Time is divided into slashing rounds (typically 128 L2 slots per round). When you propose a block during round N, your sequencer automatically votes on which validators from round N-2 should be slashed. This 2-round offset gives the network time to detect offenses before voting. + +**Vote Encoding**: Votes are encoded as bytes where each validator's vote is represented by 2 bits indicating the slash amount (0-3 slash units). The L1 contract tallies these votes and slashes validators that reach quorum. + +**Execution**: After a round ends, there's an execution delay period (approximately 3 days) during which the slashing vetoer can pause execution if needed. Once the delay passes, anyone can execute the round to apply the slashing. + +### Slashing Rounds and Offsets + +``` +Round 1 (Grace Period): No voting happens +Round 2 (Grace Period): No voting happens +Round 3: Proposers vote on offenses from Round 1 (which are typically forgiven due to grace period) +Round 4: Proposers vote on offenses from Round 2 +Round N: Proposers vote on offenses from Round N-2 +``` + +**Key parameters**: +- **Round Size**: 128 L2 slots (approximately 1.28 hours at 36 seconds per slot) +- **Slashing Offset**: 2 rounds (proposers in round N vote on offenses from round N-2) +- **Execution Delay**: 28 rounds (~3 days) +- **Grace Period**: First 128 slots (configurable per node) + +### Slashing Amounts + +The L1 contract defines three fixed slashing tiers that can be configured for different offenses. These amounts are set on L1 deployment and can only be changed via governance. + +:::info Network Configuration +On the current network, **all offenses are currently configured to slash 2,000 tokens (1% of the Activation Threshold - the minimum stake required to join the validator set)**. With the ejection threshold at 98%, validators can be slashed a maximum of **3 times** (totaling 3% of their Activation Threshold) before being automatically ejected from the validator set. +::: + +## Slashable Offenses + +Your sequencer automatically detects and votes to slash the following offenses: + +### 1. Inactivity + +**What it is**: A validator fails to attest to block proposals when selected for committee duty, or fails to propose a block when selected as proposer. + +**Detection criteria**: +- Measured **per epoch** for validators on the committee during that epoch (committees are assigned per epoch and remain constant for all slots in that epoch) +- The Sentinel calculates: `(missed_proposals + missed_attestations) / (total_proposals + total_attestations)` +- A validator is considered inactive for an epoch if this ratio meets or exceeds `SLASH_INACTIVITY_TARGET_PERCENTAGE` (e.g., 0.8 = 80% or more duties missed) +- Requires **consecutive committee participation with inactivity**: Must be inactive for N consecutive epochs where they were on the committee (configured via `SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD=2`). Epochs where the validator was not on the committee are not counted, so a validator inactive in epochs 1, 3, and 5 meets the threshold for 3 consecutive inactive epochs even though epochs 2 and 4 are skipped. + +**Proposed penalty**: 1% of stake + +**Note**: Requires the Sentinel to be enabled (`SENTINEL_ENABLED=true`). The Sentinel tracks attestation and proposal activity for all validators. + +### 2. Valid Epoch Not Proven + +**What it is**: An epoch was not proven within the proof submission window, even though all data was available and the epoch was valid. + +**Detection criteria**: +- An epoch gets pruned (removed from the chain) +- Your node can re-execute all transactions from that epoch +- The state roots match the original epoch (indicating it could have been proven) + +**Proposed penalty**: 0% (disabled for initial deployment) + +**Responsibility**: The entire committee of the pruned epoch is slashed. + +### 3. Data Withholding + +**What it is**: The committee failed to make transaction data publicly available, preventing the epoch from being proven. + +**Detection criteria**: +- An epoch gets pruned +- Your node cannot obtain all the transactions needed to re-execute the epoch +- The data was not propagated to the sequencer set before the proof submission window ended + +**Proposed penalty**: 0% (disabled for initial deployment) + +**Responsibility**: The entire committee from the pruned epoch is slashed for failing to propagate data. + +### 4. Proposed Insufficient Attestations + +**What it is**: A proposer submitted a block to L1 without collecting enough valid committee attestations. + +**Detection criteria**: +- Block published to L1 has fewer than 2/3 + 1 attestations from the committee +- Your node detects this through L1 block validation + +**Proposed penalty**: 1% of stake + +### 5. Proposed Incorrect Attestations + +**What it is**: A proposer submitted a block with invalid signatures or signatures from non-committee members. + +**Detection criteria**: +- Block contains attestations with invalid ECDSA signatures +- Block contains signatures from addresses not in the committee + +**Proposed penalty**: 1% of stake + +### 6. Attested to Descendant of Invalid Block + +**What it is**: A validator attested to a block that builds on top of an invalid block. + +**Detection criteria**: +- A validator attests to block B +- Block B's parent block has invalid or insufficient attestations +- Your node has previously identified the parent as invalid + +**Proposed penalty**: 1% of stake + +**Note**: Validators should only attest to blocks that build on valid chains with proper attestations. + +## Configuring Your Sequencer for Slashing + +The slashing module runs automatically when your sequencer is enabled. You can configure its behavior using environment variables or the node's admin API. Remember to enable the Sentinel if you want to detect inactivity offenses. + +### Environment Variables + +Your sequencer comes pre-configured with default slashing settings. You can optionally override these defaults by setting environment variables before starting your node. + +**Default configuration:** + +```bash +# Grace period - offenses during the first N slots are not slashed +SLASH_GRACE_PERIOD_L2_SLOTS=128 # Default: first round is grace period + +# Inactivity detection (requires SENTINEL_ENABLED=true) +SLASH_INACTIVITY_TARGET_PERCENTAGE=0.8 # Slash if missed proposals + attestations >= 80% +SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD=2 # Must be inactive for 2+ epochs +SLASH_INACTIVITY_PENALTY=2000000000000000000000 # 2000 tokens (1%) + +# Sentinel configuration (required for inactivity detection) +SENTINEL_ENABLED=true # Must be true to detect inactivity offenses +SENTINEL_HISTORY_LENGTH_IN_EPOCHS=100 # Track 100 epochs of history + +# Epoch prune and data withholding penalties (disabled by default) +SLASH_PRUNE_PENALTY=0 # Set to >0 to enable +SLASH_DATA_WITHHOLDING_PENALTY=0 # Set to >0 to enable + +# Invalid attestations and blocks +SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY=2000000000000000000000 # 2000 tokens +SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY=2000000000000000000000 # 2000 tokens +SLASH_INVALID_BLOCK_PENALTY=2000000000000000000000 # 2000 tokens + +# Offense expiration +SLASH_OFFENSE_EXPIRATION_ROUNDS=4 # Offenses older than 4 rounds are dropped + +# Execution behavior +SLASH_EXECUTE_ROUNDS_LOOK_BACK=4 # Check 4 rounds back for executable slashing rounds +``` + +### Runtime Configuration via API + +You can update slashing configuration while your node is running using the `nodeAdmin_setConfig` method: + +**CLI Method**: + +```bash +curl -X POST http://localhost:8880 \ + -H 'Content-Type: application/json' \ + -d '{ + "jsonrpc":"2.0", + "method":"nodeAdmin_setConfig", + "params":[{ + "slashInactivityPenalty":"2000000000000000000000", + "slashInactivityTargetPercentage":0.9 + }], + "id":1 + }' +``` + +**Docker Method**: + +```bash +docker exec -it aztec-sequencer curl -X POST http://localhost:8880 \ + -H 'Content-Type: application/json' \ + -d '{ + "jsonrpc":"2.0", + "method":"nodeAdmin_setConfig", + "params":[{ + "slashInactivityPenalty":"2000000000000000000000", + "slashInactivityTargetPercentage":0.9 + }], + "id":1 + }' +``` + +### Excluding Validators from Slashing + +You can configure your node to always or never slash specific validators: + +```bash +# Always slash these validators (regardless of detected offenses) +SLASH_VALIDATORS_ALWAYS=0x1234...,0x5678... + +# Never slash these validators (even if offenses are detected) +SLASH_VALIDATORS_NEVER=0xabcd...,0xef01... +``` + +**Note**: Validators in `SLASH_VALIDATORS_NEVER` take priority. If a validator appears in both lists, they won't be slashed. + +**Automatic protection**: Your own validator addresses (from your keystore) are automatically added to `SLASH_VALIDATORS_NEVER` unless you set `slashSelfAllowed=true` via the node admin API. + +### Verify Your Configuration + +Check your current slashing configuration: + +**CLI Method**: + +```bash +curl -X POST http://localhost:8880 \ + -H 'Content-Type: application/json' \ + -d '{ + "jsonrpc":"2.0", + "method":"nodeAdmin_getConfig", + "id":1 + }' +``` + +**Docker Method**: + +```bash +docker exec -it aztec-sequencer curl -X POST http://localhost:8880 \ + -H 'Content-Type: application/json' \ + -d '{ + "jsonrpc":"2.0", + "method":"nodeAdmin_getConfig", + "id":1 + }' +``` + +Look for fields starting with `slash` in the response to verify your settings. + +## How Automatic Slashing Works + +Once configured, your sequencer handles slashing automatically: + +### 1. Continuous Offense Detection + +Watchers run in the background, monitoring: +- Block attestations via the Sentinel (when enabled) +- Invalid blocks from the P2P network +- Chain prunes and epoch validation +- L1 block data for attestation validation + +### 2. Offense Storage + +When a watcher detects an offense, it's automatically stored with: +- Validator address +- Offense type +- Epoch or slot number +- Penalty amount + +Offenses are kept until they're voted on or expire after the configured number of rounds. + +### 3. Automatic Voting + +When you're selected as a block proposer: +1. Your sequencer retrieves offenses from 2 rounds ago (the slashing offset) +2. It filters out validators in your `SLASH_VALIDATORS_NEVER` list +3. It adds synthetic offenses for validators in your `SLASH_VALIDATORS_ALWAYS` list +4. Votes are encoded as a byte array, with each validator's vote represented by two bits specifying the proposed slash amount (0–3 units) +5. The votes are submitted to L1 as part of your proposal transaction + +**You don't need to take any manual action** - this happens automatically during block proposal. + +### 4. Round Execution + +When slashing rounds become executable (after the execution delay): +- Your sequencer checks if there are rounds ready to execute +- If you're the proposer and a round is ready, your node includes the execution call in your proposal +- This triggers the L1 contract to tally votes and slash validators that reached quorum + +## Understanding the Slashing Vetoer + +The slashing vetoer is an independent security group that can pause slashing to protect validators from unfair slashing due to software bugs. + +**Execution Delay**: All slashing proposals have a ~3 day execution delay (28 rounds on testnet) during which the vetoer can review and potentially block execution. + +**Temporary Disable**: The vetoer can disable all slashing for up to 3 days if needed, with the ability to extend this period. + +**Purpose**: This failsafe protects sequencers from being unfairly slashed due to client software bugs or network issues that might cause false positives in offense detection. + +## Ejection from the Validator Set + +If a validator's stake falls below the ejection threshold after being slashed, they are automatically exited from the validator set. + +**Ejection Threshold**: 98% of Activation Threshold + +This means a validator can be slashed up to **3 times** (at 1% per slash, totaling 3%) before being automatically ejected. Their remaining stake is sent to their registered withdrawer address. + +## Monitoring Slashing Activity + +### Check Pending Offenses + +Monitor offenses your node has detected but not yet voted on by checking your node logs: + +```bash +# Look for these log messages +grep "Adding pending offense" /path/to/node/logs +grep "Voting to slash" /path/to/node/logs +``` + +### View Executed Slashing Rounds + +Your node logs when slashing rounds are executed: + +```bash +grep "Slashing round.*has been executed" /path/to/node/logs +``` + +### Query L1 Contract State + +You can query the TallySlashingProposer contract to see voting activity: + +```bash +# Get current round information +cast call [TALLY_SLASHING_PROPOSER_ADDRESS] \ + "getCurrentRound()" \ + --rpc-url [YOUR_RPC_URL] + +# Check a specific round's vote count +cast call [TALLY_SLASHING_PROPOSER_ADDRESS] \ + "getRound(uint256)" [ROUND_NUMBER] \ + --rpc-url [YOUR_RPC_URL] +``` + +## Troubleshooting + +### Slashing Module Not Running + +**Symptom**: No slashing-related logs appear in your node output. + +**Solutions**: +1. Verify your node is running as a validator (not just an observer) +2. Check that `disableValidator` is not set to `true` in your config +3. Confirm the rollup contract has a slashing proposer configured +4. Restart your node and check for errors during slasher initialization + +### Inactivity Offenses Not Detected + +**Symptom**: Your node doesn't detect inactivity offenses even when validators miss attestations. + +**Solutions**: +1. Enable the Sentinel: Set `SENTINEL_ENABLED=true` +2. Verify Sentinel is tracking data: Check logs for "Sentinel" messages +3. Ensure `SLASH_INACTIVITY_PENALTY` is greater than 0 +4. Check that `SENTINEL_HISTORY_LENGTH_IN_EPOCHS` is configured appropriately (see configuration section) +5. Remember: Validators need to be inactive for consecutive epochs (threshold: 2 by default) + +### Own Validators Being Slashed + +**Symptom**: Your node is voting to slash your own validators. + +**Solutions**: +1. Verify that `slashSelfAllowed` is not set to `true` +2. Check that your validator addresses from the keystore are being automatically added to `SLASH_VALIDATORS_NEVER` +3. Manually add your addresses to `SLASH_VALIDATORS_NEVER` as a safeguard: + ```bash + SLASH_VALIDATORS_NEVER=0xYourAddress1,0xYourAddress2 + ``` + +### Penalty Amounts Not Matching L1 + +**Symptom**: Your configured penalties don't result in slashing on L1. + +**Solutions**: +1. For the current network, all penalties should be set to `2000000000000000000000` (2000 tokens, 1%) +2. Verify your penalty configuration matches the default values shown in the Environment Variables section + +## Best Practices + +**Enable the Sentinel**: If you want to participate in inactivity slashing, make sure `SENTINEL_ENABLED=true`. This is the only way to detect validators who go offline. + +**Use Grace Periods**: Set `SLASH_GRACE_PERIOD_L2_SLOTS` to avoid slashing validators during the initial network bootstrap period when issues are more likely. + +**Monitor Your Offenses**: Regularly check your logs to see what offenses your node is detecting and voting on. This helps you verify your slashing configuration is working as expected. + +**Don't Disable Default Protections**: Unless you explicitly want to slash your own validators, keep `slashSelfAllowed` at its default (`false`) to avoid accidentally voting against yourself. + +**Understand the Impact**: Remember that slashing is permanent and affects validators' stake. Only configure `SLASH_VALIDATORS_ALWAYS` for validators you have strong evidence of malicious behavior. + +**Stay Updated**: Monitor Aztec Discord and governance proposals for changes to slashing parameters or new offense types being added to the protocol. + +## Summary + +As a sequencer operator: + +1. **Slashing is automatic**: Your sequencer detects offenses and votes during block proposals without manual intervention +2. **Configuration is flexible**: Use environment variables or runtime API calls to adjust penalties and behavior +3. **Safety mechanisms exist**: Grace periods, vetoer controls, and automatic self-protection prevent unfair slashing +4. **Monitoring is important**: Check logs and L1 state to ensure your slasher is operating as expected + +## Next Steps + +- Review [Governance and Proposal Process](./creating_and_voting_on_proposals.md) to understand how slashing parameters can be changed +- Set up [monitoring](../monitoring.md) to track your sequencer's slashing activity +- Join the [Aztec Discord](https://discord.gg/aztec) to discuss slashing behavior and network health with other operators diff --git a/docs/network_versioned_docs/version-v3.0.2/operation/sequencer_management/useful_commands.md b/docs/network_versioned_docs/version-v3.0.2/operation/sequencer_management/useful_commands.md new file mode 100644 index 000000000000..8afba3f6b5f2 --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/operation/sequencer_management/useful_commands.md @@ -0,0 +1,340 @@ +--- +sidebar_position: 5 +title: Useful Commands +description: Essential cast commands for querying Registry, Rollup, and Governance contracts as a sequencer operator. +--- + +## Overview + +This reference provides commands for common sequencer operator tasks. You'll use Foundry's `cast` command to query onchain contract state, check sequencer status, and monitor governance processes. + +If you need help with something not covered here, visit the [Aztec Discord](https://discord.gg/aztec) in the `#operator-faq` channel. + +## Prerequisites + +Before using these commands, ensure you have: + +- **Foundry installed** with the `cast` command available ([installation guide](https://book.getfoundry.sh/getting-started/installation)) +- **Aztec CLI tool** installed (see [prerequisites guide](../../prerequisites.md#aztec-toolchain)) +- **Ethereum RPC endpoint** (execution layer) for the network you're querying +- **Contract addresses** for your deployment (Registry, Rollup, Governance) + +## Getting Started + +### Set Up Your Environment + +For convenience, set your RPC URL as an environment variable: + +```bash +export RPC_URL="https://your-ethereum-rpc-endpoint.com" +``` + +All examples below use `--rpc-url $RPC_URL`. In production, always include this flag with your actual RPC endpoint. + +### Understanding Deployments + +Assume there are multiple deployments of Aztec, such as `testnet` and `ignition-testnet`. Each deployment has a unique Registry contract address that remains constant across upgrades. If a governance upgrade deploys a new rollup contract, the Registry contract address stays the same. + + + +### Find the Registry Contract Address + +The Registry contract is your entrypoint to all other contracts for a specific deployment. You'll need this address to discover other contract addresses. + +Contact the Aztec team or check the documentation for the Registry contract address for your target network (testnet, ignition-testnet, etc.). + +### Get the Rollup Contract Address + +Once you have the Registry address, retrieve the Rollup contract: + +```bash +cast call [REGISTRY_CONTRACT_ADDRESS] "getCanonicalRollup()" --rpc-url $RPC_URL +``` + +Replace `[REGISTRY_CONTRACT_ADDRESS]` with your actual Registry contract address. + +**Example:** +```bash +cast call 0x1234567890abcdef1234567890abcdef12345678 "getCanonicalRollup()" --rpc-url $RPC_URL +``` + +This returns the Rollup contract address in hexadecimal format. + +## Query the Sequencer Set + +### Get the GSE Contract Address + +The GSE (Governance Staking Escrow) contract manages sequencer registrations and balances. Get its address from the Rollup contract: + +```bash +cast call [ROLLUP_ADDRESS] "getGSE()" --rpc-url $RPC_URL +``` + +This returns the GSE contract address, which you'll need for some queries below. + +### Count Active Sequencers + +Get the total number of active sequencers in the set: + +```bash +cast call [ROLLUP_ADDRESS] "getActiveAttesterCount()" --rpc-url $RPC_URL +``` + +This returns the count of currently active sequencers as a hexadecimal number. + +### List Sequencers by Index + +Retrieve individual sequencer addresses by their index (0-based): + +```bash +cast call [ROLLUP_ADDRESS] "getAttesterAtIndex(uint256)" [INDEX] --rpc-url $RPC_URL +``` + +Replace: +- `[ROLLUP_ADDRESS]` - Your Rollup contract address +- `[INDEX]` - The index of the sequencer (starting from 0) + +**Example:** +```bash +# Get the first sequencer (index 0) +cast call 0xabcdef1234567890abcdef1234567890abcdef12 "getAttesterAtIndex(uint256)" 0 --rpc-url $RPC_URL + +# Get the second sequencer (index 1) +cast call 0xabcdef1234567890abcdef1234567890abcdef12 "getAttesterAtIndex(uint256)" 1 --rpc-url $RPC_URL +``` + +### Check Sequencer Status + +Query the complete status and information for a specific sequencer: + +```bash +cast call [ROLLUP_ADDRESS] "getAttesterView(address)" [ATTESTER_ADDRESS] --rpc-url $RPC_URL +``` + +Replace: +- `[ROLLUP_ADDRESS]` - Your Rollup contract address +- `[ATTESTER_ADDRESS]` - The sequencer's attester address you want to check + +**Example:** +```bash +cast call 0xabcdef1234567890abcdef1234567890abcdef12 "getAttesterView(address)" 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb --rpc-url $RPC_URL +``` + +### Interpret the Response + +The `getAttesterView` command returns an `AttesterView` struct containing: + +1. **status** - The sequencer's current status code (see Status Codes below) +2. **effectiveBalance** - The sequencer's effective stake balance +3. **exit** - Exit information struct (if the sequencer is exiting): + - `withdrawalId` - Withdrawal ID in the GSE contract + - `amount` - Amount being withdrawn + - `exitableAt` - Timestamp when withdrawal can be finalized + - `recipientOrWithdrawer` - Address that receives funds or can initiate withdrawal + - `isRecipient` - Whether the exit has a recipient set + - `exists` - Whether an exit exists +4. **config** - Attester configuration struct: + - `publicKey` - BLS public key (G1 point with x and y coordinates) + - `withdrawer` - Address authorized to withdraw stake + +### Get Individual Sequencer Information + +Query specific pieces of information using the GSE contract: + +```bash +# Check if a sequencer is registered +cast call [GSE_ADDRESS] "isRegistered(address,address)" [ROLLUP_ADDRESS] [ATTESTER_ADDRESS] --rpc-url $RPC_URL + +# Get sequencer's balance on this rollup instance +cast call [GSE_ADDRESS] "balanceOf(address,address)" [ROLLUP_ADDRESS] [ATTESTER_ADDRESS] --rpc-url $RPC_URL + +# Get sequencer's effective balance (includes bonus if latest rollup) +cast call [GSE_ADDRESS] "effectiveBalanceOf(address,address)" [ROLLUP_ADDRESS] [ATTESTER_ADDRESS] --rpc-url $RPC_URL + +# Get sequencer's configuration (withdrawer and public key) +cast call [ROLLUP_ADDRESS] "getConfig(address)" [ATTESTER_ADDRESS] --rpc-url $RPC_URL + +# Get only the status +cast call [ROLLUP_ADDRESS] "getStatus(address)" [ATTESTER_ADDRESS] --rpc-url $RPC_URL +``` + +### Status Codes + +| Status | Name | Meaning | +| ------ | ---- | ------- | +| 0 | NONE | The sequencer does not exist in the sequencer set | +| 1 | VALIDATING | The sequencer is currently active and participating in consensus | +| 2 | ZOMBIE | The sequencer is not active (balance fell below ejection threshold, possibly due to slashing) but still has funds in the system | +| 3 | EXITING | The sequencer has initiated withdrawal and is in the exit delay period | + +## Governance Operations + +### Get Governance Contract Addresses + +First, get the Governance contract from the Registry, then query it for the GovernanceProposer contract: + +```bash +# Get the Governance contract +cast call [REGISTRY_ADDRESS] "getGovernance()" --rpc-url $RPC_URL + +# Get the GovernanceProposer contract +cast call [GOVERNANCE_ADDRESS] "governanceProposer()" --rpc-url $RPC_URL +``` + +Replace `[REGISTRY_ADDRESS]` and `[GOVERNANCE_ADDRESS]` with your actual addresses. + +### Check Governance Quorum Requirements + +Query the quorum parameters for the governance system: + +```bash +# Get the signaling round size (in L2 blocks) +cast call [GOVERNANCE_PROPOSER_ADDRESS] "M()" --rpc-url $RPC_URL + +# Get the number of signals required for quorum in any single round +cast call [GOVERNANCE_PROPOSER_ADDRESS] "N()" --rpc-url $RPC_URL +``` + +**What these values mean:** +- **M()** - The size of any signaling round, measured in L2 blocks (e.g., 1000 blocks) +- **N()** - The number of signals needed within a round for a payload to reach quorum (e.g., 750 signals, which is 75% of M) + +### Find the Current Round Number + +Calculate which governance round corresponds to a specific L2 slot: + +```bash +cast call [GOVERNANCE_PROPOSER_ADDRESS] "computeRound(uint256)" [SLOT_NUMBER] --rpc-url $RPC_URL +``` + +Replace: +- `[GOVERNANCE_PROPOSER_ADDRESS]` - Your GovernanceProposer contract address +- `[SLOT_NUMBER]` - The L2 slot number you want to check + +This returns the round number in hexadecimal format. Convert it to decimal for use in the next command. + +**Example:** +```bash +# Check which round slot 5000 belongs to +cast call 0x9876543210abcdef9876543210abcdef98765432 "computeRound(uint256)" 5000 --rpc-url $RPC_URL + +# Output: 0x0000000000000000000000000000000000000000000000000000000000000005 (round 5) +``` + +### Check Signal Count for a Payload + +Check how many sequencers have signaled support for a specific payload in a given round: + +```bash +cast call [GOVERNANCE_PROPOSER_ADDRESS] "yeaCount(address,uint256,address)" [ROLLUP_ADDRESS] [ROUND_NUMBER] [PAYLOAD_ADDRESS] --rpc-url $RPC_URL +``` + +Replace: +- `[GOVERNANCE_PROPOSER_ADDRESS]` - Your GovernanceProposer contract address +- `[ROLLUP_ADDRESS]` - Your Rollup contract address +- `[ROUND_NUMBER]` - The round number as a decimal integer (not hex) +- `[PAYLOAD_ADDRESS]` - The address of the payload contract you're checking + +**Example:** +```bash +cast call 0x9876543210abcdef9876543210abcdef98765432 "yeaCount(address,uint256,address)" 0xabcdef1234567890abcdef1234567890abcdef12 5 0x1111111111111111111111111111111111111111 --rpc-url $RPC_URL +``` + +This returns the number of signals the payload has received in that round. Compare this to the quorum threshold (N) to determine if the payload can be promoted to a proposal. + +### Get Current Proposal Count + +Check how many governance proposals exist: + +```bash +cast call [GOVERNANCE_CONTRACT_ADDRESS] "proposalCount()" --rpc-url $RPC_URL +``` + +### Query a Specific Proposal + +Get details about a specific proposal: + +```bash +cast call [GOVERNANCE_CONTRACT_ADDRESS] "proposals(uint256)" [PROPOSAL_ID] --rpc-url $RPC_URL +``` + +Replace: +- `[GOVERNANCE_CONTRACT_ADDRESS]` - Your Governance contract address +- `[PROPOSAL_ID]` - The proposal ID (zero-indexed, so the first proposal is 0) + +This returns the proposal struct containing: +- Payload address +- Creation timestamp +- Voting start and end times +- Current vote tallies + +## Tips and Best Practices + +### Using Etherscan + +You can also query these contracts through Etherscan's "Read Contract" interface: + +1. Navigate to the contract address on Etherscan +2. Go to the "Contract" tab +3. Click "Read Contract" or "Read as Proxy" +4. Find the function you want to call and enter parameters + +This provides a user-friendly interface without requiring command-line tools. + +### Monitoring Automation + +Consider creating scripts that regularly query sequencer status and governance signals. This helps you: +- Track your sequencer's health +- Monitor governance proposals you care about +- Receive alerts when action is needed + +### Decoding Hex Output + +Some commands return hexadecimal values. Use `cast` to convert them: + +```bash +# Convert hex to decimal +cast --to-dec 0x03e8 + +# Convert hex to address format +cast --to-address 0x000000000000000000000000742d35Cc6634C0532925a3b844Bc9e7595f0bEb +``` + +## Troubleshooting + +### "Invalid JSON RPC response" + +**Issue**: Command fails with JSON RPC error. + +**Solutions**: +- Verify your RPC endpoint is accessible and correct +- Check that you're connected to the right network (Sepolia for testnet) +- Ensure your RPC provider supports the `eth_call` method +- Try a different RPC endpoint + +### "Reverted" or "Execution reverted" + +**Issue**: Contract call reverts. + +**Solutions**: +- Verify the contract address is correct +- Check that the function signature matches the contract's ABI +- Ensure you're passing the correct parameter types +- Verify the contract is deployed on the network you're querying + +### "Could not find function" + +**Issue**: Function not found in contract. + +**Solutions**: +- Verify the function name spelling and capitalization +- Check that you're querying the correct contract +- Ensure the contract version matches the function you're calling +- Try querying through Etherscan to verify the contract ABI + +## Next Steps + +- [Learn about sequencer management](../../setup/sequencer_management) to operate your sequencer node +- [Participate in governance](./creating_and_voting_on_proposals.md) by signaling, voting, and creating proposals +- [Monitor your node](../monitoring.md) with metrics and observability tools +- Join the [Aztec Discord](https://discord.gg/aztec) for operator support and community discussions diff --git a/docs/network_versioned_docs/version-v3.0.2/prerequisites.md b/docs/network_versioned_docs/version-v3.0.2/prerequisites.md new file mode 100644 index 000000000000..4ca67a5c18ec --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/prerequisites.md @@ -0,0 +1,131 @@ +--- +id: prerequisites +sidebar_position: 1 +title: Prerequisites +description: Common prerequisites and requirements for running nodes on the Aztec network, including hardware, software, and network configuration. +--- + +## Overview + +This guide covers the prerequisites and setup requirements for running nodes on the Aztec network. + +## Common Prerequisites + +The following prerequisites apply to all node types. + +### Operating System + +The node software can be run on any Unix system released after 2020. + +- Linux (common flavors) +- MacOS (ARM and intel) + +### Docker and Docker Compose + +Docker and Docker Compose are required for all node types. All Aztec nodes run in Docker containers managed by Docker Compose. + +**On Linux:** Install Docker Engine and Docker Compose separately: + +1. Install Docker: + +```bash +curl -fsSL https://get.docker.com -o get-docker.sh +sudo sh get-docker.sh +``` + +2. Add your user to the docker group so `sudo` is not needed: + +```bash +sudo groupadd docker +sudo usermod -aG docker $USER +newgrp docker +# Test without sudo +docker run hello-world +``` + +3. Install Docker Compose by following the [Docker Compose installation guide](https://docs.docker.com/compose/install/). + +**On macOS:** Install [Docker Desktop](https://docs.docker.com/desktop/install/mac-install/), which includes both Docker and Docker Compose. + +### Aztec Toolchain + +The Aztec toolchain provides CLI utilities for key generation, validator registration, and other operational tasks. While not required for running nodes (which use Docker Compose), it is needed for: + +- Generating validator keystores and creating staking registration data (`aztec validator-keys`) +- Registering sequencers on L1 (`aztec add-l1-validator`) + +Install the Aztec toolchain using the official installer: + +```bash +bash -i <(curl -s https://install.aztec.network) +``` + +Install the correct version for the current network: + +```bash +aztec-up 2.1.9 +``` + +### L1 Ethereum Node Access + +All Aztec nodes require access to Ethereum L1 node endpoints: + +- **Execution client endpoint** (e.g., Geth, Nethermind, Besu, Erigon) +- **Consensus client endpoint** (e.g., Prysm, Lighthouse, Teku, Nimbus) + +**Options:** +1. **Run your own L1 node** (recommended for best performance): + - Better performance and lower latency + - No rate limiting or request throttling + - Greater reliability and uptime control + - Enhanced privacy for your node operations + - See [Eth Docker's guide](https://ethdocker.com/Usage/QuickStart) for setup instructions + +2. **Use a third-party RPC provider**: + - Easier to set up initially + - May have rate limits and throttling + - Ensure the provider supports beacon apis + +:::tip High Throughput Required +Your L1 endpoints must support high throughput to avoid degraded node performance. +::: + +### Port Forwarding and Connectivity + +For nodes participating in the P2P network (full nodes, sequencers, provers), proper port configuration is essential: + +**Required steps:** +1. Configure your router to forward both UDP and TCP traffic on your P2P port (default: 40400) to your node's local IP address +2. Ensure your firewall allows traffic on the required ports: + - P2P port: 40400 (default, both TCP and UDP) + - HTTP API port: 8080 (default) +3. Set the `P2P_IP` environment variable to your external IP address +4. Verify the P2P port is accessible from the internet + +**Find your public IP address:** + +```bash +curl ipv4.icanhazip.com +``` + +**Verify port connectivity:** + +```bash +# For TCP traffic on port 40400 +nc -zv [YOUR_EXTERNAL_IP] 40400 + +# For UDP traffic on port 40400 +nc -zuv [YOUR_EXTERNAL_IP] 40400 +``` + +:::tip Port Forwarding Required +If port forwarding isn't properly configured, your node may not be able to participate in P2P duties. +::: + +## Next Steps + +Once you have met the prerequisites, proceed to set up your desired node type: + +- [Run a Full Node →](./setup/running_a_node.md) +- [Run a Sequencer Node →](./setup/sequencer_management) +- [Run a Prover Node →](./setup/running_a_prover.md) diff --git a/docs/network_versioned_docs/version-v3.0.2/reference/changelog/index.md b/docs/network_versioned_docs/version-v3.0.2/reference/changelog/index.md new file mode 100644 index 000000000000..57857e8a7836 --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/reference/changelog/index.md @@ -0,0 +1,45 @@ +--- +id: changelog +sidebar_position: 0 +title: Changelog +description: Comprehensive changelog documenting configuration changes, new features, and breaking changes across Aztec node versions. +--- + +## Overview + +This changelog documents all configuration changes, new features, and breaking changes across Aztec node versions. Each version has a dedicated page with detailed migration instructions. + +## Version history + +### [v2.0.2 (from v1.2.1)](./v2.0.2.md) + +Major release with significant configuration simplification, keystore integration, and feature updates. + +**Key changes:** +- Simplified L1 contract address configuration (registry-only) +- Integrated keystore system for key management +- Removed component-specific settings in favor of global configuration +- Enhanced P2P transaction collection capabilities +- New invalidation controls for sequencers + +**Migration difficulty**: Moderate to High + +[View full changelog →](./v2.0.2.md) + +--- + +## Migration guides + +When upgrading between versions: + +1. Review the version-specific changelog for breaking changes +2. Follow the migration checklist for your node type +3. Test in a non-production environment first +4. Check the troubleshooting section for common upgrade issues +5. Join [Aztec Discord](https://discord.gg/aztec) for upgrade support + +## Related resources + +- [CLI Reference](../cli_reference.md) - Current command-line options +- [Node API Reference](../node_api_reference.md) - API documentation +- [Ethereum RPC Reference](../ethereum_rpc_reference.md) - L1 RPC usage diff --git a/docs/network_versioned_docs/version-v3.0.2/reference/changelog/v2.0.2.md b/docs/network_versioned_docs/version-v3.0.2/reference/changelog/v2.0.2.md new file mode 100644 index 000000000000..f91f1eebb27d --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/reference/changelog/v2.0.2.md @@ -0,0 +1,365 @@ +--- +title: v2.0.2 (from v1.2.1) +description: Major release with configuration simplification, keystore integration, and enhanced features. Includes breaking changes requiring migration. +--- + +## Overview + +Version 2.0.2 introduces significant configuration simplification, an integrated keystore system, and enhanced P2P capabilities. This release includes breaking changes that require migration from v1.2.1. + +**Migration difficulty**: Moderate to High + +## Breaking changes + +### L1 contract addresses + +**v1.2.1:** +```bash +--rollup-address ($ROLLUP_CONTRACT_ADDRESS) +--inbox-address ($INBOX_CONTRACT_ADDRESS) +--outbox-address ($OUTBOX_CONTRACT_ADDRESS) +--fee-juice-address ($FEE_JUICE_CONTRACT_ADDRESS) +--staking-asset-address ($STAKING_ASSET_CONTRACT_ADDRESS) +--fee-juice-portal-address ($FEE_JUICE_PORTAL_CONTRACT_ADDRESS) +--registry-address ($REGISTRY_CONTRACT_ADDRESS) +``` + +**v2.0.2:** +```bash +--registry-address ($REGISTRY_CONTRACT_ADDRESS) +--rollup-version ($ROLLUP_VERSION) # Default: canonical +``` + +**Migration**: Only registry address is required. All other contract addresses are derived automatically. + +### Keystore integration + +**v1.2.1:** +```bash +--sequencer.publisherPrivateKey ($SEQ_PUBLISHER_PRIVATE_KEY) +--proverNode.publisherPrivateKey ($PROVER_PUBLISHER_PRIVATE_KEY) +``` + +**v2.0.2:** +```bash +--proverNode.keyStoreDirectory ($KEY_STORE_DIRECTORY) + +# Multiple publishers supported +--sequencer.publisherPrivateKeys ($SEQ_PUBLISHER_PRIVATE_KEYS) +--sequencer.publisherAddresses ($SEQ_PUBLISHER_ADDRESSES) + +--proverNode.publisherPrivateKeys ($PROVER_PUBLISHER_PRIVATE_KEYS) +--proverNode.publisherAddresses ($PROVER_PUBLISHER_ADDRESSES) +``` + +**Migration**: Create keystore directory, change singular to plural. Use `*_ADDRESSES` for remote signers. See [Advanced Keystore Guide](../../operation/keystore/index.md). + +### Validator configuration + +**v1.2.1:** +```bash +--sequencer.validatorPrivateKeys ($VALIDATOR_PRIVATE_KEYS) +``` + +**v2.0.2:** +```bash +--sequencer.validatorPrivateKeys ($VALIDATOR_PRIVATE_KEYS) +--sequencer.validatorAddresses ($VALIDATOR_ADDRESSES) # For remote signers +--sequencer.disabledValidators # Temporarily disable +``` + +### Sync mode relocated + +**v1.2.1:** Component-specific +```bash +--node.syncMode ($SYNC_MODE) +--node.snapshotsUrl ($SYNC_SNAPSHOTS_URL) +--proverNode.syncMode ($SYNC_MODE) +--proverNode.snapshotsUrl ($SYNC_SNAPSHOTS_URL) +``` + +**v2.0.2:** Global setting +```bash +--sync-mode ($SYNC_MODE) # Options: full, snapshot, force-snapshot +--snapshots-url ($SYNC_SNAPSHOTS_URL) +``` + +### World state separation + +**v1.2.1:** Prover-node-specific +```bash +--proverNode.worldStateBlockCheckIntervalMS ($WS_BLOCK_CHECK_INTERVAL_MS) +--proverNode.worldStateProvenBlocksOnly ($WS_PROVEN_BLOCKS_ONLY) +--proverNode.worldStateBlockRequestBatchSize ($WS_BLOCK_REQUEST_BATCH_SIZE) +--proverNode.worldStateDbMapSizeKb ($WS_DB_MAP_SIZE_KB) +--proverNode.archiveTreeMapSizeKb ($ARCHIVE_TREE_MAP_SIZE_KB) +--proverNode.nullifierTreeMapSizeKb ($NULLIFIER_TREE_MAP_SIZE_KB) +--proverNode.noteHashTreeMapSizeKb ($NOTE_HASH_TREE_MAP_SIZE_KB) +--proverNode.messageTreeMapSizeKb ($MESSAGE_TREE_MAP_SIZE_KB) +--proverNode.publicDataTreeMapSizeKb ($PUBLIC_DATA_TREE_MAP_SIZE_KB) +--proverNode.worldStateDataDirectory ($WS_DATA_DIRECTORY) +--proverNode.worldStateBlockHistory ($WS_NUM_HISTORIC_BLOCKS) +``` + +**v2.0.2:** Global settings only +```bash +--world-state-data-directory ($WS_DATA_DIRECTORY) +--world-state-db-map-size-kb ($WS_DB_MAP_SIZE_KB) +--world-state-block-history ($WS_NUM_HISTORIC_BLOCKS) +``` + +**Migration**: Move to global WORLD STATE section. Tree-specific map sizes and other world state settings removed. + +## Removed features + +### Faucet service +```bash +# All removed in v2.0.2 +--faucet +--faucet.apiServer +--faucet.apiServerPort ($FAUCET_API_SERVER_PORT) +--faucet.viemPollingIntervalMS ($L1_READER_VIEM_POLLING_INTERVAL_MS) +--faucet.l1Mnemonic ($MNEMONIC) +--faucet.mnemonicAddressIndex ($FAUCET_MNEMONIC_ADDRESS_INDEX) +--faucet.interval ($FAUCET_INTERVAL_MS) +--faucet.ethAmount ($FAUCET_ETH_AMOUNT) +--faucet.l1Assets ($FAUCET_L1_ASSETS) +``` + +### L1 transaction monitoring + +All removed from archiver and sequencer: + +```bash +--archiver.gasLimitBufferPercentage ($L1_GAS_LIMIT_BUFFER_PERCENTAGE) +--archiver.maxGwei ($L1_GAS_PRICE_MAX) +--archiver.maxBlobGwei ($L1_BLOB_FEE_PER_GAS_MAX) +--archiver.priorityFeeBumpPercentage ($L1_PRIORITY_FEE_BUMP_PERCENTAGE) +--archiver.priorityFeeRetryBumpPercentage ($L1_PRIORITY_FEE_RETRY_BUMP_PERCENTAGE) +--archiver.fixedPriorityFeePerGas ($L1_FIXED_PRIORITY_FEE_PER_GAS) +--archiver.maxAttempts ($L1_TX_MONITOR_MAX_ATTEMPTS) +--archiver.checkIntervalMs ($L1_TX_MONITOR_CHECK_INTERVAL_MS) +--archiver.stallTimeMs ($L1_TX_MONITOR_STALL_TIME_MS) +--archiver.txTimeoutMs ($L1_TX_MONITOR_TX_TIMEOUT_MS) +--archiver.txPropagationMaxQueryAttempts ($L1_TX_PROPAGATION_MAX_QUERY_ATTEMPTS) +--archiver.cancelTxOnTimeout ($L1_TX_MONITOR_CANCEL_TX_ON_TIMEOUT) + +# Same settings removed from --sequencer.* +``` + +**Migration**: L1 transaction management now uses optimized internal defaults. + +### Rollup constants from archiver + +All rollup constants now derived from L1 contracts: + +```bash +# All removed in v2.0.2 +--archiver.ethereumSlotDuration ($ETHEREUM_SLOT_DURATION) +--archiver.aztecSlotDuration ($AZTEC_SLOT_DURATION) +--archiver.aztecEpochDuration ($AZTEC_EPOCH_DURATION) +--archiver.aztecTargetCommitteeSize ($AZTEC_TARGET_COMMITTEE_SIZE) +--archiver.aztecProofSubmissionEpochs ($AZTEC_PROOF_SUBMISSION_EPOCHS) +--archiver.depositAmount ($AZTEC_DEPOSIT_AMOUNT) +--archiver.minimumStake ($AZTEC_MINIMUM_STAKE) +--archiver.slashingQuorum ($AZTEC_SLASHING_QUORUM) +--archiver.slashingRoundSize ($AZTEC_SLASHING_ROUND_SIZE) +--archiver.governanceProposerQuorum ($AZTEC_GOVERNANCE_PROPOSER_QUORUM) +--archiver.governanceProposerRoundSize ($AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE) +--archiver.manaTarget ($AZTEC_MANA_TARGET) +--archiver.provingCostPerMana ($AZTEC_PROVING_COST_PER_MANA) +--archiver.exitDelaySeconds ($AZTEC_EXIT_DELAY_SECONDS) + +# Same settings removed from --sequencer.* +``` + +### Node deployment options + +```bash +# All removed in v2.0.2 (moved to sandbox only) +--node.deployAztecContracts ($DEPLOY_AZTEC_CONTRACTS) +--node.deployAztecContractsSalt ($DEPLOY_AZTEC_CONTRACTS_SALT) +--node.assumeProvenThroughBlockNumber ($ASSUME_PROVEN_THROUGH_BLOCK_NUMBER) +--node.publisherPrivateKey ($L1_PRIVATE_KEY) +``` + +**Migration**: Contract deployment now sandbox-only via `--sandbox.deployAztecContractsSalt`. For production, deploy contracts separately. + +### Other removed settings + +```bash +# Prover coordination +--proverNode.proverCoordinationNodeUrls ($PROVER_COORDINATION_NODE_URLS) + +# Custom forwarder +--sequencer.customForwarderContractAddress ($CUSTOM_FORWARDER_CONTRACT_ADDRESS) +--proverNode.customForwarderContractAddress ($CUSTOM_FORWARDER_CONTRACT_ADDRESS) + +# Component-specific settings now global +--archiver.viemPollingIntervalMS ($ARCHIVER_VIEM_POLLING_INTERVAL_MS) +--sequencer.viemPollingIntervalMS ($L1_READER_VIEM_POLLING_INTERVAL_MS) +--blobSink.viemPollingIntervalMS ($L1_READER_VIEM_POLLING_INTERVAL_MS) +--proverBroker.viemPollingIntervalMS ($L1_READER_VIEM_POLLING_INTERVAL_MS) + +--archiver.rollupVersion ($ROLLUP_VERSION) +--sequencer.rollupVersion ($ROLLUP_VERSION) +--blobSink.rollupVersion ($ROLLUP_VERSION) +--proverBroker.rollupVersion ($ROLLUP_VERSION) +--pxe.rollupVersion ($ROLLUP_VERSION) + +--archiver.dataStoreMapSizeKB ($DATA_STORE_MAP_SIZE_KB) +--pxe.dataStoreMapSizeKB ($DATA_STORE_MAP_SIZE_KB) +--blobSink.dataStoreMapSizeKB ($DATA_STORE_MAP_SIZE_KB) +--proverBroker.dataStoreMapSizeKB ($DATA_STORE_MAP_SIZE_KB) +--p2pBootstrap.dataStoreMapSizeKB ($DATA_STORE_MAP_SIZE_KB) + +# Aztec node specific +--node.worldStateBlockCheckIntervalMS ($WS_BLOCK_CHECK_INTERVAL_MS) +--node.archiverUrl ($ARCHIVER_URL) +``` + +## New features + +### P2P transaction collection + +```bash +--p2p.txCollectionNodeRpcUrls ($TX_COLLECTION_NODE_RPC_URLS) +--p2p.txCollectionFastNodeIntervalMs ($TX_COLLECTION_FAST_NODE_INTERVAL_MS) +--p2p.txCollectionFastMaxParallelRequestsPerNode ($TX_COLLECTION_FAST_MAX_PARALLEL_REQUESTS_PER_NODE) +--p2p.txCollectionNodeRpcMaxBatchSize ($TX_COLLECTION_NODE_RPC_MAX_BATCH_SIZE) +--p2p.txCollectionFastNodesTimeoutBeforeReqRespMs ($TX_COLLECTION_FAST_NODES_TIMEOUT_BEFORE_REQ_RESP_MS) +--p2p.txCollectionSlowNodesIntervalMs ($TX_COLLECTION_SLOW_NODES_INTERVAL_MS) +--p2p.txCollectionSlowReqRespIntervalMs ($TX_COLLECTION_SLOW_REQ_RESP_INTERVAL_MS) +--p2p.txCollectionSlowReqRespTimeoutMs ($TX_COLLECTION_SLOW_REQ_RESP_TIMEOUT_MS) +--p2p.txCollectionReconcileIntervalMs ($TX_COLLECTION_RECONCILE_INTERVAL_MS) +--p2p.txCollectionDisableSlowDuringFastRequests ($TX_COLLECTION_DISABLE_SLOW_DURING_FAST_REQUESTS) +``` + +### P2P security and testing + +```bash +# Discovery and security +--p2p.p2pDiscoveryDisabled ($P2P_DISCOVERY_DISABLED) +--p2p.p2pAllowOnlyValidators ($P2P_ALLOW_ONLY_VALIDATORS) +--p2p.p2pMaxFailedAuthAttemptsAllowed ($P2P_MAX_AUTH_FAILED_ATTEMPTS_ALLOWED) + +# Testing features +--p2p.dropTransactions ($P2P_DROP_TX) +--p2p.dropTransactionsProbability ($P2P_DROP_TX_CHANCE) + +# Transaction handling +--p2p.disableTransactions ($TRANSACTIONS_DISABLED) +--p2p.txPoolDeleteTxsAfterReorg ($P2P_TX_POOL_DELETE_TXS_AFTER_REORG) + +# Preferred peers +--p2p.preferredPeers ($P2P_PREFERRED_PEERS) +``` + +### Sequencer invalidation controls + +```bash +--sequencer.attestationPropagationTime ($SEQ_ATTESTATION_PROPAGATION_TIME) +--sequencer.secondsBeforeInvalidatingBlockAsCommitteeMember ($SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_COMMITTEE_MEMBER) +--sequencer.secondsBeforeInvalidatingBlockAsNonCommitteeMember ($SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_NON_COMMITTEE_MEMBER) +``` + +### Other new features + +```bash +# Archiver - skip validation (testing only) +--archiver.skipValidateBlockAttestations + +# Prover - transaction gathering timeout +--proverNode.txGatheringTimeoutMs ($PROVER_NODE_TX_GATHERING_TIMEOUT_MS) +``` + +## Changed defaults + +| Flag | Environment Variable | v1.2.1 | v2.0.2 | +|------|---------------------|--------|--------| +| `--p2p.overallRequestTimeoutMs` | `$P2P_REQRESP_OVERALL_REQUEST_TIMEOUT_MS` | 4000 | **10000** | +| `--p2p.individualRequestTimeoutMs` | `$P2P_REQRESP_INDIVIDUAL_REQUEST_TIMEOUT_MS` | 2000 | **10000** | +| `--p2p.dialTimeoutMs` | `$P2P_REQRESP_DIAL_TIMEOUT_MS` | 1000 | **5000** | +| `--proverAgent.proverAgentPollIntervalMs` | `$PROVER_AGENT_POLL_INTERVAL_MS` | 100 | **1000** | +| `--bot.l1ToL2MessageTimeoutSeconds` | `$BOT_L1_TO_L2_TIMEOUT_SECONDS` | 60 | **3600** | +| `--bot.recipientEncryptionSecret` | `$BOT_RECIPIENT_ENCRYPTION_SECRET` | [Redacted] | **0x...cafecafe** | + +## Migration checklist + +### All nodes +- [ ] Update to `--registry-address` only (remove all other contract addresses) +- [ ] Add `--rollup-version canonical` if needed +- [ ] Move `--sync-mode` and `--snapshots-url` to global config +- [ ] Remove component-specific `--*.rollupVersion`, `--*.dataStoreMapSizeKB` +- [ ] Set global `--data-store-map-size-kb` if needed (default: 134217728 KB) + +### Sequencer nodes +- [ ] Create and configure `--sequencer.keyStoreDirectory` (actually `--proverNode.keyStoreDirectory`) +- [ ] Change `--sequencer.publisherPrivateKey` → `--sequencer.publisherPrivateKeys` +- [ ] Update `--sequencer.validatorPrivateKeys` or add `--sequencer.validatorAddresses` +- [ ] Remove all `--sequencer.gasLimitBufferPercentage` and related L1 settings +- [ ] Remove `--sequencer.customForwarderContractAddress`, `--sequencer.viemPollingIntervalMS` +- [ ] Consider using `--sequencer.disabledValidators` for temporary disabling + +### Prover nodes +- [ ] Create and configure `--proverNode.keyStoreDirectory` +- [ ] Change `--proverNode.publisherPrivateKey` → `--proverNode.publisherPrivateKeys` +- [ ] Move world state settings to global WORLD STATE section +- [ ] Remove `--proverNode.archiveTreeMapSizeKb` and other tree-specific sizes +- [ ] Remove `--proverNode.proverCoordinationNodeUrls`, `--proverNode.customForwarderContractAddress` +- [ ] Set `--proverNode.txGatheringTimeoutMs` if needed + +### Archiver nodes +- [ ] Remove all `--archiver.gasLimitBufferPercentage` and related L1 settings +- [ ] Remove `--archiver.ethereumSlotDuration`, `--archiver.aztecSlotDuration`, etc. +- [ ] Remove `--archiver.viemPollingIntervalMS` + +### P2P configuration +- [ ] Configure `--p2p.txCollectionNodeRpcUrls` if using external nodes +- [ ] Review `--p2p.p2pAllowOnlyValidators` security settings +- [ ] Consider using `--p2p.preferredPeers` + +### Sandbox/development +- [ ] Move deployment to `--sandbox.deployAztecContractsSalt` +- [ ] Configure `--sandbox.l1Mnemonic` if needed +- [ ] Remove all faucet flags + +## Troubleshooting + +### Node fails with contract address errors +**Solution**: Remove all individual contract addresses, keep only `--registry-address`, add `--rollup-version canonical` + +### Publisher key not found +**Solution**: +- Check `--proverNode.keyStoreDirectory` ($KEY_STORE_DIRECTORY) is set +- Change `--*.publisherPrivateKey` to `--*.publisherPrivateKeys` (plural) +- See [Advanced Keystore Guide](../../operation/keystore/index.md) + +### World state sync failures (prover) +**Solution**: +- Move `--proverNode.worldStateDataDirectory` to `--world-state-data-directory` +- Remove prover-specific world state settings +- Use global `--world-state-db-map-size-kb` + +### Slow P2P after upgrade +**Solution**: +- Configure `--p2p.txCollectionNodeRpcUrls` ($TX_COLLECTION_NODE_RPC_URLS) +- Adjust `--p2p.txCollectionFastNodeIntervalMs` + +### Validator not attesting +**Solution**: +- Check not in `--sequencer.disabledValidators` list +- Verify `--sequencer.validatorPrivateKeys` or `--sequencer.validatorAddresses` +- Check keystore permissions + +### Missing sync snapshots +**Solution**: +- Move `--node.syncMode` to `--sync-mode` (global) +- Set `--snapshots-url` at global level + +## Next steps + +- [How to Run a Sequencer Node](../../setup/sequencer_management) - Updated setup instructions +- [Advanced Keystore Usage](../../operation/keystore/index.md) - Keystore configuration +- [Ethereum RPC Calls Reference](../ethereum_rpc_reference.md) - Infrastructure requirements +- [Aztec Discord](https://discord.gg/aztec) - Upgrade support \ No newline at end of file diff --git a/docs/network_versioned_docs/version-v3.0.2/reference/cli_reference.md b/docs/network_versioned_docs/version-v3.0.2/reference/cli_reference.md new file mode 100644 index 000000000000..92da74e30ecc --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/reference/cli_reference.md @@ -0,0 +1,731 @@ +--- +sidebar_position: 1 +title: Cli Reference +description: A reference of the --help output when running aztec start. +references: ["yarn-project/aztec/src/cli/aztec_start_options.ts", "yarn-project/aztec/src/cli/cli.ts"] +keywords: + [ + aztec, + prover, + node, + blockchain, + L2, + scaling, + ethereum, + zero-knowledge, + ZK, + setup, + ] +tags: + - prover + - node + - tutorial + - infrastructure +--- + +**Configuration notes:** + +- The environment variable name corresponding to each flag is shown as $ENV_VAR on the right hand side. +- If two subsystems can contain the same configuration option, only one needs to be provided. For example, `--archiver.blobSinkUrl` and `--sequencer.blobSinkUrl` point to the same value if the node is started with both the `--archiver` and `--sequencer` options. + +```bash + MISC + + --network ($NETWORK) + Network to run Aztec on + + --auto-update (default: disabled) ($AUTO_UPDATE) + The auto update mode for this node + + --auto-update-url ($AUTO_UPDATE_URL) + Base URL to check for updates + + --sync-mode (default: snapshot) ($SYNC_MODE) + Set sync mode to `full` to always sync via L1, `snapshot` to download a snapshot if there is no local data, `force-snapshot` to download even if there is local data. + + --snapshots-url ($SYNC_SNAPSHOTS_URL) + Base URL for snapshots index. + + LOCAL NETWORK + + --local-network + Starts Aztec local network + + --local-network.noPXE ($NO_PXE) + Do not expose PXE service on local network start + + --local-network.l1Mnemonic (default: test test test test test test test test test test test junk)($MNEMONIC) + Mnemonic for L1 accounts. Will be used + + API + + --port (default: 8080) ($AZTEC_PORT) + Port to run the Aztec Services on + + --admin-port (default: 8880) ($AZTEC_ADMIN_PORT) + Port to run admin APIs of Aztec Services on + + --api-prefix ($API_PREFIX) + Prefix for API routes on any service that is started + + ETHEREUM + + --l1-chain-id ($L1_CHAIN_ID) + The chain ID of the ethereum host. + + --l1-rpc-urls ($ETHEREUM_HOSTS) + List of URLs of Ethereum RPC nodes that services will connect to (comma separated). + + --l1-consensus-host-urls ($L1_CONSENSUS_HOST_URLS) + List of URLs of the Ethereum consensus nodes that services will connect to (comma separated) + + --l1-consensus-host-api-keys ($L1_CONSENSUS_HOST_API_KEYS) + List of API keys for the corresponding L1 consensus clients, if needed. Added to the end of the corresponding URL as "?key=" unless a header is defined + + --l1-consensus-host-api-key-headers ($L1_CONSENSUS_HOST_API_KEY_HEADERS) + List of header names for the corresponding L1 consensus client API keys, if needed. Added to the corresponding request as ": " + + L1 CONTRACTS + + --registry-address ($REGISTRY_CONTRACT_ADDRESS) + The deployed L1 registry contract address. + + --rollup-version ($ROLLUP_VERSION) + The version of the rollup. + + STORAGE + + --data-directory ($DATA_DIRECTORY) + Optional dir to store data. If omitted will store in memory. + + --data-store-map-size-kb (default: 134217728) ($DATA_STORE_MAP_SIZE_KB) + The maximum possible size of a data store DB in KB. Can be overridden by component-specific options. + + WORLD STATE + + --world-state-data-directory ($WS_DATA_DIRECTORY) + Optional directory for the world state database + + --world-state-db-map-size-kb ($WS_DB_MAP_SIZE_KB) + The maximum possible size of the world state DB in KB. Overwrites the general dataStoreMapSizeKb. + + --world-state-block-history (default: 64) ($WS_NUM_HISTORIC_BLOCKS) + The number of historic blocks to maintain. Values less than 1 mean all history is maintained + + AZTEC NODE + + --node + Starts Aztec Node with options + + ARCHIVER + + --archiver + Starts Aztec Archiver with options + + --archiver.blobSinkUrl ($BLOB_SINK_URL) + The URL of the blob sink + + --archiver.blobSinkMapSizeKb ($BLOB_SINK_MAP_SIZE_KB) + The maximum possible size of the blob sink DB in KB. Overwrites the general dataStoreMapSizeKb. + + --archiver.archiveApiUrl ($BLOB_SINK_ARCHIVE_API_URL) + The URL of the archive API + + --archiver.archiverPollingIntervalMS (default: 500) ($ARCHIVER_POLLING_INTERVAL_MS) + The polling interval in ms for retrieving new L2 blocks and encrypted logs. + + --archiver.archiverBatchSize (default: 100) ($ARCHIVER_BATCH_SIZE) + The number of L2 blocks the archiver will attempt to download at a time. + + --archiver.maxLogs (default: 1000) ($ARCHIVER_MAX_LOGS) + The max number of logs that can be obtained in 1 "getPublicLogs" call. + + --archiver.archiverStoreMapSizeKb ($ARCHIVER_STORE_MAP_SIZE_KB) + The maximum possible size of the archiver DB in KB. Overwrites the general dataStoreMapSizeKb. + + --archiver.skipValidateBlockAttestations + Whether to skip validating block attestations (use only for testing). + + SEQUENCER + + --sequencer + Starts Aztec Sequencer with options + + --sequencer.validatorPrivateKeys (default: [Redacted]) ($VALIDATOR_PRIVATE_KEYS) + List of private keys of the validators participating in attestation duties + + --sequencer.validatorAddresses (default: ) ($VALIDATOR_ADDRESSES) + List of addresses of the validators to use with remote signers + + --sequencer.disableValidator ($VALIDATOR_DISABLED) + Do not run the validator + + --sequencer.disabledValidators (default: ) + Temporarily disable these specific validator addresses + + --sequencer.attestationPollingIntervalMs (default: 200) ($VALIDATOR_ATTESTATIONS_POLLING_INTERVAL_MS) + Interval between polling for new attestations + + --sequencer.validatorReexecute (default: true) ($VALIDATOR_REEXECUTE) + Re-execute transactions before attesting + + --sequencer.validatorReexecuteDeadlineMs (default: 6000) ($VALIDATOR_REEXECUTE_DEADLINE_MS) + Will re-execute until this many milliseconds are left in the slot + + --sequencer.alwaysReexecuteBlockProposals ($ALWAYS_REEXECUTE_BLOCK_PROPOSALS) + Whether to always reexecute block proposals, even for non-validator nodes (useful for monitoring network status). + + --sequencer.transactionPollingIntervalMS (default: 500) ($SEQ_TX_POLLING_INTERVAL_MS) + The number of ms to wait between polling for pending txs. + + --sequencer.maxTxsPerBlock (default: 32) ($SEQ_MAX_TX_PER_BLOCK) + The maximum number of txs to include in a block. + + --sequencer.minTxsPerBlock (default: 1) ($SEQ_MIN_TX_PER_BLOCK) + The minimum number of txs to include in a block. + + --sequencer.publishTxsWithProposals ($SEQ_PUBLISH_TXS_WITH_PROPOSALS) + Whether to publish txs with proposals. + + --sequencer.maxL2BlockGas (default: 10000000000) ($SEQ_MAX_L2_BLOCK_GAS) + The maximum L2 block gas. + + --sequencer.maxDABlockGas (default: 10000000000) ($SEQ_MAX_DA_BLOCK_GAS) + The maximum DA block gas. + + --sequencer.coinbase ($COINBASE) + Recipient of block reward. + + --sequencer.feeRecipient ($FEE_RECIPIENT) + Address to receive fees. + + --sequencer.acvmWorkingDirectory ($ACVM_WORKING_DIRECTORY) + The working directory to use for simulation/proving + + --sequencer.acvmBinaryPath ($ACVM_BINARY_PATH) + The path to the ACVM binary + + --sequencer.maxBlockSizeInBytes (default: 1048576) ($SEQ_MAX_BLOCK_SIZE_IN_BYTES) + Max block size + + --sequencer.enforceTimeTable (default: true) ($SEQ_ENFORCE_TIME_TABLE) + Whether to enforce the time table when building blocks + + --sequencer.governanceProposerPayload (default: 0x0000000000000000000000000000000000000000) ($GOVERNANCE_PROPOSER_PAYLOAD_ADDRESS) + The address of the payload for the governanceProposer + + --sequencer.maxL1TxInclusionTimeIntoSlot ($SEQ_MAX_L1_TX_INCLUSION_TIME_INTO_SLOT) + How many seconds into an L1 slot we can still send a tx and get it mined. + + --sequencer.attestationPropagationTime (default: 2) ($SEQ_ATTESTATION_PROPAGATION_TIME) + How many seconds it takes for proposals and attestations to travel across the p2p layer (one-way) + + --sequencer.secondsBeforeInvalidatingBlockAsCommitteeMember (default: 144) ($SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_COMMITTEE_MEMBER) + How many seconds to wait before trying to invalidate a block from the pending chain as a committee member (zero to never invalidate). The next proposer is expected to invalidate, so the committee acts as a fallback. + + --sequencer.secondsBeforeInvalidatingBlockAsNonCommitteeMember (default: 432) ($SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_NON_COMMITTEE_MEMBER) + How many seconds to wait before trying to invalidate a block from the pending chain as a non-committee member (zero to never invalidate). The next proposer is expected to invalidate, then the committee, so other sequencers act as a fallback. + + --sequencer.txPublicSetupAllowList ($TX_PUBLIC_SETUP_ALLOWLIST) + The list of functions calls allowed to run in setup + + --sequencer.keyStoreDirectory ($KEY_STORE_DIRECTORY) + Location of key store directory + + --sequencer.publisherPrivateKeys (default: ) ($SEQ_PUBLISHER_PRIVATE_KEYS) + The private keys to be used by the publisher. + + --sequencer.publisherAddresses (default: ) ($SEQ_PUBLISHER_ADDRESSES) + The addresses of the publishers to use with remote signers + + --sequencer.l1PublishRetryIntervalMS (default: 1000) ($SEQ_PUBLISH_RETRY_INTERVAL_MS) + The interval to wait between publish retries. + + --sequencer.publisherAllowInvalidStates ($SEQ_PUBLISHER_ALLOW_INVALID_STATES) + True to use publishers in invalid states (timed out, cancelled, etc) if no other is available + + --sequencer.blobSinkUrl ($BLOB_SINK_URL) + The URL of the blob sink + + --sequencer.archiveApiUrl ($BLOB_SINK_ARCHIVE_API_URL) + The URL of the archive API + + BLOB SINK + + --blob-sink + Starts Aztec Blob Sink with options + + --blobSink.port ($BLOB_SINK_PORT) + The port to run the blob sink server on + + --blobSink.blobSinkMapSizeKb ($BLOB_SINK_MAP_SIZE_KB) + The maximum possible size of the blob sink DB in KB. Overwrites the general dataStoreMapSizeKb. + + --blobSink.archiveApiUrl ($BLOB_SINK_ARCHIVE_API_URL) + The URL of the archive API + + PROVER NODE + + --prover-node + Starts Aztec Prover Node with options + + --proverNode.keyStoreDirectory ($KEY_STORE_DIRECTORY) + Location of key store directory + + --proverNode.acvmWorkingDirectory ($ACVM_WORKING_DIRECTORY) + The working directory to use for simulation/proving + + --proverNode.acvmBinaryPath ($ACVM_BINARY_PATH) + The path to the ACVM binary + + --proverNode.bbWorkingDirectory ($BB_WORKING_DIRECTORY) + The working directory to use for proving + + --proverNode.bbBinaryPath ($BB_BINARY_PATH) + The path to the bb binary + + --proverNode.bbSkipCleanup ($BB_SKIP_CLEANUP) + Whether to skip cleanup of bb temporary files + + --proverNode.numConcurrentIVCVerifiers (default: 8) ($BB_NUM_IVC_VERIFIERS) + Max number of client IVC verifiers to run concurrently + + --proverNode.bbIVCConcurrency (default: 1) ($BB_IVC_CONCURRENCY) + Number of threads to use for IVC verification + + --proverNode.nodeUrl ($AZTEC_NODE_URL) + The URL to the Aztec node to take proving jobs from + + --proverNode.proverId ($PROVER_ID) + Hex value that identifies the prover. Defaults to the address used for submitting proofs if not set. + + --proverNode.failedProofStore ($PROVER_FAILED_PROOF_STORE) + Store for failed proof inputs. Google cloud storage is only supported at the moment. Set this value as gs://bucket-name/path/to/store. + + --proverNode.l1PublishRetryIntervalMS (default: 1000) ($PROVER_PUBLISH_RETRY_INTERVAL_MS) + The interval to wait between publish retries. + + --proverNode.publisherAllowInvalidStates ($PROVER_PUBLISHER_ALLOW_INVALID_STATES) + True to use publishers in invalid states (timed out, cancelled, etc) if no other is available + + --proverNode.publisherPrivateKeys (default: ) ($PROVER_PUBLISHER_PRIVATE_KEYS) + The private keys to be used by the publisher. + + --proverNode.publisherAddresses (default: ) ($PROVER_PUBLISHER_ADDRESSES) + The addresses of the publishers to use with remote signers + + --proverNode.proverNodeMaxPendingJobs (default: 10) ($PROVER_NODE_MAX_PENDING_JOBS) + The maximum number of pending jobs for the prover node + + --proverNode.proverNodePollingIntervalMs (default: 1000) ($PROVER_NODE_POLLING_INTERVAL_MS) + The interval in milliseconds to poll for new jobs + + --proverNode.proverNodeMaxParallelBlocksPerEpoch (default: 32) ($PROVER_NODE_MAX_PARALLEL_BLOCKS_PER_EPOCH) + The Maximum number of blocks to process in parallel while proving an epoch + + --proverNode.proverNodeFailedEpochStore ($PROVER_NODE_FAILED_EPOCH_STORE) + File store where to upload node state when an epoch fails to be proven + + --proverNode.proverNodeEpochProvingDelayMs + Optional delay in milliseconds to wait before proving a new epoch + + --proverNode.txGatheringIntervalMs (default: 1000) ($PROVER_NODE_TX_GATHERING_INTERVAL_MS) + How often to check that tx data is available + + --proverNode.txGatheringBatchSize (default: 10) ($PROVER_NODE_TX_GATHERING_BATCH_SIZE) + How many transactions to gather from a node in a single request + + --proverNode.txGatheringMaxParallelRequestsPerNode (default: 100) ($PROVER_NODE_TX_GATHERING_MAX_PARALLEL_REQUESTS_PER_NODE) + How many tx requests to make in parallel to each node + + --proverNode.txGatheringTimeoutMs (default: 120000) ($PROVER_NODE_TX_GATHERING_TIMEOUT_MS) + How long to wait for tx data to be available before giving up + + PROVER BROKER + + --prover-broker + Starts Aztec proving job broker + + --proverBroker.proverBrokerJobTimeoutMs (default: 30000) ($PROVER_BROKER_JOB_TIMEOUT_MS) + Jobs are retried if not kept alive for this long + + --proverBroker.proverBrokerPollIntervalMs (default: 1000) ($PROVER_BROKER_POLL_INTERVAL_MS) + The interval to check job health status + + --proverBroker.proverBrokerJobMaxRetries (default: 3) ($PROVER_BROKER_JOB_MAX_RETRIES) + If starting a prover broker locally, the max number of retries per proving job + + --proverBroker.proverBrokerBatchSize (default: 100) ($PROVER_BROKER_BATCH_SIZE) + The prover broker writes jobs to disk in batches + + --proverBroker.proverBrokerBatchIntervalMs (default: 50) ($PROVER_BROKER_BATCH_INTERVAL_MS) + How often to flush batches to disk + + --proverBroker.proverBrokerMaxEpochsToKeepResultsFor (default: 1) ($PROVER_BROKER_MAX_EPOCHS_TO_KEEP_RESULTS_FOR) + The maximum number of epochs to keep results for + + --proverBroker.proverBrokerStoreMapSizeKb ($PROVER_BROKER_STORE_MAP_SIZE_KB) + The size of the prover broker's database. Will override the dataStoreMapSizeKb if set. + + PROVER AGENT + + --prover-agent + Starts Aztec Prover Agent with options + + --proverAgent.proverAgentCount (default: 1) ($PROVER_AGENT_COUNT) + Whether this prover has a local prover agent + + --proverAgent.proverAgentPollIntervalMs (default: 1000) ($PROVER_AGENT_POLL_INTERVAL_MS) + The interval agents poll for jobs at + + --proverAgent.proverAgentProofTypes ($PROVER_AGENT_PROOF_TYPES) + The types of proofs the prover agent can generate + + --proverAgent.proverBrokerUrl ($PROVER_BROKER_HOST) + The URL where this agent takes jobs from + + --proverAgent.realProofs (default: true) ($PROVER_REAL_PROOFS) + Whether to construct real proofs + + --proverAgent.proverTestDelayType (default: fixed) ($PROVER_TEST_DELAY_TYPE) + The type of artificial delay to introduce + + --proverAgent.proverTestDelayMs ($PROVER_TEST_DELAY_MS) + Artificial delay to introduce to all operations to the test prover. + + --proverAgent.proverTestDelayFactor (default: 1) ($PROVER_TEST_DELAY_FACTOR) + If using realistic delays, what percentage of realistic times to apply. + + P2P SUBSYSTEM + + --p2p-enabled [value] ($P2P_ENABLED) + Enable P2P subsystem + + --p2p.p2pDiscoveryDisabled ($P2P_DISCOVERY_DISABLED) + A flag dictating whether the P2P discovery system should be disabled. + + --p2p.blockCheckIntervalMS (default: 100) ($P2P_BLOCK_CHECK_INTERVAL_MS) + The frequency in which to check for new L2 blocks. + + --p2p.debugDisableColocationPenalty ($DEBUG_P2P_DISABLE_COLOCATION_PENALTY) + DEBUG: Disable colocation penalty - NEVER set to true in production + + --p2p.peerCheckIntervalMS (default: 30000) ($P2P_PEER_CHECK_INTERVAL_MS) + The frequency in which to check for new peers. + + --p2p.l2QueueSize (default: 1000) ($P2P_L2_QUEUE_SIZE) + Size of queue of L2 blocks to store. + + --p2p.listenAddress (default: 0.0.0.0) ($P2P_LISTEN_ADDR) + The listen address. ipv4 address. + + --p2p.p2pPort (default: 40400) ($P2P_PORT) + The port for the P2P service. Defaults to 40400 + + --p2p.p2pBroadcastPort ($P2P_BROADCAST_PORT) + The port to broadcast the P2P service on (included in the node's ENR). Defaults to P2P_PORT. + + --p2p.p2pIp ($P2P_IP) + The IP address for the P2P service. ipv4 address. + + --p2p.peerIdPrivateKey ($PEER_ID_PRIVATE_KEY) + An optional peer id private key. If blank, will generate a random key. + + --p2p.peerIdPrivateKeyPath ($PEER_ID_PRIVATE_KEY_PATH) + An optional path to store generated peer id private keys. If blank, will default to storing any generated keys in the root of the data directory. + + --p2p.bootstrapNodes (default: ) ($BOOTSTRAP_NODES) + A list of bootstrap peer ENRs to connect to. Separated by commas. + + --p2p.bootstrapNodeEnrVersionCheck ($P2P_BOOTSTRAP_NODE_ENR_VERSION_CHECK) + Whether to check the version of the bootstrap node ENR. + + --p2p.bootstrapNodesAsFullPeers ($P2P_BOOTSTRAP_NODES_AS_FULL_PEERS) + Whether to consider our configured bootnodes as full peers + + --p2p.maxPeerCount (default: 100) ($P2P_MAX_PEERS) + The maximum number of peers to connect to. + + --p2p.queryForIp ($P2P_QUERY_FOR_IP) + If announceUdpAddress or announceTcpAddress are not provided, query for the IP address of the machine. Default is false. + + --p2p.gossipsubInterval (default: 700) ($P2P_GOSSIPSUB_INTERVAL_MS) + The interval of the gossipsub heartbeat to perform maintenance tasks. + + --p2p.gossipsubD (default: 8) ($P2P_GOSSIPSUB_D) + The D parameter for the gossipsub protocol. + + --p2p.gossipsubDlo (default: 4) ($P2P_GOSSIPSUB_DLO) + The Dlo parameter for the gossipsub protocol. + + --p2p.gossipsubDhi (default: 12) ($P2P_GOSSIPSUB_DHI) + The Dhi parameter for the gossipsub protocol. + + --p2p.gossipsubDLazy (default: 8) ($P2P_GOSSIPSUB_DLAZY) + The Dlazy parameter for the gossipsub protocol. + + --p2p.gossipsubFloodPublish ($P2P_GOSSIPSUB_FLOOD_PUBLISH) + Whether to flood publish messages. - For testing purposes only + + --p2p.gossipsubMcacheLength (default: 6) ($P2P_GOSSIPSUB_MCACHE_LENGTH) + The number of gossipsub interval message cache windows to keep. + + --p2p.gossipsubMcacheGossip (default: 3) ($P2P_GOSSIPSUB_MCACHE_GOSSIP) + How many message cache windows to include when gossiping with other peers. + + --p2p.gossipsubSeenTTL (default: 1200000) ($P2P_GOSSIPSUB_SEEN_TTL) + How long to keep message IDs in the seen cache. + + --p2p.gossipsubTxTopicWeight (default: 1) ($P2P_GOSSIPSUB_TX_TOPIC_WEIGHT) + The weight of the tx topic for the gossipsub protocol. + + --p2p.gossipsubTxInvalidMessageDeliveriesWeight (default: -20) ($P2P_GOSSIPSUB_TX_INVALID_MESSAGE_DELIVERIES_WEIGHT) + The weight of the tx invalid message deliveries for the gossipsub protocol. + + --p2p.gossipsubTxInvalidMessageDeliveriesDecay (default: 0.5) ($P2P_GOSSIPSUB_TX_INVALID_MESSAGE_DELIVERIES_DECAY) + Determines how quickly the penalty for invalid message deliveries decays over time. Between 0 and 1. + + --p2p.peerPenaltyValues (default: 2,10,50) ($P2P_PEER_PENALTY_VALUES) + The values for the peer scoring system. Passed as a comma separated list of values in order: low, mid, high tolerance errors. + + --p2p.doubleSpendSeverePeerPenaltyWindow (default: 30) ($P2P_DOUBLE_SPEND_SEVERE_PEER_PENALTY_WINDOW) + The "age" (in L2 blocks) of a tx after which we heavily penalize a peer for sending it. + + --p2p.blockRequestBatchSize (default: 20) ($P2P_BLOCK_REQUEST_BATCH_SIZE) + The number of blocks to fetch in a single batch. + + --p2p.archivedTxLimit ($P2P_ARCHIVED_TX_LIMIT) + The number of transactions that will be archived. If the limit is set to 0 then archiving will be disabled. + + --p2p.trustedPeers (default: ) ($P2P_TRUSTED_PEERS) + A list of trusted peer ENRs that will always be persisted. Separated by commas. + + --p2p.privatePeers (default: ) ($P2P_PRIVATE_PEERS) + A list of private peer ENRs that will always be persisted and not be used for discovery. Separated by commas. + + --p2p.preferredPeers (default: ) ($P2P_PREFERRED_PEERS) + A list of preferred peer ENRs that will always be persisted and not be used for discovery. Separated by commas. + + --p2p.p2pStoreMapSizeKb ($P2P_STORE_MAP_SIZE_KB) + The maximum possible size of the P2P DB in KB. Overwrites the general dataStoreMapSizeKb. + + --p2p.txPublicSetupAllowList ($TX_PUBLIC_SETUP_ALLOWLIST) + The list of functions calls allowed to run in setup + + --p2p.maxTxPoolSize (default: 100000000) ($P2P_MAX_TX_POOL_SIZE) + The maximum cumulative tx size of pending txs (in bytes) before evicting lower priority txs. + + --p2p.txPoolOverflowFactor (default: 1.1) ($P2P_TX_POOL_OVERFLOW_FACTOR) + How much the tx pool can overflow before it starts evicting txs. Must be greater than 1 + + --p2p.seenMessageCacheSize (default: 100000) ($P2P_SEEN_MSG_CACHE_SIZE) + The number of messages to keep in the seen message cache + + --p2p.p2pDisableStatusHandshake ($P2P_DISABLE_STATUS_HANDSHAKE) + True to disable the status handshake on peer connected. + + --p2p.p2pAllowOnlyValidators ($P2P_ALLOW_ONLY_VALIDATORS) + True to only permit validators to connect. + + --p2p.p2pMaxFailedAuthAttemptsAllowed (default: 3) ($P2P_MAX_AUTH_FAILED_ATTEMPTS_ALLOWED) + Number of auth attempts to allow before peer is banned. Number is inclusive + + --p2p.dropTransactions ($P2P_DROP_TX) + True to simulate discarding transactions. - For testing purposes only + + --p2p.dropTransactionsProbability ($P2P_DROP_TX_CHANCE) + The probability that a transaction is discarded. - For testing purposes only + + --p2p.disableTransactions ($TRANSACTIONS_DISABLED) + Whether transactions are disabled for this node. This means transactions will be rejected at the RPC and P2P layers. + + --p2p.txPoolDeleteTxsAfterReorg ($P2P_TX_POOL_DELETE_TXS_AFTER_REORG) + Whether to delete transactions from the pool after a reorg instead of moving them back to pending. + + --p2p.overallRequestTimeoutMs (default: 10000) ($P2P_REQRESP_OVERALL_REQUEST_TIMEOUT_MS) + The overall timeout for a request response operation. + + --p2p.individualRequestTimeoutMs (default: 10000) ($P2P_REQRESP_INDIVIDUAL_REQUEST_TIMEOUT_MS) + The timeout for an individual request response peer interaction. + + --p2p.dialTimeoutMs (default: 5000) ($P2P_REQRESP_DIAL_TIMEOUT_MS) + How long to wait for the dial protocol to establish a connection + + --p2p.p2pOptimisticNegotiation ($P2P_REQRESP_OPTIMISTIC_NEGOTIATION) + Whether to use optimistic protocol negotiation when dialing to another peer (opposite of `negotiateFully`). + + --p2p.txCollectionFastNodesTimeoutBeforeReqRespMs (default: 200) ($TX_COLLECTION_FAST_NODES_TIMEOUT_BEFORE_REQ_RESP_MS) + How long to wait before starting reqresp for fast collection + + --p2p.txCollectionSlowNodesIntervalMs (default: 12000) ($TX_COLLECTION_SLOW_NODES_INTERVAL_MS) + How often to collect from configured nodes in the slow collection loop + + --p2p.txCollectionSlowReqRespIntervalMs (default: 12000) ($TX_COLLECTION_SLOW_REQ_RESP_INTERVAL_MS) + How often to collect from peers via reqresp in the slow collection loop + + --p2p.txCollectionSlowReqRespTimeoutMs (default: 20000) ($TX_COLLECTION_SLOW_REQ_RESP_TIMEOUT_MS) + How long to wait for a reqresp response during slow collection + + --p2p.txCollectionReconcileIntervalMs (default: 60000) ($TX_COLLECTION_RECONCILE_INTERVAL_MS) + How often to reconcile found txs from the tx pool + + --p2p.txCollectionDisableSlowDuringFastRequests (default: true) ($TX_COLLECTION_DISABLE_SLOW_DURING_FAST_REQUESTS) + Whether to disable the slow collection loop if we are dealing with any immediate requests + + --p2p.txCollectionFastNodeIntervalMs (default: 500) ($TX_COLLECTION_FAST_NODE_INTERVAL_MS) + How many ms to wait between retried request to a node via RPC during fast collection + + --p2p.txCollectionNodeRpcUrls (default: ) ($TX_COLLECTION_NODE_RPC_URLS) + A comma-separated list of Aztec node RPC URLs to use for tx collection + + --p2p.txCollectionFastMaxParallelRequestsPerNode (default: 4) ($TX_COLLECTION_FAST_MAX_PARALLEL_REQUESTS_PER_NODE) + Maximum number of parallel requests to make to a node during fast collection + + --p2p.txCollectionNodeRpcMaxBatchSize (default: 50) ($TX_COLLECTION_NODE_RPC_MAX_BATCH_SIZE) + Maximum number of transactions to request from a node in a single batch + + P2P BOOTSTRAP + + --p2p-bootstrap + Starts Aztec P2P Bootstrap with options + + --p2pBootstrap.p2pBroadcastPort ($P2P_BROADCAST_PORT) + The port to broadcast the P2P service on (included in the node's ENR). Defaults to P2P_PORT. + + --p2pBootstrap.peerIdPrivateKeyPath ($PEER_ID_PRIVATE_KEY_PATH) + An optional path to store generated peer id private keys. If blank, will default to storing any generated keys in the root of the data directory. + + TELEMETRY + + --tel.metricsCollectorUrl ($OTEL_EXPORTER_OTLP_METRICS_ENDPOINT) + The URL of the telemetry collector for metrics + + --tel.tracesCollectorUrl ($OTEL_EXPORTER_OTLP_TRACES_ENDPOINT) + The URL of the telemetry collector for traces + + --tel.logsCollectorUrl ($OTEL_EXPORTER_OTLP_LOGS_ENDPOINT) + The URL of the telemetry collector for logs + + --tel.otelCollectIntervalMs (default: 60000) ($OTEL_COLLECT_INTERVAL_MS) + The interval at which to collect metrics + + --tel.otelExportTimeoutMs (default: 30000) ($OTEL_EXPORT_TIMEOUT_MS) + The timeout for exporting metrics + + --tel.otelExcludeMetrics (default: ) ($OTEL_EXCLUDE_METRICS) + A list of metric prefixes to exclude from export + + --tel.publicMetricsCollectorUrl ($PUBLIC_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT) + A URL to publish a subset of metrics for public consumption + + --tel.publicMetricsCollectFrom (default: ) ($PUBLIC_OTEL_COLLECT_FROM) + The role types to collect metrics from + + --tel.publicIncludeMetrics (default: ) ($PUBLIC_OTEL_INCLUDE_METRICS) + A list of metric prefixes to publicly export + + --tel.publicMetricsOptOut ($PUBLIC_OTEL_OPT_OUT) + Whether to opt out of sharing optional telemetry + + BOT + + --bot + Starts Aztec Bot with options + + --bot.nodeUrl ($AZTEC_NODE_URL) + The URL to the Aztec node to check for tx pool status. + + --bot.nodeAdminUrl ($AZTEC_NODE_ADMIN_URL) + The URL to the Aztec node admin API to force-flush txs if configured. + + --bot.l1Mnemonic ($BOT_L1_MNEMONIC) + The mnemonic for the account to bridge fee juice from L1. + + --bot.l1PrivateKey ($BOT_L1_PRIVATE_KEY) + The private key for the account to bridge fee juice from L1. + + --bot.l1ToL2MessageTimeoutSeconds (default: 3600) ($BOT_L1_TO_L2_TIMEOUT_SECONDS) + How long to wait for L1 to L2 messages to become available on L2 + + --bot.senderPrivateKey ($BOT_PRIVATE_KEY) + Signing private key for the sender account. + + --bot.senderSalt ($BOT_ACCOUNT_SALT) + The salt to use to deploy the sender account. + + --bot.tokenSalt (default: 0x0000000000000000000000000000000000000000000000000000000000000001)($BOT_TOKEN_SALT) + The salt to use to deploy the token contract. + + --bot.txIntervalSeconds (default: 60) ($BOT_TX_INTERVAL_SECONDS) + Every how many seconds should a new tx be sent. + + --bot.privateTransfersPerTx (default: 1) ($BOT_PRIVATE_TRANSFERS_PER_TX) + How many private token transfers are executed per tx. + + --bot.publicTransfersPerTx (default: 1) ($BOT_PUBLIC_TRANSFERS_PER_TX) + How many public token transfers are executed per tx. + + --bot.feePaymentMethod (default: fee_juice) ($BOT_FEE_PAYMENT_METHOD) + How to handle fee payments. (Options: fee_juice) + + --bot.noStart ($BOT_NO_START) + True to not automatically setup or start the bot on initialization. + + --bot.txMinedWaitSeconds (default: 180) ($BOT_TX_MINED_WAIT_SECONDS) + How long to wait for a tx to be mined before reporting an error. + + --bot.followChain (default: NONE) ($BOT_FOLLOW_CHAIN) + Which chain the bot follows + + --bot.maxPendingTxs (default: 128) ($BOT_MAX_PENDING_TXS) + Do not send a tx if the node's tx pool already has this many pending txs. + + --bot.flushSetupTransactions ($BOT_FLUSH_SETUP_TRANSACTIONS) + Make a request for the sequencer to build a block after each setup transaction. + + --bot.l2GasLimit ($BOT_L2_GAS_LIMIT) + L2 gas limit for the tx (empty to have the bot trigger an estimate gas). + + --bot.daGasLimit ($BOT_DA_GAS_LIMIT) + DA gas limit for the tx (empty to have the bot trigger an estimate gas). + + --bot.contract (default: TokenContract) ($BOT_TOKEN_CONTRACT) + Token contract to use + + --bot.maxConsecutiveErrors ($BOT_MAX_CONSECUTIVE_ERRORS) + The maximum number of consecutive errors before the bot shuts down + + --bot.stopWhenUnhealthy ($BOT_STOP_WHEN_UNHEALTHY) + Stops the bot if service becomes unhealthy + + --bot.ammTxs ($BOT_AMM_TXS) + Deploy an AMM and send swaps to it + + PXE + + --pxe + Starts Aztec PXE with options + + --pxe.l2BlockBatchSize (default: 50) ($PXE_L2_BLOCK_BATCH_SIZE) + Maximum amount of blocks to pull from the stream in one request when synchronizing + + --pxe.bbBinaryPath ($BB_BINARY_PATH) + Path to the BB binary + + --pxe.bbWorkingDirectory ($BB_WORKING_DIRECTORY) + Working directory for the BB binary + + --pxe.bbSkipCleanup ($BB_SKIP_CLEANUP) + True to skip cleanup of temporary files for debugging purposes + + --pxe.proverEnabled (default: true) ($PXE_PROVER_ENABLED) + Enable real proofs + + --pxe.nodeUrl ($AZTEC_NODE_URL) + Custom Aztec Node URL to connect to + + TXE + + --txe + Starts Aztec TXE with options +``` diff --git a/docs/network_versioned_docs/version-v3.0.2/reference/ethereum_rpc_reference.md b/docs/network_versioned_docs/version-v3.0.2/reference/ethereum_rpc_reference.md new file mode 100644 index 000000000000..cc8b63b17cdd --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/reference/ethereum_rpc_reference.md @@ -0,0 +1,311 @@ +--- +id: ethereum_rpc_reference +sidebar_position: 3 +title: Ethereum RPC call reference +description: A comprehensive reference of Ethereum RPC calls used by different Aztec node components, including archiver, sequencer, prover, and slasher nodes. +--- + +This guide provides a comprehensive reference of Ethereum RPC calls used by different Aztec node components. Understanding these calls helps with infrastructure planning, monitoring, and debugging. + +## Prerequisites + +Before proceeding, you should: + +- Understand how Aztec nodes interact with Ethereum L1 +- Be familiar with Ethereum JSON-RPC API specifications +- Have basic knowledge of the viem library (Aztec's Ethereum client library) + +## Overview + +Aztec nodes interact with Ethereum L1 through the [viem](https://viem.sh) library, which provides a type-safe interface to Ethereum JSON-RPC methods. Different node components make different RPC calls based on their responsibilities: + +- **Archiver**: Monitors L1 for new blocks and events +- **Sequencer**: Proposes blocks and submits them to L1 +- **Prover**: Submits proofs to L1 +- **Validator**: Reads L1 state for validation +- **Slasher**: Monitors for misbehavior and submits slashing payloads + +## RPC call mapping + +This table shows the Ethereum JSON-RPC calls used by Aztec nodes: + +| Ethereum RPC Call | Description | +|------------------|-------------| +| `eth_getBlockByNumber` | Retrieve block information | +| `eth_blockNumber` | Get latest block number | +| `eth_getTransactionByHash` | Get transaction details | +| `eth_getTransactionReceipt` | Get transaction receipt | +| `eth_getTransactionCount` | Get account nonce | +| `eth_getLogs` | Retrieve event logs | +| `eth_getBalance` | Get account ETH balance | +| `eth_getCode` | Get contract bytecode | +| `eth_getStorageAt` | Read contract storage slot | +| `eth_chainId` | Get chain identifier | +| `eth_estimateGas` | Estimate gas for transaction | +| `eth_call` | Execute read-only call | +| `eth_sendRawTransaction` | Broadcast signed transaction | +| `eth_gasPrice` | Get current gas price | +| `eth_maxPriorityFeePerGas` | Get priority fee (EIP-1559) | + +## Archiver node + +The archiver continuously monitors L1 for new blocks and retrieves historical data. + +### Block retrieval + +**Purpose**: Sync L2 block data published to L1 + +**RPC calls used**: +- `eth_blockNumber` - Get latest L1 block number +- `eth_getLogs` - Retrieve rollup contract events +- `eth_getBlockByNumber` - Get block timestamps and metadata + +**Example RPC calls**: +```json +// eth_blockNumber +{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1} + +// eth_getLogs +{"jsonrpc":"2.0","method":"eth_getLogs","params":[{ + "fromBlock":"0x100", + "toBlock":"0x200", + "address":"0x...", + "topics":["0x..."] +}],"id":2} + +// eth_getBlockByNumber +{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x100",false],"id":3} +``` + +### L1 to L2 message retrieval + +**Purpose**: Track messages sent from L1 to L2 + +**RPC calls used**: +- `eth_getLogs` - Retrieve `MessageSent` events from Inbox contract + +### Contract event monitoring + +**Purpose**: Monitor contract deployments and updates + +**RPC calls used**: +- `eth_getLogs` - Retrieve events from ClassRegistry and InstanceRegistry + +**Events monitored**: +- `ContractClassPublished` +- `ContractInstancePublished` +- `ContractInstanceUpdated` +- `PrivateFunctionBroadcasted` +- `UtilityFunctionBroadcasted` + +## Sequencer node + +Sequencers propose blocks and submit them to L1, they also read L1 state to validate blocks and participate in consensus. + +### Transaction broadcasting + +**Purpose**: Submit block proposals to L1 + +**RPC calls used**: +- `eth_getTransactionCount` - Get nonce for sender account +- `eth_estimateGas` - Estimate gas for proposal transaction +- `eth_sendRawTransaction` - Broadcast signed transaction +- `eth_getTransactionReceipt` - Verify transaction inclusion + +**Example RPC calls**: +```json +// eth_getTransactionCount +{"jsonrpc":"2.0","method":"eth_getTransactionCount","params":["0x...","latest"],"id":1} + +// eth_estimateGas +{"jsonrpc":"2.0","method":"eth_estimateGas","params":[{ + "from":"0x...", + "to":"0x...", + "data":"0x..." +}],"id":2} + +// eth_sendRawTransaction +{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params":["0x..."],"id":3} + +// eth_getTransactionReceipt +{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0x..."],"id":4} +``` + +### State reading + +**Purpose**: Read rollup state and validate proposals + +**RPC calls used**: +- `eth_call` - Read contract state +- `eth_getStorageAt` - Read specific storage slots +- `eth_blockNumber` - Get current L1 block for validation context +- `eth_getBlockByNumber` - Get block timestamps + +**Example RPC calls**: +```json +// eth_call +{"jsonrpc":"2.0","method":"eth_call","params":[{ + "to":"0x...", + "data":"0x..." +},"latest"],"id":1} + +// eth_getStorageAt +{"jsonrpc":"2.0","method":"eth_getStorageAt","params":["0x...","0x0","latest"],"id":2} +``` + +### Gas management + +**Purpose**: Monitor gas prices and publisher account balances + +**RPC calls used**: +- `eth_getBalance` - Check publisher account balance +- `eth_gasPrice` / `eth_maxPriorityFeePerGas` - Get current gas prices + +### Block simulation + +**Purpose**: Validate block proposals before submission + +**RPC calls used**: +- `eth_call` - Simulate contract call to validate proposals + +## Prover node + +The prover submits validity proofs to L1. + +### Proof submission + +**Purpose**: Submit epoch proofs to the Rollup contract + +**RPC calls used**: +- `eth_getTransactionCount` - Get nonce for prover publisher +- `eth_estimateGas` - Estimate gas for proof submission +- `eth_sendRawTransaction` - Broadcast proof transaction +- `eth_getTransactionReceipt` - Confirm proof inclusion + +**Note**: Uses the same transaction flow as sequencer broadcasting + +### Chain state monitoring + +**Purpose**: Track L1 state for attestation validation + +**RPC calls used**: +- `eth_getBlockByNumber` - Get L1 timestamps for epoch calculations +- `eth_chainId` - Verify connected to correct chain + +## Slasher node + +The slasher monitors for validator misbehavior and submits slashing payloads. + +### Misbehavior detection + +**Purpose**: Monitor for slashable offenses and create slash payloads + +**RPC calls used**: +- `eth_getLogs` - Retrieve rollup events for analysis +- `eth_getBlockByNumber` - Get block timestamps for slashing proofs +- `eth_call` - Read validator state + +### Slashing payload submission + +**Purpose**: Submit slash payloads to L1 + +**RPC calls used**: +- `eth_getTransactionCount` - Get nonce for slasher account +- `eth_sendRawTransaction` - Broadcast slashing transaction +- `eth_getTransactionReceipt` - Verify slash transaction inclusion + +**Note**: Uses the same transaction flow as sequencer broadcasting + +## Shared infrastructure + +Aztec provides shared transaction management utilities for all components that submit to L1. + +### Core functionality + +**RPC calls used**: +- `eth_getTransactionCount` - Nonce management +- `eth_estimateGas` - Gas estimation +- `eth_gasPrice` / `eth_maxPriorityFeePerGas` - Gas pricing (EIP-1559) +- `eth_sendRawTransaction` - Transaction broadcasting +- `eth_getTransactionReceipt` - Transaction status checking +- `eth_getTransactionByHash` - Transaction lookup for replacement +- `eth_getBlockByNumber` - Block timestamp for timeout checks +- `eth_getBalance` - Publisher balance monitoring + +### Transaction lifecycle + +1. **Preparation**: Estimate gas and get gas price +2. **Nonce management**: Get and track nonce via `NonceManager` +3. **Signing**: Sign transaction with keystore +4. **Broadcasting**: Send via `eth_sendRawTransaction` +5. **Monitoring**: Poll with `eth_getTransactionReceipt` +6. **Replacement**: Replace stuck transactions if needed +7. **Cancellation**: Send zero-value transaction to cancel + +## RPC endpoint configuration + +### Environment variables + +Configure L1 RPC endpoints using: + +```bash +# Single endpoint +ETHEREUM_HOSTS=https://eth-mainnet.example.com + +# Multiple endpoints (fallback) +ETHEREUM_HOSTS=https://eth-mainnet-1.example.com,https://eth-mainnet-2.example.com + +# Consensus endpoints for archiver +L1_CONSENSUS_HOST_URLS=https://beacon-node.example.com +``` + +### Fallback configuration + +Aztec automatically retries failed requests on alternative endpoints when multiple RPC URLs are configured. This provides reliability and redundancy for critical operations. + +## Monitoring and debugging + +### RPC call logging + +Enable detailed RPC logging: + +```bash +LOG_LEVEL=debug # or verbose +``` + +Look for log entries related to: +- Transaction lifecycle and nonce management +- Block sync and event retrieval +- Block proposal submissions +- Contract interactions + +### Common issues + +**Issue**: `eth_getLogs` query exceeds limits + +**Solution**: +- Reduce block range in queries +- Use archive node with higher limits +- Implement chunked log retrieval + +**Issue**: Transaction replacement failures + +**Solution**: +- Ensure `eth_getTransactionCount` returns consistent nonces +- Configure appropriate gas price bumps +- Monitor transaction pool status + +**Issue**: Stale state reads + +**Solution**: +- Use specific block tags (not `latest`) +- Disable caching with `cacheTime: 0` +- Ensure RPC node is fully synced + +## Next steps + +- Review [How to Run a Sequencer Node](../setup/sequencer_management) for operational guidance +- Learn about [High Availability Sequencers](../setup/high_availability_sequencers.md) for production redundancy configurations +- Explore [Advanced Keystore Patterns](../operation/keystore/advanced_patterns.md) for complex key management +- Check [Useful Commands](../operation/sequencer_management/useful_commands.md) for monitoring tools +- Join the [Aztec Discord](https://discord.gg/aztec) for infrastructure support diff --git a/docs/network_versioned_docs/version-v3.0.2/reference/glossary.md b/docs/network_versioned_docs/version-v3.0.2/reference/glossary.md new file mode 100644 index 000000000000..06e80897d937 --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/reference/glossary.md @@ -0,0 +1,295 @@ +--- +id: glossary +sidebar_position: 4 +title: Glossary +description: A comprehensive glossary of terms used throughout the Aztec network documentation, covering node operations, consensus, cryptography, and infrastructure concepts. +--- + +This glossary defines key terms used throughout the Aztec network documentation. Terms are organized alphabetically with cross-references to related concepts. + +## A + +### Agent + +See [Prover Agent](#prover-agent). + +### Archiver + +A component that monitors Ethereum L1 for rollup events and synchronizes L2 state. The archiver retrieves block data, contract deployments, and L1-to-L2 messages from the data availability layer. + +### Attestation + +A cryptographic signature from a sequencer committee member confirming the validity of a proposed block. Blocks require attestations from two-thirds of the committee plus one before submission to L1. + +### Attester + +The identity of a sequencer node in the network. The Ethereum address derived from the attester private key uniquely identifies the sequencer and is used to sign block proposals and attestations. + +## B + +### BIP44 + +Bitcoin Improvement Proposal 44 defines a standard derivation path for hierarchical deterministic wallets. Aztec uses BIP44 to derive multiple Ethereum addresses from a single mnemonic seed phrase. + +### Block Proposal + +A candidate block assembled by a sequencer containing ordered transactions. Proposals must be validated by the sequencer committee before submission to L1. + +### Bootnode + +A network node that facilitates peer discovery by maintaining lists of active peers. New nodes connect to bootnodes to discover and join the P2P network. + +### Broker + +See [Prover Broker](#prover-broker). + +## C + +### Coinbase + +The Ethereum address that receives L1 rewards and fees for a sequencer. If not specified in the keystore, defaults to the attester address. + +### Committee + +See [Sequencer Committee](#sequencer-committee). + +### Consensus + +The process by which sequencer nodes agree on the validity of proposed blocks through attestations and signatures. + +### Contract Class + +A published smart contract definition containing bytecode and function signatures. Multiple contract instances can be deployed from a single contract class. + +### Contract Instance + +A deployed instance of a contract class with a unique address and storage state. + +## D + +### Data Availability + +The guarantee that block data is accessible to network participants. Aztec publishes data to Ethereum L1 to ensure data availability for state reconstruction. + +### Derivation Path + +A hierarchical path used to derive cryptographic keys from a master seed. Follows the BIP44 standard for deterministic key generation. + +## E + +### EIP-1559 + +Ethereum Improvement Proposal 1559 introduces a base fee mechanism for transaction pricing. Aztec nodes use EIP-1559 gas pricing when submitting transactions to L1. + +### ENR (Ethereum Node Record) + +A signed record containing information about a network node, used for peer discovery in the P2P network. Bootnodes share their ENR for other nodes to connect. + +### Epoch + +A period of multiple L2 blocks that are proven together. Prover nodes generate a single validity proof for an entire epoch and submit it to the rollup contract. + +### Execution Layer + +The Ethereum L1 execution client (e.g., Geth, Nethermind) that processes transactions. Aztec nodes require access to an execution layer RPC endpoint. + +## F + +### Fee Recipient + +The Aztec address that receives unburnt transaction fees from blocks produced by a sequencer. Must be a deployed Aztec account. + +### Full Node + +A node that maintains a complete copy of the Aztec blockchain state and provides RPC interfaces for users to interact with the network without relying on third parties. + +## G + +### Gas Estimation + +The process of calculating the expected gas cost for an Ethereum transaction before submission. Aztec nodes estimate gas for L1 transactions like block proposals and proof submissions. + +## I + +### Inbox + +The L1 contract that receives messages sent from Ethereum to Aztec L2. The archiver monitors the Inbox for new L1-to-L2 messages. + +## J + +### JSON V3 Keystore + +An Ethereum standard for encrypted key storage using AES-128-CTR encryption and scrypt key derivation. Aztec supports JSON V3 keystores for secure key management. + +## K + +### Keystore + +A configuration file or encrypted store containing private keys for sequencer operations. Keystores define attester keys, publisher keys, coinbase addresses, and fee recipients. + +## L + +### L1 (Layer 1) + +Ethereum mainnet or testnet, serving as the base layer for Aztec's rollup. L1 provides data availability, settlement, and consensus for the L2. + +### L2 (Layer 2) + +The Aztec network, a rollup scaling solution built on top of Ethereum L1. L2 processes transactions offchain and submits validity proofs to L1. + +### L1 Sync + +A synchronization mode where nodes reconstruct state by querying the rollup contract and data availability layer on Ethereum L1 directly. + +## M + +### Mempool + +The pool of unprocessed transactions waiting to be included in a block. Sequencers select transactions from the mempool when proposing blocks. + +### Merkle Tree + +A cryptographic data structure that enables efficient verification of data integrity and membership. Aztec uses Merkle trees for state commitments, note storage, and nullifier tracking. + +### Mnemonic + +A human-readable seed phrase (typically 12 or 24 words) used to generate deterministic cryptographic keys. Follows BIP39 standard for encoding. + +## N + +### Node + +A participant in the Aztec network. See [Full Node](#full-node), [Sequencer Node](#sequencer-node), [Prover Node](#prover-node), or [Bootnode](#bootnode). + +### Nonce + +A sequential number used to order transactions from an Ethereum account. Aztec nodes manage nonces when submitting transactions to L1. + +### Note Tree + +A Merkle tree containing encrypted notes representing private state in Aztec contracts. + +### Nullifier + +A unique value that marks a note as consumed, preventing double-spending. Nullifiers are published to L1 and tracked in the nullifier tree. + +## O + +### Outbox + +The L1 contract that receives messages sent from Aztec L2 to Ethereum. Used for withdrawals and cross-chain communication. + +## P + +### P2P (Peer-to-Peer) + +The network protocol used by Aztec nodes to discover peers, exchange transactions, and propagate blocks without central coordination. + +### Proof-of-Stake + +The consensus mechanism where sequencers lock collateral (stake) to participate in block production. Misbehavior results in stake slashing. + +### Prover Agent + +A stateless worker that executes proof generation jobs. Multiple agents can run in parallel to distribute proving workload. + +### Prover Broker + +A coordinator that manages the prover job queue, distributing work to agents and collecting results. + +### Prover Node + +Infrastructure that generates validity proofs for epochs of L2 blocks. Consists of a prover node coordinator, broker, and one or more agents. + +### Publisher + +The Ethereum account used by a sequencer to submit block proposals to L1. Must be funded with ETH to pay gas fees. If not specified, the attester key is used. + +### PXE (Private Execution Environment) + +The client-side component that executes private functions, manages user keys, and constructs privacy-preserving transactions. + +## R + +### Registry + +The L1 contract that tracks deployed contract classes and instances. The archiver monitors Registry events to maintain a database of available contracts. + +### Remote Signer + +An external service (e.g., Web3Signer) that stores private keys and signs transactions remotely. Used for enhanced security in production deployments. + +### Rollup + +A scaling solution that processes transactions offchain and submits compressed data and validity proofs to L1. Aztec is a zkRollup with privacy features. + +### RPC (Remote Procedure Call) + +A protocol for remote communication. Aztec nodes expose JSON-RPC interfaces for client interaction and use RPC to communicate with Ethereum L1. + +## S + +### Sequencer Committee + +A rotating group of validators responsible for validating proposed blocks through attestations during a specific time period. + +### Sequencer Node + +A validator that assembles transactions into blocks, executes public functions, and participates in consensus through attestations. + +### Slashing + +The penalty mechanism that reduces or confiscates a sequencer's stake for provable misbehavior such as double-signing or prolonged downtime. + +### Slasher Node + +Infrastructure that monitors for validator misbehavior and submits slashing payloads to L1 when violations are detected. + +### Snapshot + +A pre-built database containing blockchain state at a specific block height. Nodes can download snapshots for faster synchronization. + +### Snapshot Sync + +A synchronization mode where nodes download pre-built state snapshots instead of reconstructing state from L1. Significantly faster than L1 sync. + +### Stake + +Collateral locked by a sequencer to participate in block production. Higher stake increases selection probability as block proposer. + +### State Tree + +A Merkle tree representing the current world state of all Aztec contracts and accounts. + +## T + +### Transaction Receipt + +A record of a transaction's execution on Ethereum, including status, gas used, and emitted events. Aztec nodes poll for receipts to confirm L1 transaction inclusion. + +## V + +### Validator + +See [Sequencer Node](#sequencer-node). The terms are used interchangeably in Aztec documentation. + +### Viem + +A TypeScript library providing type-safe interfaces to Ethereum JSON-RPC methods. Aztec nodes use viem for all L1 interactions. + +## W + +### Web3Signer + +An open-source remote signing service that stores keys securely and provides signing APIs. Commonly used for production sequencer deployments. + +### World State + +The complete state of the Aztec network at a given block height, including all contract storage, notes, and nullifiers. + +## Related Resources + +- [Node API Reference](./node_api_reference.md) - Complete API documentation for node JSON-RPC methods +- [Ethereum RPC Reference](./ethereum_rpc_reference.md) - L1 RPC calls used by Aztec components +- [Advanced Keystore Guide](../operation/keystore/index.md) - Detailed keystore configuration options +- [CLI Reference](./cli_reference.md) - Complete command-line interface documentation diff --git a/docs/network_versioned_docs/version-v3.0.2/reference/node_api_reference.md b/docs/network_versioned_docs/version-v3.0.2/reference/node_api_reference.md new file mode 100644 index 000000000000..cc7f2422d22a --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/reference/node_api_reference.md @@ -0,0 +1,1050 @@ +--- +id: node_api_reference +sidebar_position: 2 +title: Node JSON RPC API reference +description: Complete reference for the Aztec Node JSON RPC API, including block queries, transaction submission, world state access, and administrative operations. +references: ["yarn-project/stdlib/src/interfaces/aztec-node.ts"] +--- + +This document provides a complete reference for the Aztec Node JSON RPC API. All methods are exposed via JSON RPC on the node's configured ports. + +## API endpoint + +**Public RPC URL**: `http://localhost:8080` + +**Admin URL**: `http://localhost:8880` + +Note that the above ports are only defaults, and can be modified by setting `--port` and `--admin-port` flags upon startup. + +All methods use standard JSON RPC 2.0 format with methods prefixed by `node_` or `nodeAdmin_`. + +## Block queries + +### node_getBlockNumber + +Returns the latest block number synchronized by the node. + +**Parameters**: None + +**Returns**: `number` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getBlockNumber","params":[],"id":1}' +``` + +### node_getProvenBlockNumber + +Returns the latest proven block number. + +**Parameters**: None + +**Returns**: `number` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getProvenBlockNumber","params":[],"id":1}' +``` + +### node_getL2Tips + +Returns the tips of the L2 chain (latest, pending, proven). + +**Parameters**: None + +**Returns**: Object containing `latest`, `pending`, and `proven` block info + +**Example**: +```bash +curl -s -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getL2Tips","params":[],"id":67}' \ + | jq -r ".result.proven.number" +``` + +### node_getBlock + +Gets a block by its number. + +**Parameters**: +1. `blockNumber` - `number | "latest"` - Block number or "latest" + +**Returns**: `L2Block | null` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getBlock","params":[12345],"id":1}' +``` + +### node_getBlocks + +Gets multiple blocks in a range. + +**Parameters**: +1. `from` - `number` - Starting block number (≥ 1) +2. `limit` - `number` - Max blocks to return (1-100) + +**Returns**: `L2Block[]` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getBlocks","params":[100,50],"id":1}' +``` + +### node_getBlockHeader + +Gets a block header. + +**Parameters**: +1. `blockNumber` - `number | "latest" | undefined` - Block number or omit for latest + +**Returns**: `BlockHeader | null` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getBlockHeader","params":["latest"],"id":1}' +``` + +## Transaction operations + +### node_sendTx + +Submits a transaction to the P2P mempool. + +**Parameters**: +1. `tx` - `Tx` - The transaction object + +**Returns**: `void` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_sendTx","params":[{"data":"0x..."}],"id":1}' +``` + +### node_getTxReceipt + +Gets a transaction receipt. + +**Parameters**: +1. `txHash` - `string` - Transaction hash (32-byte hex) + +**Returns**: `TxReceipt` - Receipt with status (mined, pending, or dropped) + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getTxReceipt","params":["0x1234..."],"id":1}' +``` + +### node_getTxEffect + +Gets the transaction effect for a given transaction. + +**Parameters**: +1. `txHash` - `string` - Transaction hash + +**Returns**: `IndexedTxEffect | null` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getTxEffect","params":["0x1234..."],"id":1}' +``` + +### node_getTxByHash + +Gets a single pending transaction by hash. + +**Parameters**: +1. `txHash` - `string` - Transaction hash + +**Returns**: `Tx | null` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getTxByHash","params":["0x1234..."],"id":1}' +``` + +### node_getPendingTxs + +Gets pending transactions from the mempool. + +**Parameters**: +1. `limit` - `number | undefined` - Max txs to return (1-100, default: 100) +2. `after` - `string | undefined` - Return txs after this tx hash + +**Returns**: `Tx[]` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getPendingTxs","params":[50],"id":1}' +``` + +### node_getPendingTxCount + +Gets the count of pending transactions. + +**Parameters**: None + +**Returns**: `number` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getPendingTxCount","params":[],"id":1}' +``` + +### node_isValidTx + +Validates a transaction for correctness. + +**Parameters**: +1. `tx` - `Tx` - Transaction to validate +2. `options` - `object | undefined` - Options: `isSimulation`, `skipFeeEnforcement` + +**Returns**: `TxValidationResult` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_isValidTx","params":[{"data":"0x..."},{"isSimulation":true}],"id":1}' +``` + +### node_simulatePublicCalls + +Simulates the public part of a transaction. + +**Parameters**: +1. `tx` - `Tx` - Transaction to simulate +2. `skipFeeEnforcement` - `boolean | undefined` - Skip fee enforcement + +**Returns**: `PublicSimulationOutput` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_simulatePublicCalls","params":[{"data":"0x..."},false],"id":1}' +``` + +## State queries + +### node_getPublicStorageAt + +Gets public storage value at a contract slot. + +**Parameters**: +1. `blockNumber` - `number | "latest"` - Block number +2. `contract` - `string` - Contract address (32-byte hex) +3. `slot` - `string` - Storage slot (32-byte hex) + +**Returns**: `string` - Storage value (32-byte hex) + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getPublicStorageAt","params":["latest","0x1234...","0x0000..."],"id":1}' +``` + +### node_getWorldStateSyncStatus + +Gets the sync status of the node's world state. + +**Parameters**: None + +**Returns**: `WorldStateSyncStatus` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getWorldStateSyncStatus","params":[],"id":1}' +``` + +## Merkle tree queries + +### node_findLeavesIndexes + +Finds indexes of leaves in a merkle tree. + +**Parameters**: +1. `blockNumber` - `number | "latest"` - Block number +2. `treeId` - `number` - Tree ID (0-6) +3. `leafValues` - `string[]` - Leaf values (max 1000, 32-byte hex each) + +**Tree IDs**: +- `0` - NULLIFIER_TREE +- `1` - NOTE_HASH_TREE +- `2` - PUBLIC_DATA_TREE +- `3` - L1_TO_L2_MESSAGE_TREE +- `4` - ARCHIVE +- `5` - BLOCKS_TREE + +**Returns**: Array of leaf indexes with block metadata + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_findLeavesIndexes","params":["latest",1,["0x1234...","0x5678..."]],"id":1}' +``` + +### node_getNullifierSiblingPath + +Gets sibling path for a nullifier tree leaf. + +**Parameters**: +1. `blockNumber` - `number | "latest"` - Block number +2. `leafIndex` - `string` - Leaf index (bigint as string) + +**Returns**: `string[]` - Sibling path + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getNullifierSiblingPath","params":[12345,"100"],"id":1}' +``` + +### node_getNoteHashSiblingPath + +Gets sibling path for a note hash tree leaf. + +**Parameters**: +1. `blockNumber` - `number | "latest"` - Block number +2. `leafIndex` - `string` - Leaf index (bigint as string) + +**Returns**: `string[]` - Sibling path + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getNoteHashSiblingPath","params":["latest","100"],"id":1}' +``` + +### node_getArchiveSiblingPath + +Gets sibling path for an archive tree leaf. + +**Parameters**: +1. `blockNumber` - `number | "latest"` - Block number +2. `leafIndex` - `string` - Leaf index (bigint as string) + +**Returns**: `string[]` - Sibling path + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getArchiveSiblingPath","params":[12345,"50"],"id":1}' +``` + +### node_getPublicDataSiblingPath + +Gets sibling path for a public data tree leaf. + +**Parameters**: +1. `blockNumber` - `number | "latest"` - Block number +2. `leafIndex` - `string` - Leaf index (bigint as string) + +**Returns**: `string[]` - Sibling path + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getPublicDataSiblingPath","params":["latest","200"],"id":1}' +``` + +## Membership witnesses + +### node_getNullifierMembershipWitness + +Gets a nullifier membership witness. + +**Parameters**: +1. `blockNumber` - `number | "latest"` - Block number +2. `nullifier` - `string` - Nullifier value (32-byte hex) + +**Returns**: `NullifierMembershipWitness | null` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getNullifierMembershipWitness","params":[12345,"0x1234..."],"id":1}' +``` + +### node_getLowNullifierMembershipWitness + +Gets a low nullifier membership witness for non-inclusion proofs. + +**Parameters**: +1. `blockNumber` - `number | "latest"` - Block number +2. `nullifier` - `string` - Nullifier value (32-byte hex) + +**Returns**: `NullifierMembershipWitness | null` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getLowNullifierMembershipWitness","params":["latest","0x1234..."],"id":1}' +``` + +### node_getPublicDataWitness + +Gets a public data tree witness for a leaf slot. + +**Parameters**: +1. `blockNumber` - `number | "latest"` - Block number +2. `leafSlot` - `string` - Leaf slot (32-byte hex) + +**Returns**: `PublicDataWitness | null` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getPublicDataWitness","params":[12345,"0x0000..."],"id":1}' +``` + +### node_getArchiveMembershipWitness + +Gets archive tree membership witness. + +**Parameters**: +1. `blockNumber` - `number | "latest"` - Block number +2. `archive` - `string` - Archive leaf value (32-byte hex) + +**Returns**: `MembershipWitness | null` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getArchiveMembershipWitness","params":[12345,"0x1234..."],"id":1}' +``` + +### node_getNoteHashMembershipWitness + +Gets note hash tree membership witness. + +**Parameters**: +1. `blockNumber` - `number | "latest"` - Block number +2. `noteHash` - `string` - Note hash value (32-byte hex) + +**Returns**: `MembershipWitness | null` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getNoteHashMembershipWitness","params":["latest","0x1234..."],"id":1}' +``` + +## L1 to L2 messages + +### node_getL1ToL2MessageMembershipWitness + +Gets L1 to L2 message membership witness. + +**Parameters**: +1. `blockNumber` - `number | "latest"` - Block number +2. `l1ToL2Message` - `string` - L1 to L2 message (32-byte hex) + +**Returns**: `[string, string[]] | null` - Tuple of [index, sibling path] + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getL1ToL2MessageMembershipWitness","params":[12345,"0x1234..."],"id":1}' +``` + +### node_getL1ToL2MessageBlock + +Gets the L2 block number when an L1 to L2 message becomes available. + +**Parameters**: +1. `l1ToL2Message` - `string` - L1 to L2 message (32-byte hex) + +**Returns**: `number | null` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getL1ToL2MessageBlock","params":["0x1234..."],"id":1}' +``` + +### node_isL1ToL2MessageSynced + +Checks if an L1 to L2 message is synced. + +**Parameters**: +1. `l1ToL2Message` - `string` - L1 to L2 message (32-byte hex) + +**Returns**: `boolean` + +**Deprecated**: Use `node_getL1ToL2MessageBlock` instead. + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_isL1ToL2MessageSynced","params":["0x1234..."],"id":1}' +``` + +### node_getL2ToL1Messages + +Gets all L2 to L1 messages in a block. + +**Parameters**: +1. `blockNumber` - `number | "latest"` - Block number + +**Returns**: `string[][] | null` - Array of message arrays + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getL2ToL1Messages","params":[12345],"id":1}' +``` + +## Log queries + +### node_getPrivateLogs + +Gets private logs from a block range. + +**Parameters**: +1. `from` - `number` - Starting block (≥ 1) +2. `limit` - `number` - Number of blocks (max 1000) + +**Returns**: `PrivateLog[]` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getPrivateLogs","params":[100,50],"id":1}' +``` + +### node_getPublicLogs + +Gets public logs based on filter. + +**Parameters**: +1. `filter` - `LogFilter` - Filter object with `fromBlock`, `toBlock`, `contractAddress`, etc. + +**Returns**: `GetPublicLogsResponse` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getPublicLogs","params":[{"fromBlock":100,"toBlock":200}],"id":1}' +``` + +### node_getContractClassLogs + +Gets contract class logs based on filter. + +**Parameters**: +1. `filter` - `LogFilter` - Filter object + +**Returns**: `GetContractClassLogsResponse` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getContractClassLogs","params":[{"fromBlock":100}],"id":1}' +``` + +### node_getLogsByTags + +Gets logs matching specific tags. + +**Parameters**: +1. `tags` - `string[]` - Array of tags (max 1000, 32-byte hex each) +2. `logsPerTag` - `number | undefined` - Max logs per tag (1-10, default: 10) + +**Returns**: `TxScopedL2Log[][]` - For each tag, array of matching logs + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getLogsByTags","params":[["0x1234...","0x5678..."],10],"id":1}' +``` + +## Contract queries + +### node_getContractClass + +Gets a registered contract class by ID. + +**Parameters**: +1. `id` - `string` - Contract class ID (32-byte hex) + +**Returns**: `ContractClassPublic | null` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getContractClass","params":["0x1234..."],"id":1}' +``` + +### node_getContract + +Gets a deployed contract instance by address. + +**Parameters**: +1. `address` - `string` - Contract address (32-byte hex) + +**Returns**: `ContractInstanceWithAddress | null` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getContract","params":["0x1234..."],"id":1}' +``` + +## Node information + +### node_isReady + +Checks if the node is ready to accept transactions. + +**Parameters**: None + +**Returns**: `boolean` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_isReady","params":[],"id":1}' +``` + +### node_getNodeInfo + +Gets information about the node. + +**Parameters**: None + +**Returns**: `NodeInfo` - Node version, protocol version, chain ID, contracts, etc. + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getNodeInfo","params":[],"id":42}' +``` + +### node_getNodeVersion + +Gets the node package version. + +**Parameters**: None + +**Returns**: `string` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getNodeVersion","params":[],"id":1}' +``` + +### node_getVersion + +Gets the rollup protocol version. + +**Parameters**: None + +**Returns**: `number` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getVersion","params":[],"id":1}' +``` + +### node_getChainId + +Gets the L1 chain ID. + +**Parameters**: None + +**Returns**: `number` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getChainId","params":[],"id":1}' +``` + +### node_getL1ContractAddresses + +Gets deployed L1 contract addresses. + +**Parameters**: None + +**Returns**: `L1ContractAddresses` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getL1ContractAddresses","params":[],"id":1}' +``` + +### node_getProtocolContractAddresses + +Gets protocol contract addresses. + +**Parameters**: None + +**Returns**: `ProtocolContractAddresses` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getProtocolContractAddresses","params":[],"id":1}' +``` + +### node_getEncodedEnr + +Gets the node's ENR for P2P discovery. + +**Parameters**: None + +**Returns**: `string | null` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getEncodedEnr","params":[],"id":1}' +``` + +### node_getCurrentBaseFees + +Gets current base fees for transactions. + +**Parameters**: None + +**Returns**: `GasFees` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getCurrentBaseFees","params":[],"id":1}' +``` + +## Validator queries + +### node_getValidatorsStats + +Gets statistics for all validators. + +**Parameters**: None + +**Returns**: `ValidatorsStats` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getValidatorsStats","params":[],"id":1}' +``` + +### node_getValidatorStats + +Gets statistics for a single validator. + +**Parameters**: +1. `validatorAddress` - `string` - Validator address (20-byte hex) +2. `fromSlot` - `string | undefined` - Starting slot (bigint as string) +3. `toSlot` - `string | undefined` - Ending slot (bigint as string) + +**Returns**: `SingleValidatorStats | null` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getValidatorStats","params":["0x1234...","100","200"],"id":1}' +``` + +## Debug operations + +### node_registerContractFunctionSignatures + +Registers contract function signatures for debugging. + +**Parameters**: +1. `functionSignatures` - `string[]` - Array of function signatures (max 100) + +**Returns**: `void` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_registerContractFunctionSignatures","params":[["transfer(address,uint256)"]],"id":1}' +``` + +### node_getAllowedPublicSetup + +Gets the list of allowed public setup function calls. + +**Parameters**: None + +**Returns**: `AllowedElement[]` + +**Example**: +```bash +curl -X POST http://localhost:8080 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getAllowedPublicSetup","params":[],"id":1}' +``` + +## Admin API + +Administrative operations are exposed on port 8880 under the `nodeAdmin_` namespace. + +:::warning Security: Admin API Access +For security reasons, the admin port (8880) should **not be exposed** to the host machine in Docker deployments. The examples below show both CLI and Docker methods: + +**CLI Method** (when running with `aztec start` directly): +```bash +curl -X POST http://localhost:8880 ... +``` + +**Docker Method** (when running with Docker Compose): +```bash +docker exec -it curl -X POST http://localhost:8880 ... +``` + +Replace `` with your container name (e.g., `aztec-node`, `aztec-sequencer`, `prover-node`). +::: + +### nodeAdmin_getConfig + +Gets the current node configuration. + +**Parameters**: None + +**Returns**: `AztecNodeAdminConfig` + +**Example (CLI)**: +```bash +curl -X POST http://localhost:8880 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"nodeAdmin_getConfig","params":[],"id":1}' +``` + +**Example (Docker)**: +```bash +docker exec -it aztec-node curl -X POST http://localhost:8880 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"nodeAdmin_getConfig","params":[],"id":1}' +``` + +### nodeAdmin_setConfig + +Updates the node configuration. + +**Parameters**: +1. `config` - `Partial` - Configuration updates + +**Returns**: `void` + +**Example (CLI)**: +```bash +curl -X POST http://localhost:8880 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"nodeAdmin_setConfig","params":[{"archiverPollingIntervalMS":1000}],"id":1}' +``` + +**Example (Docker)**: +```bash +docker exec -it aztec-node curl -X POST http://localhost:8880 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"nodeAdmin_setConfig","params":[{"archiverPollingIntervalMS":1000}],"id":1}' +``` + +### nodeAdmin_pauseSync + +Pauses archiver and world state syncing. + +**Parameters**: None + +**Returns**: `void` + +**Example (CLI)**: +```bash +curl -X POST http://localhost:8880 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"nodeAdmin_pauseSync","params":[],"id":1}' +``` + +**Example (Docker)**: +```bash +docker exec -it aztec-node curl -X POST http://localhost:8880 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"nodeAdmin_pauseSync","params":[],"id":1}' +``` + +### nodeAdmin_resumeSync + +Resumes archiver and world state syncing. + +**Parameters**: None + +**Returns**: `void` + +**Example (CLI)**: +```bash +curl -X POST http://localhost:8880 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"nodeAdmin_resumeSync","params":[],"id":1}' +``` + +**Example (Docker)**: +```bash +docker exec -it aztec-node curl -X POST http://localhost:8880 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"nodeAdmin_resumeSync","params":[],"id":1}' +``` + +### nodeAdmin_rollbackTo + +Rolls back the database to a target block. + +**Parameters**: +1. `targetBlockNumber` - `number` - Block to roll back to +2. `force` - `boolean | undefined` - Clear world state/p2p if needed + +**Returns**: `void` + +**Example (CLI)**: +```bash +curl -X POST http://localhost:8880 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"nodeAdmin_rollbackTo","params":[12000,true],"id":1}' +``` + +**Example (Docker)**: +```bash +docker exec -it aztec-node curl -X POST http://localhost:8880 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"nodeAdmin_rollbackTo","params":[12000,true],"id":1}' +``` + +### nodeAdmin_startSnapshotUpload + +Starts uploading a database snapshot. + +**Parameters**: +1. `location` - `string` - Upload location/URL + +**Returns**: `void` + +**Example (CLI)**: +```bash +curl -X POST http://localhost:8880 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"nodeAdmin_startSnapshotUpload","params":["gs://bucket/snapshots/"],"id":1}' +``` + +**Example (Docker)**: +```bash +docker exec -it aztec-node curl -X POST http://localhost:8880 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"nodeAdmin_startSnapshotUpload","params":["gs://bucket/snapshots/"],"id":1}' +``` + +### nodeAdmin_getSlashPayloads + +Gets all monitored slash payloads for the current round. + +**Parameters**: None + +**Returns**: `SlashPayloadRound[]` + +**Example (CLI)**: +```bash +curl -X POST http://localhost:8880 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"nodeAdmin_getSlashPayloads","params":[],"id":1}' +``` + +**Example (Docker)**: +```bash +docker exec -it aztec-node curl -X POST http://localhost:8880 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"nodeAdmin_getSlashPayloads","params":[],"id":1}' +``` + +### nodeAdmin_getSlashOffenses + +Gets all offenses for a specific round. + +**Parameters**: +1. `round` - `string | "all" | "current"` - Round number or "all"/"current" + +**Returns**: `Offense[]` + +**Example (CLI)**: +```bash +curl -X POST http://localhost:8880 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"nodeAdmin_getSlashOffenses","params":["current"],"id":1}' +``` + +**Example (Docker)**: +```bash +docker exec -it aztec-node curl -X POST http://localhost:8880 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"nodeAdmin_getSlashOffenses","params":["current"],"id":1}' +``` + +## Next steps + +- [How to Run a Sequencer Node](../setup/sequencer_management) - Set up a node +- [Ethereum RPC Calls Reference](./ethereum_rpc_reference.md) - L1 RPC usage +- [CLI Reference](./cli_reference.md) - Command-line options +- [Aztec Discord](https://discord.gg/aztec) - Developer support diff --git a/docs/network_versioned_docs/version-v3.0.2/setup/_category_.json b/docs/network_versioned_docs/version-v3.0.2/setup/_category_.json new file mode 100644 index 000000000000..2bccb9e539ef --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/setup/_category_.json @@ -0,0 +1,6 @@ +{ + "position": 1, + "collapsible": true, + "collapsed": true, + "label": "Setup" +} diff --git a/docs/network_versioned_docs/version-v3.0.2/setup/bootnode_operation.md b/docs/network_versioned_docs/version-v3.0.2/setup/bootnode_operation.md new file mode 100644 index 000000000000..657a5b6b3fe0 --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/setup/bootnode_operation.md @@ -0,0 +1,176 @@ +--- +id: bootnode_operation +sidebar_position: 3 +title: Using and running a bootnode +description: Learn how to connect to and operate bootnodes for peer discovery in the Aztec network. +references: ["yarn-project/aztec/src/cli/cmds/start_p2p_bootstrap.ts"] +--- + +## Overview + +Bootnodes facilitate peer discovery in the Aztec network by maintaining a list of active peers that new nodes can connect to. This guide covers how to connect your node to a bootnode and how to run your own bootnode. + +## What is a bootnode? + +Nodes in the Aztec network must connect to peers to gossip transactions and propagate them across the network. Bootnodes help new nodes discover and connect to these peers, enabling them to join the peer-to-peer layer. + +## Prerequisites + +Before proceeding, you should: + +- Have the Aztec node software installed +- Understand basic command-line operations +- For running a bootnode: Have the necessary network infrastructure and port access + +## Connecting to a bootnode + +To connect your node to a bootnode for peer discovery: + +1. Obtain the bootnode's ENR (Ethereum Node Record) +2. Add the ENR to your node's `.env` file using the `BOOTSTRAP_NODES` environment variable + +The variable accepts a comma-separated list of bootstrap node ENRs: + +```bash +BOOTSTRAP_NODES=[ENR] +``` + +For multiple bootnodes: + +```bash +BOOTSTRAP_NODES=[ENR1],[ENR2],[ENR3] +``` + +Then add the environment variable to your `docker-compose.yml`: + +```yaml +environment: + # ... other environment variables + BOOTSTRAP_NODES: ${BOOTSTRAP_NODES} +``` + +## Running a bootnode + +To run your own bootnode, create a dedicated Docker Compose configuration. + +Create a `docker-compose.yml` file for your bootnode: + +```yaml +services: + aztec-bootnode: + image: "aztecprotocol/aztec:2.1.9" + container_name: "aztec-bootnode" + ports: + - ${P2P_PORT}:${P2P_PORT} + - ${P2P_PORT}:${P2P_PORT}/udp + volumes: + - ${DATA_DIRECTORY}:/var/lib/data + environment: + P2P_PORT: ${P2P_PORT} + P2P_BROADCAST_PORT: ${P2P_BROADCAST_PORT} + PEER_ID_PRIVATE_KEY_PATH: ${PEER_ID_PRIVATE_KEY_PATH} + entrypoint: >- + node + --no-warnings + /usr/src/yarn-project/aztec/dest/bin/index.js + start + --p2p-bootstrap + networks: + - aztec + restart: always + +networks: + aztec: + name: aztec +``` + +### Configuring the bootnode port + +By default, the bootnode uses the `P2P_PORT` value. To customize the port, add to your `.env` file: + +```bash +P2P_PORT=40400 +P2P_BROADCAST_PORT=[PORT] +``` + +### Persisting bootnode identity + +To maintain a consistent bootnode identity across restarts, specify a private key location in your `.env` file: + +```bash +DATA_DIRECTORY=./data +PEER_ID_PRIVATE_KEY_PATH=/var/lib/data/bootnode-peer-id +``` + +**How it works:** +- If a private key exists at the path, the bootnode will use it for its identity +- If no private key exists, a new one will be generated and saved to that location +- This ensures your bootnode maintains the same ENR across restarts + +### Obtaining your bootnode's ENR + +After starting your bootnode, obtain its ENR from the startup logs. You can share this ENR with node operators who want to connect to your bootnode. + +### Adding your bootnode to the default set + +:::info + +The process for adding bootnodes to Aztec's default bootnode list is currently being finalized. For now, share your bootnode ENR directly with node operators who +want to connect. + +::: + +## Verification + +To verify your bootnode setup: + +### For nodes connecting to a bootnode + +1. **Check logs**: Look for messages indicating successful peer discovery +2. **Verify peer count**: Confirm your node has connected to peers from the bootnode +3. **Monitor network activity**: Ensure transactions are being gossiped correctly + +### For bootnode operators + +1. **Confirm bootnode is running**: Check that the process started successfully +2. **Verify port accessibility**: Ensure the configured port is open and accessible +3. **Monitor peer connections**: Check logs for incoming peer connection requests +4. **Validate ENR generation**: Confirm your bootnode's ENR is displayed in the logs + +## Troubleshooting + +### Cannot connect to bootnode + +**Issue**: Your node fails to connect to the specified bootnode. + +**Solutions**: +- Verify the ENR is correct and properly formatted +- Check network connectivity to the bootnode's address +- Ensure the bootnode is running and accessible +- Confirm firewall rules allow P2P connections + +### Bootnode not discovering peers + +**Issue**: Your bootnode isn't discovering or storing peers. + +**Solutions**: +- Verify the bootnode container is running with the correct configuration +- Check that the P2P port is properly configured and accessible +- Review logs for error messages or connection issues +- Ensure sufficient system resources are available + +### Private key path errors + +**Issue**: Errors occur when specifying the peer ID private key path. + +**Solutions**: +- Verify the path exists and is writable within the container +- Check file permissions for the directory and file +- Ensure the volume mount is correctly configured in docker-compose.yml +- Confirm the private key file format is correct (if reusing an existing key) + +## Next Steps + +- Monitor your bootnode or node connections regularly +- Consider running multiple bootnodes for redundancy +- Join the Aztec community to share your bootnode ENR with other operators diff --git a/docs/network_versioned_docs/version-v3.0.2/setup/building_from_source.md b/docs/network_versioned_docs/version-v3.0.2/setup/building_from_source.md new file mode 100644 index 000000000000..8c00ec3dbdcf --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/setup/building_from_source.md @@ -0,0 +1,324 @@ +--- +id: building_from_source +title: Building Node Software from Source +description: Build the Aztec node Docker image from source code for development, testing, or running a specific version. +sidebar_position: 10 +--- + +## Overview + +This guide shows you how to build the Aztec node Docker image from source, including all build tools and dependencies. + +Building from source allows you to: + +- Run a specific tagged version +- Verify the build process matches the official CI pipeline +- Customize the software for development or testing +- Audit the complete build chain + +### Requirements + +**Hardware:** +- 4 core / 8 vCPU +- 16 GB RAM for Docker +- 150 GB free disk space +- Stable internet connection + +**Software:** +- Git to clone the repository +- Docker version 20.10 or later with at least 16 GB RAM allocated + +This guide assumes you're using a standard Linux distribution such as Debian or Ubuntu. While other operating systems may work, these instructions are tested and optimized for Linux environments. + +These requirements are for building the software. Running a node has different requirements—see [Running a Full Node](./running_a_node.md). + +## Build Steps + +### Step 1: Clone the Repository + +Clone the Aztec packages repository: + +```bash +git clone https://github.com/AztecProtocol/aztec-packages.git +cd aztec-packages +``` + +### Step 2: Check Out a Version Tag + +Check out the version tag you want to build. For example, to build version 2.1.9: + +```bash +git checkout v2.1.9 +``` + +:::tip +View all available release tags with: +```bash +git tag | grep "^v[0-9]" +``` +::: + +### Step 3: Build the Container with Build Tools + +Build the container image with all necessary compilation tools: + +```bash +cd build-images/src +docker build --target build -t aztec-build-local:3.0 . +cd ../.. +``` + +:::tip +The tag `aztec-build-local:3.0` avoids conflicts with the official Docker Hub image and clearly indicates this is a locally-built version. +::: + +**What this does:** +- Builds the `build` stage from `build-images/src/Dockerfile` +- Installs Node.js 22.16.0 from NodeSource repository +- Installs Clang 16, 18, and 20 from LLVM +- Installs Rust 1.85.0 using the Rust toolchain installer with wasm32 targets +- Downloads and installs WASI SDK 27 from GitHub releases +- Builds Foundry v1.4.1 from source +- Installs CMake, Ninja, and other build essentials + +:::note +This step builds all compilation tooling from scratch. The Dockerfile uses multi-stage builds—you only need the `build` target. Other targets (`devbox` and `sysbox`) are for development environments. +::: + +:::tip Verifying the Build Image +After the build completes, inspect the image to verify its contents: + +```bash +# Run a shell in the container to explore +docker run -it --rm aztec-build-local:3.0 /bin/bash + +# Check specific versions once inside: +node --version # Should show v22.16.0 +rustc --version # Should show Rust 1.85.0 +clang-20 --version # Should show clang 20.x +forge --version # Should show v1.4.1 +cmake --version # Should show cmake 3.24+ +``` + +You can review the Dockerfile at `build-images/src/Dockerfile` to see exactly what's installed and verify each step. +::: + +### Step 4: Compile the Source Code + +Run the bootstrap script inside the build container to compile all source code: + +```bash +docker run --rm \ + -v $(pwd):/workspaces/aztec-packages \ + -w /workspaces/aztec-packages \ + aztec-build-local:3.0 \ + ./bootstrap.sh full +``` + +**What this does:** +- Mounts your local repository into the container +- Compiles C++ code (Barretenberg proving system) +- Compiles Rust code (Noir compiler and ACVM) +- Builds TypeScript/JavaScript packages +- Writes compiled artifacts to your local filesystem (persist after container exits) +- Runs tests to verify the build + +:::note +The bootstrap process is incremental—if interrupted, restart it to resume from where it left off. Git submodules for L1 contract dependencies are initialized automatically during the build. +::: + +### Step 5: Build the Runtime Base Image + +Build the runtime base image with Node.js dependencies. This image contains only runtime requirements—no build tools or compiled code: + +```bash +docker build -f release-image/Dockerfile.base -t aztecprotocol/release-image-base . +``` + +:::note +The tag `aztecprotocol/release-image-base` must match exactly—the Dockerfile in Step 6 references this specific tag. This image is not published to Docker Hub; it exists only locally. +::: + +**What this does:** +- Installs production Node.js dependencies (no dev dependencies) +- Includes Node.js 22 runtime and system utilities +- Copies Foundry tools (anvil, cast) from the build container +- Creates a slim Ubuntu-based runtime environment without build tools + +### Step 6: Build the Final Release Image + +Build the final node image, combining the runtime environment (Step 5) with your compiled code (Step 4): + +```bash +docker build -f release-image/Dockerfile --build-arg VERSION=2.1.9 -t aztec-local:2.1.9 . +``` + +:::tip +The tag `aztec-local:2.1.9` avoids conflicts with the official Docker Hub image and clearly indicates this is a locally-built version. +::: + +**Build arguments:** +- `VERSION` - Sets the version string that appears in `aztec --version` + +**What this does:** +- Starts from the `aztecprotocol/release-image-base` image (Step 5) +- Copies compiled source code from your local filesystem (Step 4) +- Sets up environment variables for Barretenberg and ACVM binaries +- Configures the entrypoint to run the Aztec node + +## Verification + +Verify your build completed successfully: + +### Check Image Exists + +```bash +docker images aztec-local +``` + +You should see your image listed: + +``` +REPOSITORY TAG IMAGE ID CREATED SIZE +aztec-local 2.1.9 abc123def456 2 minutes ago 2.5GB +``` + +### Verify Version + +```bash +docker run --rm aztec-local:2.1.9 --version +``` + +Should display version 2.1.9. + +### Test Basic Functionality + +```bash +docker run --rm aztec-local:2.1.9 --help +``` + +Should display CLI help information without errors. + +If all checks pass, your image is ready to use. + +## Troubleshooting + +### Build fails with "no space left on device" + +**Issue**: Insufficient disk space. + +**Solutions**: +- Clean up unused Docker images and build cache: `docker system prune -a` +- Free up at least 150 GB of disk space +- Ensure adequate storage for intermediate build artifacts + +### Build image fails + +**Issue**: Errors during Step 3 when building `aztec-build-local:3.0`. + +**Solutions**: +- Verify you're in the `build-images/src` directory +- Ensure the `--target build` flag is specified +- Retry the build if network issues occur while downloading Rust, LLVM, or WASI SDK +- Review `build-images/src/Dockerfile` to identify the failing stage + +### Build fails with "failed to solve with frontend dockerfile.v0: failed to create LLB definition" + +**Issue**: The release image build cannot find the base image. + +**Solutions**: +- Ensure you completed Step 5 and built the base image with the exact tag: `aztecprotocol/release-image-base` +- Verify the base image exists locally: `docker images aztecprotocol/release-image-base` +- If missing, return to Step 5 and rebuild the base image + +### Bootstrap compilation fails + +**Issue**: Errors during `./bootstrap.sh` in Step 4. + +**Solutions**: +- Verify you're using the correct build image: `aztec-build-local:3.0` +- Confirm you checked out a valid release tag (not a branch) +- Retry the build—the bootstrap script is incremental and resumes where it left off +- Review error messages for specifics—missing dependencies should not occur in the build container + +### Docker runs out of memory + +**Issue**: Build crashes due to insufficient memory. + +**Solutions**: +- Increase Docker's memory limit to at least 16 GB (Docker Desktop: Settings → Resources → Memory) +- Close other applications to free system memory +- Build on a machine with more RAM if possible + +### Wrong version shows in `aztec --version` + +**Issue**: Version argument not passed correctly. + +**Solutions**: +- Ensure you used `--build-arg VERSION=X.Y.Z` when building the release image +- The version should match the git tag without the 'v' prefix (e.g., `2.1.9` not `v2.1.9`) + +## Using Your Custom Build + +### Running a Node + +Use your locally-built image with any node setup method. For Docker Compose, update your `docker-compose.yml`: + +```yaml +services: + aztec-node: + image: "aztec-local:2.1.9" + # ... rest of configuration +``` + +See [Running a Full Node](./running_a_node.md) for complete setup instructions. + +### Using the CLI + +Run the Aztec CLI directly from your custom image: + +```bash +docker run --rm aztec-local:2.1.9 --version +``` + +## Alternative Approaches + +### Using Pre-built Build Image + +To save time, skip Step 3 and pull the pre-built image from Docker Hub, then tag it locally: + +```bash +docker pull aztecprotocol/build:3.0 +docker tag aztecprotocol/build:3.0 aztec-build-local:3.0 +``` + +This approach is faster but requires trusting the published image. The official image is built from the same `build-images/src/Dockerfile`. + +### Building Without Docker + +To build without Docker, install all build dependencies locally and run `./bootstrap.sh` directly: + +- Install all toolchains from the build image (Node.js 22, Rust 1.85.0, Clang 20, CMake, wasi-sdk) +- Run `bootstrap.sh check` to verify your environment +- See `build-images/README.md` for details + +Using the build container is strongly recommended to ensure a consistent, tested environment. + +## Understanding the Build Process + +The build process uses these key files in the repository: + +- **`build-images/src/Dockerfile`** - Defines the build container with all compilation tools +- **`bootstrap.sh`** - Main build script that compiles all source code (C++, Rust, TypeScript) +- **`release-image/Dockerfile.base`** - Multi-stage Dockerfile that creates a slim runtime base image +- **`release-image/Dockerfile`** - Final release image with compiled Aztec software +- **`release-image/bootstrap.sh`** - Build script used in CI for Docker images + +The official CI pipeline follows a similar process. See `.github/workflows/ci3.yml` for how production images are built and deployed. + +## Next Steps + +- Use your custom build to [run a full node](./running_a_node.md) +- Set up [monitoring](../operation/monitoring.md) for your node +- Review the [CLI reference](../reference/cli_reference.md) for configuration options +- Join the [Aztec Discord](https://discord.gg/aztec) to discuss development and customization diff --git a/docs/network_versioned_docs/version-v3.0.2/setup/high_availability_sequencers.md b/docs/network_versioned_docs/version-v3.0.2/setup/high_availability_sequencers.md new file mode 100644 index 000000000000..befee207a2e1 --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/setup/high_availability_sequencers.md @@ -0,0 +1,370 @@ +--- +id: high_availability_sequencers +sidebar_position: 3 +title: High Availability Sequencers +description: Learn how to run highly available sequencers across multiple nodes for redundancy and improved reliability. +--- + +## Overview + +This guide shows you how to set up high availability (HA) for your sequencer by running the same sequencer identity across multiple physical nodes. This configuration provides redundancy and resilience, ensuring your sequencer continues operating even if individual nodes fail. + +**What is High Availability for sequencers?** + +High availability means running multiple sequencer nodes that share the same attester identity but use different publisher addresses. This allows your sequencer to: +- Continue attesting even if one node goes offline +- Maintain uptime during maintenance windows and upgrades +- Protect against infrastructure failures +- Ensure you don't miss attestation duties + +## Prerequisites + +Before setting up HA sequencers, ensure you have: + +- Experience running a single sequencer node (see the [Sequencer Management guide](../setup/sequencer_management.md)) +- Understanding of basic keystore structure and configuration +- Access to multiple servers or VMs for running separate nodes +- Ability to securely distribute keys across infrastructure + +## Why High Availability? + +### Benefits of HA Configuration + +**1. Redundancy and Fault Tolerance** + +If one node crashes, experiences network issues, or needs maintenance, the other node continues operating. You won't miss attestations or proposals during: +- Hardware failures +- Network outages +- Planned maintenance +- Software upgrades +- Infrastructure provider issues + +**2. Improved Uptime** + +With properly configured HA, your sequencer can achieve near-perfect uptime. You can perform rolling upgrades, switching nodes in and out of service without missing duties. + +### The Core Concept + +In an HA setup: +- **Attester identity is shared** across both nodes (same private key) +- **Publisher identity is unique** per node (different private keys) +- Both nodes run simultaneously and can attest independently +- Only one proposal is accepted per slot (enforced by L1) + +## Setting Up High Availability Sequencers + +### Infrastructure Requirements + +**HA Setup (2 nodes):** +- 2 separate servers/VMs +- Each meeting the minimum sequencer requirements (see [Sequencer Management](./sequencer_management.md)) +- Different physical locations or availability zones (recommended) +- Reliable network connectivity for both nodes +- Access to the same L1 infrastructure (or separate L1 endpoints) +- Monitoring and alerting for both nodes + +### Key Management + +You'll need to generate: + +1. **One shared attester key** - Your sequencer's identity (used by both nodes) +2. **One unique publisher key per node** - For submitting proposals +3. **Secure distribution method** - For safely deploying the shared attester key + +:::warning Secure Key Distribution +The shared attester key must be distributed securely to both nodes. Consider using remote signers with: +- Encrypted secrets management (HashiCorp Vault, AWS Secrets Manager, etc.) +- Hardware security modules (HSMs) for production deployments + +Never transmit private keys over unencrypted channels or store them in version control. +::: + +### Step 1: Generate Keys + +Generate a base keystore with multiple publishers using the Aztec CLI. This will create one attester identity with multiple publisher keys that can be distributed across your nodes. + +```bash +# Generate base keystore with one attester and 2 publishers +aztec validator-keys new \ + --fee-recipient 0x0000000000000000000000000000000000000000000000000000000000000000 \ + --staker-output \ + --gse-address 0xa92ecFD0E70c9cd5E5cd76c50Af0F7Da93567a4f \ + --l1-rpc-urls $ETH_RPC \ + --mnemonic "your shared mnemonic phrase for key derivation" \ + --address-index 0 \ + --publisher-count 2 \ + --data-dir ~/ha-keys-temp +``` + +This command generates: +- **One attester** with both ETH and BLS keys (at derivation index 0) +- **Two publisher keys** (at derivation indices 1 and 2) +- All keys saved to `~/ha-keys-temp/key1.json` + +The output will show the complete keystore JSON with all generated keys. **Save this output securely** as you'll need to extract keys from it for each node. + +:::tip Managing Your Mnemonic +Store your mnemonic phrase securely in a password manager or hardware wallet. You'll need it to: +- Regenerate keys if lost +- Add more publishers later +- Recover your sequencer setup + +Never commit mnemonics to version control or share them over insecure channels. +::: + +### Step 2: Fund Publisher Accounts + +Each publisher account needs ETH to pay for L1 gas when submitting proposals. You must maintain at least **0.1 ETH** in each publisher account. + +**Check publisher balances:** + +```bash +# Check balance for Publisher 1 +cast balance [PUBLISHER_1_ADDRESS] --rpc-url $ETH_RPC + +# Check balance for Publisher 2 +cast balance [PUBLISHER_2_ADDRESS] --rpc-url $ETH_RPC +``` + +**Example:** +```bash +cast balance 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb --rpc-url $ETH_RPC +# Output: 100000000000000000 (0.1 ETH in wei) +``` + +:::warning Balance Monitoring +Monitor these balances regularly to ensure they don't drop below 0.1 ETH. Falling below this threshold risks slashing. Consider setting up automated alerts when balances drop below 0.15 ETH. +::: + +### Step 3: Extract Keys from Generated Keystore + +Open the generated keystore file (`~/ha-keys-temp/key1.json`) and extract the keys. The file will look something like this: + +```json +{ + "schemaVersion": 1, + "validators": [ + { + "attester": { + "eth": "0xABC...123", // Shared attester ETH key + "bls": "0xDEF...456" // Shared attester BLS key + }, + "publisher": [ + "0x111...AAA", // Publisher 1 (for Node 1) + "0x222...BBB" // Publisher 2 (for Node 2) + ], + "feeRecipient": "0x0000000000000000000000000000000000000000000000000000000000000000" + } + ] +} +``` + +You'll use: +- The **same attester keys** (both ETH and BLS) on both nodes +- A **different publisher key** for each node + +### Step 4: Create Node-Specific Keystores + +Create a separate keystore file for each node, using the same attester but different publishers: + +**Node 1 Keystore** (`~/node1/keys/keystore.json`): + +Use the same attester ETH and BLS keys, but only Publisher 1: + +```json +{ + "schemaVersion": 1, + "validators": [ + { + "attester": { + "eth": "0xABC...123", + "bls": "0xDEF...456" + }, + "publisher": ["0x111...AAA"], + "feeRecipient": "0x0000000000000000000000000000000000000000000000000000000000000000" + } + ] +} +``` + +**Node 2 Keystore** (`~/node2/keys/keystore.json`): + +Use the same attester ETH and BLS keys, but only Publisher 2: + +```json +{ + "schemaVersion": 1, + "validators": [ + { + "attester": { + "eth": "0xABC...123", + "bls": "0xDEF...456" + }, + "publisher": ["0x222...BBB"], + "feeRecipient": "0x0000000000000000000000000000000000000000000000000000000000000000" + } + ] +} +``` + +:::warning Security Best Practice +After creating node-specific keystores, **securely delete** the base keystore file (`~/ha-keys-temp/key1.json`) that contains all publishers together. Each node should only have access to its own publisher key. +::: + +### Step 5: Deploy Keystores to Nodes + +Securely transfer each keystore to its respective node: + +```bash +# Example: Copy keystores to remote nodes via SCP +scp ~/node1/keys/keystore.json user@node1-server:~/aztec/keys/ +scp ~/node2/keys/keystore.json user@node2-server:~/aztec/keys/ +``` + +Ensure proper file permissions on each node: + +```bash +chmod 600 ~/aztec/keys/keystore.json +``` + +### Step 6: Start All Nodes + +Start each node (assuming you are using Docker Compose): + +```bash +# On each server +docker compose up -d +``` + +Ensure both nodes are configured with: +- The same network (`--network mainnet`) +- Proper L1 endpoints +- Correct P2P configuration +- Adequate resources + +## Verification and Monitoring + +### Verify Your HA Setup + +**1. Check that both nodes are running:** + +```bash +# On each server +curl http://localhost:8080/status + +# Or for Docker +docker compose logs -f aztec-sequencer +``` + +**2. Confirm nodes recognize the shared attester:** + +Check logs for messages indicating the attester address is loaded correctly. Both nodes should show the same attester address. + +**3. Verify different publishers:** + +Each node's logs should show a different publisher address being used for submitting transactions. + +**4. Monitor attestations:** + +Watch L1 for attestations from your sequencer's attester address. You should see attestations being submitted even if one node goes offline. + +### Testing Failover + +To verify HA is working correctly: + +1. **Monitor baseline**: Note the attestation rate with both nodes running +2. **Stop one node**: `docker compose down` on one server +3. **Verify continuity**: Check that attestations continue from the remaining node +4. **Check logs**: The remaining node should show normal operation +5. **Restart the stopped node**: Verify it rejoins seamlessly + +If attestations stop when you stop one node, your HA configuration is not working correctly. + +## Operational Best Practices + +### Load Balancing L1 Access + +If possible, configure each node with its own L1 infrastructure: + +- **Node 1**: L1 endpoints in Region A +- **Node 2**: L1 endpoints in Region B + +This protects against L1 provider outages affecting both nodes simultaneously. + +### Geographic Distribution + +For maximum resilience, distribute nodes across: +- Multiple data centers +- Different cloud providers +- Different geographic regions +- Different network availability zones + +This protects against regional failures, provider outages, and network issues. + +### Regular Testing + +Periodically test your HA setup: + +- Simulate node failures (stop nodes intentionally) +- Test network partitions (firewall rules) +- Verify monitoring and alerting +- Practice recovery procedures +- Test rolling upgrades + +## Troubleshooting + +### Both Nodes Stopped Attesting + +**Issue**: No attestations from either node. + +**Solutions**: +- Verify both nodes aren't simultaneously offline +- Check L1 connectivity from each node +- Verify the shared attester key is correct in both keystores +- Check that the sequencer is still registered and active on L1 +- Review logs for errors on both nodes + +### Duplicate Proposals Appearing + +**Issue**: Seeing multiple proposals for the same slot from your sequencer. + +**Solutions**: +- Verify each node has a unique publisher key +- Check that publisher keys aren't duplicated across keystores +- Ensure nodes aren't sharing the same keystore file +- Review keystore configuration on each node + +### One Node Not Contributing + +**Issue**: One node running but not attesting/proposing. + +**Solutions**: +- Check that node's sync status +- Verify keystore is loaded correctly +- Check network connectivity to L1 +- Review logs for specific errors +- Confirm publisher account has sufficient ETH + +### Keystore Loading Failures + +**Issue**: Node fails to load the keystore. + +**Solutions**: +- Verify keystore.json syntax is valid +- Check file permissions (readable by the node process) +- Ensure the keystore path is correct +- Validate all private keys are properly formatted +- Review the [Keystore Troubleshooting guide](../operation/keystore/troubleshooting.md) + +## Related Guides + +:::tip Running Multiple Sequencers Per Node +Want to run multiple sequencer identities on a **single node** instead? See the [Advanced Keystore Patterns guide](../operation/keystore/advanced_patterns.md#multiple-sequencers)—that's a different use case from HA. +::: + +## Next Steps + +- Review the [Advanced Keystore Patterns guide](../operation/keystore/advanced_patterns.md) for multiple sequencers per node +- Set up [monitoring and observability](../operation/monitoring.md) for your HA infrastructure +- Learn about [governance participation](../operation/sequencer_management/creating_and_voting_on_proposals.md) as a sequencer +- Join the [Aztec Discord](https://discord.gg/aztec) for operator support and best practices diff --git a/docs/network_versioned_docs/version-v3.0.2/setup/running_a_node.md b/docs/network_versioned_docs/version-v3.0.2/setup/running_a_node.md new file mode 100644 index 000000000000..582394af4f1b --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/setup/running_a_node.md @@ -0,0 +1,202 @@ +--- +id: running_a_node +sidebar_position: 2 +title: Running a Full Node +description: A comprehensive guide on how to run a full node on the Aztec network using Docker Compose. +references: ["yarn-project/aztec/src/cli/cmds/start_node.ts"] +--- + +## Overview + +This guide covers the steps required to run a full node on Aztec using Docker Compose. + +A full node allows you to connect and interact with the network, providing an interface to send and receive transactions and state updates without relying on third parties. + +You should run your own full node if you want to interact with the network in the most privacy-preserving way. It's also a great way to support the Aztec network and get involved with the community. + +### Minimum Hardware Requirements + +- 8 core / 16 vCPU (released in 2015 or later) +- 16 GB RAM +- 1 TB NVMe SSD +- 25 Mbps network connection + +These requirements are subject to change as the network throughput increases. + +**Before proceeding:** Ensure you've reviewed and completed the [prerequisites](../prerequisites.md). + +This setup includes only essential settings. The `--network testnet` flag applies network-specific defaults—see the [CLI reference](../reference/cli_reference.md) for all available configuration options. + +## Setup + +### Step 1: Set Up Directory Structure + +Create the directory structure for node data: + +```bash +mkdir -p aztec-node/data +cd aztec-node +touch .env +``` + +### Step 2: Configure Environment Variables + +Add the following to your `.env` file: + +```bash +DATA_DIRECTORY=./data +LOG_LEVEL=info +ETHEREUM_HOSTS=[your L1 execution endpoint] +L1_CONSENSUS_HOST_URLS=[your L1 consensus endpoint] +P2P_IP=[your external IP address] +P2P_PORT=40400 +AZTEC_PORT=8080 +AZTEC_ADMIN_PORT=8880 +``` + +:::tip +Find your public IP address with: `curl ipv4.icanhazip.com` +::: + +### Step 3: Create Docker Compose File + +Create a `docker-compose.yml` file in your `aztec-node` directory: + +```yaml +services: + aztec-node: + image: "aztecprotocol/aztec:2.1.9" + container_name: "aztec-node" + ports: + - ${AZTEC_PORT}:${AZTEC_PORT} + - ${P2P_PORT}:${P2P_PORT} + - ${P2P_PORT}:${P2P_PORT}/udp + volumes: + - ${DATA_DIRECTORY}:/var/lib/data + environment: + DATA_DIRECTORY: /var/lib/data + LOG_LEVEL: ${LOG_LEVEL} + ETHEREUM_HOSTS: ${ETHEREUM_HOSTS} + L1_CONSENSUS_HOST_URLS: ${L1_CONSENSUS_HOST_URLS} + P2P_IP: ${P2P_IP} + P2P_PORT: ${P2P_PORT} + AZTEC_PORT: ${AZTEC_PORT} + AZTEC_ADMIN_PORT: ${AZTEC_ADMIN_PORT} + entrypoint: >- + node + --no-warnings + /usr/src/yarn-project/aztec/dest/bin/index.js + start + --node + --archiver + --network testnet + networks: + - aztec + restart: always + +networks: + aztec: + name: aztec +``` + +:::warning Security: Admin Port Not Exposed +The admin port (8880) is intentionally **not exposed** to the host machine for security reasons. The admin API provides sensitive operations like configuration changes and database rollbacks that should never be accessible from outside the container. + +If you need to access admin endpoints, use `docker exec`: +```bash +docker exec -it aztec-node curl -X POST http://localhost:8880 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"nodeAdmin_getConfig","params":[],"id":1}' +``` +::: + +### Step 4: Start the Node + +Start the node: + +```bash +docker compose up -d +``` + +## Verification + +Once your node is running, verify it's working correctly: + +### Check Node Sync Status + +Check the current sync status: + +```bash +curl -s -X POST -H 'Content-Type: application/json' \ +-d '{"jsonrpc":"2.0","method":"node_getL2Tips","params":[],"id":67}' \ +http://localhost:8080 | jq -r ".result.proven.number" +``` + +Compare the output with block explorers like [Aztec Scan](https://aztecscan.xyz/) or [Aztec Explorer](https://aztecexplorer.xyz/). + +### Check Node Status + +```bash +curl http://localhost:8080/status +``` + +### Verify Port Connectivity + +```bash +# Check TCP connectivity on port 40400 +nc -vz [YOUR_EXTERNAL_IP] 40400 +# Should return: "Connection to [YOUR_EXTERNAL_IP] 40400 port [tcp/*] succeeded!" + +# Check UDP connectivity on port 40400 +nc -vu [YOUR_EXTERNAL_IP] 40400 +# Should return: "Connection to [YOUR_EXTERNAL_IP] 40400 port [udp/*] succeeded!" +``` + +### View Logs + +```bash +docker compose logs -f aztec-node +``` + +If all checks pass, your node should be up, running, and connected to the network. + +## Troubleshooting + +### Port forwarding not working + +**Issue**: Your node cannot connect to peers. + +**Solutions**: + +- Verify your external IP address matches the `P2P_IP` setting +- Check firewall rules on your router and local machine +- Test connectivity using: `nc -zv [your-ip] 40400` + +### Node not syncing + +**Issue**: Your node is not synchronizing with the network. + +**Solutions**: + +- Check L1 endpoint connectivity +- Verify both execution and consensus clients are fully synced +- Review logs for specific error messages +- Ensure L1 endpoints support high throughput + +### Docker issues + +**Issue**: Container won't start or crashes. + +**Solutions**: + +- Ensure Docker and Docker Compose are up to date +- Check disk space availability +- Verify the `.env` file is properly formatted +- Review container logs: `docker compose logs aztec-node` + +## Next Steps + +- Review [syncing best practices](./syncing_best_practices.md) for faster synchronization +- Learn about [bootnode operation](./bootnode_operation.md) for peer discovery +- Check the [CLI reference](../reference/cli_reference.md) for advanced configuration options +- Join the [Aztec Discord](https://discord.gg/aztec) for support and community discussions diff --git a/docs/network_versioned_docs/version-v3.0.2/setup/running_a_prover.md b/docs/network_versioned_docs/version-v3.0.2/setup/running_a_prover.md new file mode 100644 index 000000000000..498b5b0223ba --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/setup/running_a_prover.md @@ -0,0 +1,383 @@ +--- +id: running_a_prover +sidebar_position: 4 +title: Running a Prover +description: A comprehensive guide on how to run an Aztec prover on the network using Docker Compose in a distributed configuration. +references: ["yarn-project/aztec/src/cli/cmds/start_prover_node.ts"] +--- + +## Overview + +This guide covers the steps required to run a prover on the Aztec network. Operating a prover is a resource-intensive role typically undertaken by experienced engineers due to its technical complexity and hardware requirements. + +Aztec provers are critical infrastructure components. They generate cryptographic proofs attesting to transaction correctness, ultimately producing a single rollup proof submitted to Ethereum. + +:::tip Prerequisites +Before proceeding, ensure you've reviewed and completed the [prerequisites](../prerequisites.md). +::: + +## Prover Architecture + +The prover consists of three main components: + +1. **Prover node**: Polls L1 for unproven epochs, creates prover jobs, distributes them to the broker, and submits the final rollup proof to the rollup contract. + +2. **Prover broker**: Manages the job queue, distributing work to agents and collecting results. + +3. **Prover agent(s)**: Executes proof generation jobs in a stateless manner. + +## Minimum Requirements + +### Prover Node + +- 16 core / 32 vCPU (released in 2015 or later) +- 16 GB RAM +- 1 TB NVMe SSD +- 25 Mbps network connection + +### Prover Broker + +- 8 core / 16 vCPU (released in 2015 or later) +- 16 GB RAM +- 10 GB SSD + +### Prover Agents + +**For each agent:** +- 32 core / 64 vCPU (released in 2015 or later) +- 128 GB RAM +- 10 GB SSD + +These requirements are subject to change as the network throughput increases. Prover agents require high-performance hardware, typically data center-grade infrastructure. + +:::tip Running Multiple Agents +You can run multiple prover agents on a single machine by adjusting `PROVER_AGENT_COUNT`. Hardware requirements scale approximately linearly: +- **2 agents**: 64 cores, 256 GB RAM +- **3 agents**: 96 cores, 384 GB RAM +- **4 agents**: 128 cores, 512 GB RAM +::: + +## Generating Keys + +Before setting up your prover, you need to generate the required Ethereum private key for the prover publisher. + +### Prover Publisher Private Key + +The prover publisher key is used to submit proofs to L1. This account needs ETH funding to pay for L1 gas. + +Generate an Ethereum private key using Foundry's `cast` tool: + +```bash +# Generate a new wallet with a 24-word mnemonic +cast wallet new-mnemonic --words 24 + +# This outputs a mnemonic phrase, a derived address, and private key +# Save these securely - you'll need the private key for PROVER_PUBLISHER_PRIVATE_KEY +# and the address for PROVER_ID +``` + +**Important notes:** +- Save both the private key and the derived address securely +- The private key will be used for `PROVER_PUBLISHER_PRIVATE_KEY` +- The derived Ethereum address will be used for `PROVER_ID` + +:::warning Account Funding Required +The publisher account needs to be funded with ETH to post proofs to L1. Ensure the account holds sufficient ETH for gas costs during operation. +::: + +:::tip +If you don't have Foundry installed, follow the installation guide at [getfoundry.sh](https://getfoundry.sh/). +::: + +## Setup + +The prover components are distributed across multiple machines for better performance and resource utilization. This setup runs multiple prover agents on separate high-performance machines, isolates the broker for better job queue management, and separates network-facing components (prover node) from compute-intensive components (agents). + +### Architecture + +- **Prover Node**: Runs on a machine with network access and L1 connectivity +- **Prover Broker**: Can run on the same machine as the prover node or separately (must be accessible from prover agents) +- **Prover Agents**: Run on separate high-performance machines (32+ cores each, scalable with `PROVER_AGENT_COUNT`) + +:::warning Network Requirements +Prover agents must communicate with the prover broker over the network. Ensure that: + +- The broker machine's port 8080 is accessible from all agent machines +- Firewall rules allow traffic between agents and broker +- Network connectivity is stable and low-latency between components +::: + +### Prover Node and Broker Setup + +On the machine that will run the prover node and broker: + +#### Step 1: Set Up Directory Structure + +```bash +mkdir -p aztec-prover-node/prover-node-data aztec-prover-node/prover-broker-data +cd aztec-prover-node +touch .env +``` + +#### Step 2: Configure Environment Variables + +Add to your `.env` file: + +```bash +# Prover Node Configuration +DATA_DIRECTORY=./prover-node-data +P2P_IP=[your external IP address] +P2P_PORT=40400 +ETHEREUM_HOSTS=[your L1 execution endpoint] +L1_CONSENSUS_HOST_URLS=[your L1 consensus endpoint] +LOG_LEVEL=info +PROVER_BROKER_HOST=http://prover-broker:8080 +PROVER_PUBLISHER_PRIVATE_KEY=[your prover publisher private key, see prerequisites] +AZTEC_PORT=8080 +AZTEC_ADMIN_PORT=8880 + +# Prover Broker Configuration +PROVER_BROKER_DATA_DIRECTORY=./prover-broker-data +PROVER_BROKER_PORT=8080 +``` + +#### Step 3: Create Docker Compose File + +Create `docker-compose.yml`: + +```yaml +name: aztec-prover-node +services: + prover-node: + image: aztecprotocol/aztec:2.1.9 + entrypoint: >- + node + --no-warnings + /usr/src/yarn-project/aztec/dest/bin/index.js + start + --prover-node + --archiver + --network testnet + depends_on: + prover-broker: + condition: service_started + required: true + environment: + DATA_DIRECTORY: /var/lib/data + ETHEREUM_HOSTS: ${ETHEREUM_HOSTS} + L1_CONSENSUS_HOST_URLS: ${L1_CONSENSUS_HOST_URLS} + LOG_LEVEL: ${LOG_LEVEL} + PROVER_BROKER_HOST: ${PROVER_BROKER_HOST} + PROVER_PUBLISHER_PRIVATE_KEY: ${PROVER_PUBLISHER_PRIVATE_KEY} + P2P_IP: ${P2P_IP} + P2P_PORT: ${P2P_PORT} + AZTEC_PORT: ${AZTEC_PORT} + AZTEC_ADMIN_PORT: ${AZTEC_ADMIN_PORT} + ports: + - ${AZTEC_PORT}:${AZTEC_PORT} + - ${P2P_PORT}:${P2P_PORT} + - ${P2P_PORT}:${P2P_PORT}/udp + volumes: + - ${DATA_DIRECTORY}:/var/lib/data + restart: unless-stopped + + prover-broker: + image: aztecprotocol/aztec:2.1.9 + entrypoint: >- + node + --no-warnings + /usr/src/yarn-project/aztec/dest/bin/index.js + start + --prover-broker + --network testnet + environment: + DATA_DIRECTORY: /var/lib/data + ETHEREUM_HOSTS: ${ETHEREUM_HOSTS} + P2P_IP: ${P2P_IP} + LOG_LEVEL: ${LOG_LEVEL} + ports: + - ${PROVER_BROKER_PORT}:8080 + volumes: + - ${PROVER_BROKER_DATA_DIRECTORY}:/var/lib/data + restart: unless-stopped +``` + +:::warning Security: Admin Port Not Exposed +The admin port (8880) is intentionally **not exposed** to the host machine for security reasons. The admin API provides sensitive operations like configuration changes and database rollbacks that should never be accessible from outside the container. + +If you need to access admin endpoints, use `docker exec`: +```bash +docker exec -it prover-node curl -X POST http://localhost:8880 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"nodeAdmin_getConfig","params":[],"id":1}' +``` +::: + +**Important:** The broker exposes port 8080 via `ports: - ${PROVER_BROKER_PORT}:8080`, making it accessible to external prover agents. Ensure this port is reachable from your agent machines. + +This configuration includes only essential settings. The `--network testnet` flag applies network-specific defaults—see the [CLI reference](../reference/cli_reference.md) for all available configuration options. + +#### Step 4: Start Node and Broker + +```bash +docker compose up -d +``` + +### Prover Agent Setup + +On each machine that will run prover agents: + +#### Step 1: Set Up Directory + +```bash +mkdir aztec-prover-agent +cd aztec-prover-agent +touch .env +``` + +#### Step 2: Configure Environment Variables + +Add to your `.env` file: + +```bash +PROVER_AGENT_COUNT=1 +PROVER_AGENT_POLL_INTERVAL_MS=10000 +PROVER_BROKER_HOST=http://[BROKER_MACHINE_IP]:8080 +PROVER_ID=[address corresponding to PROVER_PUBLISHER_PRIVATE_KEY] +``` + +Replace `[BROKER_MACHINE_IP]` with the IP address of the machine running the prover broker. + +**Agent configuration tips:** + +- Set `PROVER_AGENT_COUNT` based on your machine's hardware (e.g., 64 cores/256 GB RAM = 2 agents, 96 cores/384 GB RAM = 3 agents, 128 cores/512 GB RAM = 4 agents) +- Test connectivity before starting: `curl http://[BROKER_MACHINE_IP]:8080` +- If the curl test fails, check your network configuration, firewall rules, and ensure the broker is running + +#### Step 3: Create Docker Compose File + +Create `docker-compose.yml`: + +```yaml +name: aztec-prover-agent +services: + prover-agent: + image: aztecprotocol/aztec:2.1.9 + entrypoint: >- + node + --no-warnings + /usr/src/yarn-project/aztec/dest/bin/index.js + start + --prover-agent + --network testnet + environment: + PROVER_AGENT_COUNT: ${PROVER_AGENT_COUNT} + PROVER_AGENT_POLL_INTERVAL_MS: ${PROVER_AGENT_POLL_INTERVAL_MS} + PROVER_BROKER_HOST: ${PROVER_BROKER_HOST} + PROVER_ID: ${PROVER_ID} + restart: unless-stopped +``` + +#### Step 4: Start Agent + +```bash +docker compose up -d +``` + +**Scaling your prover capacity:** + +- **Horizontal scaling**: Add more agent machines by repeating the agent setup on additional high-performance machines +- **Vertical scaling**: Increase `PROVER_AGENT_COUNT` on existing machines (ensure adequate hardware) + +All agents, regardless of which machine they're on, must be able to communicate with the broker at the configured `PROVER_BROKER_HOST`. + +## Verification + +Once your prover is running, verify all components are working correctly: + +### Check Services + +On the prover node machine: +```bash +docker compose ps +``` + +On each agent machine: +```bash +docker compose ps +``` + +### View Logs + +On prover node machine: +```bash +# Prover node logs +docker compose logs -f prover-node + +# Broker logs +docker compose logs -f prover-broker +``` + +On agent machines: +```bash +# Agent logs +docker compose logs -f prover-agent +``` + +## Troubleshooting + +### Components not communicating + +**Issue**: Prover agent cannot connect to broker. + +**Solutions**: +- Verify the broker IP address in `PROVER_BROKER_HOST` is correct +- Ensure port 8080 on the broker machine is accessible from agent machines +- Check firewall rules between machines allow traffic on port 8080 +- Test connectivity from agent machine: `curl http://[BROKER_IP]:8080` +- Verify the broker container is running: `docker compose ps` +- Check if the broker port is exposed in docker-compose.yml +- Review broker logs for connection attempts: `docker compose logs prover-broker` + +### Insufficient resources + +**Issue**: Prover agent crashes or performs poorly. + +**Solutions**: +- Verify your hardware meets the minimum requirements (32 cores per agent, 128 GB RAM per agent) +- Check system resource usage: `docker stats` +- Reduce `PROVER_AGENT_COUNT` if running multiple agents per machine +- Ensure no other resource-intensive processes are running +- Monitor CPU and memory usage to verify resources match your configured agent count + +### Agent not picking up jobs + +**Issue**: Agent logs show no job activity. + +**Solutions**: +- Verify the broker is receiving jobs from the prover node +- Check broker logs for errors +- Confirm `PROVER_ID` matches your publisher address +- Ensure agent can reach the broker endpoint +- Test broker connectivity: `curl http://[BROKER_IP]:8080` + +### Docker issues + +**Issue**: Containers won't start or crash repeatedly. + +**Solutions**: +- Ensure Docker and Docker Compose are up to date +- Check disk space availability on all machines +- Verify `.env` files are properly formatted +- Review logs for specific error messages + +### Common Issues + +See the [Operator FAQ](../operation/operator_faq.md) for additional common issues and resolutions. + +## Next Steps + +- Monitor your prover's performance and proof submission rate +- Consider adding more prover agents for increased capacity (either by increasing `PROVER_AGENT_COUNT` or adding more machines) +- Join the [Aztec Discord](https://discord.gg/aztec) for operator support +- Review [creating and voting on proposals](../operation/sequencer_management/creating_and_voting_on_proposals.md) for participating in governance diff --git a/docs/network_versioned_docs/version-v3.0.2/setup/sequencer_management.md b/docs/network_versioned_docs/version-v3.0.2/setup/sequencer_management.md new file mode 100644 index 000000000000..cda6fa982bae --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/setup/sequencer_management.md @@ -0,0 +1,546 @@ +--- +id: sequencer_management +sidebar_position: 1 +title: Running a Sequencer +description: Learn how to manage your sequencer on the Aztec network, including registration, keystore configuration, stake management, and status monitoring. +--- + +## Overview + +This guide covers sequencer lifecycle management on the Aztec network: keystore configuration, node setup, registration, ongoing operations, and eventual exit. + +:::danger Minimum Stake Requirement +To participate as a sequencer on the Aztec network, you must stake a minimum of **200,000 AZTEC tokens**. Ensure you have sufficient tokens before proceeding with sequencer setup and registration. +::: + +Sequencer nodes are critical infrastructure responsible for ordering transactions and producing blocks. They perform three key actions: + +1. Assemble unprocessed transactions and propose the next block +2. Attest to correct execution of transactions in proposed blocks (when part of the sequencer committee) +3. Submit successfully attested blocks to L1 + +Before publication, blocks must be validated by a committee of sequencer nodes who re-execute public transactions and verify private function proofs. Committee members attest to validity by signing the block header. + +Once sufficient attestations are collected (two-thirds of the committee plus one), the block can be submitted to L1. + +### Minimum Hardware Requirements + +- 8 core / 16 vCPU (released in 2015 or later) +- 16 GB RAM +- 1 TB NVMe SSD +- 25 Mbps network connection + +These requirements are subject to change as the network throughput increases. + +**Before proceeding:** Ensure you've reviewed and completed the [prerequisites](../prerequisites.md). + +## Keystore Explanation + +Sequencers require private keys to identify themselves as valid proposers and attesters. These keys are configured through a private keystore file. + +### Private Keystore Structure + +The private keystore file (`keystore.json`) uses the following structure: + +```json +{ + "schemaVersion": 1, + "validators": [ + { + "attester": { + "eth": "ETH_PRIVATE_KEY", + "bls": "BLS_PRIVATE_KEY" + }, + "publisher": ["PUBLISHER_PRIVATE_KEY"], // Optional: defaults to attester key + "feeRecipient": "0x0000000000000000000000000000000000000000000000000000000000000000", // Not currently used, set to all zeros + "coinbase": "ETH_ADDRESS" + } + ] +} +``` + +:::info +The attester field contains both Ethereum and BLS keys: +- **ETH key**: Derives the address that serves as your sequencer's unique identifier in the protocol +- **BLS key**: Used to sign proposals and attestations, as well as for staking operations +::: + +### Field Descriptions + +#### attester (required) + +**Your sequencer's identity.** Contains both Ethereum and BLS keys: + +- **Format**: Object with `eth` and `bls` fields +- **eth**: Ethereum private key - the derived address serves as your sequencer's unique identifier in the protocol +- **bls**: BLS private key - actually signs proposals and attestations, and is used for staking operations (validator registration and proof of possession) +- **Purpose**: The ETH address identifies your sequencer, while the BLS key performs the cryptographic signing of consensus messages + +#### publisher (optional) + +Separate private key(s) for submitting BLS-signed messages to L1. The publisher just pays gas to post already-signed proposals and attestations. + +- **Format**: Array of Ethereum private keys +- **Default**: Uses attester key if not specified +- **Purpose**: Posts signed messages to L1 and pays for gas (doesn't participate in signing) +- **Rule of thumb**: Ensure every publisher account maintains at least 0.1 ETH per attester account it serves. This balance allows the selected publisher to successfully post transactions when chosen. + +:::tip +If you're using the attester ETH key for publishing (no separate publisher keys), you can omit the `publisher` field entirely from your keystore, but you will still need to fund the attester account according to the rule of thumb above. +::: + +#### feeRecipient + +Aztec address that would receive L2 transaction fees. + +- **Format**: 32-byte Aztec address (64 hex characters) +- **Current status**: Not currently used by the protocol - set to `0x0000000000000000000000000000000000000000000000000000000000000000` +- **Purpose**: Reserved for future fee distribution mechanisms + +#### coinbase (optional) + +Ethereum address that receives all L1 block rewards and tx fees. + +- **Format**: Ethereum address +- **Default**: Uses attester address if not specified + +### Generating Keys + +Use the Aztec CLI's keystore utility to generate both your private and public keystores: + +```bash +aztec validator-keys new \ + --fee-recipient 0x0000000000000000000000000000000000000000000000000000000000000000 \ + --staker-output \ + --gse-address 0xa92ecFD0E70c9cd5E5cd76c50Af0F7Da93567a4f \ + --l1-rpc-urls $ETH_RPC +``` + +**Relevant parameters:** +- `--fee-recipient`: Set to all zeros (not currently used by the protocol) +- `--staker-output`: Generate the public keystore for the staking dashboard +- `--gse-address`: The GSE (Governance Staking Escrow) contract address (`0xa92ecFD0E70c9cd5E5cd76c50Af0F7Da93567a4f` for mainnet) +- `--l1-rpc-urls`: Your Ethereum mainnet RPC endpoint + - Set `ETH_RPC` environment variable, or replace `$ETH_RPC` with your Ethereum mainnet RPC URL (e.g., `https://mainnet.infura.io/v3/YOUR_API_KEY`) +- `--count`: Number of validator identities to generate (default: 1) + - Use this to generate multiple attester identities in a single keystore + - Example: `--count 5` generates 5 validator identities with sequential addresses + - All identities are derived from the same mnemonic using different derivation paths + - Useful for operators running multiple sequencer identities or delegated staking providers + + +**This command creates two JSON files:** +1. **Private keystore** (`~/.aztec/keystore/keyN.json`) - Contains your ETH and BLS private keys for running the node +2. **Public keystore** (`~/.aztec/keystore/keyN_staker_output.json`) - Contains only public information (public keys and proof of possession) for the staking dashboard + +Where `N` is an auto-incrementing number (e.g., `key1.json`, `key2.json`, etc.) + +**What gets generated:** +- Automatically generates a mnemonic for key derivation (or provide your own with `--mnemonic`) +- Creates an ETH key (for your sequencer identifier) and BLS key (for signing) +- Computes BLS public keys (G1 and G2) and proof of possession +- Outputs your attester address and BLS public key to the console + +**Example output (single validator):** +``` +No mnemonic provided, generating new one... +Using new mnemonic: + +word1 word2 word3 word4 word5 word6 word7 word8 word9 word10 word11 word12 + +Wrote validator keystore to /Users/aztec/.aztec/keystore/key1.json +Wrote staker output for 1 validator(s) to /Users/aztec/.aztec/keystore/key1_staker_output.json + +acc1: + attester: + eth: 0xA55aB561877E479361BA033c4ff7B516006CF547 + bls: 0xa931139040533679ff3990bfc4f40b63f50807815d77346e3c02919d71891dc1 +``` + +**Example output (multiple validators with `--count 3`):** +``` +No mnemonic provided, generating new one... +Using new mnemonic: + +word1 word2 word3 word4 word5 word6 word7 word8 word9 word10 word11 word12 + +Wrote validator keystore to /Users/aztec/.aztec/keystore/key1.json +Wrote staker output for 3 validator(s) to /Users/aztec/.aztec/keystore/key1_staker_output.json + +acc1: + attester: + eth: 0xA55aB561877E479361BA033c4ff7B516006CF547 + bls: 0xa931139040533679ff3990bfc4f40b63f50807815d77346e3c02919d71891dc1 +acc2: + attester: + eth: 0xB66bC672988F590472CA144e5D8d9F82307DA658 + bls: 0xb842240151644780ff4991cfd5f51c74f61918926e88457f4d13020e82902ed2 +acc3: + attester: + eth: 0xC77cD783999F601583DB255f6E9e0F93418EB769 + bls: 0xc953351262755891ff5aa2dfe6f62d85f72a29a37f99568f5e24131f93a13fe3 +``` + +**Critical: Save your mnemonic phrase!** +- The mnemonic is the **only thing you must save** - it can regenerate all your keys, addresses, and keystores +- Store it securely offline (not on the server running the node) + +**For convenience, note:** +- **Attester address** (eth): Your sequencer's identifier (e.g., `0xA55aB...F547`) - useful for registration and monitoring +- **File paths**: Where the keystores were saved + +All other information (BLS keys, public keys, addresses) can be re-derived from the mnemonic if needed. + +:::tip Provide Your Own Mnemonic +For deterministic key generation or to recreate keys later, provide your own mnemonic: +```bash +aztec validator-keys new \ + --fee-recipient 0x0000000000000000000000000000000000000000000000000000000000000000 \ + --staker-output \ + --gse-address 0xa92ecFD0E70c9cd5E5cd76c50Af0F7Da93567a4f \ + --l1-rpc-urls $ETH_RPC \ + --mnemonic "your twelve word mnemonic phrase here" +``` +::: + +:::tip Generate Multiple Validator Identities +To generate multiple validator identities (useful for delegated staking providers or operators running multiple sequencers): +```bash +# Generate 5 validator identities from the same mnemonic +aztec validator-keys new \ + --fee-recipient 0x0000000000000000000000000000000000000000000000000000000000000000 \ + --staker-output \ + --gse-address 0xa92ecFD0E70c9cd5E5cd76c50Af0F7Da93567a4f \ + --l1-rpc-urls $ETH_RPC \ + --count 5 +``` + +Each identity gets a unique attester address derived from sequential derivation paths. All identities are included in: +- The same private keystore file (`keyN.json`) +- The same public keystore file (`keyN_staker_output.json`) +::: + +For detailed instructions, advanced options, and complete examples, see the [Creating Sequencer Keystores guide](../operation/keystore/creating_keystores.md). + +## Setup with Docker Compose + +### Step 1: Set Up Directory Structure + +Create the directory structure for sequencer data storage: + +```bash +mkdir -p aztec-sequencer/keys aztec-sequencer/data +cd aztec-sequencer +touch .env +``` + +### Step 2: Generate and Move Private Keystore to Docker Directory + +If you haven't already generated your private and public keystores, do so now (see [Generating Keys](#generating-keys) above). + +Move the private keystore (not the public keystore) into the Docker directory: + +```bash +# Move the private keystore to Docker directory (replace N with your key number) +cp ~/.aztec/keystore/keyN.json aztec-sequencer/keys/keystore.json + +# Keep the public keystore for later use with the staking dashboard +# It will be at ~/.aztec/keystore/keyN_staker_output.json +``` + +### Step 3: Fund Your Publisher Account + +Your sequencer needs ETH to pay for gas when submitting blocks to L1. Fund the account that will act as the publisher. + +**Determine which address to fund:** + +```bash +# Get your attester address (this will be your publisher if no separate publisher is configured) +jq -r '.validators[0].attester.eth' aztec-sequencer/keys/keystore.json + +# If you have a separate publisher configured: +jq -r '.validators[0].publisher[0]' aztec-sequencer/keys/keystore.json +``` + +**Funding requirements:** +- **Rule of thumb**: Maintain at least **0.1 ETH per attester account** in each publisher account +- Publisher accounts submit blocks to L1 and pay for gas fees +- The system does not retry with another publisher if a transaction fails due to insufficient funds + +**Examples:** +- 1 attester with 1 publisher (or using attester as publisher) → Maintain ≥ 0.1 ETH +- 3 attesters with 1 publisher → Maintain ≥ 0.3 ETH in that publisher account +- 3 attesters with 2 publishers → Maintain ≥ 0.15 ETH in each publisher account (0.3 ETH total) + +:::tip +Set up monitoring or alerts to notify you when the publisher balance falls below the recommended threshold to prevent failed block publications. +::: + +### Step 4: Configure Environment Variables + +Add the following to your `.env` file: + +```bash +DATA_DIRECTORY=./data +KEY_STORE_DIRECTORY=./keys +LOG_LEVEL=info +ETHEREUM_HOSTS=[your Ethereum mainnet execution endpoint, or a comma separated list if you have multiple] +L1_CONSENSUS_HOST_URLS=[your Ethereum mainnet consensus endpoint, or a comma separated list if you have multiple] +P2P_IP=[your external IP address] +P2P_PORT=40400 +AZTEC_PORT=8080 +AZTEC_ADMIN_PORT=8880 +``` + +:::tip +Find your public IP address with: `curl ipv4.icanhazip.com` +::: + +### Step 5: Create Docker Compose File + +Create a `docker-compose.yml` file in your `aztec-sequencer` directory: + +```yaml +services: + aztec-sequencer: + image: "aztecprotocol/aztec:2.1.9" + container_name: "aztec-sequencer" + ports: + - ${AZTEC_PORT}:${AZTEC_PORT} + - ${P2P_PORT}:${P2P_PORT} + - ${P2P_PORT}:${P2P_PORT}/udp + volumes: + - ${DATA_DIRECTORY}:/var/lib/data + - ${KEY_STORE_DIRECTORY}:/var/lib/keystore + environment: + KEY_STORE_DIRECTORY: /var/lib/keystore + DATA_DIRECTORY: /var/lib/data + LOG_LEVEL: ${LOG_LEVEL} + ETHEREUM_HOSTS: ${ETHEREUM_HOSTS} + L1_CONSENSUS_HOST_URLS: ${L1_CONSENSUS_HOST_URLS} + P2P_IP: ${P2P_IP} + P2P_PORT: ${P2P_PORT} + AZTEC_PORT: ${AZTEC_PORT} + AZTEC_ADMIN_PORT: ${AZTEC_ADMIN_PORT} + entrypoint: >- + node + --no-warnings + /usr/src/yarn-project/aztec/dest/bin/index.js + start + --node + --archiver + --sequencer + --network mainnet + networks: + - aztec + restart: always + +networks: + aztec: + name: aztec +``` + +:::warning Security: Admin Port Not Exposed +The admin port (8880) is intentionally **not exposed** to the host machine for security reasons. The admin API provides sensitive operations like configuration changes and database rollbacks that should never be accessible from outside the container. + +If you need to access admin endpoints, use `docker exec`: +```bash +docker exec -it aztec-sequencer curl -X POST http://localhost:8880 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"nodeAdmin_getConfig","params":[],"id":1}' +``` +::: + +This configuration includes only essential settings. The `--network mainnet` flag applies network-specific defaults—see the [CLI reference](../reference/cli_reference.md) for all available configuration options. + +### Step 6: Start the Sequencer + +Start the sequencer: + +```bash +docker compose up -d +``` + +## Verification + +Once your sequencer is running, verify it's working correctly: + +### Check Sync Status + +Check the current sync status (this may take a few minutes): + +```bash +curl -s -X POST -H 'Content-Type: application/json' \ +-d '{"jsonrpc":"2.0","method":"node_getL2Tips","params":[],"id":67}' \ +http://localhost:8080 | jq -r ".result.proven.number" +``` + +Compare the output with block explorers like [Aztec Scan](https://aztecscan.xyz/) or [Aztec Explorer](https://aztecexplorer.xyz/). + +### Check Node Status + +```bash +curl http://localhost:8080/status +``` + +### View Logs + +```bash +docker compose logs -f --tail 100 aztec-sequencer +``` + +## Next Steps: Registering Your Sequencer + +Now that your sequencer node is set up and running, you need to register it with the network. There are two ways to participate as a sequencer: + +### Option 1: Self-Staking via Staking Dashboard + +Register your sequencer and provide your own stake through the staking dashboard. This is the most common approach for individual operators. + +**→ [Register Your Sequencer (Self-Staking)](../operation/sequencer_management/registering_sequencer.md)** + +You'll use the **public keystore** file (`keyN_staker_output.json`) that was generated when you created your keys. + +### Option 2: Running with Delegated Stake + +Operate sequencers backed by tokens from delegators. This non-custodial system allows you to run sequencer infrastructure while delegators provide the economic backing. + +**→ [Run with Delegated Stake](../operation/sequencer_management/running_delegated_stake.md)** + +As a provider, you'll register with the Staking Registry and manage a queue of sequencer identities that activate when delegators stake to you. + +:::tip Which Option Should I Choose? +- **Self-staking**: You have tokens and want to run your own sequencer +- **Delegated staking**: You want to operate sequencer infrastructure and earn commission from delegators' stake + +Both options use the same node setup from this guide. +::: + +## Monitoring Sequencer Status + +You can query the status of any sequencer (attester) using the Rollup and GSE (Governance Staking Escrow) contracts on L1. + +### Prerequisites + +- Foundry installed (`cast` command) +- Ethereum RPC endpoint +- Registry contract address for your network + +### Get Contract Addresses + +First, get the canonical Rollup contract address from the Registry: + +```bash +# Get the canonical rollup address +cast call [REGISTRY_CONTRACT_ADDRESS] "getCanonicalRollup()" --rpc-url [YOUR_RPC_URL] +``` + +Then get the GSE contract address from the Rollup: + +```bash +# Get the GSE contract address +cast call [ROLLUP_ADDRESS] "getGSE()" --rpc-url [YOUR_RPC_URL] +``` + +### Query Sequencer Status + +Check the complete status and information for a specific sequencer: + +```bash +# Get full attester view (status, balance, exit info, config) +cast call [ROLLUP_ADDRESS] "getAttesterView(address)" [ATTESTER_ADDRESS] --rpc-url [YOUR_RPC_URL] +``` + +This returns an `AttesterView` struct containing: + +1. **status** - The sequencer's current status (see Status Codes below) +2. **effectiveBalance** - The sequencer's effective stake balance +3. **exit** - Exit information (if the sequencer is exiting) +4. **config** - Attester configuration (withdrawer address and public key) + +#### Status Codes + +| Status | Name | Meaning | +| ------ | ---------- | ------------------------------------------------------------------------------------------------------------------------------- | +| 0 | NONE | The sequencer does not exist in the sequencer set | +| 1 | VALIDATING | The sequencer is currently active and participating in consensus | +| 2 | ZOMBIE | The sequencer is not active (balance fell below ejection threshold, possibly due to slashing) but still has funds in the system | +| 3 | EXITING | The sequencer has initiated withdrawal and is in the exit delay period | + +### Performance Monitoring + +Track your sequencer's performance by monitoring: + +- **Effective balance** - Should remain above the ejection threshold +- **Status** - Should be VALIDATING for active participation +- **Attestation rate** - How many attestations you've successfully submitted +- **Proposal success rate** - How many of your proposed blocks were accepted +- **Network participation metrics** - Overall participation in network consensus + +## Exiting a Sequencer + +:::warning +Information about the exit process will be added when the mechanism is finalized. Check the [Aztec Discord](https://discord.gg/aztec) for the latest information on exiting the sequencer set. +::: + +## Troubleshooting + +### Port forwarding not working + +**Issue**: Your node cannot connect to peers. + +**Solutions**: + +- Verify your external IP address matches the `P2P_IP` setting +- Check firewall rules on your router and local machine +- Test connectivity using: `nc -zv [your-ip] 40400` + +### Sequencer not syncing + +**Issue**: Your node is not synchronizing with the network. + +**Solutions**: + +- Check L1 endpoint connectivity +- Verify both execution and consensus clients are fully synced +- Review logs for specific error messages +- Ensure L1 endpoints support high throughput + +### Private keystore issues + +**Issue**: Private keystore not loading or errors about invalid keys. + +**Solutions**: + +- Ensure `keystore.json` is properly formatted +- Verify private keys are valid Ethereum private keys +- Check file permissions on the keys directory + +### Docker issues + +**Issue**: Container won't start or crashes. + +**Solutions**: + +- Ensure Docker and Docker Compose are up to date +- Check disk space availability +- Verify the `.env` file is properly formatted +- Review container logs: `docker compose logs aztec-sequencer` + +### Common Issues + +See the [Operator FAQ](../operation/operator_faq.md) for additional common issues and resolutions. + +## Additional Resources + +After setting up and registering your sequencer: + +- **[Register Your Sequencer](../operation/sequencer_management/registering_sequencer.md)** - Complete registration via staking dashboard +- **[Monitor Sequencer Status](#monitoring-sequencer-status)** - Track performance and attestation rate +- **[Operator FAQ](../operation/operator_faq.md)** - Common issues and resolutions +- **[Creating and Voting on Proposals](../operation/sequencer_management/creating_and_voting_on_proposals.md)** - Participate in governance +- **[High Availability Setup](./high_availability_sequencers.md)** - Run your sequencer across multiple nodes for redundancy +- **[Advanced Keystore Patterns](../operation/keystore/advanced_patterns.md)** - Manage multiple sequencer identities + +**Community support:** +- Join the [Aztec Discord](https://discord.gg/aztec) for operator support and network updates diff --git a/docs/network_versioned_docs/version-v3.0.2/setup/syncing_best_practices.md b/docs/network_versioned_docs/version-v3.0.2/setup/syncing_best_practices.md new file mode 100644 index 000000000000..f59f115b6e6c --- /dev/null +++ b/docs/network_versioned_docs/version-v3.0.2/setup/syncing_best_practices.md @@ -0,0 +1,249 @@ +--- +id: syncing_best_practices +sidebar_position: 3 +title: Using and uploading snapshots +description: Learn sync modes and snapshot strategies to efficiently sync your Aztec node with the network. +--- + +## Overview + +All nodes on the Aztec network must download and synchronize the blockchain state before they can operate. This guide covers different sync modes, including how to use snapshots for faster synchronization and how to create your own snapshots. + +:::tip Automatic Configuration +When using `--network [NETWORK_NAME]`, snapshot URLs are automatically configured for you. Most users don't need to manually set snapshot sources. +::: + +## Understanding sync modes + +Nodes can synchronize state in two ways: + +1. **L1 sync**: Queries the rollup and data availability layer for historical state directly from Layer 1 +2. **Snapshot sync**: Downloads pre-built state snapshots from a storage location for faster synchronization + +Since Aztec uses blobs, syncing from L1 requires an archive node that stores complete blob history from Aztec's deployment. Snapshot sync is significantly faster, doesn't require archive nodes, and reduces load on L1 infrastructure, making it the recommended approach for most deployments. + +## Prerequisites + +Before proceeding, you should: + +- Have the Aztec node software installed +- Understand basic node operation +- For uploading snapshots: Have access to cloud storage (Google Cloud Storage, Amazon S3, or Cloudflare R2) with appropriate permissions + +## Using snapshots to sync your node + +### Configuring sync mode + +Control how your node synchronizes using the `SYNC_MODE` environment variable in your `.env` file: + +```bash +aztec start --node --sync-mode [MODE] +SYNC_MODE=[MODE] +``` + +Available sync modes: + +- **`snapshot`**: Downloads and uses a snapshot only if no local data exists (default behavior) +- **`force-snapshot`**: Downloads and uses a snapshot even if local data exists, overwriting it +- **`l1`**: Syncs directly from Layer 1 without using snapshots + +### Setting the snapshot source + +By default, nodes use Aztec's official snapshot storage. To specify a custom snapshot location, add the `SNAPSHOTS_URL` environment variable to your `.env` file: + +```bash +SYNC_MODE=snapshot +SNAPSHOTS_URL=[BASE_URL] +``` + +The node searches for the snapshot index at: +``` +[BASE_URL]/aztec-[L1_CHAIN_ID]-[VERSION]-[ROLLUP_ADDRESS]/index.json +``` + +**Supported storage backends**: +- **Google Cloud Storage** - `gs://bucket-name/path/` +- **Amazon S3** - `s3://bucket-name/path/` +- **Cloudflare R2** - `s3://bucket-name/path/?endpoint=https://[ACCOUNT_ID].r2.cloudflarestorage.com` +- **HTTP/HTTPS** - `https://host/path` +- **Local filesystem** - `file:///absolute/path` + +**Default snapshot locations by network**: + +- **Mainnet**: `https://aztec-labs-snapshots.com/mainnet/` +- **Testnet**: `https://aztec-labs-snapshots.com/testnet/` +- **Staging networks**: Configured via network metadata + +### Using custom snapshot sources + +You can configure your node to use custom snapshot sources for various use cases. + +Add the following to your `.env` file: + +**Google Cloud Storage:** +```bash +SYNC_MODE=force-snapshot +SNAPSHOTS_URL=gs://my-snapshots/ +``` + +**Cloudflare R2:** +```bash +SYNC_MODE=snapshot +SNAPSHOTS_URL=s3://my-bucket/snapshots/?endpoint=https://[ACCOUNT_ID].r2.cloudflarestorage.com +``` +Replace `[ACCOUNT_ID]` with your Cloudflare account ID. + +**HTTP/HTTPS mirror:** +```bash +SYNC_MODE=snapshot +SNAPSHOTS_URL=https://my-mirror.example.com/snapshots/ +``` + +Then add the environment variables to your `docker-compose.yml`: + +```yaml +environment: + # ... other environment variables + SYNC_MODE: ${SYNC_MODE} + SNAPSHOTS_URL: ${SNAPSHOTS_URL} +``` + +## Creating and uploading snapshots + +You can create snapshots of your node's state for backup purposes or to share with other nodes. This is done by calling the `nodeAdmin_startSnapshotUpload` method on the node admin API. + +### How snapshot upload works + +When triggered, the upload process: + +1. Pauses node syncing temporarily +2. Creates a backup of the archiver and world-state databases +3. Uploads the backup to the specified storage location +4. Resumes normal operation + +### Uploading a snapshot + +Use the node admin API to trigger a snapshot upload. You can upload to Google Cloud Storage, Amazon S3, or Cloudflare R2 by specifying the appropriate storage URI. + +**Example command**: + +**Upload to Google Cloud Storage:** +```bash +docker exec -it aztec-node curl -XPOST http://localhost:8880 \ + -H 'Content-Type: application/json' \ + -d '{ + "method": "nodeAdmin_startSnapshotUpload", + "params": ["gs://your-bucket/snapshots/"], + "id": 1, + "jsonrpc": "2.0" + }' +``` + +**Upload to Amazon S3:** +```bash +docker exec -it aztec-node curl -XPOST http://localhost:8880 \ + -H 'Content-Type: application/json' \ + -d '{ + "method": "nodeAdmin_startSnapshotUpload", + "params": ["s3://your-bucket/snapshots/"], + "id": 1, + "jsonrpc": "2.0" + }' +``` + +**Upload to Cloudflare R2:** +```bash +docker exec -it aztec-node curl -XPOST http://localhost:8880 \ + -H 'Content-Type: application/json' \ + -d '{ + "method": "nodeAdmin_startSnapshotUpload", + "params": ["s3://your-bucket/snapshots/?endpoint=https://[ACCOUNT_ID].r2.cloudflarestorage.com"], + "id": 1, + "jsonrpc": "2.0" + }' +``` + +Replace `aztec-node` with your container name and `[ACCOUNT_ID]` with your Cloudflare account ID. + +**Note**: Ensure your storage credentials are configured before uploading: +- **Google Cloud Storage**: Set up [Application Default Credentials](https://cloud.google.com/docs/authentication/application-default-credentials) +- **Amazon S3 / Cloudflare R2**: Set environment variables `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` + +### Scheduling regular snapshots + +For continuous backup, schedule the upload command to run at regular intervals using cron or a similar scheduler. The frequency depends on how current you need your snapshots to be. + +Once uploaded, other nodes can download these snapshots by configuring their `--snapshots-url` to point to your storage location. + +## Verification + +To verify your sync configuration is working: + +### For snapshot downloads + +1. **Check startup logs**: Look for messages indicating snapshot download progress +2. **Monitor sync time**: Snapshot sync should be significantly faster than L1 sync +3. **Verify state completeness**: Confirm your node has the expected block height after sync +4. **Check data directories**: Ensure the archiver and world-state databases are populated + +### For snapshot uploads + +1. **Check API response**: The upload command should return a success response +2. **Monitor logs**: Watch for upload progress messages in the node logs +3. **Verify storage**: Check your storage bucket to confirm the snapshot files exist +4. **Validate index file**: Ensure the `index.json` file is created at the expected path +5. **Test download**: Try downloading the snapshot with another node to confirm it works + +## Troubleshooting + +### Snapshot download fails + +**Issue**: Node cannot download snapshot from the specified URL. + +**Solutions**: +- Verify the `--snapshots-url` is correct and accessible +- Check network connectivity to the storage location +- Confirm the snapshot index file exists at the expected path +- Review node logs for specific error messages +- Try using Aztec's default snapshot URL to isolate custom URL issues + +### Snapshot upload fails + +**Issue**: The `nodeAdmin_startSnapshotUpload` command returns an error. + +**Solutions**: +- Verify storage credentials are properly configured (Google Cloud, AWS, or Cloudflare R2) +- Check that the specified bucket exists and you have write permissions +- Confirm sufficient disk space is available for creating the backup +- Review node logs for detailed error messages +- For S3/R2: Ensure environment variables `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` are set + +### Storage space issues + +**Issue**: Running out of disk space during sync or snapshot creation. + +**Solutions**: +- Ensure sufficient disk space (at least 2x the expected database size for snapshots) +- Clean up old snapshots or data if running recurring uploads +- Monitor disk usage and set up alerts +- Consider using a larger volume or adding storage + +## Best practices + +- **Use snapshot sync for production**: Snapshot sync is significantly faster and more efficient than L1 sync +- **Choose the right storage backend**: + - Google Cloud Storage for simplicity and GCP integration + - Amazon S3 for AWS infrastructure integration + - Cloudflare R2 for cost-effective public distribution (free egress) +- **Schedule regular snapshots**: Create snapshots at regular intervals if running critical infrastructure +- **Test snapshot restoration**: Periodically verify that your snapshots download and restore correctly +- **Monitor storage costs**: Implement retention policies to manage cloud storage costs +- **Keep snapshots current**: Older snapshots require more time to sync to the current state +- **Use `force-snapshot` sparingly**: Only use when you need to reset to a known state, as it overwrites local data + +## Next Steps + +- Learn about [running bootnodes](./bootnode_operation.md) for improved peer discovery +- Set up [monitoring](../operation/monitoring.md) to track your node's sync progress +- Check the [CLI reference](../reference/cli_reference.md) for additional sync-related options +- Join the [Aztec Discord](https://discord.gg/aztec) for sync optimization tips diff --git a/docs/network_versioned_sidebars/version-v3.0.2-sidebars.json b/docs/network_versioned_sidebars/version-v3.0.2-sidebars.json new file mode 100644 index 000000000000..6661135ec5c4 --- /dev/null +++ b/docs/network_versioned_sidebars/version-v3.0.2-sidebars.json @@ -0,0 +1,200 @@ +{ + "sidebar": [ + { + "type": "html", + "value": "Getting Started", + "className": "sidebar-title" + }, + { + "type": "doc", + "id": "index" + }, + { + "type": "doc", + "id": "prerequisites" + }, + { + "type": "html", + "value": "" + }, + { + "type": "html", + "value": "Setup", + "className": "sidebar-title" + }, + { + "type": "doc", + "id": "setup/running_a_node" + }, + { + "type": "category", + "label": "Running a Sequencer", + "link": { + "type": "doc", + "id": "setup/sequencer_management" + }, + "items": [ + { + "type": "doc", + "id": "setup/high_availability_sequencers" + } + ] + }, + { + "type": "doc", + "id": "setup/running_a_prover" + }, + { + "type": "doc", + "id": "setup/building_from_source" + }, + { + "type": "doc", + "id": "setup/bootnode_operation" + }, + { + "type": "doc", + "id": "setup/syncing_best_practices" + }, + { + "type": "html", + "value": "Operation", + "className": "sidebar-title" + }, + { + "type": "category", + "label": "Monitoring", + "link": { + "type": "doc", + "id": "operation/monitoring" + }, + "items": [ + { + "type": "category", + "label": "Setup Guides", + "items": [ + { + "type": "doc", + "id": "operation/otel_setup" + }, + { + "type": "doc", + "id": "operation/prometheus_setup" + }, + { + "type": "doc", + "id": "operation/grafana_setup" + } + ] + }, + { + "type": "doc", + "id": "operation/metrics_reference" + }, + { + "type": "doc", + "id": "operation/monitoring_example_troubleshooting" + } + ] + }, + { + "type": "category", + "label": "Keystore Usage", + "link": { + "type": "doc", + "id": "operation/keystore/advanced_keystore_guide" + }, + "items": [ + { + "type": "doc", + "id": "operation/keystore/creating_keystores" + }, + { + "type": "doc", + "id": "operation/keystore/storage_methods" + }, + { + "type": "doc", + "id": "operation/keystore/advanced_patterns" + }, + { + "type": "doc", + "id": "operation/keystore/troubleshooting" + } + ] + }, + { + "type": "category", + "label": "Sequencer Management", + "link": { + "type": "doc", + "id": "operation/sequencer_management/sequencer_management_overview" + }, + "items": [ + { + "type": "doc", + "id": "operation/sequencer_management/creating_and_voting_on_proposals" + }, + { + "type": "doc", + "id": "operation/sequencer_management/slashing_and_offenses" + }, + { + "type": "doc", + "id": "operation/sequencer_management/become_a_staking_provider" + }, + { + "type": "doc", + "id": "operation/sequencer_management/claiming_rewards" + }, + { + "type": "doc", + "id": "operation/sequencer_management/useful_commands" + } + ] + }, + { + "type": "doc", + "id": "operation/operator_faq" + }, + { + "type": "html", + "value": "" + }, + { + "type": "html", + "value": "Reference", + "className": "sidebar-title" + }, + { + "type": "category", + "label": "Changelog", + "link": { + "type": "doc", + "id": "reference/changelog/changelog" + }, + "items": [ + { + "type": "doc", + "id": "reference/changelog/v2.0.2" + } + ] + }, + { + "type": "doc", + "id": "reference/cli_reference" + }, + { + "type": "doc", + "id": "reference/node_api_reference" + }, + { + "type": "doc", + "id": "reference/ethereum_rpc_reference" + }, + { + "type": "doc", + "id": "reference/glossary" + } + ] +} diff --git a/docs/network_versions.json b/docs/network_versions.json index 95aba1e1dded..fbb5b4e2f701 100644 --- a/docs/network_versions.json +++ b/docs/network_versions.json @@ -1,4 +1,5 @@ [ + "v3.0.2", "v3.0.1", "v2.1.4", "v2.1.9-ignition" diff --git a/docs/static/aztec-nr-api/v3.0.2/address_note/address_note/index.html b/docs/static/aztec-nr-api/v3.0.2/address_note/address_note/index.html new file mode 100644 index 000000000000..efa22e54e4a5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/address_note/address_note/index.html @@ -0,0 +1,40 @@ + + + + + + +Module address_note documentation + + + + + +
+
aztec-nr - address_note::address_note
+

Module address_note

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/address_note/address_note/struct.AddressNote.html b/docs/static/aztec-nr-api/v3.0.2/address_note/address_note/struct.AddressNote.html new file mode 100644 index 000000000000..e17cfadafd27 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/address_note/address_note/struct.AddressNote.html @@ -0,0 +1,102 @@ + + + + + + +Struct AddressNote documentation + + + + + +
+ +

Struct AddressNote

+
pub struct AddressNote {
+    pub address: AztecAddress,
+}
+
+

Fields

+
address: AztecAddress
+

Trait implementations

+

impl Deserialize for AddressNote

+ +
pub fn deserialize(serialized: [Field; 1]) -> Self + +

impl Eq for AddressNote

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl NoteHash for AddressNote

+ +
pub fn compute_note_hash( + self, + owner: AztecAddress, + storage_slot: Field, + randomness: Field, +) -> Field + +pub fn compute_nullifier( + self, + context: &mut PrivateContext, + owner: AztecAddress, + note_hash_for_nullification: Field, +) -> Field + +pub unconstrained fn compute_nullifier_unconstrained( + self, + owner: AztecAddress, + note_hash_for_nullification: Field, +) -> Field + +

impl NoteProperties<AddressNoteProperties> for AddressNote

+ +
pub fn properties() -> AddressNoteProperties + +

impl NoteType for AddressNote

+ +
pub fn get_id() -> Field + +

impl Packable for AddressNote

+ +
pub fn pack(self) -> [Field; 1] + +pub fn unpack(packed: [Field; 1]) -> Self + +

impl Serialize for AddressNote

+ +
pub fn serialize(self) -> [Field; 1] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/address_note/address_note/struct.AddressNoteProperties.html b/docs/static/aztec-nr-api/v3.0.2/address_note/address_note/struct.AddressNoteProperties.html new file mode 100644 index 000000000000..290ef0bd44d7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/address_note/address_note/struct.AddressNoteProperties.html @@ -0,0 +1,43 @@ + + + + + + +Struct AddressNoteProperties documentation + + + + + +
+ +

Struct AddressNoteProperties

+
pub struct AddressNoteProperties {
+    pub address: PropertySelector,
+}
+
+

Fields

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/address_note/index.html b/docs/static/aztec-nr-api/v3.0.2/address_note/index.html new file mode 100644 index 000000000000..7e8e3f26abe6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/address_note/index.html @@ -0,0 +1,43 @@ + + + + + + +Crate address_note documentation + + + + + +
+
aztec-nr - address_note
+

Crate address_note

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/all.html b/docs/static/aztec-nr-api/v3.0.2/all.html new file mode 100644 index 000000000000..429d57daa880 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/all.html @@ -0,0 +1,344 @@ + + + + + + +All items in aztec-nr documentation + + + + + +
+ +

All items in aztec-nr

+

Structs

+ +

Traits

+ +

Type aliases

+ +

Globals

+ +

Functions

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/balance_set/balance_set/fn.preprocess_notes_min_sum.html b/docs/static/aztec-nr-api/v3.0.2/balance_set/balance_set/fn.preprocess_notes_min_sum.html new file mode 100644 index 000000000000..b744a3622bab --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/balance_set/balance_set/fn.preprocess_notes_min_sum.html @@ -0,0 +1,39 @@ + + + + + + +Function preprocess_notes_min_sum documentation + + + + + +
+ +

Function preprocess_notes_min_sum

+
pub fn preprocess_notes_min_sum(
+    notes: [Option<RetrievedNote<UintNote>>; 16],
+    min_sum: u128,
+) -> [Option<RetrievedNote<UintNote>>; 16]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/balance_set/balance_set/index.html b/docs/static/aztec-nr-api/v3.0.2/balance_set/balance_set/index.html new file mode 100644 index 000000000000..01178865afff --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/balance_set/balance_set/index.html @@ -0,0 +1,43 @@ + + + + + + +Module balance_set documentation + + + + + +
+
aztec-nr - balance_set::balance_set
+

Module balance_set

+

Structs

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/balance_set/balance_set/struct.BalanceSet.html b/docs/static/aztec-nr-api/v3.0.2/balance_set/balance_set/struct.BalanceSet.html new file mode 100644 index 000000000000..64d929063a36 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/balance_set/balance_set/struct.BalanceSet.html @@ -0,0 +1,70 @@ + + + + + + +Struct BalanceSet documentation + + + + + +
+ +

Struct BalanceSet

+
pub struct BalanceSet<Context>
+{ /* private fields */ }
+
+

Implementations

+

impl BalanceSet<UtilityContext>

+ +
pub unconstrained fn balance_of(self) -> u128 + +pub unconstrained fn balance_of_with_offset(self, offset: u32) -> u128 + +

impl BalanceSet<&mut PrivateContext>

+ +
pub fn add(self, addend: u128) -> MaybeNoteMessage<UintNote> + +pub fn sub(self, amount: u128) -> MaybeNoteMessage<UintNote> + +pub fn try_sub(self, target_amount: u128, max_notes: u32) -> u128 + +

Trait implementations

+

impl<Context> OwnedStateVariable<Context> for BalanceSet<Context>

+ +
pub fn new(context: Context, storage_slot: Field, owner: AztecAddress) -> Self + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/balance_set/index.html b/docs/static/aztec-nr-api/v3.0.2/balance_set/index.html new file mode 100644 index 000000000000..41e9e4382352 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/balance_set/index.html @@ -0,0 +1,48 @@ + + + + + + +Crate balance_set documentation + + + + + +
+
aztec-nr - balance_set
+

Crate balance_set

+

Re-exports

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/compressed_string/index.html b/docs/static/aztec-nr-api/v3.0.2/compressed_string/index.html new file mode 100644 index 000000000000..1e8cf40ead3b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/compressed_string/index.html @@ -0,0 +1,49 @@ + + + + + + +Crate compressed_string documentation + + + + + +
+
aztec-nr - compressed_string
+

Crate compressed_string

+

Structs

    +
  • Convenience struct for capturing a string of type str<M>, and converting it +into other basic Noir types. Notably: converts to [Field; N] or [u8; M]. +This particular conversion process tightly-packs the M bytes of the input str +into 31-byte chunks, with each chunk being put into a field. +Each field can store 31 characters, so N should be M/31 rounded up. +Can be used for longer strings that don't fit into a single field.
  • +
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/compressed_string/struct.CompressedString.html b/docs/static/aztec-nr-api/v3.0.2/compressed_string/struct.CompressedString.html new file mode 100644 index 000000000000..437778f84e3c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/compressed_string/struct.CompressedString.html @@ -0,0 +1,82 @@ + + + + + + +Struct CompressedString documentation + + + + + +
+ +

Struct CompressedString

+
pub struct CompressedString<let N: u32, let M: u32>
+{ /* private fields */ }
+
+
+

Convenience struct for capturing a string of type str<M>, and converting it +into other basic Noir types. Notably: converts to [Field; N] or [u8; M]. +This particular conversion process tightly-packs the M bytes of the input str +into 31-byte chunks, with each chunk being put into a field. +Each field can store 31 characters, so N should be M/31 rounded up. +Can be used for longer strings that don't fit into a single field.

+
+

Implementations

+

impl<let M: u32, let N: u32> CompressedString<N, M>

+ +
pub fn from_string(input_string: str<M>) -> Self + +pub fn to_bytes(self) -> [u8; M] + +

Trait implementations

+

impl<let M: u32, let N: u32> Deserialize for CompressedString<N, M>

+ +
pub fn deserialize(serialized: [Field; N * 1]) -> Self + +

impl<let M: u32, let N: u32> Eq for CompressedString<N, M>

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl<let M: u32, let N: u32> Packable for CompressedString<N, M>

+ +
pub fn pack(self) -> [Field; N * 1] + +pub fn unpack(packed: [Field; N * 1]) -> Self + +

impl<let M: u32, let N: u32> Serialize for CompressedString<N, M>

+ +
pub fn serialize(self) -> [Field; N * 1] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/compressed_string/struct.FieldCompressedString.html b/docs/static/aztec-nr-api/v3.0.2/compressed_string/struct.FieldCompressedString.html new file mode 100644 index 000000000000..85f8c7fe9a31 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/compressed_string/struct.FieldCompressedString.html @@ -0,0 +1,80 @@ + + + + + + +Struct FieldCompressedString documentation + + + + + +
+ +

Struct FieldCompressedString

+
pub struct FieldCompressedString
+{ /* private fields */ }
+
+

Implementations

+

impl FieldCompressedString

+ +
pub fn is_eq(self, other: Self) -> bool + +pub fn from_field(input_field: Field) -> Self + +pub fn from_string(input_string: str<31>) -> Self + +pub fn to_bytes(self) -> [u8; 31] + +

Trait implementations

+

impl Deserialize for FieldCompressedString

+ +
pub fn deserialize(serialized: [Field; 1]) -> Self + +

impl Eq for FieldCompressedString

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Packable for FieldCompressedString

+ +
pub fn pack(self) -> [Field; 1] + +pub fn unpack(packed: [Field; 1]) -> Self + +

impl Serialize for FieldCompressedString

+ +
pub fn serialize(self) -> [Field; 1] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/field_note/field_note/index.html b/docs/static/aztec-nr-api/v3.0.2/field_note/field_note/index.html new file mode 100644 index 000000000000..889d9d20a2ef --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/field_note/field_note/index.html @@ -0,0 +1,40 @@ + + + + + + +Module field_note documentation + + + + + +
+
aztec-nr - field_note::field_note
+

Module field_note

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/field_note/field_note/struct.FieldNote.html b/docs/static/aztec-nr-api/v3.0.2/field_note/field_note/struct.FieldNote.html new file mode 100644 index 000000000000..d4cb28d9c62b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/field_note/field_note/struct.FieldNote.html @@ -0,0 +1,102 @@ + + + + + + +Struct FieldNote documentation + + + + + +
+ +

Struct FieldNote

+
pub struct FieldNote {
+    pub value: Field,
+}
+
+

Fields

+
value: Field
+

Trait implementations

+

impl Deserialize for FieldNote

+ +
pub fn deserialize(serialized: [Field; 1]) -> Self + +

impl Eq for FieldNote

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl NoteHash for FieldNote

+ +
pub fn compute_note_hash( + self, + owner: AztecAddress, + storage_slot: Field, + randomness: Field, +) -> Field + +pub fn compute_nullifier( + self, + context: &mut PrivateContext, + owner: AztecAddress, + note_hash_for_nullification: Field, +) -> Field + +pub unconstrained fn compute_nullifier_unconstrained( + self, + owner: AztecAddress, + note_hash_for_nullification: Field, +) -> Field + +

impl NoteProperties<FieldNoteProperties> for FieldNote

+ +
pub fn properties() -> FieldNoteProperties + +

impl NoteType for FieldNote

+ +
pub fn get_id() -> Field + +

impl Packable for FieldNote

+ +
pub fn pack(self) -> [Field; 1] + +pub fn unpack(packed: [Field; 1]) -> Self + +

impl Serialize for FieldNote

+ +
pub fn serialize(self) -> [Field; 1] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/field_note/field_note/struct.FieldNoteProperties.html b/docs/static/aztec-nr-api/v3.0.2/field_note/field_note/struct.FieldNoteProperties.html new file mode 100644 index 000000000000..46fe3acbd366 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/field_note/field_note/struct.FieldNoteProperties.html @@ -0,0 +1,43 @@ + + + + + + +Struct FieldNoteProperties documentation + + + + + +
+ +

Struct FieldNoteProperties

+
pub struct FieldNoteProperties {
+    pub value: PropertySelector,
+}
+
+

Fields

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/field_note/index.html b/docs/static/aztec-nr-api/v3.0.2/field_note/index.html new file mode 100644 index 000000000000..784e09bf2f1c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/field_note/index.html @@ -0,0 +1,43 @@ + + + + + + +Crate field_note documentation + + + + + +
+
aztec-nr - field_note
+

Crate field_note

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/index.html b/docs/static/aztec-nr-api/v3.0.2/index.html new file mode 100644 index 000000000000..c2c756e7ead1 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/index.html @@ -0,0 +1,33 @@ + + + + + + +aztec-nr documentation documentation + + + + + +
+ +

aztec-nr documentation

+

Crates

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/nargo_doc.js b/docs/static/aztec-nr-api/v3.0.2/nargo_doc.js new file mode 100644 index 000000000000..a0d72a8935af --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/nargo_doc.js @@ -0,0 +1,36 @@ +var sidebarShown = false; + +const button = document.getElementById('sidebar-toggle-button'); +const main = document.getElementsByTagName('main')[0]; +const sidebar = document.getElementsByTagName('nav')[0]; + +// When clicking on the hamburger icon, toggle between showing +// the sidebar or hiding the sidebar +button.onclick = function () { + if (sidebarShown) { + hideSidebar(); + } else { + showSidebar(); + } +}; + +// When clicking on a sidebar link that is an anchor to the main +// content, hide the sidebar and show the main content. +const allSidebarLinks = document.querySelectorAll('.sidebar a'); +for (const link of allSidebarLinks) { + if (link.href.includes('#')) { + link.onclick = hideSidebar; + } +} + +function showSidebar() { + main.style.display = 'none'; + sidebar.style.display = 'block'; + sidebarShown = true; +} + +function hideSidebar() { + main.style.display = 'block'; + sidebar.style.display = 'none'; + sidebarShown = false; +} diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/account/global.AccountFeePaymentMethodOptions.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/account/global.AccountFeePaymentMethodOptions.html new file mode 100644 index 000000000000..7795edce8658 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/account/global.AccountFeePaymentMethodOptions.html @@ -0,0 +1,37 @@ + + + + + + +Global AccountFeePaymentMethodOptions documentation + + + + + +
+ +

Global AccountFeePaymentMethodOptions

+
pub global AccountFeePaymentMethodOptions: AccountFeePaymentMethodOptionsEnum;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/account/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/account/index.html new file mode 100644 index 000000000000..078b1adee008 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/account/index.html @@ -0,0 +1,48 @@ + + + + + + +Module account documentation + + + + + +
+ +

Module account

+

Structs

+

Globals

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/account/struct.AccountActions.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/account/struct.AccountActions.html new file mode 100644 index 000000000000..7886aa08a653 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/account/struct.AccountActions.html @@ -0,0 +1,90 @@ + + + + + + +Struct AccountActions documentation + + + + + +
+ +

Struct AccountActions

+
pub struct AccountActions<Context>
+{ /* private fields */ }
+
+

Implementations

+

impl<Context> AccountActions<Context>

+ +
pub fn init( + context: Context, + is_valid_impl: fn(&mut PrivateContext, Field) -> bool, +) -> Self + +

impl AccountActions<&mut PrivateContext>

+ +
pub fn entrypoint( + self, + app_payload: AppPayload, + fee_payment_method: u8, + cancellable: bool, +) + +
+

Verifies that the app_hash is authorized and executes the app_payload.

+

@param app_payload The payload that contains the calls to be executed in the app phase.

+

@param fee_payment_method The mechanism via which the account contract will pay for the transaction:

+
    +
  • EXTERNAL (0): Signals that some other contract is in charge of paying the fee, nothing needs to be done.
  • +
  • PREEXISTING_FEE_JUICE (1): Makes the account contract publicly pay for the transaction with its own FeeJuice +balance, which it must already have prior to this transaction. The contract will +set itself as the fee payer and end the setup phase.
  • +
  • FEE_JUICE_WITH_CLAIM (2): Makes the account contract publicly pay for the transaction with its own FeeJuice +balance which is being claimed in the same transaction. The contract will set +itself as the fee payer but not end setup phase - this is done by the FeeJuice +contract after enqueuing a public call, which unlike most public calls is +whitelisted to be executable during setup.
  • +
+

@param cancellable Controls whether to emit app_payload.tx_nonce as a nullifier, allowing a subsequent +transaction to be sent with a higher priority fee. This can be used to cancel the first transaction sent, +assuming it hasn't been mined yet.

+
+
pub fn verify_private_authwit(self, inner_hash: Field) -> Field + +
+

Verifies that the msg_sender is authorized to consume inner_hash by the account.

+

Computes the message_hash using the msg_sender, chain_id, version and inner_hash. +Then executes the is_valid_impl function to verify that the message is authorized.

+

Will revert if the message is not authorized.

+

@param inner_hash The hash of the message that the msg_sender is trying to consume.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/account/struct.AccountFeePaymentMethodOptionsEnum.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/account/struct.AccountFeePaymentMethodOptionsEnum.html new file mode 100644 index 000000000000..fddc9f2a927e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/account/struct.AccountFeePaymentMethodOptionsEnum.html @@ -0,0 +1,52 @@ + + + + + + +Struct AccountFeePaymentMethodOptionsEnum documentation + + + + + +
+ +

Struct AccountFeePaymentMethodOptionsEnum

+
pub struct AccountFeePaymentMethodOptionsEnum {
+    pub EXTERNAL: u8,
+    pub PREEXISTING_FEE_JUICE: u8,
+    pub FEE_JUICE_WITH_CLAIM: u8,
+}
+
+

Fields

+
EXTERNAL: u8
+
PREEXISTING_FEE_JUICE: u8
+
FEE_JUICE_WITH_CLAIM: u8
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/fn.assert_current_call_valid_authwit.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/fn.assert_current_call_valid_authwit.html new file mode 100644 index 000000000000..f2be46167a3f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/fn.assert_current_call_valid_authwit.html @@ -0,0 +1,59 @@ + + + + + + +Function assert_current_call_valid_authwit documentation + + + + + +
+ +

Function assert_current_call_valid_authwit

+
pub fn assert_current_call_valid_authwit<let N: u32>(
+    context: &mut PrivateContext,
+    on_behalf_of: AztecAddress,
+)
+ +
+

Assert that on_behalf_of has authorized the current call with a valid authentication witness

+

Compute the inner_hash using the msg_sender, selector and args_hash and then make a call out to the +on_behalf_of contract to verify that the inner_hash is valid.

+

Additionally, this function emits the identifying information of the call as an offchain effect +so PXE can rely the information to the user/wallet in a readable way. To that effect, it is generic over N, +where N is the number of arguments the authorized functions takes. This is used to load the arguments +from the execution cache. This function is intended to be called via a macro, which will use the turbofish +operator to specify the number of arguments.

+

@param on_behalf_of The address that has allegedly authorized the current call

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/fn.assert_current_call_valid_authwit_public.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/fn.assert_current_call_valid_authwit_public.html new file mode 100644 index 000000000000..094516c6e7d2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/fn.assert_current_call_valid_authwit_public.html @@ -0,0 +1,56 @@ + + + + + + +Function assert_current_call_valid_authwit_public documentation + + + + + +
+ +

Function assert_current_call_valid_authwit_public

+
pub unconstrained fn assert_current_call_valid_authwit_public(
+    context: PublicContext,
+    on_behalf_of: AztecAddress,
+)
+ +
+

Assert that on_behalf_of has authorized the current call in the authentication registry

+

Compute the inner_hash using the msg_sender, selector and args_hash and then make a call out to the +on_behalf_of contract to verify that the inner_hash is valid.

+

Note that the authentication registry will take the msg_sender into account as the consumer, so this will only +work if the msg_sender is the same as the consumer when the message_hash was inserted into the registry.

+

@param on_behalf_of The address that has allegedly authorized the current call

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/fn.assert_inner_hash_valid_authwit.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/fn.assert_inner_hash_valid_authwit.html new file mode 100644 index 000000000000..809cab5e9f95 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/fn.assert_inner_hash_valid_authwit.html @@ -0,0 +1,56 @@ + + + + + + +Function assert_inner_hash_valid_authwit documentation + + + + + +
+ +

Function assert_inner_hash_valid_authwit

+
pub fn assert_inner_hash_valid_authwit(
+    context: &mut PrivateContext,
+    on_behalf_of: AztecAddress,
+    inner_hash: Field,
+)
+ +
+

Assert that a specific inner_hash is valid for the on_behalf_of address

+

Used as an internal function for assert_current_call_valid_authwit and can be used as a standalone function when +the inner_hash is from a different source, e.g., say a block of text etc.

+

@param on_behalf_of The address that has allegedly authorized the current call +@param inner_hash The hash of the message to authorize

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/fn.assert_inner_hash_valid_authwit_public.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/fn.assert_inner_hash_valid_authwit_public.html new file mode 100644 index 000000000000..7412f1b42c98 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/fn.assert_inner_hash_valid_authwit_public.html @@ -0,0 +1,57 @@ + + + + + + +Function assert_inner_hash_valid_authwit_public documentation + + + + + +
+ +

Function assert_inner_hash_valid_authwit_public

+
pub unconstrained fn assert_inner_hash_valid_authwit_public(
+    context: PublicContext,
+    on_behalf_of: AztecAddress,
+    inner_hash: Field,
+)
+ +
+

Assert that on_behalf_of has authorized a specific inner_hash in the authentication registry

+

Compute the inner_hash using the msg_sender, selector and args_hash and then make a call out to the +on_behalf_of contract to verify that the inner_hash is valid.

+

Note that the authentication registry will take the msg_sender into account as the consumer, so this will only +work if the msg_sender is the same as the consumer when the message_hash was inserted into the registry.

+

@param on_behalf_of The address that has allegedly authorized the inner_hash

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/fn.compute_authwit_message_hash.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/fn.compute_authwit_message_hash.html new file mode 100644 index 000000000000..5a9f315bd5bf --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/fn.compute_authwit_message_hash.html @@ -0,0 +1,57 @@ + + + + + + +Function compute_authwit_message_hash documentation + + + + + +
+ +

Function compute_authwit_message_hash

+
pub fn compute_authwit_message_hash(
+    consumer: AztecAddress,
+    chain_id: Field,
+    version: Field,
+    inner_hash: Field,
+) -> Field
+ +
+

Computes the message_hash for the authentication witness

+

@param consumer The address of the contract that is consuming the message +@param chain_id The chain id of the chain that the message is being consumed on +@param version The version of the chain that the message is being consumed on +@param inner_hash The hash of the "inner" message that is being consumed

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/fn.compute_authwit_message_hash_from_call.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/fn.compute_authwit_message_hash_from_call.html new file mode 100644 index 000000000000..52a0b1042fa9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/fn.compute_authwit_message_hash_from_call.html @@ -0,0 +1,64 @@ + + + + + + +Function compute_authwit_message_hash_from_call documentation + + + + + +
+ +

Function compute_authwit_message_hash_from_call

+
pub fn compute_authwit_message_hash_from_call<let N: u32>(
+    caller: AztecAddress,
+    consumer: AztecAddress,
+    chain_id: Field,
+    version: Field,
+    selector: FunctionSelector,
+    args: [Field; N],
+) -> Field
+ +
+

Compute the message_hash from a function call to be used by an authentication witness

+

Useful for when you need a non-account contract to approve during execution. For example if you need a contract +to make a call to nested contract, e.g., contract A wants to exit token T to L1 using bridge B, so it needs to allow +B to transfer T on its behalf.

+

@param caller The address of the contract that is calling the function, in the example above, this would be B +@param consumer The address of the contract that is consuming the message, in the example above, this would be T +@param chain_id The chain id of the chain that the message is being consumed on +@param version The version of the chain that the message is being consumed on +@param selector The function selector of the function that is being called +@param args The arguments of the function that is being called

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/fn.compute_authwit_nullifier.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/fn.compute_authwit_nullifier.html new file mode 100644 index 000000000000..3dfcd11a50ef --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/fn.compute_authwit_nullifier.html @@ -0,0 +1,51 @@ + + + + + + +Function compute_authwit_nullifier documentation + + + + + +
+ +

Function compute_authwit_nullifier

+
pub fn compute_authwit_nullifier(on_behalf_of: AztecAddress, inner_hash: Field) -> Field
+ +
+

Computes the authwit_nullifier for a specific on_behalf_of and inner_hash

+

Using the on_behalf_of and the inner_hash to ensure that the nullifier is siloed for a specific on_behalf_of.

+

@param on_behalf_of The address that has authorized the inner_hash +@param inner_hash The hash of the message to authorize

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/fn.compute_inner_authwit_hash.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/fn.compute_inner_authwit_hash.html new file mode 100644 index 000000000000..2c49c0b92772 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/fn.compute_inner_authwit_hash.html @@ -0,0 +1,51 @@ + + + + + + +Function compute_inner_authwit_hash documentation + + + + + +
+ +

Function compute_inner_authwit_hash

+
pub fn compute_inner_authwit_hash<let N: u32>(args: [Field; N]) -> Field
+ +
+

Computes the inner_hash of the authentication witness

+

This is used internally, but also useful in cases where you want to compute the inner_hash for a specific message +that is not necessarily a call, but just some "bytes" or text.

+

@param args The arguments to hash

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/fn.set_authorized.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/fn.set_authorized.html new file mode 100644 index 000000000000..701a1c05ff50 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/fn.set_authorized.html @@ -0,0 +1,55 @@ + + + + + + +Function set_authorized documentation + + + + + +
+ +

Function set_authorized

+
pub unconstrained fn set_authorized(
+    context: PublicContext,
+    message_hash: Field,
+    authorize: bool,
+)
+ +
+

Helper function to set the authorization status of a message hash

+

Wraps a public call to the authentication registry to set the authorization status of a message_hash

+

@param message_hash The hash of the message to authorize +@param authorize True if the message should be authorized, false if it should be revoked

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/fn.set_reject_all.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/fn.set_reject_all.html new file mode 100644 index 000000000000..6de4f5f204df --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/fn.set_reject_all.html @@ -0,0 +1,50 @@ + + + + + + +Function set_reject_all documentation + + + + + +
+ +

Function set_reject_all

+
pub unconstrained fn set_reject_all(context: PublicContext, reject: bool)
+ +
+

Helper function to reject all authwits

+

Wraps a public call to the authentication registry to set the reject_all flag

+

@param reject True if all authwits should be rejected, false otherwise

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/global.IS_VALID_SELECTOR.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/global.IS_VALID_SELECTOR.html new file mode 100644 index 000000000000..72ad35231063 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/global.IS_VALID_SELECTOR.html @@ -0,0 +1,199 @@ + + + + + + +Global IS_VALID_SELECTOR documentation + + + + + +
+ +

Global IS_VALID_SELECTOR

+
pub global IS_VALID_SELECTOR: Field;
+ +
+

Authentication witness helper library

+

Authentication Witness is a scheme for authenticating actions on Aztec, so users can allow third-parties +(e.g. protocols or other users) to execute an action on their behalf.

+

This library provides helper functions to manage such witnesses. +The authentication witness, is some "witness" (data) that authenticates a message_hash. +The simplest example of an authentication witness, is a signature. The signature is the "evidence", +that the signer has seen the message, agrees with it, and has allowed it. +It does not need to be a signature. It could be any kind of "proof" that the message is allowed. +Another proof could be knowing some kind of secret, or having some kind of "token" that allows the message.

+

The message_hash is a hash of the following structure: +hash(consumer, chain_id, version, inner_hash)

+
    +
  • consumer: the address of the contract that is "consuming" the message,
  • +
  • chain_id: the chain id of the chain that the message is being consumed on,
  • +
  • version: the version of the chain that the message is being consumed on,
  • +
  • inner_hash: the hash of the "inner" message that is being consumed, this is the "actual" message or action.
  • +
+

While the inner_hash could be anything, such as showing you signed a specific message, it will often be +a hash of the "action" to approve, along with who made the call. As part of this library, we provide a few +helper functions to deal with such messages.

+

For example, we provide helper function that is used for checking that the message is an encoding of the current call. +This can be used to let some contract "allow" another contract to act on its behalf, as long as it can +show that it is acting on behalf of the contract.

+

If we take a case of allowing a contract to transfer tokens on behalf of an account, the inner_hash can be +derived as: +inner_hash = hash(caller, "transfer", hash(to, amount))

+

Where the caller would be the address of the contract that is trying to transfer the tokens, and to and amount +the arguments for the transfer.

+

Note that we have both a caller and a consumer, the consumer will be the contract that is consuming the message, +in the case of the transfer, it would be the Token contract itself, while the caller, will be the actor that is +allowed to transfer the tokens.

+

The authentication mechanism works differently in public and private contexts. In private, we recall that everything +is executed on the user's device, so we can use oracles to "ask" the user (not contract) for information. In public +we cannot do this, since it is executed by the sequencer (someone else). Therefore we can instead use a "registry" +to store the messages that we have approved.

+

A simple example would be a "token" that is being "pulled" from one account into another. We will first outline +how this would look in private, and then in public later.

+

Say that a user Alice wants to deposit some tokens into a DeFi protocol (say a DEX). +Alice would make a deposit transaction, that she is executing using her account contract. +The account would call the DeFi contract to execute deposit, which would try to pull funds from the Token +contract. Since the DeFi contract is trying to pull funds from an account that is not its own, it needs to +convince the Token contract that it is allowed to do so.

+

This is where the authentication witness comes in The Token contract computes a message_hash from the +transfer call, and then asks Alice Account contract to verify that the DeFi contract is allowed to +execute that call.

+

Alice Account contract can then ask Alice if she wants to allow the DeFi contract to pull funds from her +account. If she does, she will sign the message_hash and return the signature to the Alice Account which +will validate it and return success to the Token contract which will then allow the DeFi contract to pull +funds from Alice.

+

To ensure that the same "approval" cannot be used multiple times, we also compute a nullifier for the +authentication witness, and emit it from the Token contract (consumer).

+

Note that we can do this flow as we are in private were we can do oracle calls out from contracts.

+

Person Contract Contract Contract +Alice Alice Account Token DeFi +| | | | +| Defi.deposit(Token, 1000) | | +|----------------->| | | +| | deposit(Token, 1000) | +| |---------------------------------------->| +| | | | +| | | transfer(Alice, Defi, 1000) +| | |<---------------------| +| | | | +| | Check if Defi may call transfer(Alice, Defi, 1000) +| |<-----------------| | +| | | | +| Please give me AuthWit for DeFi | | +| calling transfer(Alice, Defi, 1000) | | +|<-----------------| | | +| | | | +| | | | +| AuthWit for transfer(Alice, Defi, 1000) | +|----------------->| | | +| | AuthWit validity | | +| |----------------->| | +| | | | +| | throw if invalid AuthWit | +| | | | +| | emit AuthWit nullifier | +| | | | +| | transfer(Alice, Defi, 1000) | +| | | | +| | | | +| | | success | +| | |--------------------->| +| | | | +| | | | +| | | deposit(Token, 1000) +| | | | +| | | |

+

If we instead were in public, we cannot do the same flow. Instead we would use an authentication registry to store +the messages that we have approved.

+

To approve a message, Alice Account can make a set_authorized call to the registry, to set a message_hash +as authorized. This is essentially a mapping from message_hash to true for Alice Contract. Every account +has its own map in the registry, so Alice cannot approve a message for Bob.

+

The Token contract can then try to "spend" the approval by calling consume on the registry. If the message +was approved, the value is updated to false, and we return the success flag. For more information on the +registry, see main.nr in auth_registry_contract.

+

Person Contract Contract Contract Contract +Alice Alice Account Registry Token DeFi +| | | | | +| Registry.set_authorized(..., true) | | | +|----------------->| | | | +| | set_authorized(..., true) | | +| |------------------->| | | +| | | | | +| | set authorized to true | | +| | | | | +| | | | | +| Defi.deposit(Token, 1000) | | | +|----------------->| | | | +| | deposit(Token, 1000) | | +| |-------------------------------------------------------------->| +| | | | | +| | | transfer(Alice, Defi, 1000) | +| | | |<---------------------| +| | | | | +| | | Check if Defi may call transfer(Alice, Defi, 1000) +| | |<------------------| | +| | | | | +| | throw if invalid AuthWit | | +| | | | | +| | | | | +| | set authorized to false | | +| | | | | +| | | | | +| | | AuthWit validity | | +| | |------------------>| | +| | | | | +| | | | transfer(Alice, Defi, 1000) +| | | |<-------------------->| +| | | | | +| | | | success | +| | | |--------------------->| +| | | | | +| | | | deposit(Token, 1000) +| | | | |

+

--- FAQ --- +Q: Why are we using a success flag of poseidon2_hash_bytes("IS_VALID()") instead of just returning a boolean? +A: We want to make sure that we don't accidentally return true if there is a collision in the function selector. +By returning a hash of IS_VALID(), it becomes very unlikely that there is both a collision and we return +a success flag.

+

Q: Why are we using static calls? +A: We are using static calls to ensure that the account contract cannot re-enter. If it was a normal call, it +could make a new call and do a re-entry attack. Using a static ensures that it cannot update any state.

+

Q: Would it not be cheaper to use a nullifier instead of updating state in public? +A: At a quick glance, a public state update + nullifier is 96 bytes, but two state updates are 128, so it would be +cheaper to use a nullifier, if this is the way it would always be done. However, if both the approval and the +consumption is done in the same transaction, then we will be able to squash the updates (only final tx state diff is posted to DA), and now it is cheaper.

+

Q: Why is the chain id and the version part of the message hash? +A: The chain id and the version is part of the message hash to ensure that the message is only valid on a specific +chain to avoid a case where the same message could be used across multiple chains.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/index.html new file mode 100644 index 000000000000..f8c537a3d75d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/auth/index.html @@ -0,0 +1,56 @@ + + + + + + +Module auth documentation + + + + + +
+ +

Module auth

+

Functions

+

Globals

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/authorization_interface/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/authorization_interface/index.html new file mode 100644 index 000000000000..c00af6af8978 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/authorization_interface/index.html @@ -0,0 +1,46 @@ + + + + + + +Module authorization_interface documentation + + + + + +
+
aztec-nr - noir_aztec::authwit::authorization_interface
+

Module authorization_interface

+

Traits

    +
  • Allows getting the selector for an authorization struct (see src/macros/authorization.nr) +used to uniquely identify them and avoiding collisions. This is important +because authorizations are emitted as offchain effects and their +unique selector allows users/wallets to decode them correctly
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/authorization_interface/trait.AuthorizationInterface.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/authorization_interface/trait.AuthorizationInterface.html new file mode 100644 index 000000000000..4e74829cf665 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/authorization_interface/trait.AuthorizationInterface.html @@ -0,0 +1,60 @@ + + + + + + +Trait AuthorizationInterface documentation + + + + + +
+ +

Trait AuthorizationInterface

+
pub trait AuthorizationInterface {
+    // Required methods
+    pub fn get_authorization_selector(self) -> AuthorizationSelector;
+}
+ +
+

Allows getting the selector for an authorization struct (see src/macros/authorization.nr) +used to uniquely identify them and avoiding collisions. This is important +because authorizations are emitted as offchain effects and their +unique selector allows users/wallets to decode them correctly

+
+

Required methods

+
pub fn get_authorization_selector(self) -> AuthorizationSelector + +
+

Returns the unique identifier of the authorization type.

+
+

Implementors

+

impl AuthorizationInterface for CallAuthorization

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/authorization_selector/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/authorization_selector/index.html new file mode 100644 index 000000000000..3e9781d7b7b3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/authorization_selector/index.html @@ -0,0 +1,43 @@ + + + + + + +Module authorization_selector documentation + + + + + +
+
aztec-nr - noir_aztec::authwit::authorization_selector
+

Module authorization_selector

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/authorization_selector/struct.AuthorizationSelector.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/authorization_selector/struct.AuthorizationSelector.html new file mode 100644 index 000000000000..26f579b73803 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/authorization_selector/struct.AuthorizationSelector.html @@ -0,0 +1,88 @@ + + + + + + +Struct AuthorizationSelector documentation + + + + + +
+ +

Struct AuthorizationSelector

+
pub struct AuthorizationSelector
+{ /* private fields */ }
+
+

Implementations

+

impl AuthorizationSelector

+ +
pub fn from_u32(value: u32) -> Self + +pub fn from_signature<let N: u32>(signature: str<N>) -> Self + +pub fn zero() -> Self + +

Trait implementations

+

impl Deserialize for AuthorizationSelector

+ +
pub fn deserialize(serialized: [Field; 1]) -> Self + +

impl Empty for AuthorizationSelector

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for AuthorizationSelector

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl FromField for AuthorizationSelector

+ +
pub fn from_field(field: Field) -> Self + +

impl Serialize for AuthorizationSelector

+ +
pub fn serialize(self) -> [Field; 1] + +

impl ToField for AuthorizationSelector

+ +
pub fn to_field(self) -> Field + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/entrypoint/app/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/entrypoint/app/index.html new file mode 100644 index 000000000000..33d7cd4e00d6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/entrypoint/app/index.html @@ -0,0 +1,40 @@ + + + + + + +Module app documentation + + + + + +
+ +

Module app

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/entrypoint/app/struct.AppPayload.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/entrypoint/app/struct.AppPayload.html new file mode 100644 index 000000000000..07ac3d79d383 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/entrypoint/app/struct.AppPayload.html @@ -0,0 +1,66 @@ + + + + + + +Struct AppPayload documentation + + + + + +
+ +

Struct AppPayload

+
pub struct AppPayload {
+    pub tx_nonce: Field,
+    /* private fields */
+}
+
+

Fields

+
tx_nonce: Field
+

Implementations

+

impl AppPayload

+ +
pub fn execute_calls(self, context: &mut PrivateContext) + +

Trait implementations

+

impl Hash for AppPayload

+ +
pub fn hash(self) -> Field + +

impl Serialize for AppPayload

+ +
pub fn serialize(self) -> [Field; 31] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/entrypoint/function_call/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/entrypoint/function_call/index.html new file mode 100644 index 000000000000..2668bd642a0f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/entrypoint/function_call/index.html @@ -0,0 +1,40 @@ + + + + + + +Module function_call documentation + + + + + +
+ +

Module function_call

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/entrypoint/function_call/struct.FunctionCall.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/entrypoint/function_call/struct.FunctionCall.html new file mode 100644 index 000000000000..2f47170d9873 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/entrypoint/function_call/struct.FunctionCall.html @@ -0,0 +1,75 @@ + + + + + + +Struct FunctionCall documentation + + + + + +
+ +

Struct FunctionCall

+
pub struct FunctionCall {
+    pub args_hash: Field,
+    pub function_selector: FunctionSelector,
+    pub target_address: AztecAddress,
+    pub is_public: bool,
+    pub hide_msg_sender: bool,
+    pub is_static: bool,
+}
+
+

Fields

+
args_hash: Field
+
function_selector: FunctionSelector
+
target_address: AztecAddress
+
is_public: bool
+
hide_msg_sender: bool
+
is_static: bool
+

Implementations

+

impl FunctionCall

+ +
pub fn to_be_bytes(self) -> [u8; 99] + +

Trait implementations

+

impl Serialize for FunctionCall

+ +
pub fn serialize(self) -> [Field; 6] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/entrypoint/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/entrypoint/index.html new file mode 100644 index 000000000000..bbd48580f5f0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/entrypoint/index.html @@ -0,0 +1,44 @@ + + + + + + +Module entrypoint documentation + + + + + +
+
aztec-nr - noir_aztec::authwit::entrypoint
+

Module entrypoint

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/index.html new file mode 100644 index 000000000000..63086b87aa78 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/authwit/index.html @@ -0,0 +1,57 @@ + + + + + + +Module authwit documentation + + + + + +
+
aztec-nr - noir_aztec::authwit
+

Module authwit

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/calls/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/calls/index.html new file mode 100644 index 000000000000..894a4defdf14 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/calls/index.html @@ -0,0 +1,50 @@ + + + + + + +Module calls documentation + + + + + +
+ +

Module calls

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/calls/struct.PrivateCall.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/calls/struct.PrivateCall.html new file mode 100644 index 000000000000..a9b315092ff9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/calls/struct.PrivateCall.html @@ -0,0 +1,83 @@ + + + + + + +Struct PrivateCall documentation + + + + + +
+ +

Struct PrivateCall

+
pub struct PrivateCall<let M: u32, let N: u32, T> {
+    pub target_contract: AztecAddress,
+    pub selector: FunctionSelector,
+    pub name: str<M>,
+    pub args: [Field; N],
+    /* private fields */
+}
+
+

Fields

+
target_contract: AztecAddress
+
+
name: str<M>
+
args: [Field; N]
+

Implementations

+

impl<let M: u32, let N: u32, T> PrivateCall<M, N, T>

+ +
pub fn new( + target_contract: AztecAddress, + selector: FunctionSelector, + name: str<M>, + args: [Field; N], +) -> Self + +

impl<let M: u32, let N: u32, T> PrivateCall<M, N, T>

+ +
pub fn call(self, context: &mut PrivateContext) -> T +
where + T: Deserialize
+ +
+

[DEPRECATED] +This function is deprecated. Please use the new contract API: +self.call(MyContract::at(address).my_private_function(...args)) +instead of manually constructing and calling PrivateCall.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/calls/struct.PrivateStaticCall.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/calls/struct.PrivateStaticCall.html new file mode 100644 index 000000000000..3793b299fda2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/calls/struct.PrivateStaticCall.html @@ -0,0 +1,81 @@ + + + + + + +Struct PrivateStaticCall documentation + + + + + +
+ +

Struct PrivateStaticCall

+
pub struct PrivateStaticCall<let M: u32, let N: u32, T> {
+    pub target_contract: AztecAddress,
+    pub selector: FunctionSelector,
+    pub name: str<M>,
+    pub args: [Field; N],
+    /* private fields */
+}
+
+

Fields

+
target_contract: AztecAddress
+
+
name: str<M>
+
args: [Field; N]
+

Implementations

+

impl<let M: u32, let N: u32, T> PrivateStaticCall<M, N, T>

+ +
pub fn new( + target_contract: AztecAddress, + selector: FunctionSelector, + name: str<M>, + args: [Field; N], +) -> Self + +pub fn view(self, context: &mut PrivateContext) -> T +
where + T: Deserialize
+ +
+

[DEPRECATED] +This function is deprecated. Please use the new contract API: +self.view(MyContract::at(address).my_private_static_function(...args)) +instead of manually constructing and calling PrivateCall.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/calls/struct.PublicCall.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/calls/struct.PublicCall.html new file mode 100644 index 000000000000..75379bd748f4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/calls/struct.PublicCall.html @@ -0,0 +1,120 @@ + + + + + + +Struct PublicCall documentation + + + + + +
+ +

Struct PublicCall

+
pub struct PublicCall<let M: u32, let N: u32, T> {
+    pub target_contract: AztecAddress,
+    pub selector: FunctionSelector,
+    pub name: str<M>,
+    pub args: [Field; N],
+    /* private fields */
+}
+
+

Fields

+
target_contract: AztecAddress
+
+
name: str<M>
+
args: [Field; N]
+

Implementations

+

impl<let M: u32, let N: u32, T> PublicCall<M, N, T>

+ +
pub fn new( + target_contract: AztecAddress, + selector: FunctionSelector, + name: str<M>, + args: [Field; N], +) -> Self + +pub fn with_gas(self, gas_opts: GasOpts) -> Self + +pub unconstrained fn call(self, context: PublicContext) -> T +
where + T: Deserialize
+ +
+

[DEPRECATED] +This function is deprecated. Please use the new contract API: +self.call(MyContract::at(address).my_public_function(...args)) +instead of manually constructing and calling PublicCall.

+
+
pub fn enqueue(self, context: &mut PrivateContext) + +
+

[DEPRECATED] +This function is deprecated. Please use the new contract API: +self.enqueue(MyContract::at(address).my_public_function(...args)) +instead of manually constructing and calling PublicCall.

+
+
pub fn enqueue_incognito(self, context: &mut PrivateContext) + +
+

[DEPRECATED] +This function is deprecated. Please use the new contract API: +self.enqueue_incognito(MyContract::at(address).my_public_function(...args)) +instead of manually constructing and calling PublicCall.

+
+
pub fn set_as_teardown(self, context: &mut PrivateContext) + +
+

[DEPRECATED] +This function is deprecated. Please use the new contract API: +self.set_as_teardown(MyContract::at(address).my_public_function(...args)) +instead of manually constructing and setting the teardown function PublicCall.

+
+
pub fn set_as_teardown_incognito(self, context: &mut PrivateContext) + +
+

[DEPRECATED] +This function is deprecated. Please use the new contract API: +self.set_as_teardown_incognito(MyContract::at(address).my_public_function(...args)) +instead of manually constructing and setting the teardown function PublicCall.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/calls/struct.PublicStaticCall.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/calls/struct.PublicStaticCall.html new file mode 100644 index 000000000000..258442e52f44 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/calls/struct.PublicStaticCall.html @@ -0,0 +1,102 @@ + + + + + + +Struct PublicStaticCall documentation + + + + + +
+ +

Struct PublicStaticCall

+
pub struct PublicStaticCall<let M: u32, let N: u32, T> {
+    pub target_contract: AztecAddress,
+    pub selector: FunctionSelector,
+    pub name: str<M>,
+    pub args: [Field; N],
+    /* private fields */
+}
+
+

Fields

+
target_contract: AztecAddress
+
+
name: str<M>
+
args: [Field; N]
+

Implementations

+

impl<let M: u32, let N: u32, T> PublicStaticCall<M, N, T>

+ +
pub fn new( + target_contract: AztecAddress, + selector: FunctionSelector, + name: str<M>, + args: [Field; N], +) -> Self + +pub fn with_gas(self, gas_opts: GasOpts) -> Self + +pub unconstrained fn view(self, context: PublicContext) -> T +
where + T: Deserialize
+ +
+

[DEPRECATED] +This function is deprecated. Please use the new contract API: +self.view(MyContract::at(address).my_public_static_function(...args)) +instead of manually constructing and calling PublicStaticCall.

+
+
pub fn enqueue_view(self, context: &mut PrivateContext) + +
+

[DEPRECATED] +This function is deprecated. Please use the new contract API: +self.enqueue_view(MyContract::at(address).my_public_static_function(...args)) +instead of manually constructing and calling PublicStaticCall.

+
+
pub fn enqueue_view_incognito(self, context: &mut PrivateContext) + +
+

[DEPRECATED] +This function is deprecated. Please use the new contract API: +self.enqueue_view_incognito(MyContract::at(address).my_public_static_function(...args)) +instead of manually constructing and calling PublicStaticCall.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/calls/struct.UtilityCall.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/calls/struct.UtilityCall.html new file mode 100644 index 000000000000..33fde955349d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/calls/struct.UtilityCall.html @@ -0,0 +1,70 @@ + + + + + + +Struct UtilityCall documentation + + + + + +
+ +

Struct UtilityCall

+
pub struct UtilityCall<let M: u32, let N: u32, T> {
+    pub target_contract: AztecAddress,
+    pub selector: FunctionSelector,
+    pub name: str<M>,
+    pub args: [Field; N],
+    /* private fields */
+}
+
+

Fields

+
target_contract: AztecAddress
+
+
name: str<M>
+
args: [Field; N]
+

Implementations

+

impl<let M: u32, let N: u32, T> UtilityCall<M, N, T>

+ +
pub fn new( + target_contract: AztecAddress, + selector: FunctionSelector, + name: str<M>, + args: [Field; N], +) -> Self + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/gas/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/gas/index.html new file mode 100644 index 000000000000..5c1a38330ae0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/gas/index.html @@ -0,0 +1,46 @@ + + + + + + +Module gas documentation + + + + + +
+ +

Module gas

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/gas/struct.GasOpts.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/gas/struct.GasOpts.html new file mode 100644 index 000000000000..26902cabb8f4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/gas/struct.GasOpts.html @@ -0,0 +1,57 @@ + + + + + + +Struct GasOpts documentation + + + + + +
+ +

Struct GasOpts

+
pub struct GasOpts {
+    pub l2_gas: Option<u32>,
+    pub da_gas: Option<u32>,
+}
+
+

Fields

+
l2_gas: Option<u32>
+
da_gas: Option<u32>
+

Implementations

+

impl GasOpts

+ +
pub fn default() -> Self + +pub fn new(l2_gas: u32, da_gas: u32) -> Self + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/globals/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/globals/index.html new file mode 100644 index 000000000000..7707b9ad53c0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/globals/index.html @@ -0,0 +1,39 @@ + + + + + + +Module globals documentation + + + + + +
+ +

Module globals

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/index.html new file mode 100644 index 000000000000..57cd91a41525 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/index.html @@ -0,0 +1,72 @@ + + + + + + +Module context documentation + + + + + +
+
aztec-nr - noir_aztec::context
+

Module context

+

Re-exports

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/inputs/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/inputs/index.html new file mode 100644 index 000000000000..ce91c1e97cb2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/inputs/index.html @@ -0,0 +1,50 @@ + + + + + + +Module inputs documentation + + + + + +
+ +

Module inputs

+

Re-exports

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/inputs/private_context_inputs/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/inputs/private_context_inputs/index.html new file mode 100644 index 000000000000..bd99f533faad --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/inputs/private_context_inputs/index.html @@ -0,0 +1,39 @@ + + + + + + +Module private_context_inputs documentation + + + + + +
+
aztec-nr - noir_aztec::context::inputs::private_context_inputs
+

Module private_context_inputs

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/inputs/private_context_inputs/struct.PrivateContextInputs.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/inputs/private_context_inputs/struct.PrivateContextInputs.html new file mode 100644 index 000000000000..dae3106b453e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/inputs/private_context_inputs/struct.PrivateContextInputs.html @@ -0,0 +1,69 @@ + + + + + + +Struct PrivateContextInputs documentation + + + + + +
+ +

Struct PrivateContextInputs

+
pub struct PrivateContextInputs {
+    pub call_context: CallContext,
+    pub anchor_block_header: BlockHeader,
+    pub tx_context: TxContext,
+    pub start_side_effect_counter: u32,
+}
+
+

Fields

+
call_context: CallContext
+
anchor_block_header: BlockHeader
+
tx_context: TxContext
+
start_side_effect_counter: u32
+

Trait implementations

+

impl Empty for PrivateContextInputs

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for PrivateContextInputs

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/note_hash_read/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/note_hash_read/index.html new file mode 100644 index 000000000000..0a3446b52169 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/note_hash_read/index.html @@ -0,0 +1,46 @@ + + + + + + +Module note_hash_read documentation + + + + + +
+
aztec-nr - noir_aztec::context::note_hash_read
+

Module note_hash_read

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/note_hash_read/struct.NoteHashRead.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/note_hash_read/struct.NoteHashRead.html new file mode 100644 index 000000000000..1861331fd04a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/note_hash_read/struct.NoteHashRead.html @@ -0,0 +1,53 @@ + + + + + + +Struct NoteHashRead documentation + + + + + +
+ +

Struct NoteHashRead

+
pub struct NoteHashRead
+{ /* private fields */ }
+
+

Implementations

+

impl NoteHashRead

+ +
pub fn new_transient(note_hash: Field, contract_address: AztecAddress) -> Self + +pub fn new_settled(note_hash: Field) -> Self + +pub fn note_hash(self) -> Field + +pub fn contract_address(self) -> Option<AztecAddress> + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/private_context/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/private_context/index.html new file mode 100644 index 000000000000..6877db5c1eb2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/private_context/index.html @@ -0,0 +1,46 @@ + + + + + + +Module private_context documentation + + + + + +
+
aztec-nr - noir_aztec::context::private_context
+

Module private_context

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/private_context/struct.PrivateContext.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/private_context/struct.PrivateContext.html new file mode 100644 index 000000000000..7490c363f246 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/private_context/struct.PrivateContext.html @@ -0,0 +1,1372 @@ + + + + + + +Struct PrivateContext documentation + + + + + +
+ +

Struct PrivateContext

+
pub struct PrivateContext {
+    pub inputs: PrivateContextInputs,
+    pub side_effect_counter: u32,
+    pub min_revertible_side_effect_counter: u32,
+    pub is_fee_payer: bool,
+    pub args_hash: Field,
+    pub return_hash: Field,
+    pub include_by_timestamp: u64,
+    pub note_hash_read_requests: BoundedVec<Scoped<Counted<Field>>, 16>,
+    pub nullifier_read_requests: BoundedVec<Scoped<Counted<Field>>, 16>,
+    pub note_hashes: BoundedVec<Counted<NoteHash>, 16>,
+    pub nullifiers: BoundedVec<Counted<Nullifier>, 16>,
+    pub private_call_requests: BoundedVec<PrivateCallRequest, 8>,
+    pub public_call_requests: BoundedVec<Counted<PublicCallRequest>, 32>,
+    pub public_teardown_call_request: PublicCallRequest,
+    pub l2_to_l1_msgs: BoundedVec<Counted<L2ToL1Message>, 8>,
+    pub anchor_block_header: BlockHeader,
+    pub private_logs: BoundedVec<Counted<PrivateLogData>, 16>,
+    pub contract_class_logs_hashes: BoundedVec<Counted<LogHash>, 1>,
+    pub last_key_validation_requests: [Option<KeyValidationRequest>; 4],
+    pub expected_non_revertible_side_effect_counter: u32,
+    pub expected_revertible_side_effect_counter: u32,
+    /* private fields */
+}
+
+
+

PrivateContext

+

The main interface between an #[external("private")] function and the Aztec blockchain.

+

An instance of the PrivateContext is initialized automatically at the outset +of every private function, within the #[external("private")] macro, so you'll never +need to consciously instantiate this yourself.

+

The instance is always named context, and it is always be available within +the body of every #[external("private")] function in your smart contract.

+
+

For those used to "vanilla" Noir, it might be jarring to have access to +context without seeing a declaration let context = PrivateContext::new(...) +within the body of your function. This is just a consequence of using +macros to tidy-up verbose boilerplate. You can use nargo expand to +expand all macros, if you dare.

+
+

Typical usage for a smart contract developer will be to call getter +methods of the PrivateContext.

+

Pushing data and requests to the context is mostly handled within +aztec-nr's own functions, so typically a smart contract developer won't +need to call any setter methods directly.

+
+

Advanced users might occasionally wish to push data to the context +directly for lower-level control. If you find yourself doing this, please +open an issue on GitHub to describe your use case: it might be that +new functionality should be added to aztec-nr.

+
+

Responsibilities

+
    +
  • Exposes contextual data to a private function: +
      +
    • Data relating to how this private function was called. +
        +
      • msg_sender
      • +
      • this_address - (the contract address of the private function being +executed)
      • +
      • See CallContext for more data.
      • +
      +
    • +
    • Data relating to the transaction in which this private function is +being executed. +
        +
      • chain_id
      • +
      • version
      • +
      • gas_settings
      • +
      +
    • +
    +
  • +
  • Provides state access: +
      +
    • Access to the "Anchor block" header. +Recall, a private function cannot read from the "current" block header, +but must read from some historical block header, because as soon as +private function execution begins (asynchronously, on a user's device), +the public state of the chain (the "current state") will have progressed +forward. We call this reference the "Anchor block". +See BlockHeader.
    • +
    • Enables consumption of L1->L2 messages.
    • +
    +
  • +
  • Enables calls to functions of other smart contracts: +
      +
    • Private function calls
    • +
    • Enqueueing of public function call requests +(Since public functions are executed at a later time, by a block +proposer, we say they are "enqueued").
    • +
    +
  • +
  • Writes data to the blockchain: +
      +
    • New notes
    • +
    • New nullifiers
    • +
    • Private logs (for sending encrypted note contents or encrypted events)
    • +
    • New L2->L1 messages.
    • +
    +
  • +
  • Provides args to the private function (handled by the #[external("private")] macro).
  • +
  • Returns the return values of this private function (handled by the +#[external("private")] macro).
  • +
  • Makes Key Validation Requests. +
      +
    • Private functions are not allowed to see master secret keys, because we +do not trust them. They are instead given "app-siloed" secret keys with +a claim that they relate to a master public key. They can then request +validation of this claim, by making a "key validation request" to the +protocol's kernel circuits (which are allowed to see certain master +secret keys).
    • +
    +
  • +
+

Advanced Responsibilities

+
    +
  • Ultimately, the PrivateContext is responsible for constructing the +PrivateCircuitPublicInputs of the private function being executed. +All private functions on Aztec must have public inputs which adhere +to the rigid layout of the PrivateCircuitPublicInputs, in order to be +compatible with the protocol's kernel circuits. +A well-known misnomer: +
      +
    • "public inputs" contain both inputs and outputs of this function. +
        +
      • By "outputs" we mean a lot more side-effects than just the +"return values" of the function.
      • +
      +
    • +
    • Most of the so-called "public inputs" are kept private, and never leak +to the outside world, because they are 'swallowed' by the protocol's +kernel circuits before the tx is sent to the network. Only the +following are exposed to the outside world: +
        +
      • New note_hashes
      • +
      • New nullifiers
      • +
      • New private logs
      • +
      • New L2->L1 messages
      • +
      • New enqueued public function call requests +All the above-listed arrays of side-effects can be padded by the +user's wallet (through instructions to the kernel circuits, via the +PXE) to obscure their true lengths.
      • +
      +
    • +
    +
  • +
+

Syntax Justification

+

Both user-defined functions and most functions in aztec-nr need access to +the PrivateContext instance to read/write data. This is why you'll see the +arguably-ugly pervasiveness of the "context" throughout your smart contract +and the aztec-nr library. +For example, &mut context is prevalent. In some languages, you can access +and mutate a global variable (such as a PrivateContext instance) from a +function without polluting the function's parameters. With Noir, a function +must explicitly pass control of a mutable variable to another function, by +reference. Since many functions in aztec-nr need to be able to push new data +to the PrivateContext, they need to be handed a mutable reference to the +context as a parameter. +For example, Context is prevalent as a generic parameter, to give better +type safety at compile time. Many aztec-nr functions don't make sense if +they're called in a particular runtime (private, public or utility), and so +are intentionally only implemented over certain +[Private|Public|Utility]Context structs. This gives smart contract +developers a much faster feedback loop if they're making a mistake, as an +error will be thrown by the LSP or when they compile their contract.

+
+

Fields

+ +
side_effect_counter: u32
+
min_revertible_side_effect_counter: u32
+
is_fee_payer: bool
+
args_hash: Field
+
return_hash: Field
+
include_by_timestamp: u64
+
note_hash_read_requests: BoundedVec<Scoped<Counted<Field>>, 16>
+
nullifier_read_requests: BoundedVec<Scoped<Counted<Field>>, 16>
+
note_hashes: BoundedVec<Counted<NoteHash>, 16>
+
nullifiers: BoundedVec<Counted<Nullifier>, 16>
+
private_call_requests: BoundedVec<PrivateCallRequest, 8>
+
public_call_requests: BoundedVec<Counted<PublicCallRequest>, 32>
+
public_teardown_call_request: PublicCallRequest
+
l2_to_l1_msgs: BoundedVec<Counted<L2ToL1Message>, 8>
+
anchor_block_header: BlockHeader
+
private_logs: BoundedVec<Counted<PrivateLogData>, 16>
+
contract_class_logs_hashes: BoundedVec<Counted<LogHash>, 1>
+
last_key_validation_requests: [Option<KeyValidationRequest>; 4]
+
expected_non_revertible_side_effect_counter: u32
+
expected_revertible_side_effect_counter: u32
+

Implementations

+

impl PrivateContext

+ +
pub fn new(inputs: PrivateContextInputs, args_hash: Field) -> Self + +pub fn msg_sender(self) -> Option<AztecAddress> + +
+

Returns the contract address that initiated this function call.

+

This is similar to msg.sender in Solidity (hence the name).

+

Important Note: Since Aztec doesn't have a concept of an EoA ( +Externally-owned Account), the msg_sender is "null" for the first +function call of every transaction. +The first function call of a tx is likely to be a call to the user's +account contract, so this quirk will most often be handled by account +contract developers.

+

Returns

+
    +
  • Option<AztecAddress> - The address of the smart contract that called +this function (be it an app contract or a user's account contract). +Returns Option<AztecAddress>::none for the first function call of +the tx. No other private function calls in the tx will have a none +msg_sender, but public function calls might (see the PublicContext).
  • +
+
+
pub fn msg_sender_unsafe(self) -> AztecAddress + +
+

"Unsafe" versus calling context.msg_sender(), because it doesn't +translate NULL_MSG_SENDER_CONTRACT_ADDRESS as +Option<AztecAddress>::none. +Used by some internal aztecnr functions.

+
+
pub fn this_address(self) -> AztecAddress + +
+

Returns the contract address of the current function being executed.

+

This is equivalent to address(this) in Solidity (hence the name). +Use this to identify the current contract's address, commonly needed for +access control or when interacting with other contracts.

+

Returns

+
    +
  • AztecAddress - The contract address of the current function being +executed.
  • +
+
+
pub fn chain_id(self) -> Field + +
+

Returns the chain ID of the current network.

+

This is similar to block.chainid in Solidity. Returns the unique +identifier for the blockchain network this transaction is executing on.

+

Helps prevent cross-chain replay attacks. Useful if implementing +multi-chain contract logic.

+

Returns

+
    +
  • Field - The chain ID as a field element
  • +
+
+
pub fn version(self) -> Field + +
+

Returns the Aztec protocol version that this transaction is executing +under. Different versions may have different rules, opcodes, or +cryptographic primitives.

+

This is similar to how Ethereum has different EVM versions.

+

Useful for forward/backward compatibility checks

+

Not to be confused with contract versions; this is the protocol version.

+

Returns

+
    +
  • Field - The protocol version as a field element
  • +
+
+
pub fn gas_settings(self) -> GasSettings + +
+

Returns the gas settings for the current transaction.

+

This provides information about gas limits and pricing for the +transaction, similar to tx.gasprice and gas limits in Ethereum. +However, Aztec has a more sophisticated gas model with separate +accounting for L2 computation and data availability (DA) costs.

+

Returns

+
    +
  • GasSettings - Struct containing gas limits and fee information
  • +
+
+
pub fn selector(self) -> FunctionSelector + +
+

Returns the function selector of the currently executing function.

+

Low-level function: Ordinarily, smart contract developers will not need +to access this.

+

This is similar to msg.sig in Solidity, which returns the first 4 +bytes of the function signature. In Aztec, the selector uniquely +identifies which function within the contract is being called.

+

Returns

+
    +
  • FunctionSelector - The 4-byte function identifier
  • +
+

Advanced

+

Only #[external("private")] functions have a function selector as a protocol- +enshrined concept. The function selectors of private functions are +baked into the preimage of the contract address, and are used by the +protocol's kernel circuits to identify each private function and ensure +the correct one is being executed.

+

Used internally for function dispatch and call verification.

+
+
pub fn get_args_hash(self) -> Field + +
+

Returns the hash of the arguments passed to the current function.

+

Very low-level function: You shouldn't need to call this. The #[external("private")] +macro calls this, and it makes the arguments neatly available to the +body of your private function.

+

Returns

+
    +
  • Field - Hash of the function arguments
  • +
+

Advanced

+
    +
  • Arguments are hashed to reduce proof size and verification time
  • +
  • Enables efficient argument passing in recursive function calls
  • +
  • The hash can be used to retrieve the original arguments from the PXE.
  • +
+
+
pub fn push_note_hash(&mut self, note_hash: Field) + +
+

Pushes a new note_hash to the Aztec blockchain's global Note Hash Tree +(a state tree).

+

A note_hash is a commitment to a piece of private state.

+

Low-level function: Ordinarily, smart contract developers will not need +to manually call this. Aztec-nr's state variables (see ../state_vars/) +are designed to understand when to create and push new note hashes.

+

Arguments

+
    +
  • note_hash - The new note_hash.
  • +
+

Advanced

+

From here, the protocol's kernel circuits will take over and insert the +note_hash into the protocol's "note hash tree" (in the Base Rollup +circuit). +Before insertion, the protocol will:

+
    +
  • "Silo" the note_hash with the contract address of this function, +to yield a siloed_note_hash. This prevents state collisions +between different smart contracts.
  • +
  • Ensure uniqueness of the siloed_note_hash, to prevent Faerie-Gold +attacks, by hashing the siloed_note_hash with a unique value, to +yield a unique_siloed_note_hash (see the protocol spec for more).
  • +
+

In addition to calling this function, aztec-nr provides the contents +of the newly-created note to the PXE, via the notify_created_note +oracle.

+
+

Advanced users might occasionally wish to push data to the context +directly for lower-level control. If you find yourself doing this, +please open an issue on GitHub to describe your use case: it might be +that new functionality should be added to aztec-nr.

+
+
+
pub fn push_nullifier(&mut self, nullifier: Field) + +
+

Pushes a new nullifier to the Aztec blockchain's global Nullifier Tree +(a state tree).

+

See also: push_nullifier_for_note_hash.

+

Low-level function: Ordinarily, smart contract developers will not need +to manually call this. Aztec-nr's state variables (see ../state_vars/) +are designed to understand when to create and push new nullifiers.

+

A nullifier can only be emitted once. Duplicate nullifier insertions are +rejected by the protocol.

+

Generally, a nullifier is emitted to prevent an action from happening +more than once, in such a way that the action cannot be linked (by an +observer of the blockchain) to any earlier transactions.

+

I.e. a nullifier is a random-looking, but deterministic record of a +private, one-time action, which does not leak what action has been +taken, and which preserves the property of "tx unlinkability".

+

Usually, a nullifier will be emitted to "spend" a note (a piece of +private state), without revealing which specific note is being spent.

+

(Important: in such cases, use the below push_nullifier_for_note_hash).

+

Sometimes, a nullifier might be emitted completely unrelated to any +notes. Examples include initialization of a new contract; initialization +of a PrivateMutable, or signalling in Semaphore-like applications. +This push_nullifier function serves such use cases.

+

Arguments

+
    +
  • nullifier
  • +
+

Advanced

+

From here, the protocol's kernel circuits will take over and insert the +nullifier into the protocol's "nullifier tree" (in the Base Rollup +circuit). +Before insertion, the protocol will:

+
    +
  • "Silo" the nullifier with the contract address of this function, +to yield a siloed_nullifier. This prevents state collisions +between different smart contracts.
  • +
  • Ensure the siloed_nullifier is unique (the nullifier tree is an +indexed merkle tree which supports efficient non-membership proofs).
  • +
+
+
pub fn push_nullifier_for_note_hash( + &mut self, + nullifier: Field, + nullified_note_hash: Field, +) + +
+

Pushes a nullifier that corresponds to a specific note hash.

+

Low-level function: Ordinarily, smart contract developers will not need +to manually call this. Aztec-nr's state variables (see ../state_vars/) +are designed to understand when to create and push new nullifiers.

+

This is a specialized version of push_nullifier that links a nullifier +to the specific note hash it's nullifying. This is the most common +usage pattern for nullifiers. +See push_nullifier for more explanation on nullifiers.

+

Arguments

+
    +
  • nullifier
  • +
  • nullified_note_hash - The note hash of the note being nullified
  • +
+

Advanced

+

Important: usage of this function doesn't mean that the world will see +that this nullifier relates to the given nullified_note_hash (as that +would violate "tx unlinkability"); it simply informs the user's PXE +about the relationship (via notify_nullified_note). The PXE can then +use this information to feed hints to the kernel circuits for +"squashing" purposes: If a note is nullified during the same tx which +created it, we can "squash" (delete) the note and nullifier (and any +private logs associated with the note), to save on data emission costs.

+
+
pub fn get_anchor_block_header(self) -> BlockHeader + +
+

Returns the anchor block header - the historical block header that this +private function is reading from.

+

A private function CANNOT read from the "current" block header, +but must read from some older block header, because as soon as +private function execution begins (asynchronously, on a user's device), +the public state of the chain (the "current state") will have progressed +forward.

+

Returns

+
    +
  • BlockHeader - The anchor block header.
  • +
+

Advanced

+
    +
  • All private functions of a tx read from the same anchor block header.
  • +
  • The protocol asserts that the include_by_timestamp of every tx +is at most 24 hours beyond the timestamp of the tx's chosen anchor +block header. This enables the network's nodes to safely prune old txs +from the mempool. Therefore, the chosen block header must be one +from within the last 24 hours.
  • +
+
+
pub fn get_block_header_at(self, block_number: u32) -> BlockHeader + +
+

Returns the header of any historical block at or before the anchor +block.

+

This enables private contracts to access information from even older +blocks than the anchor block header.

+

Useful for time-based contract logic that needs to compare against +multiple historical points.

+

Arguments

+
    +
  • block_number - The block number to retrieve (must be <= anchor +block number)
  • +
+

Returns

+
    +
  • BlockHeader - The header of the requested historical block
  • +
+

Advanced

+

This function uses an oracle to fetch block header data from the user's +PXE. Depending on how much blockchain data the user's PXE has been set +up to store, this might require a query from the PXE to another Aztec +node to get the data.

+
+

This is generally true of all oracle getters (see ../oracle).

+
+

Each block header gets hashed and stored as a leaf in the protocol's +Archive Tree. In fact, the i-th block header gets stored at the i-th +leaf index of the Archive Tree. Behind the scenes, this +get_block_header_at function will add Archive Tree merkle-membership +constraints (~3k) to your smart contract function's circuit, to prove +existence of the block header in the Archive Tree.

+

Note: we don't do any caching, so avoid making duplicate calls for the +same block header, because each call will add duplicate constraints.

+

Calling this function is more expensive (constraint-wise) than getting +the anchor block header (via get_block_header). This is because the +anchor block's merkle membership proof is handled by Aztec's protocol +circuits, and is only performed once for the entire tx because all +private functions of a tx share a common anchor block header. Therefore, +the cost (constraint-wise) of calling get_block_header is effectively +free.

+
+
pub fn set_return_hash<let N: u32>(&mut self, serialized_return_values: [Field; N]) + +
+

Sets the hash of the return values for this private function.

+

Very low-level function: this is called by the #[external("private")] macro.

+

Arguments

+
    +
  • serialized_return_values - The serialized return values as a field array
  • +
+
+
pub fn finish(self) -> PrivateCircuitPublicInputs + +
+

Builds the PrivateCircuitPublicInputs for this private function, to +ensure compatibility with the protocol's kernel circuits.

+

Very low-level function: This function is automatically called by the +#[external("private")] macro.

+
+
pub fn set_as_fee_payer(&mut self) + +
+

Designates this contract as the fee payer for the transaction.

+

Unlike Ethereum, where the transaction sender always pays fees, Aztec +allows any contract to voluntarily pay transaction fees. This enables +patterns like sponsored transactions or fee abstraction where users +don't need to hold fee-juice themselves. (Fee juice is a fee-paying +asset for Aztec).

+

Only one contract per transaction can declare itself as the fee payer, +and it must have sufficient fee-juice balance (>= the gas limits +specified in the TxContext) by the time we reach the public setup phase +of the tx.

+
+
pub fn in_revertible_phase(&mut self) -> bool + +pub fn end_setup(&mut self) + +
+

Declares the end of the "setup phase" of this tx.

+

Only one function per tx can declare the end of the setup phase.

+

Niche function: Only wallet developers and paymaster contract developers +(aka Fee-payment contracts) will need to make use of this function.

+

Aztec supports a three-phase execution model: setup, app logic, teardown. +The phases exist to enable a fee payer to take on the risk of paying +a transaction fee, safe in the knowledge that their payment (in whatever +token or method the user chooses) will succeed, regardless of whether +the app logic will succeed. The "setup" phase enables such a payment to +be made, because the setup phase cannot revert: a reverting function +within the setup phase would result in an invalid block which cannot +be proven. Any side-effects generated during that phase are guaranteed +to be inserted into Aztec's state trees (except for squashed notes & +nullifiers, of course).

+

Even though the end of the setup phase is declared within a private +function, you might have noticed that public functions can also +execute within the setup phase. This is because any public function +calls which were enqueued within the setup phase by a private +function are considered part of the setup phase.

+

Advanced

+
    +
  • Sets the minimum revertible side effect counter of this tx to be the +PrivateContext's current side effect counter.
  • +
+
+
pub fn set_include_by_timestamp(&mut self, include_by_timestamp: u64) + +
+

Sets a deadline (an "include-by timestamp") for when this transaction +must be included in a block.

+

Other functions in this tx might call this setter with differing +values for the include-by timestamp. To ensure that all functions' +deadlines are met, the minimum of all these include-by timestamps will +be exposed when this tx is submitted to the network.

+

If the transaction is not included in a block by its include-by +timestamp, it becomes invalid and it will never be included.

+

This expiry timestamp is publicly visible. See the "Advanced" section +for privacy concerns.

+

Arguments

+
    +
  • include_by_timestamp - Unix timestamp (seconds) deadline for inclusion. +The include-by timestamp of this tx will be +at most the timestamp specified.
  • +
+

Advanced

+
    +
  • If multiple functions set differing include_by_timestamps, the +kernel circuits will set it to be the minimum of the two. This +ensures the tx expiry requirements of all functions in the tx are met.
  • +
  • Rollup circuits will reject expired txs.
  • +
  • The protocol enforces that all transactions must be included within +24 hours of their chosen anchor block's timestamp, to enable safe +mempool pruning.
  • +
  • The DelayedPublicMutable design makes heavy use of this functionality, +to enable private functions to read public state.
  • +
  • A sophisticated Wallet should cleverly set an include-by timestamp +to improve the privacy of the user and the network as a whole. +For example, if a contract interaction sets include-by to some +publicly-known value (e.g. the time when a contract upgrades), then +the wallet might wish to set an even lower one to avoid revealing that +this tx is interacting with said contract. +Ideally, all wallets should standardize on an approach in order to +provide users with a large anonymity set -- although the exact approach +will need to be discussed. Wallets that deviate from a standard might +accidentally reveal which wallet each transaction originates from.
  • +
+
+
pub fn push_note_hash_read_request(&mut self, note_hash_read: NoteHashRead) + +
+

Makes a request to the protocol's kernel circuit to ensure a note_hash +actually exists.

+

"Read requests" are used to prove that a note hash exists without +revealing which specific note was read.

+

This can be used to prove existence of both settled notes (created in +prior transactions) and transient notes (created in the current +transaction). +If you need to prove existence of a settled note at a specific block +number, use note_inclusion::prove_note_inclusion.

+

Low-level function. Ordinarily, smart contract developers will not need +to call this directly. Aztec-nr's state variables (see ../state_vars/) +are designed to understand when to create and push new note_hash read +requests.

+

Arguments

+
    +
  • note_hash_read - The note hash to read and verify
  • +
+

Advanced

+

In "traditional" circuits for non-Aztec privacy applications, the merkle +membership proofs to check existence of a note are performed within +the application circuit.

+

All Aztec private functions have access to the following constraint +optimisation: +In cases where the note being read was created earlier in the same tx, +the note wouldn't yet exist in the Note Hash Tree, so a hard-coded +merkle membership check which then gets ignored would be a waste of +constraints. +Instead, we can send read requests for all notes to the protocol's +kernel circuits, where we can conditionally assess which notes actually +need merkle membership proofs, and select an appropriately-sized +kernel circuit.

+

For "settled notes" (which already existed in the Note Hash Tree of the +anchor block (i.e. before the tx began)), the kernel does a merkle +membership check.

+

For "pending notes" (which were created earlier in this tx), the +kernel will check that the note existed before this read request was +made, by checking the side-effect counters of the note_hash and this +read request.

+

This approach improves latency between writes and reads: +a function can read a note which was created earlier in the tx (rather +than performing the read in a later tx, after waiting for the earlier tx +to be included, to ensure the note is included in the tree).

+
+
pub fn assert_has_been_requested(self, note_hash_read: NoteHashRead) + +
+

Asserts that a NoteHashRead has been requested to the kernel by this context. +Asserts instead of returning a boolean to save on gates.

+

Arguments

+
    +
  • note_hash_read - The note hash read to assert that has been requested.
  • +
+
+
pub fn push_nullifier_read_request( + &mut self, + nullifier: Field, + contract_address: AztecAddress, +) + +
+

Requests to read a specific nullifier from the nullifier tree.

+

Nullifier read requests are used to prove that a nullifier exists without +revealing which specific nullifier preimage was read.

+

This can be used to prove existence of both settled nullifiers (created in +prior transactions) and transient nullifiers (created in the current +transaction). +If you need to prove existence of a settled nullifier at a specific block +number, use nullifier_inclusion::prove_nullifier_inclusion.

+

Low-level function. Ordinarily, smart contract developers will not need +to call this directly. Aztec-nr's state variables (see ../state_vars/) +are designed to understand when to create and push new nullifier read +requests.

+

Arguments

+
    +
  • nullifier - The nullifier to read and verify
  • +
  • contract_address - The contract address that emitted the nullifier
  • +
+

Advanced

+

This approach improves latency between writes and reads: +a function can read a nullifier which was created earlier in the tx +(rather than performing the read in a later tx, after waiting for the +earlier tx to be included, to ensure the nullifier is included in the tree).

+
+
pub fn request_nsk_app(&mut self, npk_m_hash: Field) -> Field + +
+

Requests the app-siloed nullifier secret key (nsk_app) for the given +(hashed) master nullifier public key (npk_m), from the user's PXE.

+

Advanced function: Only needed if you're designing your own notes and/or +nullifiers.

+

Contracts are not allowed to compute nullifiers for other contracts, as +that would let them read parts of their private state. Because of this, +a contract is only given an "app-siloed secret key", which is +constructed by hashing the user's master nullifier secret key with the +contract's address. +However, because contracts cannot be trusted with a user's master +nullifier secret key (because we don't know which contracts are honest +or malicious), the PXE refuses to provide any master secret keys to +any app smart contract function. This means app functions are unable to +prove that the derivation of an app-siloed nullifier secret key has been +computed correctly. Instead, an app function can request to the kernel +(via request_nsk_app) that it validates the siloed derivation, since +the kernel has been vetted to not leak any master secret keys.

+

A common nullification scheme is to inject a nullifier secret key into +the preimage of a nullifier, to make the nullifier deterministic but +random-looking. This function enables that flow.

+

Arguments

+
    +
  • npk_m_hash - A hash of the master nullifier public key of the user +whose PXE is executing this function.
  • +
+

Returns

+
    +
  • The app-siloed nullifier secret key that corresponds to the given +npk_m_hash.
  • +
+
+
pub fn request_ovsk_app(&mut self, ovpk_m_hash: Field) -> Field + +
+

Requests the app-siloed nullifier secret key (nsk_app) for the given +(hashed) master nullifier public key (npk_m), from the user's PXE.

+

See request_nsk_app and request_sk_app for more info.

+

The intention of the "outgoing" keypair is to provide a second secret +key for all of a user's outgoing activity (i.e. for notes that a user +creates, as opposed to notes that a user receives from others). The +separation of incoming and outgoing data was a distinction made by +zcash, with the intention of enabling a user to optionally share with a +3rd party a controlled view of only incoming or outgoing notes. +Similar functionality of sharing select data can be achieved with +offchain zero-knowledge proofs. It is up to an app developer whether +they choose to make use of a user's outgoing keypair within their +application logic, or instead simply use the same keypair (the address +keypair (which is effectively the same as the "incoming" keypair)) for +all incoming & outgoing messages to a user.

+

Currently, all of the exposed encryption functions in aztec-nr ignore +the outgoing viewing keys, and instead encrypt all note logs and event +logs to a user's address public key.

+

Arguments

+
    +
  • ovpk_m_hash - Hash of the outgoing viewing public key master
  • +
+

Returns

+
    +
  • The application-specific outgoing viewing secret key
  • +
+
+
pub fn message_portal(&mut self, recipient: EthAddress, content: Field) + +
+

Sends an "L2 -> L1 message" from this function (Aztec, L2) to a smart +contract on Ethereum (L1). L1 contracts which are designed to +send/receive messages to/from Aztec are called "Portal Contracts".

+

Common use cases include withdrawals, cross-chain asset transfers, and +triggering L1 actions based on L2 state changes.

+

The message will be inserted into an Aztec "Outbox" contract on L1, +when this transaction's block is proposed to L1. +Sending the message will not result in any immediate state changes in +the target portal contract. The message will need to be manually +consumed from the Outbox through a separate Ethereum transaction: a user +will need to call a function of the portal contract -- a function +specifically designed to make a call to the Outbox to consume the +message. +The message will only be available for consumption once the epoch +proof has been submitted. Given that there are multiple Aztec blocks +within an epoch, it might take some time for this epoch proof to be +submitted -- especially if the block was near the start of an epoch.

+

Arguments

+
    +
  • recipient - Ethereum address that will receive the message
  • +
  • content - Message content (32 bytes as a Field element). +This content has a very specific layout. +docs:start:context_message_portal
  • +
+
+
pub fn consume_l1_to_l2_message( + &mut self, + content: Field, + secret: Field, + sender: EthAddress, + leaf_index: Field, +) + +
+

Consumes a message sent from Ethereum (L1) to Aztec (L2).

+

Common use cases include token bridging, cross-chain governance, and +triggering L2 actions based on L1 events.

+

Use this function if you only want the message to ever be "referred to" +once. Once consumed using this method, the message cannot be consumed +again, because a nullifier is emitted. +If your use case wants for the message to be read unlimited times, then +you can always read any historic message from the L1-to-L2 messages tree; +messages never technically get deleted from that tree.

+

The message will first be inserted into an Aztec "Inbox" smart contract +on L1. +Sending the message will not result in any immediate state changes in +the target L2 contract. The message will need to be manually +consumed by the target contract through a separate Aztec transaction. +The message will not be available for consumption immediately. Messages +get copied over from the L1 Inbox to L2 by the next Proposer in batches. +So you will need to wait until the messages are copied before you can +consume them.

+

Arguments

+
    +
  • content - The message content that was sent from L1
  • +
  • secret - Secret value used for message privacy (if needed)
  • +
  • sender - Ethereum address that sent the message
  • +
  • leaf_index - Index of the message in the L1-to-L2 message tree
  • +
+

Advanced

+

Validates message existence in the L1-to-L2 message tree and nullifies +the message to prevent double-consumption.

+
+
pub fn emit_private_log(&mut self, log: [Field; 18], length: u32) + +
+

Emits a private log (an array of Fields) that will be published to an +Ethereum blob.

+

Private logs are intended for the broadcasting of ciphertexts: that is, +encrypted events or encrypted note contents. +Since the data in the logs is meant to be encrypted, private_logs are +broadcast to publicly-visible Ethereum blobs. +The intended recipients of such encrypted messages can then discover and +decrypt these encrypted logs using their viewing secret key. +(See ../messages/discovery for more details).

+

Important note: This function DOES NOT do any encryption of the input +log fields. This function blindly publishes whatever input log data +is fed into it, so the caller of this function should have already +performed the encryption, and the log should be the result of that +encryption.

+

The protocol does not dictate what encryption scheme should be used: +a smart contract developer can choose whatever encryption scheme they +like. +Aztec-nr includes some off-the-shelf encryption libraries that +developers might wish to use, for convenience. These libraries not only +encrypt a plaintext (to produce a ciphertext); they also prepend the +ciphertext with a tag and ephemeral public key for easier message +discovery. This is a very dense topic, and we will be writing more +libraries and docs soon.

+
+

Currently, AES128 CBC encryption is the main scheme included in +aztec.nr. +We are currently making significant changes to the interfaces of the +encryption library.

+
+

In some niche use cases, an app might be tempted to publish +un-encrypted data via a private log, because public logs are not +available to private functions. Be warned that emitting public data via +private logs is strongly discouraged, and is considered a "privacy +anti-pattern", because it reveals identifiable information about which +function has been executed. A tx which leaks such information does not +contribute to the privacy set of the network.

+
    +
  • Unlike emit_raw_note_log, this log is not tied to any specific note
  • +
+

Arguments

+
    +
  • log - The log data that will be publicly broadcast (so make sure +it's already been encrypted before you call this function). +Private logs are bounded in size (PRIVATE_LOG_SIZE_IN_FIELDS), to +encourage all logs from all smart contracts look identical.
  • +
  • length - The actual length of the log (measured in number of +Fields). Although the input log has a max size of +PRIVATE_LOG_SIZE_IN_FIELDS, the latter values of the array might all +be 0's for small logs. This length should reflect the trimmed length +of the array. The protocol's kernel circuits can then append random +fields as "padding" after the length, so that the logs of this +smart contract look indistinguishable from (the same length as) the +logs of all other applications. It's up to wallets how much padding +to apply, so ideally all wallets should agree on standards for this.
  • +
+

Advanced

+
+
pub fn emit_raw_note_log( + &mut self, + log: [Field; 18], + length: u32, + note_hash_counter: u32, +) + +
+

Emits a private log that is explicitly tied to a newly-emitted note_hash, +to convey to the kernel: "this log relates to this note".

+

This linkage is important in case the note gets squashed (due to being +read later in this same tx), since we can then squash the log as well.

+

See emit_private_log for more info about private log emission.

+

Arguments

+
    +
  • log - The log data as an array of Field elements
  • +
  • length - The actual length of the log (measured in number of +Fields).
  • +
  • note_hash_counter - The side-effect counter that was assigned to the +new note_hash when it was pushed to this
  • +
+

Important: If your application logic requires the log to always be +emitted regardless of note squashing, consider using emit_private_log +instead, or emitting additional events.

+
+
pub fn emit_contract_class_log<let N: u32>(&mut self, log: [Field; N]) + +pub fn call_private_function<let ArgsCount: u32>( + &mut self, + contract_address: AztecAddress, + function_selector: FunctionSelector, + args: [Field; ArgsCount], +) -> ReturnsHash + +
+

Calls a private function on another contract (or the same contract).

+

Very low-level function.

+

Arguments

+
    +
  • contract_address - Address of the contract containing the function
  • +
  • function_selector - 4-byte identifier of the function to call
  • +
  • args - Array of arguments to pass to the called function
  • +
+

Returns

+
    +
  • ReturnsHash - Hash of the called function's return values. Use +.get_preimage() to extract the actual return values.
  • +
+

This enables contracts to interact with each other while maintaining +privacy. This "composability" of private contract functions is a key +feature of the Aztec network.

+

If a user's transaction includes multiple private function calls, then +by the design of Aztec, the following information will remain private[1]:

+
    +
  • The function selectors and contract addresses of all private function +calls will remain private, so an observer of the public mempool will +not be able to look at a tx and deduce which private functions have +been executed.
  • +
  • The arguments and return values of all private function calls will +remain private.
  • +
  • The person who initiated the tx will remain private.
  • +
  • The notes and nullifiers and private logs that are emitted by all +private function calls will (if designed well) not leak any user +secrets, nor leak which functions have been executed.
  • +
+

[1] Caveats: Some of these privacy guarantees depend on how app +developers design their smart contracts. Some actions can leak +information, such as:

+
    +
  • Calling an internal public function.
  • +
  • Calling a public function and not setting msg_sender to Option::none +(feature not built yet - see github).
  • +
  • Calling any public function will always leak details about the nature +of the transaction, so devs should be careful in their contract +designs. If it can be done in a private function, then that will give +the best privacy.
  • +
  • Not padding the side-effects of a tx to some standardized, uniform +size. The kernel circuits can take hints to pad side-effects, so a +wallet should be able to request for a particular amount of padding. +Wallets should ideally agree on some standard. +
      +
    • Padding should include: +
        +
      • Padding the lengths of note & nullifier arrays
      • +
      • Padding private logs with random fields, up to some standardized +size. +See also: https://docs.aztec.network/developers/resources/considerations/privacy_considerations
      • +
      +
    • +
    +
  • +
+

Advanced

+
    +
  • The call is added to the private call stack and executed by kernel +circuits after this function completes
  • +
  • The called function can modify its own contract's private state
  • +
  • Side effects from the called function are included in this transaction
  • +
  • The call inherits the current transaction's context and gas limits
  • +
+
+
pub fn static_call_private_function<let ArgsCount: u32>( + &mut self, + contract_address: AztecAddress, + function_selector: FunctionSelector, + args: [Field; ArgsCount], +) -> ReturnsHash + +
+

Makes a read-only call to a private function on another contract.

+

This is similar to Solidity's staticcall. The called function +cannot modify state, emit L2->L2 messages, nor emit events. Any nested +calls are constrained to also be staticcalls.

+

See call_private_function for more general info on private function +calls.

+

Arguments

+
    +
  • contract_address - Address of the contract to call
  • +
  • function_selector - 4-byte identifier of the function to call
  • +
  • args - Array of arguments to pass to the called function
  • +
+

Returns

+
    +
  • ReturnsHash - Hash of the called function's return values. Use +.get_preimage() to extract the actual return values.
  • +
+
+
pub fn call_private_function_no_args( + &mut self, + contract_address: AztecAddress, + function_selector: FunctionSelector, +) -> ReturnsHash + +
+

Calls a private function that takes no arguments.

+

This is a convenience function for calling private functions that don't +require any input parameters. It's equivalent to call_private_function +but slightly more efficient to use when no arguments are needed.

+

Arguments

+
    +
  • contract_address - Address of the contract containing the function
  • +
  • function_selector - 4-byte identifier of the function to call
  • +
+

Returns

+
    +
  • ReturnsHash - Hash of the called function's return values. Use +.get_preimage() to extract the actual return values.
  • +
+
+
pub fn static_call_private_function_no_args( + &mut self, + contract_address: AztecAddress, + function_selector: FunctionSelector, +) -> ReturnsHash + +
+

Makes a read-only call to a private function which takes no arguments.

+

This combines the optimisation of call_private_function_no_args with +the safety of static_call_private_function.

+

Arguments

+
    +
  • contract_address - Address of the contract containing the function
  • +
  • function_selector - 4-byte identifier of the function to call
  • +
+

Returns

+
    +
  • ReturnsHash - Hash of the called function's return values. Use +.get_preimage() to extract the actual return values.
  • +
+
+
pub fn call_private_function_with_args_hash( + &mut self, + contract_address: AztecAddress, + function_selector: FunctionSelector, + args_hash: Field, + is_static_call: bool, +) -> ReturnsHash + +
+

Low-level private function call.

+

This is the underlying implementation used by all other private function +call methods. Instead of taking raw arguments, it accepts a +hash of the arguments.

+

Arguments

+
    +
  • contract_address - Address of the contract containing the function
  • +
  • function_selector - 4-byte identifier of the function to call
  • +
  • args_hash - Pre-computed hash of the function arguments
  • +
  • is_static_call - Whether this should be a read-only call
  • +
+

Returns

+
    +
  • ReturnsHash - Hash of the called function's return values
  • +
+
+
pub fn call_public_function<let ArgsCount: u32>( + &mut self, + contract_address: AztecAddress, + function_selector: FunctionSelector, + args: [Field; ArgsCount], + hide_msg_sender: bool, +) + +
+

Enqueues a call to a public function to be executed later.

+

Unlike private functions which execute immediately on the user's device, +public function calls are "enqueued" and executed some time later by a +block proposer.

+

This means a public function cannot return any values back to a private +function, because by the time the public function is being executed, +the private function which called it has already completed execution. +(In fact, the private function has been executed and proven, along with +all other private function calls of the user's tx. A single proof of the +tx has been submitted to the Aztec network, and some time later a +proposer has picked the tx up from the mempool and begun executing all +of the enqueued public functions).

+

Privacy warning

+

Enqueueing a public function call is an inherently leaky action. +Many interesting applications will require some interaction with public +state, but smart contract developers should try to use public function +calls sparingly, and carefully. +Internal public function calls are especially leaky, because they +completely leak which private contract made the call. +See also: https://docs.aztec.network/developers/resources/considerations/privacy_considerations

+

Arguments

+
    +
  • contract_address - Address of the contract containing the function
  • +
  • function_selector - 4-byte identifier of the function to call
  • +
  • args - Array of arguments to pass to the public function
  • +
  • hide_msg_sender - the called function will see a "null" value for +msg_sender if set to true
  • +
+
+
pub fn static_call_public_function<let ArgsCount: u32>( + &mut self, + contract_address: AztecAddress, + function_selector: FunctionSelector, + args: [Field; ArgsCount], + hide_msg_sender: bool, +) + +
+

Enqueues a read-only call to a public function.

+

This is similar to Solidity's staticcall. The called function +cannot modify state or emit events. Any nested calls are constrained to +also be staticcalls.

+

See also call_public_function for more important information about +making private -> public function calls.

+

Arguments

+
    +
  • contract_address - Address of the contract containing the function
  • +
  • function_selector - 4-byte identifier of the function to call
  • +
  • args - Array of arguments to pass to the public function
  • +
  • hide_msg_sender - the called function will see a "null" value for +msg_sender if set to true
  • +
+
+
pub fn call_public_function_no_args( + &mut self, + contract_address: AztecAddress, + function_selector: FunctionSelector, + hide_msg_sender: bool, +) + +
+

Enqueues a call to a public function that takes no arguments.

+

This is an optimisation for calling public functions that don't +take any input parameters. It's otherwise equivalent to +call_public_function.

+

Arguments

+
    +
  • contract_address - Address of the contract containing the function
  • +
  • function_selector - 4-byte identifier of the function to call
  • +
  • hide_msg_sender - the called function will see a "null" value for +msg_sender if set to true
  • +
+
+
pub fn static_call_public_function_no_args( + &mut self, + contract_address: AztecAddress, + function_selector: FunctionSelector, + hide_msg_sender: bool, +) + +
+

Enqueues a read-only call to a public function with no arguments.

+

This combines the optimisation of call_public_function_no_args with +the safety of static_call_public_function.

+

Arguments

+
    +
  • contract_address - Address of the contract containing the function
  • +
  • function_selector - 4-byte identifier of the function to call
  • +
  • hide_msg_sender - the called function will see a "null" value for +msg_sender if set to true
  • +
+
+
pub fn call_public_function_with_calldata_hash( + &mut self, + contract_address: AztecAddress, + calldata_hash: Field, + is_static_call: bool, + hide_msg_sender: bool, +) + +
+

Low-level public function call.

+

This is the underlying implementation used by all other public function +call methods. Instead of taking raw arguments, it accepts a +hash of the arguments.

+

Advanced function: Most developers should use call_public_function +or static_call_public_function instead. This function is exposed for +performance optimization and advanced use cases.

+

Arguments

+
    +
  • contract_address - Address of the contract containing the function
  • +
  • calldata_hash - Hash of the function calldata
  • +
  • is_static_call - Whether this should be a read-only call
  • +
  • hide_msg_sender - the called function will see a "null" value for +msg_sender if set to true
  • +
+
+
pub fn set_public_teardown_function<let ArgsCount: u32>( + &mut self, + contract_address: AztecAddress, + function_selector: FunctionSelector, + args: [Field; ArgsCount], + hide_msg_sender: bool, +) + +
+

Enqueues a public function call, and designates it to be the teardown +function for this tx. Only one teardown function call can be made by a +tx.

+

Niche function: Only wallet developers and paymaster contract developers +(aka Fee-payment contracts) will need to make use of this function.

+

Aztec supports a three-phase execution model: setup, app logic, teardown. +The phases exist to enable a fee payer to take on the risk of paying +a transaction fee, safe in the knowledge that their payment (in whatever +token or method the user chooses) will succeed, regardless of whether +the app logic will succeed. The "setup" phase ensures the fee payer +has sufficient balance to pay the proposer their fees. +The teardown phase is primarily intended to: calculate exactly +how much the user owes, based on gas consumption, and refund the user +any change.

+

Note: in some cases, the cost of refunding the user (i.e. DA costs of +tx side-effects) might exceed the refund amount. For app logic with +fairly stable and predictable gas consumption, a material refund amount +is unlikely. For app logic with unpredictable gas consumption, a +refund might be important to the user (e.g. if a hefty function reverts +very early). Wallet/FPC/Paymaster developers should be mindful of this.

+

Arguments

+
    +
  • contract_address - Address of the contract containing the teardown +function
  • +
  • function_selector - 4-byte identifier of the function to call
  • +
  • args - An array of fields to pass to the function.
  • +
  • hide_msg_sender - the called function will see a "null" value for +msg_sender if set to true
  • +
+
+
pub fn set_public_teardown_function_with_calldata_hash( + &mut self, + contract_address: AztecAddress, + calldata_hash: Field, + is_static_call: bool, + hide_msg_sender: bool, +) + +
+

Low-level function to set the public teardown function.

+

This is the underlying implementation for setting the teardown function +call that will execute at the end of the transaction. Instead of taking +raw arguments, it accepts a hash of the arguments.

+

Advanced function: Most developers should use +set_public_teardown_function instead.

+

Arguments

+
    +
  • contract_address - Address of the contract containing the teardown +function
  • +
  • calldata_hash - Hash of the function calldata
  • +
  • is_static_call - Whether this should be a read-only call
  • +
  • hide_msg_sender - the called function will see a "null" value for +msg_sender if set to true
  • +
+
+

Trait implementations

+

impl Empty for PrivateContext

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for PrivateContext

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/public_context/fn.avm_return.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/public_context/fn.avm_return.html new file mode 100644 index 000000000000..cda474142537 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/public_context/fn.avm_return.html @@ -0,0 +1,37 @@ + + + + + + +Function avm_return documentation + + + + + +
+ +

Function avm_return

+
pub unconstrained fn avm_return(returndata: [Field])
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/public_context/fn.calldata_copy.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/public_context/fn.calldata_copy.html new file mode 100644 index 000000000000..2114493ddf7b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/public_context/fn.calldata_copy.html @@ -0,0 +1,40 @@ + + + + + + +Function calldata_copy documentation + + + + + +
+ +

Function calldata_copy

+
pub unconstrained fn calldata_copy<let N: u32>(
+    cdoffset: u32,
+    copy_size: u32,
+) -> [Field; N]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/public_context/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/public_context/index.html new file mode 100644 index 000000000000..ffbde9885bc0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/public_context/index.html @@ -0,0 +1,51 @@ + + + + + + +Module public_context documentation + + + + + +
+
aztec-nr - noir_aztec::context::public_context
+

Module public_context

+

Structs

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/public_context/struct.PublicContext.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/public_context/struct.PublicContext.html new file mode 100644 index 000000000000..a27e263c6f3a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/public_context/struct.PublicContext.html @@ -0,0 +1,756 @@ + + + + + + +Struct PublicContext documentation + + + + + +
+ +

Struct PublicContext

+
pub struct PublicContext {
+    pub args_hash: Option<Field>,
+    pub compute_args_hash: fn() -> Field,
+}
+
+
+

PublicContext

+

The main interface between an #[external("public")] function and the Aztec blockchain.

+

An instance of the PublicContext is initialized automatically at the outset +of every public function, within the #[external("public")] macro, so you'll never +need to consciously instantiate this yourself.

+

The instance is always named context, and it will always be available +within the body of every #[external("public")] function in your smart contract.

+

Typical usage for a smart contract developer will be to call getter +methods of the PublicContext.

+

Pushing data and requests to the context is mostly handled within +aztec-nr's own functions, so typically a smart contract developer won't +need to call any setter methods directly.

+

Responsibilities

+
    +
  • Exposes contextual data to a public function: +
      +
    • Data relating to how this public function was called: +
        +
      • msg_sender, this_address
      • +
      +
    • +
    • Data relating to the current blockchain state: +
        +
      • timestamp, block_number, chain_id, version
      • +
      +
    • +
    • Gas and fee information
    • +
    +
  • +
  • Provides state access: +
      +
    • Read/write public storage (key-value mapping)
    • +
    • Check existence of notes and nullifiers +(Some patterns use notes & nullifiers to store public (not private) +information)
    • +
    • Enables consumption of L1->L2 messages.
    • +
    +
  • +
  • Enables calls to other public smart contract functions:
  • +
  • Writes data to the blockchain: +
      +
    • Updates to public state variables
    • +
    • New public logs (for events)
    • +
    • New L2->L1 messages
    • +
    • New notes & nullifiers +(E.g. pushing public info to notes/nullifiers, or for completing +"partial notes")
    • +
    +
  • +
+

Key Differences from Private Execution

+

Unlike private functions -- which are executed on the user's device and which +can only reference historic state -- public functions are executed by a block +proposer and are executed "live" on the current tip of the chain. +This means public functions can:

+
    +
  • Read and write current public state
  • +
  • Immediately see the effects of earlier transactions in the same block
  • +
+

Also, public functions are executed within a zkVM (the "AVM"), so that they +can revert whilst still ensuring payment to the proposer and prover. +(Private functions cannot revert: they either succeed, or they cannot be +included).

+

Optimising Public Functions

+

Using the AVM to execute public functions means they compile down to "AVM +bytecode" instead of the ACIR that private functions (standalone circuits) +compile to. Therefore the approach to optimising a public function is +fundamentally different from optimising a public function.

+
+

Fields

+
args_hash: Option<Field>
+
compute_args_hash: fn() -> Field
+

Implementations

+

impl PublicContext

+ +
pub fn new(compute_args_hash: fn() -> Field) -> Self + +
+

Creates a new PublicContext instance.

+

Low-level function: This is called automatically by the #[external("public")] +macro, so you shouldn't need to be called directly by smart contract +developers.

+

Arguments

+
    +
  • compute_args_hash - Function to compute the args_hash
  • +
+

Returns

+
    +
  • A new PublicContext instance
  • +
+
+
pub fn emit_public_log<T>(_self: Self, log: T) +
where + T: Serialize
+ +
+

Emits a public log that will be visible onchain to everyone.

+

Arguments

+
    +
  • log - The data to log, must implement Serialize trait
  • +
+
+
pub fn note_hash_exists(_self: Self, note_hash: Field, leaf_index: u64) -> bool + +
+

Checks if a given note hash exists in the note hash tree at a particular +leaf_index.

+

Arguments

+
    +
  • note_hash - The note hash to check for existence
  • +
  • leaf_index - The index where the note hash should be located
  • +
+

Returns

+
    +
  • bool - True if the note hash exists at the specified index
  • +
+
+
pub fn l1_to_l2_msg_exists(_self: Self, msg_hash: Field, msg_leaf_index: Field) -> bool + +
+

Checks if a specific L1-to-L2 message exists in the L1-to-L2 message +tree at a particular leaf index.

+

Common use cases include token bridging, cross-chain governance, and +triggering L2 actions based on L1 events.

+

This function should be called before attempting to consume an L1-to-L2 +message.

+

Arguments

+
    +
  • msg_hash - Hash of the L1-to-L2 message to check
  • +
  • msg_leaf_index - The index where the message should be located
  • +
+

Returns

+
    +
  • bool - True if the message exists at the specified index
  • +
+

Advanced

+
    +
  • Uses the AVM l1_to_l2_msg_exists opcode for tree lookup
  • +
  • Messages are copied from L1 Inbox to L2 by block proposers
  • +
+
+
pub fn nullifier_exists( + _self: Self, + unsiloed_nullifier: Field, + address: AztecAddress, +) -> bool + +
+

Checks if a specific nullifier has been emitted by a given contract.

+

Whilst nullifiers are primarily intended as a privacy-preserving +record of a one-time action, they can also be used to efficiently +record public one-time actions too. An example is to check +whether a contract has been published: we emit a nullifier that is +deterministic, but whose preimage is not private. This is more +efficient than using mutable storage, and can be done directly +from a private function.

+

Nullifiers can be tested for non-existence in public, which is not the +case in private. Because private functions do not have access to +the tip of the blockchain (but only the anchor block they are built +at) they can only prove nullifier non-existence in the past. But between +an anchor block and the block in which a tx is included, the nullifier +might have been inserted into the nullifier tree by some other +transaction. +Public functions do have access to the tip of the state, and so +this pattern is safe.

+

Arguments

+
    +
  • unsiloed_nullifier - The raw nullifier value (before siloing with +the contract address that emitted it).
  • +
  • address - The claimed contract address that emitted the nullifier
  • +
+

Returns

+
    +
  • bool - True if the nullifier has been emitted by the specified contract
  • +
+
+
pub fn consume_l1_to_l2_message( + self, + content: Field, + secret: Field, + sender: EthAddress, + leaf_index: Field, +) + +
+

Consumes a message sent from Ethereum (L1) to Aztec (L2) -- effectively +marking it as "read".

+

Use this function if you only want the message to ever be "referred to" +once. Once consumed using this method, the message cannot be consumed +again, because a nullifier is emitted. +If your use case wants for the message to be read unlimited times, then +you can always read any historic message from the L1-to-L2 messages tree, +using the l1_to_l2_msg_exists method. Messages never technically get +deleted from that tree.

+

The message will first be inserted into an Aztec "Inbox" smart contract +on L1. It will not be available for consumption immediately. Messages +get copied-over from the L1 Inbox to L2 by the next Proposer in batches. +So you will need to wait until the messages are copied before you can +consume them.

+

Arguments

+
    +
  • content - The message content that was sent from L1
  • +
  • secret - Secret value used for message privacy (if needed)
  • +
  • sender - Ethereum address that sent the message
  • +
  • leaf_index - Index of the message in the L1-to-L2 message tree
  • +
+

Advanced

+
    +
  • Validates message existence in the L1-to-L2 message tree
  • +
  • Prevents double-consumption by emitting a nullifier
  • +
  • Message hash is computed from all parameters + chain context
  • +
  • Will revert if message doesn't exist or was already consumed
  • +
+
+
pub fn message_portal(_self: Self, recipient: EthAddress, content: Field) + +
+

Sends an "L2 -> L1 message" from this function (Aztec, L2) to a smart +contract on Ethereum (L1). L1 contracts which are designed to +send/receive messages to/from Aztec are called "Portal Contracts".

+

Common use cases include withdrawals, cross-chain asset transfers, and +triggering L1 actions based on L2 state changes.

+

The message will be inserted into an Aztec "Outbox" contract on L1, +when this transaction's block is proposed to L1. +Sending the message will not result in any immediate state changes in +the target portal contract. The message will need to be manually +consumed from the Outbox through a separate Ethereum transaction: a user +will need to call a function of the portal contract -- a function +specifically designed to make a call to the Outbox to consume the +message. +The message will only be available for consumption once the epoch +proof has been submitted. Given that there are multiple Aztec blocks +within an epoch, it might take some time for this epoch proof to be +submitted -- especially if the block was near the start of an epoch.

+

Arguments

+
    +
  • recipient - Ethereum address that will receive the message
  • +
  • content - Message content (32 bytes as a Field element)
  • +
+
+
pub unconstrained fn call_public_function<let N: u32>( + _self: Self, + contract_address: AztecAddress, + function_selector: FunctionSelector, + args: [Field; N], + gas_opts: GasOpts, +) -> [Field] + +
+

Calls a public function on another contract.

+

Will revert if the called function reverts or runs out of gas.

+

Arguments

+
    +
  • contract_address - Address of the contract to call
  • +
  • function_selector - Function to call on the target contract
  • +
  • args - Arguments to pass to the function
  • +
  • gas_opts - An optional allocation of gas to the called function.
  • +
+

Returns

+
    +
  • [Field] - Return data from the called function
  • +
+
+
pub unconstrained fn static_call_public_function<let N: u32>( + _self: Self, + contract_address: AztecAddress, + function_selector: FunctionSelector, + args: [Field; N], + gas_opts: GasOpts, +) -> [Field] + +
+

Makes a read-only call to a public function on another contract.

+

This is similar to Solidity's staticcall. The called function +cannot modify state or emit events. Any nested calls are constrained to +also be staticcalls.

+

Useful for querying data from other contracts safely.

+

Will revert if the called function reverts or runs out of gas.

+

Arguments

+
    +
  • contract_address - Address of the contract to call
  • +
  • function_selector - Function to call on the target contract
  • +
  • args - Array of arguments to pass to the called function
  • +
  • gas_opts - An optional allocation of gas to the called function.
  • +
+

Returns

+
    +
  • [Field] - Return data from the called function
  • +
+
+
pub fn push_note_hash(_self: Self, note_hash: Field) + +
+

Adds a new note hash to the Aztec blockchain's global Note Hash Tree.

+

Notes are ordinarily constructed and emitted by private functions, to +ensure that both the content of the note, and the contract that emitted +the note, stay private.

+

There are however some useful patterns whereby a note needs to contain +public data. The ability to push a new note_hash from a public +function means that notes can be injected with public data immediately +-- as soon as the public value is known. The slower alternative would +be to submit a follow-up transaction so that a private function can +inject the data. Both are possible on Aztec.

+

Search "Partial Note" for a very common pattern which enables a note +to be "partially" populated with some data in a private function, and +then later "completed" with some data in a public function.

+

Arguments

+
    +
  • note_hash - The hash of the note to add to the tree
  • +
+

Advanced

+
    +
  • The note hash will be siloed with the contract address by the protocol
  • +
+
+
pub fn push_nullifier(_self: Self, nullifier: Field) + +
+

Adds a new nullifier to the Aztec blockchain's global Nullifier Tree.

+

Whilst nullifiers are primarily intended as a privacy-preserving +record of a one-time action, they can also be used to efficiently +record public one-time actions too. Hence why you're seeing this +function within the PublicContext. +An example is to check whether a contract has been published: we emit +a nullifier that is deterministic, but whose preimage is not private.

+

Arguments

+
    +
  • nullifier - A unique field element that represents the consumed +state
  • +
+

Advanced

+
    +
  • Nullifier is immediately added to the global nullifier tree
  • +
  • Emitted nullifiers are immediately visible to all +subsequent transactions in the same block
  • +
  • Automatically siloed with the contract address by the protocol
  • +
  • Used for preventing double-spending and ensuring one-time actions
  • +
+
+
pub fn this_address(_self: Self) -> AztecAddress + +
+

Returns the address of the current contract being executed.

+

This is equivalent to address(this) in Solidity (hence the name). +Use this to identify the current contract's address, commonly needed for +access control or when interacting with other contracts.

+

Returns

+
    +
  • AztecAddress - The contract address of the current function being +executed.
  • +
+
+
pub fn msg_sender(_self: Self) -> Option<AztecAddress> + +
+

Returns the contract address that initiated this function call.

+

This is similar to msg.sender in Solidity (hence the name).

+

Important Note: If the calling function is a private function, then +it had the option of hiding its address when enqueuing this public +function call. In such cases, this context.msg_sender() method will +return Option<AztecAddress>::none. +If the calling function is a public function, it will always return +an Option<AztecAddress>::some (i.e. a non-null value).

+

Returns

+
    +
  • Option<AztecAddress> - The address of the smart contract that called +this function (be it an app contract or a user's account contract).
  • +
+

Advanced

+
    +
  • Value is provided by the AVM sender opcode
  • +
  • In nested calls, this is the immediate caller, not the original +transaction sender
  • +
+
+
pub fn msg_sender_unsafe(_self: Self) -> AztecAddress + +
+

"Unsafe" versus calling context.msg_sender(), because it doesn't +translate NULL_MSG_SENDER_CONTRACT_ADDRESS as +Option<AztecAddress>::none. +Used by some internal aztecnr functions.

+
+
pub fn selector(_self: Self) -> FunctionSelector + +
+

Returns the function selector of the currently-executing function.

+

This is similar to msg.sig in Solidity, returning the first 4 +bytes of the function signature.

+

Returns

+
    +
  • FunctionSelector - The 4-byte function identifier
  • +
+

Advanced

+
    +
  • Extracted from the first element of calldata
  • +
  • Used internally for function dispatch in the AVM
  • +
+
+
pub fn get_args_hash(self) -> Field + +
+

Returns the hash of the arguments passed to the current function.

+

Very low-level function: The #[external("public")] macro uses this internally. +Smart contract developers typically won't need to access this +directly as arguments are automatically made available.

+

Returns

+
    +
  • Field - Hash of the function arguments
  • +
+
+
pub fn transaction_fee(_self: Self) -> Field + +
+

Returns the "transaction fee" for the current transaction. +This is the final tx fee that will be deducted from the fee_payer's +"fee-juice" balance (in the protocol's Base Rollup circuit).

+

Returns

+
    +
  • Field - The actual, final cost of the transaction, taking into account: +the actual gas used during the setup and app-logic phases, +and the fixed amount of gas that's been allocated by the user +for the teardown phase. +I.e. effectiveL2FeePerGas * l2GasUsed + effectiveDAFeePerGas * daGasUsed
  • +
+

This will return 0 during the "setup" and "app-logic" phases of +tx execution (because the final tx fee is not known at that time). +This will only return a nonzero value during the "teardown" phase of +execution, where the final tx fee can actually be computed.

+

Regardless of when this function is called during the teardown phase, +it will always return the same final tx fee value. The teardown phase +does not consume a variable amount of gas: it always consumes a +pre-allocated amount of gas, as specified by the user when they generate +their tx.

+
+
pub fn chain_id(_self: Self) -> Field + +
+

Returns the chain ID of the current network.

+

This is similar to block.chainid in Solidity. Returns the unique +identifier for the blockchain network this transaction is executing on.

+

Helps prevent cross-chain replay attacks. Useful if implementing +multi-chain contract logic.

+

Returns

+
    +
  • Field - The chain ID as a field element
  • +
+
+
pub fn version(_self: Self) -> Field + +
+

Returns the Aztec protocol version that this transaction is executing +under. Different versions may have different rules, opcodes, or +cryptographic primitives.

+

This is similar to how Ethereum has different EVM versions.

+

Useful for forward/backward compatibility checks

+

Not to be confused with contract versions; this is the protocol version.

+

Returns

+
    +
  • Field - The protocol version as a field element
  • +
+
+
pub fn block_number(_self: Self) -> u32 + +
+

Returns the current block number.

+

This is similar to block.number in Solidity.

+

Note: the current block number is only available within a public function +(as opposed to a private function).

+

Note: the time intervals between blocks should not be relied upon as +being consistent:

+
    +
  • Timestamps of blocks fall within a range, rather than at exact regular +intervals.
  • +
  • Slots can be missed.
  • +
  • Protocol upgrades can completely change the intervals between blocks +(and indeed the current roadmap plans to reduce the time between +blocks, eventually). +Use context.timestamp() for more-reliable time-based logic.
  • +
+

Returns

+
    +
  • u32 - The current block number
  • +
+
+
pub fn timestamp(_self: Self) -> u64 + +
+

Returns the timestamp of the current block.

+

This is similar to block.timestamp in Solidity.

+

All functions of all transactions in a block share the exact same +timestamp (even though technically each transaction is executed +one-after-the-other).

+

Important note: Timestamps of Aztec blocks are not at reliably-fixed +intervals. The proposer of the block has some flexibility to choose a +timestamp which is in a valid range: Obviously the timestamp of this +block must be strictly greater than that of the previous block, and must +must be less than the timestamp of whichever ethereum block the aztec +block is proposed to. Furthermore, if the timestamp is not deemed close +enough to the actual current time, the committee of validators will not +attest to the block.

+

Returns

+
    +
  • u64 - Unix timestamp in seconds
  • +
+
+
pub fn base_fee_per_l2_gas(_self: Self) -> u128 + +
+

Returns the fee per unit of L2 gas for this transaction (aka the "L2 gas +price"), as chosen by the user.

+

L2 gas covers the cost of executing public functions and handling +side-effects within the AVM.

+

Returns

+
    +
  • u128 - Fee per unit of L2 gas
  • +
+

Wallet developers should be mindful that the choice of gas price (which +is publicly visible) can leak information about the user, e.g.:

+
    +
  • which wallet software the user is using;
  • +
  • the amount of time which has elapsed from the time the user's wallet +chose a gas price (at the going rate), to the time of tx submission. +This can give clues about the proving time, and hence the nature of +the tx.
  • +
  • the urgency of the transaction (which is kind of unavoidable, if the +tx is indeed urgent).
  • +
  • the wealth of the user.
  • +
  • the exact user (if the gas price is explicitly chosen by the user to +be some unique number like 0.123456789, or their favorite number). +Wallet devs might wish to consider fuzzing the choice of gas price.
  • +
+
+
pub fn base_fee_per_da_gas(_self: Self) -> u128 + +
+

Returns the fee per unit of DA (Data Availability) gas (aka the "DA gas +price").

+

DA gas covers the cost of making transaction data available on L1.

+

See the warning in fee_pre_l2_gas for how gas prices can be leaky.

+

Returns

+
    +
  • u128 - Fee per unit of DA gas
  • +
+
+
pub fn l2_gas_left(_self: Self) -> u32 + +
+

Returns the remaining L2 gas available for this transaction.

+

Different AVM opcodes consume different amounts of gas.

+

Returns

+
    +
  • u32 - Remaining L2 gas units
  • +
+
+
pub fn da_gas_left(_self: Self) -> u32 + +
+

Returns the remaining DA (Data Availability) gas available for this +transaction.

+

DA gas is consumed when emitting data that needs to be made available +on L1, such as public logs or state updates. +All of the side-effects from the private part of the tx also consume +DA gas before execution of any public functions even begins.

+

Returns

+
    +
  • u32 - Remaining DA gas units
  • +
+
+
pub fn is_static_call(_self: Self) -> bool + +
+

Checks if the current execution is within a staticcall context, where +no state changes or logs are allowed to be emitted (by this function +or any nested function calls).

+

Returns

+
    +
  • bool - True if in staticcall context, false otherwise
  • +
+
+
pub fn raw_storage_read<let N: u32>(_self: Self, storage_slot: Field) -> [Field; N] + +
+

Reads raw field values from public storage. +Reads N consecutive storage slots starting from the given slot.

+

Very low-level function. Users should typically use the public state +variable abstractions to perform reads: PublicMutable & PublicImmutable.

+

Arguments

+
    +
  • storage_slot - The starting storage slot to read from
  • +
+

Returns

+
    +
  • [Field; N] - Array of N field values from consecutive storage slots
  • +
+

Generic Parameters

+
    +
  • N - the number of consecutive slots to return, starting from the +storage_slot.
  • +
+
+
pub fn storage_read<T>(self, storage_slot: Field) -> T +
where + T: Packable
+ +
+

Reads a typed value from public storage.

+

Low-level function. Users should typically use the public state +variable abstractions to perform reads: PublicMutable & PublicImmutable.

+

Arguments

+
    +
  • storage_slot - The storage slot to read from
  • +
+

Returns

+
    +
  • T - The deserialized value from storage
  • +
+

Generic Parameters

+
    +
  • T - The type that the caller expects to read from the storage_slot.
  • +
+
+
pub fn raw_storage_write<let N: u32>( + _self: Self, + storage_slot: Field, + values: [Field; N], +) + +
+

Writes raw field values to public storage. +Writes to N consecutive storage slots starting from the given slot.

+

Very low-level function. Users should typically use the public state +variable abstractions to perform writes: PublicMutable & PublicImmutable.

+

Public storage writes take effect immediately.

+

Arguments

+
    +
  • storage_slot - The starting storage slot to write to
  • +
  • values - Array of N Fields to write to storage
  • +
+
+
pub fn storage_write<T>(self, storage_slot: Field, value: T) +
where + T: Packable
+ +
+

Writes a typed value to public storage.

+

Low-level function. Users should typically use the public state +variable abstractions to perform writes: PublicMutable & PublicImmutable.

+

Arguments

+
    +
  • storage_slot - The storage slot to write to
  • +
  • value - The typed value to write to storage
  • +
+

Generic Parameters

+
    +
  • T - The type to write to storage.
  • +
+
+

Trait implementations

+

impl Empty for PublicContext

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for PublicContext

+ +
pub fn eq(self, other: Self) -> bool + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/returns_hash/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/returns_hash/index.html new file mode 100644 index 000000000000..655b1a4835b4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/returns_hash/index.html @@ -0,0 +1,47 @@ + + + + + + +Module returns_hash documentation + + + + + +
+
aztec-nr - noir_aztec::context::returns_hash
+

Module returns_hash

+

Structs

    +
  • A hash that represents a private contract function call's return value. Call get_preimage to get the underlying +value.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/returns_hash/struct.ReturnsHash.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/returns_hash/struct.ReturnsHash.html new file mode 100644 index 000000000000..cdb084e585fd --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/returns_hash/struct.ReturnsHash.html @@ -0,0 +1,59 @@ + + + + + + +Struct ReturnsHash documentation + + + + + +
+ +

Struct ReturnsHash

+
pub struct ReturnsHash
+{ /* private fields */ }
+
+
+

A hash that represents a private contract function call's return value. Call get_preimage to get the underlying +value.

+

The kernels don't process the actual return values but instead their hashes, so it is up to contracts to populate +oracles with the preimages of these hashes on return to make them available to their callers.

+

Public calls don't utilize this mechanism since the AVM does process the full return values.

+
+

Implementations

+

impl ReturnsHash

+ +
pub fn new(hash: Field) -> Self + +pub fn get_preimage<T>(self) -> T +
where + T: Deserialize
+ +
+

Fetches the underlying return value from an oracle, constraining that it corresponds to the return data hash.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/utility_context/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/utility_context/index.html new file mode 100644 index 000000000000..9afe398f5710 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/utility_context/index.html @@ -0,0 +1,46 @@ + + + + + + +Module utility_context documentation + + + + + +
+
aztec-nr - noir_aztec::context::utility_context
+

Module utility_context

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/utility_context/struct.UtilityContext.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/utility_context/struct.UtilityContext.html new file mode 100644 index 000000000000..129049da67fd --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/context/utility_context/struct.UtilityContext.html @@ -0,0 +1,79 @@ + + + + + + +Struct UtilityContext documentation + + + + + +
+ +

Struct UtilityContext

+
pub struct UtilityContext
+{ /* private fields */ }
+
+

Implementations

+

impl UtilityContext

+ +
pub unconstrained fn new() -> Self + +pub unconstrained fn at(contract_address: AztecAddress) -> Self + +pub unconstrained fn at_historical( + contract_address: AztecAddress, + block_number: u32, +) -> Self + +pub fn block_number(self) -> u32 + +pub fn timestamp(self) -> u64 + +pub fn this_address(self) -> AztecAddress + +pub fn version(self) -> Field + +pub fn chain_id(self) -> Field + +pub unconstrained fn raw_storage_read<let N: u32>( + self, + storage_slot: Field, +) -> [Field; N] + +pub unconstrained fn storage_read<T>(self, storage_slot: Field) -> T +
where + T: Packable
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/contract_self/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/contract_self/index.html new file mode 100644 index 000000000000..86222825e693 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/contract_self/index.html @@ -0,0 +1,53 @@ + + + + + + +Module contract_self documentation + + + + + +
+
aztec-nr - noir_aztec::contract_self
+

Module contract_self

+

Structs

    +
  • ContractSelf is the core interface for interacting with an Aztec contract's own state and context.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/contract_self/struct.ContractSelf.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/contract_self/struct.ContractSelf.html new file mode 100644 index 000000000000..daac44b4eeaf --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/contract_self/struct.ContractSelf.html @@ -0,0 +1,601 @@ + + + + + + +Struct ContractSelf documentation + + + + + +
+ +

Struct ContractSelf

+
pub struct ContractSelf<Context, Storage, CallSelf, EnqueueSelf, CallSelfStatic, EnqueueSelfStatic, CallInternal> {
+    pub address: AztecAddress,
+    pub storage: Storage,
+    pub context: Context,
+    pub call_self: CallSelf,
+    pub enqueue_self: EnqueueSelf,
+    pub call_self_static: CallSelfStatic,
+    pub enqueue_self_static: EnqueueSelfStatic,
+    pub internal: CallInternal,
+}
+
+
+

ContractSelf is the core interface for interacting with an Aztec contract's own state and context.

+

This struct is automatically injected into every #[external(...)] contract function by the Aztec macro system and is +accessible through the self variable.

+

Usage in Contract Functions

+

Once injected, you can use self to:

+
    +
  • Access storage: self.storage.balances.at(owner).read()
  • +
  • Call contracts: self.call(Token::at(address).transfer(recipient, amount))
  • +
  • Emit events: self.emit(event).deliver_to(recipient, delivery_mode) (private) or self.emit(event) (public)
  • +
  • Get the contract address: self.address
  • +
  • Get the caller: self.msg_sender()
  • +
  • Access low-level Aztec.nr APIs through the context: self.context
  • +
+

Example

+
#[external("private")]
+fn withdraw(amount: u128, recipient: AztecAddress) {
+    // Get the caller of this function
+    let sender = self.msg_sender().unwrap();
+
+    // Access storage
+    let token = self.storage.donation_token.get_note().get_address();
+
+    // Call contracts
+    self.call(Token::at(token).transfer(recipient, amount));
+}
+

Type Parameters

+
    +
  • Context: The execution context type - either &mut PrivateContext, PublicContext, or UtilityContext
  • +
  • Storage: The contract's storage struct (defined with #[storage]), or () if the contract has no storage
  • +
  • CallSelf: Macro-generated type for calling contract's own non-view functions
  • +
  • EnqueueSelf: Macro-generated type for enqueuing calls to the contract's own non-view functions
  • +
  • CallSelfStatic: Macro-generated type for calling contract's own view functions
  • +
  • EnqueueSelfStatic: Macro-generated type for enqueuing calls to the contract's own view functions
  • +
+

Fields

+
address: AztecAddress
+
+

The address of this contract

+
+
storage: Storage
+
+

The contract's storage instance, representing the struct to which the #[storage] macro was applied in your +contract. If the contract has no storage, the type of this will be ().

+

This storage instance is specialized for the current execution context (private, public, or utility) and +provides access to the contract's state variables. Each state variable accepts the context as a generic +parameter, which determines its available functionality. For example, a PublicImmutable variable can be read +from any context (public, private, or utility) but can only be written to from public contexts.

+

Developer Note

+

If you've arrived here while trying to access your contract's storage while the Storage generic type is set to +unit type (), it means you haven't yet defined a Storage struct using the #[storage] macro in your contract. +For guidance on setting this up, please refer to our docs: +https://docs.aztec.network/developers/docs/guides/smart_contracts/storage

+
+
context: Context
+
+

The execution context whose type is determined by the #[external(...)] attribute of the contract function based +on the external function type (private, public, or utility).

+
+
call_self: CallSelf
+
+

Provides type-safe methods for calling this contract's own non-view functions.

+

In private and public contexts this will be a struct with appropriate methods; +in utility context it will be the unit type ().

+

Example API:

+
self.call_self.some_private_function(args)
+
enqueue_self: EnqueueSelf
+
+

Provides type-safe methods for enqueuing calls to this contract's own non-view functions.

+

In private context this will be a struct with appropriate methods; +in public and utility contexts it will be the unit type ().

+

Example API:

+
self.enqueue_self.some_public_function(args)
+
call_self_static: CallSelfStatic
+
+

Provides type-safe methods for calling this contract's own view functions.

+

In private and public contexts this will be a struct with appropriate methods; +in utility context it will be the unit type ().

+

Example API:

+
self.call_self_static.some_view_function(args)
+
enqueue_self_static: EnqueueSelfStatic
+
+

Provides type-safe methods for enqueuing calls to this contract's own view functions.

+

In private context this will be a struct with appropriate methods; +in public and utility contexts it will be the unit type ().

+

Example API:

+
self.enqueue_self_static.some_public_view_function(args)
+
internal: CallInternal
+
+

Provides type-safe methods for calling internal functions.

+

In private and public contexts this will be a struct with appropriate methods; +in utility context it will be the unit type ().

+

Example API:

+
self.internal.some_internal_function(args)
+

Implementations

+

impl<CallInternal, CallSelf, CallSelfStatic, Storage> ContractSelf<PublicContext, Storage, CallSelf, (), CallSelfStatic, (), CallInternal>

+ +
pub fn new_public( + context: PublicContext, + storage: Storage, + call_self: CallSelf, + call_self_static: CallSelfStatic, + internal: CallInternal, +) -> Self + +
+

Creates a new ContractSelf instance for a public function.

+

This constructor is called automatically by the macro system and should not be called directly.

+
+
pub fn msg_sender(self) -> Option<AztecAddress> + +
+

Returns the contract address that initiated this function call.

+

This is similar to msg.sender in Solidity (hence the name).

+

Important Note: If the calling function is a private function, then it had the option of hiding its address +when enqueuing this public function call. In such cases, this context.msg_sender() method will return +Option<AztecAddress>::none. If the calling function is a public function, it will always return an +Option<AztecAddress>::some (i.e. a non-null value).

+

Returns

+
    +
  • Option<AztecAddress> - The address of the smart contract that called this function (be it an app contract or +a user's account contract).
  • +
+

Advanced

+
    +
  • Value is provided by the AVM sender opcode
  • +
  • In nested calls, this is the immediate caller, not the original transaction sender
  • +
+
+
pub fn emit<Event>(&mut self, event: Event) +
where + Event: EventInterface, + Event: Serialize
+ +
+

Emits an event publicly.

+

Public events are emitted as plaintext and are therefore visible to everyone. This is is the same as Solidity +events on EVM chains.

+

Unlike private events, they don't require delivery of an event message.

+

Example

+
#[event]
+struct Update { value: Field }
+
+#[external("public")]
+fn publish_update(value: Field) {
+    self.emit(Update { value });
+}
+

Cost

+

Public event emission is achieved by emitting public transaction logs. A total of N+1 fields are emitted, +where N is the serialization length of the event.

+
pub unconstrained fn call<let M: u32, let N: u32, T>( + self, + call: PublicCall<M, N, T>, +) -> T +
where + T: Deserialize
+ +
+

Makes the call to the public function defined by the call parameter.

+

Will revert if the called function reverts or runs out of gas.

+

Arguments

+
    +
  • call - The object representing the public function to invoke.
  • +
+

Returns

+
    +
  • T - Whatever data the called function has returned.
  • +
+

Example

+
self.call(Token::at(address).transfer_in_public(recipient, amount));
+
pub unconstrained fn view<let M: u32, let N: u32, T>( + self, + call: PublicStaticCall<M, N, T>, +) -> T +
where + T: Deserialize
+ +
+

Makes the read-only call to the public function defined by the call parameter.

+

This is similar to Solidity's staticcall. The called function +cannot modify state or emit events. Any nested calls are constrained to +also be static calls.

+

Will revert if the called function reverts or runs out of gas.

+

Arguments

+
    +
  • call - The object representing the read-only public function to invoke.
  • +
+

Returns

+
    +
  • T - Whatever data the called function has returned.
  • +
+

Example

+
self.view(Token::at(address).balance_of_public(recipient));
+

impl<Storage> ContractSelf<UtilityContext, Storage, (), (), (), (), ()>

+ +
pub fn new_utility(context: UtilityContext, storage: Storage) -> Self + +
+

Creates a new ContractSelf instance for a utility function.

+

This constructor is called automatically by the macro system and should not be called directly.

+
+

impl<CallInternal, CallSelf, CallSelfStatic, EnqueueSelf, EnqueueSelfStatic, Storage> ContractSelf<&mut PrivateContext, Storage, CallSelf, EnqueueSelf, CallSelfStatic, EnqueueSelfStatic, CallInternal>

+ +
pub fn new_private( + context: &mut PrivateContext, + storage: Storage, + call_self: CallSelf, + enqueue_self: EnqueueSelf, + call_self_static: CallSelfStatic, + enqueue_self_static: EnqueueSelfStatic, + internal: CallInternal, +) -> Self + +
+

Creates a new ContractSelf instance for a private function.

+

This constructor is called automatically by the macro system and should not be called directly.

+
+
pub fn msg_sender(self) -> Option<AztecAddress> + +
+

Returns the contract address that initiated this function call. This is similar to msg.sender in Solidity.

+

Important Note: Since Aztec doesn't have a concept of an EoA ( Externally-owned Account), the msg_sender is +"null" for the first function call of every transaction. The first function call of a tx is likely to be a call +to the user's account contract, so this quirk will most often be handled by account contract developers.

+

Returns

+
    +
  • Option<AztecAddress> - The address of the smart contract that called this function (be it an app contract or +a user's account contract). Returns Option<AztecAddress>::none for the first function call of the tx. No +other private function calls in the tx will have a none msg_sender, but public function calls might (see +the PublicContext).
  • +
+
+
pub fn emit<Event>(&mut self, event: Event) -> EventMessage<Event> +
where + Event: EventInterface, + Event: Serialize
+ +
+

Emits an event privately.

+

Unlike public events, private events do not reveal their contents publicly. They instead create an +EventMessage containing the private event information, which MUST be delivered to a recipient via +EventMessage::deliver_to in order for them to learn about the event. Multiple recipients can have the same +message be delivered to them.

+

Example

+
#[event]
+struct Transfer { from: AztecAddress, to: AztecAddress, amount: u128 }
+
+#[external("private")]
+fn transfer(to: AztecAddress, amount: u128) {
+    let from = self.msg_sender().unwrap();
+
+    let message: EventMessage = self.emit(Transfer { from, to, amount });
+    message.deliver_to(from, MessageDelivery.UNCONSTRAINED_OFFCHAIN);
+    message.deliver_to(to, MessageDelivery.CONSTRAINED_ONCHAIN);
+}
+

Cost

+

Private event emission always results in the creation of a nullifer, which acts as a commitment to the event and +is used by third parties to verify its authenticity. See EventMessage::deliver_to for the costs associated to +delivery.

+

Privacy

+

The nullifier created when emitting a private event leaks nothing about the content of the event - it's a +commitment that includes a random value, so even with full knowledge of the event preimage determining if an +event was emitted or not requires brute-forcing the entire Field space.

+
pub fn call<let M: u32, let N: u32, T>(&mut self, call: PrivateCall<M, N, T>) -> T +
where + T: Deserialize
+ +
+

Makes a call to the private function defined by the call parameter.

+

Arguments

+
    +
  • call - The object representing the private function to invoke.
  • +
+

Returns

+
    +
  • T - Whatever data the called function has returned.
  • +
+

Example

+
self.call(Token::at(address).transfer_in_private(recipient, amount));
+

This enables contracts to interact with each other while maintaining +privacy. This "composability" of private contract functions is a key +feature of the Aztec network.

+

If a user's transaction includes multiple private function calls, then +by the design of Aztec, the following information will remain private[1]:

+
    +
  • The function selectors and contract addresses of all private function +calls will remain private, so an observer of the public mempool will +not be able to look at a tx and deduce which private functions have +been executed.
  • +
  • The arguments and return values of all private function calls will +remain private.
  • +
  • The person who initiated the tx will remain private.
  • +
  • The notes and nullifiers and private logs that are emitted by all +private function calls will (if designed well) not leak any user +secrets, nor leak which functions have been executed.
  • +
+

[1] Caveats: Some of these privacy guarantees depend on how app +developers design their smart contracts. Some actions can leak +information, such as:

+
    +
  • Calling an internal public function.
  • +
  • Calling a public function and not setting msg_sender to Option::none +(see https://github.com/AztecProtocol/aztec-packages/pull/16433)
  • +
  • Calling any public function will always leak details about the nature +of the transaction, so devs should be careful in their contract +designs. If it can be done in a private function, then that will give +the best privacy.
  • +
  • Not padding the side-effects of a tx to some standardized, uniform +size. The kernel circuits can take hints to pad side-effects, so a +wallet should be able to request for a particular amount of padding. +Wallets should ideally agree on some standard. +
      +
    • Padding should include: +
        +
      • Padding the lengths of note & nullifier arrays
      • +
      • Padding private logs with random fields, up to some standardized +size. +See also: https://docs.aztec.network/developers/resources/considerations/privacy_considerations
      • +
      +
    • +
    +
  • +
+

Advanced

+
    +
  • The call is added to the private call stack and executed by kernel +circuits after this function completes
  • +
  • The called function can modify its own contract's private state
  • +
  • Side effects from the called function are included in this transaction
  • +
  • The call inherits the current transaction's context and gas limits
  • +
+
pub fn view<let M: u32, let N: u32, T>(&mut self, call: PrivateStaticCall<M, N, T>) -> T +
where + T: Deserialize
+ +
+

Makes a read-only call to the private function defined by the call parameter.

+

This is similar to Solidity's staticcall. The called function +cannot modify state, emit L2->L1 messages, nor emit events. Any nested +calls are constrained to also be static calls.

+

Arguments

+
    +
  • call - The object representing the read-only private function to invoke.
  • +
+

Returns

+
    +
  • T - Whatever data the called function has returned.
  • +
+

Example

+
self.view(Token::at(address).balance_of_private(recipient));
+
pub fn enqueue<let M: u32, let N: u32, T>(&mut self, call: PublicCall<M, N, T>) +
where + T: Deserialize
+ +
+

Enqueues a call to the public function defined by the call parameter, +to be executed later.

+

Unlike private functions which execute immediately on the user's device, +public function calls are "enqueued" and executed some time later by a +block proposer.

+

This means a public function cannot return any values back to a private +function, because by the time the public function is being executed, +the private function which called it has already completed execution. +(In fact, the private function has been executed and proven, along with +all other private function calls of the user's tx. A single proof of the +tx has been submitted to the Aztec network, and some time later a +proposer has picked the tx up from the mempool and begun executing all +of the enqueued public functions).

+

Privacy warning

+

Enqueueing a public function call is an inherently leaky action. +Many interesting applications will require some interaction with public +state, but smart contract developers should try to use public function +calls sparingly, and carefully. +Internal public function calls are especially leaky, because they +completely leak which private contract made the call. +See also: https://docs.aztec.network/developers/resources/considerations/privacy_considerations

+

Arguments

+
    +
  • call - The interface representing the public function to enqueue.
  • +
+

TODO(F-131): We should drop T from here because it is strange as there +is no return value. The PublicCall type seems to be defined +incorrectly.

+
+
pub fn enqueue_view<let M: u32, let N: u32, T>( + &mut self, + call: PublicStaticCall<M, N, T>, +) +
where + T: Deserialize
+ +
+

Enqueues a read-only call to the public function defined by the call parameter.

+

This is similar to Solidity's staticcall. The called function +cannot modify state, emit L2->L1 messages, nor emit events. Any nested +calls are constrained to also be static calls.

+

Arguments

+
    +
  • call - The object representing the read-only public function to enqueue.
  • +
+

Example

+
self.enqueue_view(MyContract::at(address).assert_timestamp_less_than(timestamp));
+

TODO(F-131): We should drop T from here because it is strange as there +is no return value. The PublicCall type seems to be defined +incorrectly.

+
pub fn enqueue_incognito<let M: u32, let N: u32, T>(&mut self, call: PublicCall<M, N, T>) +
where + T: Deserialize
+ +
+

Enqueues a call to the public function defined by the call parameter, +to be executed later.

+

As per enqueue, but hides this calling contract's address from the +target public function. +This means the origin of the call (msg_sender) will not be publicly +visible to any blockchain observers, nor to the target public function. +When the target public function reads context.msg_sender() it will +receive an Option<AztecAddress>::none.

+

NOTES:

+
    +
  • Not all public functions will accept a msg_sender of "none". Many +public functions will require that msg_sender is "some" and will +revert otherwise. Therefore, if using enqueue_incognito, you must +understand whether the function you're calling will accept a +msg_sender of "none". +Lots of public bookkeeping patterns rely on knowing which address made +the call, so as to ascribe state against the caller's address. +(There are patterns whereby bookkeeping could instead be done in +private-land).
  • +
  • If you are enqueueing a call to an internal public function (i.e. +a public function that will only accept calls from other functions +of its own contract), then by definition a call to it cannot possibly +be "incognito": the msg_sender must be its own address, and indeed the +called public function will assert this. Tl;dr this is not usable for +enqueued internal public calls.
  • +
+

Arguments

+
    +
  • call - The object representing the public function to enqueue.
  • +
+

Example

+
self.enqueue_incognito(Token::at(address).increase_total_supply_by(amount));
+

Advanced:

+
    +
  • The kernel circuits will permit any private function to set the +msg_sender field of any enqueued public function call to +NULL_MSG_SENDER_CONTRACT_ADDRESS.
  • +
  • When the called public function calls PublicContext::msg_sender(), +aztec-nr will translate NULL_MSG_SENDER_CONTRACT_ADDRESS into +Option<AztecAddress>::none for familiarity to devs.
  • +
+

TODO(F-131): We should drop T from here because it is strange as there +is no return value. The PublicCall type seems to be defined +incorrectly.

+
pub fn enqueue_view_incognito<let M: u32, let N: u32, T>( + &mut self, + call: PublicStaticCall<M, N, T>, +) +
where + T: Deserialize
+ +
+

Enqueues a read-only call to the public function defined by the call parameter.

+

As per enqueue_view, but hides this calling contract's address from +the target public function.

+

See enqueue_incognito for more details relating to hiding msg_sender.

+

Arguments

+
    +
  • call - The object representing the read-only public function to enqueue.
  • +
+

Example

+
self.enqueue_view_incognito(MyContract::at(address).assert_timestamp_less_than(timestamp));
+

TODO(F-131): We should drop T from here because it is strange as there +is no return value. The PublicCall type seems to be defined +incorrectly.

+
pub fn set_as_teardown<let M: u32, let N: u32, T>(&mut self, call: PublicCall<M, N, T>) +
where + T: Deserialize
+ +
+

Enqueues a call to the public function defined by the call parameter, +and designates it to be the teardown function for this tx. Only one teardown +function call can be made by a tx.

+

Niche function: Only wallet developers and paymaster contract developers +(aka Fee-payment contracts) will need to make use of this function.

+

Aztec supports a three-phase execution model: setup, app logic, teardown. +The phases exist to enable a fee payer to take on the risk of paying +a transaction fee, safe in the knowledge that their payment (in whatever +token or method the user chooses) will succeed, regardless of whether +the app logic will succeed. The "setup" phase ensures the fee payer +has sufficient balance to pay the proposer their fees. +The teardown phase is primarily intended to: calculate exactly +how much the user owes, based on gas consumption, and refund the user +any change.

+

Note: in some cases, the cost of refunding the user (i.e. DA costs of +tx side-effects) might exceed the refund amount. For app logic with +fairly stable and predictable gas consumption, a material refund amount +is unlikely. For app logic with unpredictable gas consumption, a +refund might be important to the user (e.g. if a hefty function reverts +very early). Wallet/FPC/Paymaster developers should be mindful of this.

+

See enqueue for more information about enqueuing public function calls.

+

Arguments

+
    +
  • call - The object representing the public function to designate as teardown.
  • +
+

TODO(F-131): We should drop T from here because it is strange as there +is no return value. The PublicCall type seems to be defined +incorrectly.

+
+
pub fn set_as_teardown_incognito<let M: u32, let N: u32, T>( + &mut self, + call: PublicCall<M, N, T>, +) +
where + T: Deserialize
+ +
+

Enqueues a call to the public function defined by the call parameter, +and designates it to be the teardown function for this tx. Only one teardown +function call can be made by a tx.

+

As per set_as_teardown, but hides this calling contract's address from +the target public function.

+

See enqueue_incognito for more details relating to hiding msg_sender.

+

TODO(F-131): We should drop T from here because it is strange as there +is no return value. The PublicCall type seems to be defined +incorrectly.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_emission/fn.emit_event_in_private.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_emission/fn.emit_event_in_private.html new file mode 100644 index 000000000000..f473e7c71b3a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_emission/fn.emit_event_in_private.html @@ -0,0 +1,45 @@ + + + + + + +Function emit_event_in_private documentation + + + + + +
+ +

Function emit_event_in_private

+
pub fn emit_event_in_private<Event>(
+    context: &mut PrivateContext,
+    event: Event,
+) -> EventMessage<Event>
+
where + Event: EventInterface, + Event: Serialize
+ +
+

Equivalent to self.emit(event): see crate::contract_self::ContractSelf::emit.

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_emission/fn.emit_event_in_public.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_emission/fn.emit_event_in_public.html new file mode 100644 index 000000000000..2129eb2092fd --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_emission/fn.emit_event_in_public.html @@ -0,0 +1,42 @@ + + + + + + +Function emit_event_in_public documentation + + + + + +
+ +

Function emit_event_in_public

+
pub fn emit_event_in_public<Event>(context: PublicContext, event: Event)
+
where + Event: EventInterface, + Event: Serialize
+ +
+

Equivalent to self.emit(event): see crate::contract_self::ContractSelf::emit.

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_emission/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_emission/index.html new file mode 100644 index 000000000000..030e56e6aa3a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_emission/index.html @@ -0,0 +1,47 @@ + + + + + + +Module event_emission documentation + + + + + +
+
aztec-nr - noir_aztec::event::event_emission
+

Module event_emission

+

Structs

    +
  • An event that was emitted in the current contract call.
  • +
+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_emission/struct.NewEvent.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_emission/struct.NewEvent.html new file mode 100644 index 000000000000..f325a31dc5f4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_emission/struct.NewEvent.html @@ -0,0 +1,42 @@ + + + + + + +Struct NewEvent documentation + + + + + +
+ +

Struct NewEvent

+
pub struct NewEvent<Event>
+{ /* private fields */ }
+
+
+

An event that was emitted in the current contract call.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_interface/fn.compute_private_event_commitment.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_interface/fn.compute_private_event_commitment.html new file mode 100644 index 000000000000..2bda97988f29 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_interface/fn.compute_private_event_commitment.html @@ -0,0 +1,46 @@ + + + + + + +Function compute_private_event_commitment documentation + + + + + +
+ +

Function compute_private_event_commitment

+
pub fn compute_private_event_commitment<Event>(event: Event, randomness: Field) -> Field
+
where + Event: EventInterface, + Event: Serialize
+ +
+

A private event's commitment is used to validate that an event was indeed emitted.

+

It requires a randomness value that must be produced alongside the event in order to perform said validation. This +random value prevents attacks in which someone guesses plausible events (e.g. 'Alice transfers to Bob an amount of +10'), since they will not be able to test for existence of their guessed events without brute-forcing the entire +Field space by guessing randomness values.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_interface/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_interface/index.html new file mode 100644 index 000000000000..45aca1b0edcb --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_interface/index.html @@ -0,0 +1,46 @@ + + + + + + +Module event_interface documentation + + + + + +
+
aztec-nr - noir_aztec::event::event_interface
+

Module event_interface

+

Traits

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_interface/trait.EventInterface.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_interface/trait.EventInterface.html new file mode 100644 index 000000000000..4f76d2a4f01c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_interface/trait.EventInterface.html @@ -0,0 +1,47 @@ + + + + + + +Trait EventInterface documentation + + + + + +
+ +

Trait EventInterface

+
pub trait EventInterface {
+    // Required methods
+    pub fn get_event_type_id() -> EventSelector;
+}
+ +

Required methods

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_message/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_message/index.html new file mode 100644 index 000000000000..1aee9f44069b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_message/index.html @@ -0,0 +1,43 @@ + + + + + + +Module event_message documentation + + + + + +
+
aztec-nr - noir_aztec::event::event_message
+

Module event_message

+

Structs

    +
  • A message with information about an event that was emitted in the current contract call. This message MUST be +delivered to a recipient in order to not lose the private event information.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_message/struct.EventMessage.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_message/struct.EventMessage.html new file mode 100644 index 000000000000..90768140af58 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_message/struct.EventMessage.html @@ -0,0 +1,65 @@ + + + + + + +Struct EventMessage documentation + + + + + +
+ +

Struct EventMessage

+
pub struct EventMessage<Event>
+{ /* private fields */ }
+
+
+

A message with information about an event that was emitted in the current contract call. This message MUST be +delivered to a recipient in order to not lose the private event information.

+

Use EventMessage::deliver_to to select a delivery mechanism.

+

Implementations

+

impl<Event> EventMessage<Event>

+ +
pub fn deliver_to(self, recipient: AztecAddress, delivery_mode: u8) +
where + Event: EventInterface, + Event: Serialize
+ +
+

Delivers the event message to a recipient, providing them access to the private event information.

+

The same message can be delivered to multiple recipients, resulting in all of them learning about the event. Any +recipient that receives the private event information will be able to prove its emission - events have no owner, +and as such all recipients are treated equally.

+

The message is first encrypted to the recipient's public key, ensuring no other actor can read it.

+

The delivery_mode must be one of crate::messages::message_delivery::MessageDeliveryEnum, and will inform +costs (both proving time and TX fees) as well as delivery guarantees. This value must be a compile-time +constant.

+

Invalid Recipients

+

If recipient is an invalid address, then a random public key is selected and message delivery continues as +normal. This prevents both 'king of the hill' attacks (where a sender would otherwise fail to deliver a message +to an invalid recipient) and forced privacy leaks (where an invalid recipient results in a unique transaction +fingerprint, e.g. one lacking the private logs that would correspond to message delivery).

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_selector/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_selector/index.html new file mode 100644 index 000000000000..918aee8a7a01 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_selector/index.html @@ -0,0 +1,42 @@ + + + + + + +Module event_selector documentation + + + + + +
+
aztec-nr - noir_aztec::event::event_selector
+

Module event_selector

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_selector/struct.EventSelector.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_selector/struct.EventSelector.html new file mode 100644 index 000000000000..2df1924a9c05 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/event_selector/struct.EventSelector.html @@ -0,0 +1,88 @@ + + + + + + +Struct EventSelector documentation + + + + + +
+ +

Struct EventSelector

+
pub struct EventSelector
+{ /* private fields */ }
+
+

Implementations

+

impl EventSelector

+ +
pub fn from_u32(value: u32) -> Self + +pub fn from_signature<let N: u32>(signature: str<N>) -> Self + +pub fn zero() -> Self + +

Trait implementations

+

impl Deserialize for EventSelector

+ +
pub fn deserialize(serialized: [Field; 1]) -> Self + +

impl Empty for EventSelector

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for EventSelector

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl FromField for EventSelector

+ +
pub fn from_field(field: Field) -> Self + +

impl Serialize for EventSelector

+ +
pub fn serialize(self) -> [Field; 1] + +

impl ToField for EventSelector

+ +
pub fn to_field(self) -> Field + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/index.html new file mode 100644 index 000000000000..32d78a7a0371 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/event/index.html @@ -0,0 +1,56 @@ + + + + + + +Module event documentation + + + + + +
+ +

Module event

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/hash/fn.compute_l1_to_l2_message_hash.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/hash/fn.compute_l1_to_l2_message_hash.html new file mode 100644 index 000000000000..8f5c1cbbf5d0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/hash/fn.compute_l1_to_l2_message_hash.html @@ -0,0 +1,47 @@ + + + + + + +Function compute_l1_to_l2_message_hash documentation + + + + + +
+ +

Function compute_l1_to_l2_message_hash

+
pub fn compute_l1_to_l2_message_hash(
+    sender: EthAddress,
+    chain_id: Field,
+    recipient: AztecAddress,
+    version: Field,
+    content: Field,
+    secret_hash: Field,
+    leaf_index: Field,
+) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/hash/fn.compute_l1_to_l2_message_nullifier.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/hash/fn.compute_l1_to_l2_message_nullifier.html new file mode 100644 index 000000000000..5c0f8b213d7c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/hash/fn.compute_l1_to_l2_message_nullifier.html @@ -0,0 +1,39 @@ + + + + + + +Function compute_l1_to_l2_message_nullifier documentation + + + + + +
+ +

Function compute_l1_to_l2_message_nullifier

+
pub fn compute_l1_to_l2_message_nullifier(message_hash: Field, secret: Field) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/hash/fn.compute_public_bytecode_commitment.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/hash/fn.compute_public_bytecode_commitment.html new file mode 100644 index 000000000000..d3657a9e8a69 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/hash/fn.compute_public_bytecode_commitment.html @@ -0,0 +1,48 @@ + + + + + + +Function compute_public_bytecode_commitment documentation + + + + + +
+ +

Function compute_public_bytecode_commitment

+
pub fn compute_public_bytecode_commitment(packed_public_bytecode: [Field; 3000]) -> Field
+ +
+

Computes the public bytecode commitment for a contract class. +The commitment is hash([separator, ...bytecode]) where bytecode omits the length prefix present +in packed_bytecode.

+

@param packed_bytecode - The packed bytecode of the contract class. 0th word is the length in bytes. +packed_bytecode is mutable so that we can avoid copying the array to construct one starting with +separator instead of length. +@returns The public bytecode commitment.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/hash/fn.compute_secret_hash.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/hash/fn.compute_secret_hash.html new file mode 100644 index 000000000000..cc2ec86652e9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/hash/fn.compute_secret_hash.html @@ -0,0 +1,39 @@ + + + + + + +Function compute_secret_hash documentation + + + + + +
+ +

Function compute_secret_hash

+
pub fn compute_secret_hash(secret: Field) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/hash/fn.hash_args.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/hash/fn.hash_args.html new file mode 100644 index 000000000000..74b109014409 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/hash/fn.hash_args.html @@ -0,0 +1,39 @@ + + + + + + +Function hash_args documentation + + + + + +
+ +

Function hash_args

+
pub fn hash_args<let N: u32>(args: [Field; N]) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/hash/fn.hash_calldata_array.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/hash/fn.hash_calldata_array.html new file mode 100644 index 000000000000..9bed3756980a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/hash/fn.hash_calldata_array.html @@ -0,0 +1,39 @@ + + + + + + +Function hash_calldata_array documentation + + + + + +
+ +

Function hash_calldata_array

+
pub fn hash_calldata_array<let N: u32>(calldata: [Field; N]) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/hash/fn.pedersen_commitment.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/hash/fn.pedersen_commitment.html new file mode 100644 index 000000000000..0e89da016f17 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/hash/fn.pedersen_commitment.html @@ -0,0 +1,42 @@ + + + + + + +Function pedersen_commitment documentation + + + + + +
+ +

Function pedersen_commitment

+
pub fn pedersen_commitment<let N: u32>(
+    inputs: [Field; N],
+    hash_index: u32,
+) -> EmbeddedCurvePoint
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/hash/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/hash/index.html new file mode 100644 index 000000000000..34213290a782 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/hash/index.html @@ -0,0 +1,66 @@ + + + + + + +Module hash documentation + + + + + +
+ +

Module hash

+

Re-exports

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/contract_inclusion/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/contract_inclusion/index.html new file mode 100644 index 000000000000..4f9f5befa7a8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/contract_inclusion/index.html @@ -0,0 +1,46 @@ + + + + + + +Module contract_inclusion documentation + + + + + +
+
aztec-nr - noir_aztec::history::contract_inclusion
+

Module contract_inclusion

+

Traits

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/contract_inclusion/trait.ProveContractDeployment.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/contract_inclusion/trait.ProveContractDeployment.html new file mode 100644 index 000000000000..6ee6130a6cff --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/contract_inclusion/trait.ProveContractDeployment.html @@ -0,0 +1,54 @@ + + + + + + +Trait ProveContractDeployment documentation + + + + + +
+ +

Trait ProveContractDeployment

+
pub trait ProveContractDeployment {
+    // Required methods
+    pub fn prove_contract_deployment(header: BlockHeader, contract_address: AztecAddress);
+}
+ +

Required methods

+
pub fn prove_contract_deployment(header: BlockHeader, contract_address: AztecAddress) + +

Implementors

+

impl ProveContractDeployment for BlockHeader

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/contract_inclusion/trait.ProveContractInitialization.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/contract_inclusion/trait.ProveContractInitialization.html new file mode 100644 index 000000000000..afc56424c40b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/contract_inclusion/trait.ProveContractInitialization.html @@ -0,0 +1,54 @@ + + + + + + +Trait ProveContractInitialization documentation + + + + + +
+ +

Trait ProveContractInitialization

+
pub trait ProveContractInitialization {
+    // Required methods
+    pub fn prove_contract_initialization(header: BlockHeader, contract_address: AztecAddress);
+}
+ +

Required methods

+
pub fn prove_contract_initialization(header: BlockHeader, contract_address: AztecAddress) + +

Implementors

+

impl ProveContractInitialization for BlockHeader

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/contract_inclusion/trait.ProveContractNonDeployment.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/contract_inclusion/trait.ProveContractNonDeployment.html new file mode 100644 index 000000000000..e6ba2a224257 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/contract_inclusion/trait.ProveContractNonDeployment.html @@ -0,0 +1,54 @@ + + + + + + +Trait ProveContractNonDeployment documentation + + + + + +
+ +

Trait ProveContractNonDeployment

+
pub trait ProveContractNonDeployment {
+    // Required methods
+    pub fn prove_contract_non_deployment(header: BlockHeader, contract_address: AztecAddress);
+}
+ +

Required methods

+
pub fn prove_contract_non_deployment(header: BlockHeader, contract_address: AztecAddress) + +

Implementors

+

impl ProveContractNonDeployment for BlockHeader

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/contract_inclusion/trait.ProveContractNonInitialization.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/contract_inclusion/trait.ProveContractNonInitialization.html new file mode 100644 index 000000000000..fa7a1db26629 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/contract_inclusion/trait.ProveContractNonInitialization.html @@ -0,0 +1,60 @@ + + + + + + +Trait ProveContractNonInitialization documentation + + + + + +
+ +

Trait ProveContractNonInitialization

+
pub trait ProveContractNonInitialization {
+    // Required methods
+    pub fn prove_contract_non_initialization(
+        header: BlockHeader,
+        contract_address: AztecAddress,
+    );
+}
+ +

Required methods

+
pub fn prove_contract_non_initialization( + header: BlockHeader, + contract_address: AztecAddress, +) + +

Implementors

+

impl ProveContractNonInitialization for BlockHeader

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/index.html new file mode 100644 index 000000000000..b8ca14acc545 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/index.html @@ -0,0 +1,57 @@ + + + + + + +Module history documentation + + + + + +
+
aztec-nr - noir_aztec::history
+

Module history

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/note_inclusion/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/note_inclusion/index.html new file mode 100644 index 000000000000..afb577a181f7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/note_inclusion/index.html @@ -0,0 +1,43 @@ + + + + + + +Module note_inclusion documentation + + + + + +
+
aztec-nr - noir_aztec::history::note_inclusion
+

Module note_inclusion

+

Traits

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/note_inclusion/trait.ProveNoteInclusion.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/note_inclusion/trait.ProveNoteInclusion.html new file mode 100644 index 000000000000..25f020f37147 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/note_inclusion/trait.ProveNoteInclusion.html @@ -0,0 +1,61 @@ + + + + + + +Trait ProveNoteInclusion documentation + + + + + +
+ +

Trait ProveNoteInclusion

+
pub trait ProveNoteInclusion {
+    // Required methods
+    pub fn prove_note_inclusion<Note>(
+        header: BlockHeader,
+        retrieved_note: RetrievedNote<Note>,
+    )
+
where + Note: NoteHash
; +}
+ +

Required methods

+
pub fn prove_note_inclusion<Note>( + header: BlockHeader, + retrieved_note: RetrievedNote<Note>, +) +
where + Note: NoteHash
+ +

Implementors

+

impl ProveNoteInclusion for BlockHeader

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/note_validity/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/note_validity/index.html new file mode 100644 index 000000000000..40637a5b9312 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/note_validity/index.html @@ -0,0 +1,36 @@ + + + + + + +Module note_validity documentation + + + + + +
+
aztec-nr - noir_aztec::history::note_validity
+

Module note_validity

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/nullifier_inclusion/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/nullifier_inclusion/index.html new file mode 100644 index 000000000000..8497883e394b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/nullifier_inclusion/index.html @@ -0,0 +1,44 @@ + + + + + + +Module nullifier_inclusion documentation + + + + + +
+
aztec-nr - noir_aztec::history::nullifier_inclusion
+

Module nullifier_inclusion

+

Traits

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/nullifier_inclusion/trait.ProveNoteIsNullified.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/nullifier_inclusion/trait.ProveNoteIsNullified.html new file mode 100644 index 000000000000..d301ddd1c8e4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/nullifier_inclusion/trait.ProveNoteIsNullified.html @@ -0,0 +1,64 @@ + + + + + + +Trait ProveNoteIsNullified documentation + + + + + +
+ +

Trait ProveNoteIsNullified

+
pub trait ProveNoteIsNullified {
+    // Required methods
+    pub fn prove_note_is_nullified<Note>(
+        header: BlockHeader,
+        retrieved_note: RetrievedNote<Note>,
+        context: &mut PrivateContext,
+    )
+
where + Note: NoteHash
; +}
+ +

Required methods

+
pub fn prove_note_is_nullified<Note>( + header: BlockHeader, + retrieved_note: RetrievedNote<Note>, + context: &mut PrivateContext, +) +
where + Note: NoteHash
+ +

Implementors

+

impl ProveNoteIsNullified for BlockHeader

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/nullifier_inclusion/trait.ProveNullifierInclusion.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/nullifier_inclusion/trait.ProveNullifierInclusion.html new file mode 100644 index 000000000000..cf67c34a4ed0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/nullifier_inclusion/trait.ProveNullifierInclusion.html @@ -0,0 +1,52 @@ + + + + + + +Trait ProveNullifierInclusion documentation + + + + + +
+ +

Trait ProveNullifierInclusion

+
pub trait ProveNullifierInclusion {
+    // Required methods
+    pub fn prove_nullifier_inclusion(header: BlockHeader, nullifier: Field);
+}
+ +

Required methods

+
pub fn prove_nullifier_inclusion(header: BlockHeader, nullifier: Field) + +

Implementors

+

impl ProveNullifierInclusion for BlockHeader

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/nullifier_non_inclusion/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/nullifier_non_inclusion/index.html new file mode 100644 index 000000000000..935ddbfd2be1 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/nullifier_non_inclusion/index.html @@ -0,0 +1,44 @@ + + + + + + +Module nullifier_non_inclusion documentation + + + + + +
+
aztec-nr - noir_aztec::history::nullifier_non_inclusion
+

Module nullifier_non_inclusion

+

Traits

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/nullifier_non_inclusion/trait.ProveNoteNotNullified.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/nullifier_non_inclusion/trait.ProveNoteNotNullified.html new file mode 100644 index 000000000000..8f6207b089a4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/nullifier_non_inclusion/trait.ProveNoteNotNullified.html @@ -0,0 +1,64 @@ + + + + + + +Trait ProveNoteNotNullified documentation + + + + + +
+ +

Trait ProveNoteNotNullified

+
pub trait ProveNoteNotNullified {
+    // Required methods
+    pub fn prove_note_not_nullified<Note>(
+        header: BlockHeader,
+        retrieved_note: RetrievedNote<Note>,
+        context: &mut PrivateContext,
+    )
+
where + Note: NoteHash
; +}
+ +

Required methods

+
pub fn prove_note_not_nullified<Note>( + header: BlockHeader, + retrieved_note: RetrievedNote<Note>, + context: &mut PrivateContext, +) +
where + Note: NoteHash
+ +

Implementors

+

impl ProveNoteNotNullified for BlockHeader

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/nullifier_non_inclusion/trait.ProveNullifierNonInclusion.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/nullifier_non_inclusion/trait.ProveNullifierNonInclusion.html new file mode 100644 index 000000000000..9b9b5d91ce1e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/nullifier_non_inclusion/trait.ProveNullifierNonInclusion.html @@ -0,0 +1,52 @@ + + + + + + +Trait ProveNullifierNonInclusion documentation + + + + + +
+ +

Trait ProveNullifierNonInclusion

+
pub trait ProveNullifierNonInclusion {
+    // Required methods
+    pub fn prove_nullifier_non_inclusion(header: BlockHeader, nullifier: Field);
+}
+ +

Required methods

+
pub fn prove_nullifier_non_inclusion(header: BlockHeader, nullifier: Field) + +

Implementors

+

impl ProveNullifierNonInclusion for BlockHeader

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/public_storage/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/public_storage/index.html new file mode 100644 index 000000000000..8d94a73315ca --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/public_storage/index.html @@ -0,0 +1,43 @@ + + + + + + +Module public_storage documentation + + + + + +
+
aztec-nr - noir_aztec::history::public_storage
+

Module public_storage

+

Traits

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/public_storage/trait.PublicStorageHistoricalRead.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/public_storage/trait.PublicStorageHistoricalRead.html new file mode 100644 index 000000000000..ef7f9a6375e5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/history/public_storage/trait.PublicStorageHistoricalRead.html @@ -0,0 +1,59 @@ + + + + + + +Trait PublicStorageHistoricalRead documentation + + + + + +
+ +

Trait PublicStorageHistoricalRead

+
pub trait PublicStorageHistoricalRead {
+    // Required methods
+    pub fn public_storage_historical_read(
+        header: BlockHeader,
+        storage_slot: Field,
+        contract_address: AztecAddress,
+    ) -> Field;
+}
+ +

Required methods

+
pub fn public_storage_historical_read( + header: BlockHeader, + storage_slot: Field, + contract_address: AztecAddress, +) -> Field + +

Implementors

+

impl PublicStorageHistoricalRead for BlockHeader

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/index.html new file mode 100644 index 000000000000..c0d3e9c6f47a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/index.html @@ -0,0 +1,61 @@ + + + + + + +Crate noir_aztec documentation + + + + + +
+
aztec-nr - noir_aztec
+

Crate noir_aztec

+

Re-exports

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/constants/global.INCOMING_INDEX.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/constants/global.INCOMING_INDEX.html new file mode 100644 index 000000000000..0be66f64cc5a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/constants/global.INCOMING_INDEX.html @@ -0,0 +1,38 @@ + + + + + + +Global INCOMING_INDEX documentation + + + + + +
+ +

Global INCOMING_INDEX

+
pub global INCOMING_INDEX: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/constants/global.NULLIFIER_INDEX.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/constants/global.NULLIFIER_INDEX.html new file mode 100644 index 000000000000..5fcbb182469e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/constants/global.NULLIFIER_INDEX.html @@ -0,0 +1,38 @@ + + + + + + +Global NULLIFIER_INDEX documentation + + + + + +
+ +

Global NULLIFIER_INDEX

+
pub global NULLIFIER_INDEX: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/constants/global.NUM_KEY_TYPES.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/constants/global.NUM_KEY_TYPES.html new file mode 100644 index 000000000000..5779bff9b563 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/constants/global.NUM_KEY_TYPES.html @@ -0,0 +1,38 @@ + + + + + + +Global NUM_KEY_TYPES documentation + + + + + +
+ +

Global NUM_KEY_TYPES

+
pub global NUM_KEY_TYPES: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/constants/global.OUTGOING_INDEX.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/constants/global.OUTGOING_INDEX.html new file mode 100644 index 000000000000..8a0c05b08b43 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/constants/global.OUTGOING_INDEX.html @@ -0,0 +1,38 @@ + + + + + + +Global OUTGOING_INDEX documentation + + + + + +
+ +

Global OUTGOING_INDEX

+
pub global OUTGOING_INDEX: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/constants/global.TAGGING_INDEX.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/constants/global.TAGGING_INDEX.html new file mode 100644 index 000000000000..3d8ba601479f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/constants/global.TAGGING_INDEX.html @@ -0,0 +1,38 @@ + + + + + + +Global TAGGING_INDEX documentation + + + + + +
+ +

Global TAGGING_INDEX

+
pub global TAGGING_INDEX: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/constants/global.sk_generators.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/constants/global.sk_generators.html new file mode 100644 index 000000000000..938f175823a8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/constants/global.sk_generators.html @@ -0,0 +1,38 @@ + + + + + + +Global sk_generators documentation + + + + + +
+ +

Global sk_generators

+
pub global sk_generators: [Field; 4];
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/constants/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/constants/index.html new file mode 100644 index 000000000000..26bd3691618e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/constants/index.html @@ -0,0 +1,47 @@ + + + + + + +Module constants documentation + + + + + +
+
aztec-nr - noir_aztec::keys::constants
+

Module constants

+

Globals

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/ecdh_shared_secret/fn.derive_ecdh_shared_secret.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/ecdh_shared_secret/fn.derive_ecdh_shared_secret.html new file mode 100644 index 000000000000..570471695e50 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/ecdh_shared_secret/fn.derive_ecdh_shared_secret.html @@ -0,0 +1,46 @@ + + + + + + +Function derive_ecdh_shared_secret documentation + + + + + +
+ +

Function derive_ecdh_shared_secret

+
pub fn derive_ecdh_shared_secret(
+    secret: EmbeddedCurveScalar,
+    public_key: EmbeddedCurvePoint,
+) -> EmbeddedCurvePoint
+ +
+

Computes a standard ECDH shared secret: secret * public_key = shared_secret.

+

The input secret is known only to one party. The output shared secret can be derived given knowledge of +public_key's key-pair and the public ephemeral secret, using this same function (with reversed inputs).

+

E.g.: +Epk = esk * G // ephemeral key-pair +Pk = sk * G // recipient key-pair +Shared secret S = esk * Pk = sk * Epk

+

See also: https://en.wikipedia.org/wiki/Elliptic-curve_Diffie%E2%80%93Hellman

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/ecdh_shared_secret/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/ecdh_shared_secret/index.html new file mode 100644 index 000000000000..df7d9bd895d1 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/ecdh_shared_secret/index.html @@ -0,0 +1,42 @@ + + + + + + +Module ecdh_shared_secret documentation + + + + + +
+
aztec-nr - noir_aztec::keys::ecdh_shared_secret
+

Module ecdh_shared_secret

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/ephemeral/fn.generate_ephemeral_key_pair.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/ephemeral/fn.generate_ephemeral_key_pair.html new file mode 100644 index 000000000000..4fe08c0b914b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/ephemeral/fn.generate_ephemeral_key_pair.html @@ -0,0 +1,33 @@ + + + + + + +Function generate_ephemeral_key_pair documentation + + + + + +
+ +

Function generate_ephemeral_key_pair

+
pub fn generate_ephemeral_key_pair() -> (EmbeddedCurveScalar, EmbeddedCurvePoint)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/ephemeral/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/ephemeral/index.html new file mode 100644 index 000000000000..2e49e0dc5869 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/ephemeral/index.html @@ -0,0 +1,42 @@ + + + + + + +Module ephemeral documentation + + + + + +
+
aztec-nr - noir_aztec::keys::ephemeral
+

Module ephemeral

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/getters/fn.get_nsk_app.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/getters/fn.get_nsk_app.html new file mode 100644 index 000000000000..e2552c15637b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/getters/fn.get_nsk_app.html @@ -0,0 +1,35 @@ + + + + + + +Function get_nsk_app documentation + + + + + +
+ +

Function get_nsk_app

+
pub unconstrained fn get_nsk_app(npk_m_hash: Field) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/getters/fn.get_ovsk_app.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/getters/fn.get_ovsk_app.html new file mode 100644 index 000000000000..2c789640ee90 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/getters/fn.get_ovsk_app.html @@ -0,0 +1,35 @@ + + + + + + +Function get_ovsk_app documentation + + + + + +
+ +

Function get_ovsk_app

+
pub unconstrained fn get_ovsk_app(ovpk_m_hash: Field) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/getters/fn.get_public_keys.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/getters/fn.get_public_keys.html new file mode 100644 index 000000000000..d8b727e302b0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/getters/fn.get_public_keys.html @@ -0,0 +1,35 @@ + + + + + + +Function get_public_keys documentation + + + + + +
+ +

Function get_public_keys

+
pub fn get_public_keys(account: AztecAddress) -> PublicKeys
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/getters/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/getters/index.html new file mode 100644 index 000000000000..4628ee8e56c8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/getters/index.html @@ -0,0 +1,44 @@ + + + + + + +Module getters documentation + + + + + +
+ +

Module getters

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/index.html new file mode 100644 index 000000000000..ac7b1273ba75 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/keys/index.html @@ -0,0 +1,56 @@ + + + + + + +Module keys documentation + + + + + +
+ +

Module keys

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/authorization/fn.authorization.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/authorization/fn.authorization.html new file mode 100644 index 000000000000..331b6f496495 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/authorization/fn.authorization.html @@ -0,0 +1,49 @@ + + + + + + +Function authorization documentation + + + + + +
+ +

Function authorization

+
pub comptime fn authorization(s: TypeDefinition) -> Quoted
+ +
+

An Authorization is a struct that represents an action a user can allow others to do +on their behalf. By definition, an Authorization must be human-readable and contain +enough information to be interpreted on its own. Authorizations are:

+
    +
  • Emitted as offchain effects to convey the piece of data a contract needs to be signed +in order to perform the action
  • +
  • Hashed in a specific way to produce an inner_hash that can later be signed and checked +via the authwit mechanism.
  • +
+

This allows a contract developer to convey to a user in a human-readable way what they are asked to sign, +while keeping the account contract interface simple (it just has to check if a hash was signed). It should +always be possible to recompute the inner_hash from the Authorization alone, so the user/wallet +can verify the action they are signing.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/authorization/fn.generate_authorization_interface_and_get_selector.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/authorization/fn.generate_authorization_interface_and_get_selector.html new file mode 100644 index 000000000000..aae0c57a404b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/authorization/fn.generate_authorization_interface_and_get_selector.html @@ -0,0 +1,36 @@ + + + + + + +Function generate_authorization_interface_and_get_selector documentation + + + + + +
+ +

Function generate_authorization_interface_and_get_selector

+
pub comptime fn generate_authorization_interface_and_get_selector(
+    s: TypeDefinition,
+) -> (Quoted, Field)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/authorization/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/authorization/index.html new file mode 100644 index 000000000000..09c668fe832c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/authorization/index.html @@ -0,0 +1,50 @@ + + + + + + +Module authorization documentation + + + + + +
+
aztec-nr - noir_aztec::macros::authorization
+

Module authorization

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/aztec/fn.aztec.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/aztec/fn.aztec.html new file mode 100644 index 000000000000..1d2dd33a2185 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/aztec/fn.aztec.html @@ -0,0 +1,38 @@ + + + + + + +Function aztec documentation + + + + + +
+ +

Function aztec

+
pub comptime fn aztec(m: Module) -> Quoted
+ +
+

Marks a contract as an Aztec contract, generating the interfaces for its functions and notes, as well as injecting +the sync_private_state utility function. +Note: This is a module annotation, so the returned quote gets injected inside the module (contract) itself.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/aztec/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/aztec/index.html new file mode 100644 index 000000000000..f43f2adb05bc --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/aztec/index.html @@ -0,0 +1,49 @@ + + + + + + +Module aztec documentation + + + + + +
+ +

Module aztec

+

Functions

    +
  • Marks a contract as an Aztec contract, generating the interfaces for its functions and notes, as well as injecting +the sync_private_state utility function. +Note: This is a module annotation, so the returned quote gets injected inside the module (contract) itself.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/dispatch/fn.generate_public_dispatch.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/dispatch/fn.generate_public_dispatch.html new file mode 100644 index 000000000000..5c56e11350fb --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/dispatch/fn.generate_public_dispatch.html @@ -0,0 +1,36 @@ + + + + + + +Function generate_public_dispatch documentation + + + + + +
+ +

Function generate_public_dispatch

+
pub comptime fn generate_public_dispatch(m: Module) -> Quoted
+ +
+

Returns an fn public_dispatch(...) function for the given module that's assumed to be an Aztec contract.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/dispatch/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/dispatch/index.html new file mode 100644 index 000000000000..343c5d82f3f5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/dispatch/index.html @@ -0,0 +1,47 @@ + + + + + + +Module dispatch documentation + + + + + +
+ +

Module dispatch

+

Functions

    +
  • Returns an fn public_dispatch(...) function for the given module that's assumed to be an Aztec contract.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/events/fn.event.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/events/fn.event.html new file mode 100644 index 000000000000..8869ab582848 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/events/fn.event.html @@ -0,0 +1,36 @@ + + + + + + +Function event documentation + + + + + +
+ +

Function event

+
pub comptime fn event(s: TypeDefinition) -> Quoted
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/events/global.EVENT_SELECTORS.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/events/global.EVENT_SELECTORS.html new file mode 100644 index 000000000000..2735a3388788 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/events/global.EVENT_SELECTORS.html @@ -0,0 +1,40 @@ + + + + + + +Global EVENT_SELECTORS documentation + + + + + +
+ +

Global EVENT_SELECTORS

+
pub mut comptime global EVENT_SELECTORS: UHashMap<Field, Quoted, BuildHasherDefault<Poseidon2Hasher>>;
+ +
+

A map from event selector to event name indicating whether the event selector has already been seen during +the contract compilation - prevents event selector collisions.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/events/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/events/index.html new file mode 100644 index 000000000000..a02ca3d5d6ab --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/events/index.html @@ -0,0 +1,52 @@ + + + + + + +Module events documentation + + + + + +
+ +

Module events

+

Functions

+

Globals

    +
  • A map from event selector to event name indicating whether the event selector has already been seen during +the contract compilation - prevents event selector collisions.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/fn.authorize_once.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/fn.authorize_once.html new file mode 100644 index 000000000000..691ada50709d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/fn.authorize_once.html @@ -0,0 +1,57 @@ + + + + + + +Function authorize_once documentation + + + + + +
+ +

Function authorize_once

+
pub comptime fn authorize_once(
+    f: FunctionDefinition,
+    from_arg_name: CtString,
+    nonce_arg_name: CtString,
+)
+ +
+

Private and public functions can require an authorization check to be performed before execution. This +is typically the case when the function allows performing an action on behalf of someone who is not +the caller. +This macro injects the necessary code to perform the check via the authwit mechanism and additionally +emit the authorization request as an offchain effect, so a user/wallet can verify what are they +being asked to sign. +This check also emits a nullifier with the provided nonce argument, so authorizations are valid +once and only once, preventing replay attacks.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/fn.external.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/fn.external.html new file mode 100644 index 000000000000..0ea3f9925bda --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/fn.external.html @@ -0,0 +1,56 @@ + + + + + + +Function external documentation + + + + + +
+ +

Function external

+
pub comptime fn external(f: FunctionDefinition, f_type: CtString)
+ +
+

Same as in Solidity external functions are functions that our callable from outside the contract.

+

There are 3 types of external functions: private, public, and utility.

+
    +
  • private functions are executed client-side and preserve privacy.
  • +
  • public functions are executed sequencer-side and do not preserve privacy, similar to the EVM.
  • +
  • utility functions are standalone unconstrained functions that cannot be called from another function in a +contract. They are typically used either to obtain some information from the contract (e.g. token balance of a +user) or to modify internal contract-related state of PXE (e.g. processing logs in Aztec.nr during sync).
  • +
+

In this function we perform basic checks on the function to ensure it is valid and then we add the function to the +external functions registry for later processing by the #[aztec] macro.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/fn.initializer.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/fn.initializer.html new file mode 100644 index 000000000000..7964e7e58d80 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/fn.initializer.html @@ -0,0 +1,51 @@ + + + + + + +Function initializer documentation + + + + + +
+ +

Function initializer

+
pub comptime fn initializer(f: FunctionDefinition)
+ +
+

An initializer function is similar to a constructor:

+
    +
  • it can only be called once
  • +
  • if there are multiple initializer functions, only one of them can be called
  • +
  • no non-initializer functions can be called until an initializer has ben called (except noinitcheck functions)
  • +
+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/fn.internal.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/fn.internal.html new file mode 100644 index 000000000000..659f5a7c707a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/fn.internal.html @@ -0,0 +1,50 @@ + + + + + + +Function internal documentation + + + + + +
+ +

Function internal

+
pub comptime fn internal(f: FunctionDefinition, f_type: CtString)
+ +
+

Same as in Solidity internal functions are functions that are callable from inside the contract. Unlike #only_self +functions, internal functions are inlined (e.g. akin to EVM's JUMP and not EVM's CALL).

+

Internal function can be called using the following API:

+
self.internal.my_internal_function(...)
+

Private internal functions can only be called from other private external or internal functions. +Public internal functions can only be called from other public external or internal functions.

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/fn.noinitcheck.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/fn.noinitcheck.html new file mode 100644 index 000000000000..1a3a238f0fec --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/fn.noinitcheck.html @@ -0,0 +1,46 @@ + + + + + + +Function noinitcheck documentation + + + + + +
+ +

Function noinitcheck

+
pub comptime fn noinitcheck(f: FunctionDefinition)
+ +
+

Functions with noinitcheck can be called before contract initialization.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/fn.nophasecheck.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/fn.nophasecheck.html new file mode 100644 index 000000000000..fd3a628d56e1 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/fn.nophasecheck.html @@ -0,0 +1,45 @@ + + + + + + +Function nophasecheck documentation + + + + + +
+ +

Function nophasecheck

+
pub comptime fn nophasecheck(f: FunctionDefinition)
+ +
+

Functions marked with #nophasecheck will handle phase changes internally

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/fn.only_self.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/fn.only_self.html new file mode 100644 index 000000000000..a2c28081ddf0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/fn.only_self.html @@ -0,0 +1,50 @@ + + + + + + +Function only_self documentation + + + + + +
+ +

Function only_self

+
pub comptime fn only_self(f: FunctionDefinition)
+ +
+

Functions marked with #only_self attribute can only be called by the contract itself.

+

Usage

+

This attribute is commonly used when an action starts in private but needs to be completed in public. The public +function must be marked with #only_self to restrict access to only the contract itself. A typical example is a +private token mint operation that needs to enqueue a call to a public function to update the publicly tracked total +token supply.

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/fn.view.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/fn.view.html new file mode 100644 index 000000000000..1b050756dc79 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/fn.view.html @@ -0,0 +1,46 @@ + + + + + + +Function view documentation + + + + + +
+ +

Function view

+
pub comptime fn view(f: FunctionDefinition)
+ +
+

View functions can only be called in a static execution context.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/index.html new file mode 100644 index 000000000000..d41337fdf9f8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/index.html @@ -0,0 +1,71 @@ + + + + + + +Module functions documentation + + + + + +
+
aztec-nr - noir_aztec::macros::functions
+

Module functions

+

Modules

+

Functions

    +
  • Private and public functions can require an authorization check to be performed before execution. This +is typically the case when the function allows performing an action on behalf of someone who is not +the caller. +This macro injects the necessary code to perform the check via the authwit mechanism and additionally +emit the authorization request as an offchain effect, so a user/wallet can verify what are they +being asked to sign. +This check also emits a nullifier with the provided nonce argument, so authorizations are valid +once and only once, preventing replay attacks.
  • +
  • Same as in Solidity external functions are functions that our callable from outside the contract.
  • +
  • An initializer function is similar to a constructor:

    +
      +
    • it can only be called once
    • +
    • if there are multiple initializer functions, only one of them can be called
    • +
    • no non-initializer functions can be called until an initializer has ben called (except noinitcheck functions)
    • +
  • +
  • Same as in Solidity internal functions are functions that are callable from inside the contract. Unlike #only_self +functions, internal functions are inlined (e.g. akin to EVM's JUMP and not EVM's CALL).
  • +
  • Functions with noinitcheck can be called before contract initialization.
  • +
  • Functions marked with #nophasecheck will handle phase changes internally
  • +
  • Functions marked with #only_self attribute can only be called by the contract itself.
  • +
  • View functions can only be called in a static execution context.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/initialization_utils/fn.assert_initialization_matches_address_preimage_private.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/initialization_utils/fn.assert_initialization_matches_address_preimage_private.html new file mode 100644 index 000000000000..a5c93f574ae7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/initialization_utils/fn.assert_initialization_matches_address_preimage_private.html @@ -0,0 +1,39 @@ + + + + + + +Function assert_initialization_matches_address_preimage_private documentation + + + + + +
+ +

Function assert_initialization_matches_address_preimage_private

+
pub fn assert_initialization_matches_address_preimage_private(context: PrivateContext)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/initialization_utils/fn.assert_initialization_matches_address_preimage_public.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/initialization_utils/fn.assert_initialization_matches_address_preimage_public.html new file mode 100644 index 000000000000..cd739fed0523 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/initialization_utils/fn.assert_initialization_matches_address_preimage_public.html @@ -0,0 +1,39 @@ + + + + + + +Function assert_initialization_matches_address_preimage_public documentation + + + + + +
+ +

Function assert_initialization_matches_address_preimage_public

+
pub fn assert_initialization_matches_address_preimage_public(context: PublicContext)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/initialization_utils/fn.assert_is_initialized_private.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/initialization_utils/fn.assert_is_initialized_private.html new file mode 100644 index 000000000000..ac694f60c2f4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/initialization_utils/fn.assert_is_initialized_private.html @@ -0,0 +1,39 @@ + + + + + + +Function assert_is_initialized_private documentation + + + + + +
+ +

Function assert_is_initialized_private

+
pub fn assert_is_initialized_private(context: &mut PrivateContext)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/initialization_utils/fn.assert_is_initialized_public.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/initialization_utils/fn.assert_is_initialized_public.html new file mode 100644 index 000000000000..8291774a8997 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/initialization_utils/fn.assert_is_initialized_public.html @@ -0,0 +1,39 @@ + + + + + + +Function assert_is_initialized_public documentation + + + + + +
+ +

Function assert_is_initialized_public

+
pub fn assert_is_initialized_public(context: PublicContext)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/initialization_utils/fn.compute_initialization_hash.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/initialization_utils/fn.compute_initialization_hash.html new file mode 100644 index 000000000000..ff838a1d0e80 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/initialization_utils/fn.compute_initialization_hash.html @@ -0,0 +1,46 @@ + + + + + + +Function compute_initialization_hash documentation + + + + + +
+ +

Function compute_initialization_hash

+
pub fn compute_initialization_hash(
+    init_selector: FunctionSelector,
+    init_args_hash: Field,
+) -> Field
+ +
+

This function is not only used in macros but it's also used by external people to check that an instance has been +initialized with the correct constructor arguments. Don't hide this unless you implement factory functionality.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/initialization_utils/fn.mark_as_initialized_private.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/initialization_utils/fn.mark_as_initialized_private.html new file mode 100644 index 000000000000..4e71e34f12e1 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/initialization_utils/fn.mark_as_initialized_private.html @@ -0,0 +1,39 @@ + + + + + + +Function mark_as_initialized_private documentation + + + + + +
+ +

Function mark_as_initialized_private

+
pub fn mark_as_initialized_private(context: &mut PrivateContext)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/initialization_utils/fn.mark_as_initialized_public.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/initialization_utils/fn.mark_as_initialized_public.html new file mode 100644 index 000000000000..973f151af65e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/initialization_utils/fn.mark_as_initialized_public.html @@ -0,0 +1,39 @@ + + + + + + +Function mark_as_initialized_public documentation + + + + + +
+ +

Function mark_as_initialized_public

+
pub fn mark_as_initialized_public(context: PublicContext)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/initialization_utils/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/initialization_utils/index.html new file mode 100644 index 000000000000..f20c0a4359d8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/functions/initialization_utils/index.html @@ -0,0 +1,56 @@ + + + + + + +Module initialization_utils documentation + + + + + +
+
aztec-nr - noir_aztec::macros::functions::initialization_utils
+

Module initialization_utils

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/index.html new file mode 100644 index 000000000000..10179f188dd9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/index.html @@ -0,0 +1,68 @@ + + + + + + +Module macros documentation + + + + + +
+ +

Module macros

+

Re-exports

    +
  • pub use noir_aztec::macros::aztec::aztec;
  • +
+

Modules

    +
  • +
  • +
  • +
  • +
  • +
  • The functionality in this module is triggered by the #[aztec] macro. It generates new functions, prefixed with +__aztec_nr_internals___, from the ones marked with #[external(...)] and #[internal(...)] attributes. The +original functions are then modified to be uncallable. This prevents developers from inadvertently calling a +function directly, instead of performing a proper contract call.
  • +
  • +
  • +
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/internals_functions_generation/abi_attributes/fn.abi_initializer.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/internals_functions_generation/abi_attributes/fn.abi_initializer.html new file mode 100644 index 000000000000..87eb04a622f6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/internals_functions_generation/abi_attributes/fn.abi_initializer.html @@ -0,0 +1,38 @@ + + + + + + +Function abi_initializer documentation + + + + + +
+ +

Function abi_initializer

+
pub comptime fn abi_initializer(_f: FunctionDefinition)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/internals_functions_generation/abi_attributes/fn.abi_only_self.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/internals_functions_generation/abi_attributes/fn.abi_only_self.html new file mode 100644 index 000000000000..ec55a464fbff --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/internals_functions_generation/abi_attributes/fn.abi_only_self.html @@ -0,0 +1,38 @@ + + + + + + +Function abi_only_self documentation + + + + + +
+ +

Function abi_only_self

+
pub comptime fn abi_only_self(_f: FunctionDefinition)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/internals_functions_generation/abi_attributes/fn.abi_private.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/internals_functions_generation/abi_attributes/fn.abi_private.html new file mode 100644 index 000000000000..568b38d0c1e0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/internals_functions_generation/abi_attributes/fn.abi_private.html @@ -0,0 +1,38 @@ + + + + + + +Function abi_private documentation + + + + + +
+ +

Function abi_private

+
pub comptime fn abi_private(_f: FunctionDefinition)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/internals_functions_generation/abi_attributes/fn.abi_public.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/internals_functions_generation/abi_attributes/fn.abi_public.html new file mode 100644 index 000000000000..a1ab3a0ac873 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/internals_functions_generation/abi_attributes/fn.abi_public.html @@ -0,0 +1,38 @@ + + + + + + +Function abi_public documentation + + + + + +
+ +

Function abi_public

+
pub comptime fn abi_public(_f: FunctionDefinition)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/internals_functions_generation/abi_attributes/fn.abi_utility.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/internals_functions_generation/abi_attributes/fn.abi_utility.html new file mode 100644 index 000000000000..7d44513bef65 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/internals_functions_generation/abi_attributes/fn.abi_utility.html @@ -0,0 +1,38 @@ + + + + + + +Function abi_utility documentation + + + + + +
+ +

Function abi_utility

+
pub comptime fn abi_utility(_f: FunctionDefinition)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/internals_functions_generation/abi_attributes/fn.abi_view.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/internals_functions_generation/abi_attributes/fn.abi_view.html new file mode 100644 index 000000000000..ee4d46c816bd --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/internals_functions_generation/abi_attributes/fn.abi_view.html @@ -0,0 +1,38 @@ + + + + + + +Function abi_view documentation + + + + + +
+ +

Function abi_view

+
pub comptime fn abi_view(_f: FunctionDefinition)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/internals_functions_generation/abi_attributes/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/internals_functions_generation/abi_attributes/index.html new file mode 100644 index 000000000000..56bb8040d5ad --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/internals_functions_generation/abi_attributes/index.html @@ -0,0 +1,49 @@ + + + + + + +Module abi_attributes documentation + + + + + +
+ +

Module abi_attributes

+
+

ABI attributes that are applied by the Aztec.nr macros to the generated functions with the __aztec_nr_internals___ +prefix in the name. The attributes are prefixed with abi_ as they are used only for ABI purposes and artifact +generation.

+
+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/internals_functions_generation/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/internals_functions_generation/index.html new file mode 100644 index 000000000000..8a5e2e8136dd --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/internals_functions_generation/index.html @@ -0,0 +1,55 @@ + + + + + + +Module internals_functions_generation documentation + + + + + +
+
aztec-nr - noir_aztec::macros::internals_functions_generation
+

Module internals_functions_generation

+
+

The functionality in this module is triggered by the #[aztec] macro. It generates new functions, prefixed with +__aztec_nr_internals___, from the ones marked with #[external(...)] and #[internal(...)] attributes. The +original functions are then modified to be uncallable. This prevents developers from inadvertently calling a +function directly, instead of performing a proper contract call.

+
+

Modules

    +
  • ABI attributes that are applied by the Aztec.nr macros to the generated functions with the __aztec_nr_internals___ +prefix in the name. The attributes are prefixed with abi_ as they are used only for ABI purposes and artifact +generation.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/notes/fn.custom_note.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/notes/fn.custom_note.html new file mode 100644 index 000000000000..ad42ec64efd2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/notes/fn.custom_note.html @@ -0,0 +1,74 @@ + + + + + + +Function custom_note documentation + + + + + +
+ +

Function custom_note

+
pub comptime fn custom_note(s: TypeDefinition) -> Quoted
+ +
+

Generates code for a custom note implementation that requires specialized note hash or nullifier computation.

+

Generated Code

+
    +
  • NoteTypeProperties: Defines the structure and properties of note fields
  • +
  • NoteType trait implementation: Provides the note type ID
  • +
+

Requirements

+

The note struct must:

+
    +
  • Implement the Packable trait
  • +
  • Not exceed MAX_NOTE_PACKED_LEN when packed
  • +
+

Registration

+

Registers the note in the global NOTES BoundedVec to enable note processing functionality.

+

Use Cases

+

Use this macro when implementing a note that needs custom:

+
    +
  • Note hash computation logic
  • +
  • Nullifier computation logic
  • +
+

The macro omits generating default NoteHash trait implementation, allowing you to provide your own.

+

Example

+
#[custom_note]
+struct CustomNote {
+    value: Field,
+    metadata: Field
+}
+
+impl NoteHash for CustomNote {
+    // Custom note hash computation...
+    fn compute_note_hash(...) -> Field { ... }
+
+    // Custom nullifier computation...
+    fn compute_nullifier(...) -> Field { ... }
+    fn compute_nullifier_unconstrained(...) -> Field { ... }
+}
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/notes/fn.note.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/notes/fn.note.html new file mode 100644 index 000000000000..8fff922aa00a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/notes/fn.note.html @@ -0,0 +1,60 @@ + + + + + + +Function note documentation + + + + + +
+ +

Function note

+
pub comptime fn note(s: TypeDefinition) -> Quoted
+ +
+

Generates the core note functionality for a struct:

+
    +
  • NoteTypeProperties: Defines the structure and properties of note fields
  • +
  • NoteType trait implementation: Provides the note type ID
  • +
  • NoteHash trait implementation: Handles note hash and nullifier computation
  • +
+

Requirements

+

The note struct must:

+
    +
  • Implement the Packable trait
  • +
  • Not exceed MAX_NOTE_PACKED_LEN when packed
  • +
+

Registration

+

Registers the note in the global NOTES BoundedVec to enable note processing functionality.

+

Generated Code

+

For detailed documentation on the generated implementations, see:

+
    +
  • generate_note_properties()
  • +
  • generate_note_type_impl()
  • +
  • generate_note_hash_trait_impl()
  • +
+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/notes/global.NOTES.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/notes/global.NOTES.html new file mode 100644 index 000000000000..1e9852345ffc --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/notes/global.NOTES.html @@ -0,0 +1,40 @@ + + + + + + +Global NOTES documentation + + + + + +
+ +

Global NOTES

+
pub mut comptime global NOTES: BoundedVec<Type, 128>;
+ +
+

A BoundedVec containing all the note types within this contract.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/notes/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/notes/index.html new file mode 100644 index 000000000000..4defd3d7994f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/notes/index.html @@ -0,0 +1,52 @@ + + + + + + +Module notes documentation + + + + + +
+ +

Module notes

+

Functions

    +
  • Generates code for a custom note implementation that requires specialized note hash or nullifier computation.
  • +
  • Generates the core note functionality for a struct:
  • +
+

Globals

    +
  • A BoundedVec containing all the note types within this contract.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/storage/fn.storage.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/storage/fn.storage.html new file mode 100644 index 000000000000..99dd0fe33afa --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/storage/fn.storage.html @@ -0,0 +1,50 @@ + + + + + + +Function storage documentation + + + + + +
+ +

Function storage

+
pub comptime fn storage(s: TypeDefinition) -> Quoted
+ +
+

This function

+
    +
  • marks the contract as having storage, so that macros::utils::module_has_storage will return true,
  • +
  • marks the struct s as the one describing the storage layout of a contract,
  • +
  • generates an impl block for the storage struct with an init function (call to init is then injected at the +beginning of every #[external(...)] and #[internal] contract function and the storage is then available as +self.storage),
  • +
  • creates a StorageLayout struct that is is exposed via the abi(storage) macro in the contract artifact.
  • +
+

Only a single struct in the entire contract should have this macro (or storage_no_init) applied to it, and the +struct has to be called 'Storage'.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/storage/fn.storage_no_init.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/storage/fn.storage_no_init.html new file mode 100644 index 000000000000..a01943a9525b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/storage/fn.storage_no_init.html @@ -0,0 +1,46 @@ + + + + + + +Function storage_no_init documentation + + + + + +
+ +

Function storage_no_init

+
pub comptime fn storage_no_init(s: TypeDefinition)
+ +
+

Same as storage, except the user is in charge of providing an implementation of the init constructor function +with signature fn init<Context>(context: Context) -> Self, which allows for manual control of storage slot +allocation. Similarly, no StorageLayout struct will be created.

+

The contract's storage is accessed via the storage variable, which will will automatically be made available in +all functions as an instance of the struct this macro was applied to.

+

Only a single struct in the entire contract can have this macro (or storage_no_init) applied to it, and the struct +has to be called 'Storage'.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/storage/global.STORAGE_LAYOUT_NAME.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/storage/global.STORAGE_LAYOUT_NAME.html new file mode 100644 index 000000000000..7adaf87c1e73 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/storage/global.STORAGE_LAYOUT_NAME.html @@ -0,0 +1,41 @@ + + + + + + +Global STORAGE_LAYOUT_NAME documentation + + + + + +
+ +

Global STORAGE_LAYOUT_NAME

+
pub mut comptime global STORAGE_LAYOUT_NAME: UHashMap<Module, Quoted, BuildHasherDefault<Poseidon2Hasher>>;
+ +
+

Stores a map from a module to the name of the struct that describes its storage layout. +This is then used when generating a storage_layout() getter on the contract struct.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/storage/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/storage/index.html new file mode 100644 index 000000000000..f463487d44a1 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/storage/index.html @@ -0,0 +1,63 @@ + + + + + + +Module storage documentation + + + + + +
+ +

Module storage

+

Functions

    +
  • This function

    +
      +
    • marks the contract as having storage, so that macros::utils::module_has_storage will return true,
    • +
    • marks the struct s as the one describing the storage layout of a contract,
    • +
    • generates an impl block for the storage struct with an init function (call to init is then injected at the +beginning of every #[external(...)] and #[internal] contract function and the storage is then available as +self.storage),
    • +
    • creates a StorageLayout struct that is is exposed via the abi(storage) macro in the contract artifact.
    • +
  • +
  • Same as storage, except the user is in charge of providing an implementation of the init constructor function +with signature fn init<Context>(context: Context) -> Self, which allows for manual control of storage slot +allocation. Similarly, no StorageLayout struct will be created.
  • +
+

Globals

    +
  • Stores a map from a module to the name of the struct that describes its storage layout. +This is then used when generating a storage_layout() getter on the contract struct.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/utils/fn.derive_serialize_if_not_implemented.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/utils/fn.derive_serialize_if_not_implemented.html new file mode 100644 index 000000000000..0d3e0e50b629 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/utils/fn.derive_serialize_if_not_implemented.html @@ -0,0 +1,40 @@ + + + + + + +Function derive_serialize_if_not_implemented documentation + + + + + +
+ +

Function derive_serialize_if_not_implemented

+
pub comptime fn derive_serialize_if_not_implemented(s: TypeDefinition) -> Quoted
+ +
+

Generates a quote that implements Serialize for a given struct s. +If the struct already implements Serialize, we return an empty quote.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/utils/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/utils/index.html new file mode 100644 index 000000000000..650605046f2a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/utils/index.html @@ -0,0 +1,52 @@ + + + + + + +Module utils documentation + + + + + +
+ +

Module utils

+

Traits

+

Functions

    +
  • Generates a quote that implements Serialize for a given struct s. +If the struct already implements Serialize, we return an empty quote.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/utils/trait.AsStrQuote.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/utils/trait.AsStrQuote.html new file mode 100644 index 000000000000..4892f0946342 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/macros/utils/trait.AsStrQuote.html @@ -0,0 +1,54 @@ + + + + + + +Trait AsStrQuote documentation + + + + + +
+ +

Trait AsStrQuote

+
pub trait AsStrQuote {
+    // Required methods
+    pub fn as_str_quote(self) -> (Self, u32);
+}
+ +

Required methods

+
pub fn as_str_quote(self) -> (Self, u32) + +

Implementors

+

impl AsStrQuote for Quoted

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/fn.discover_new_messages.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/fn.discover_new_messages.html new file mode 100644 index 000000000000..f6a1cb5036cd --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/fn.discover_new_messages.html @@ -0,0 +1,58 @@ + + + + + + +Function discover_new_messages documentation + + + + + +
+ +

Function discover_new_messages

+
pub unconstrained fn discover_new_messages<Env>(
+    contract_address: AztecAddress,
+    compute_note_hash_and_nullifier: ComputeNoteHashAndNullifier<Env>,
+)
+ +
+

Performs the message discovery process, in which private logs are downloaded and inspected to find new private +notes, partial notes and events, etc., and pending partial notes are processed to search for their completion logs. +This is the mechanism via which a contract updates its knowledge of its private state.

+

Note that the state is synchronized up to the latest block synchronized by PXE. That should be close to the chain +tip as block synchronization is performed before contract function simulation is done.

+

Receives the address of the contract on which discovery is performed along with its +compute_note_hash_and_nullifier function.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/index.html new file mode 100644 index 000000000000..0073fdc08cab --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/index.html @@ -0,0 +1,66 @@ + + + + + + +Module discovery documentation + + + + + +
+ +

Module discovery

+

Modules

+

Structs

+

Type aliases

    +
  • A function which takes a note's packed content, address of the emitting contract, note nonce, storage slot and note +type ID and attempts to compute its note hash (not hashed by note nonce nor siloed by address) and inner nullifier +(not siloed by address).
  • +
+

Functions

    +
  • Performs the message discovery process, in which private logs are downloaded and inspected to find new private +notes, partial notes and events, etc., and pending partial notes are processed to search for their completion logs. +This is the mechanism via which a contract updates its knowledge of its private state.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/nonce_discovery/fn.attempt_note_nonce_discovery.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/nonce_discovery/fn.attempt_note_nonce_discovery.html new file mode 100644 index 000000000000..8878bc4ac789 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/nonce_discovery/fn.attempt_note_nonce_discovery.html @@ -0,0 +1,54 @@ + + + + + + +Function attempt_note_nonce_discovery documentation + + + + + +
+ +

Function attempt_note_nonce_discovery

+
pub unconstrained fn attempt_note_nonce_discovery<Env>(
+    unique_note_hashes_in_tx: BoundedVec<Field, 64>,
+    first_nullifier_in_tx: Field,
+    compute_note_hash_and_nullifier: ComputeNoteHashAndNullifier<Env>,
+    contract_address: AztecAddress,
+    owner: AztecAddress,
+    storage_slot: Field,
+    randomness: Field,
+    note_type_id: Field,
+    packed_note: BoundedVec<Field, 10>,
+) -> BoundedVec<DiscoveredNoteInfo, 64>
+ +
+

Searches for note nonces that will result in a note that was emitted in a transaction. While rare, it is possible +for multiple notes to have the exact same packed content and storage slot but different nonces, resulting in +different unique note hashes. Because of this this function returns a vector of discovered notes, though in most +cases it will contain a single element.

+

Due to how nonces are computed, this function requires knowledge of the transaction in which the note was created, +more specifically the list of all unique note hashes in it plus the value of its first nullifier.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/nonce_discovery/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/nonce_discovery/index.html new file mode 100644 index 000000000000..1bda66a0d33b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/nonce_discovery/index.html @@ -0,0 +1,60 @@ + + + + + + +Module nonce_discovery documentation + + + + + +
+
aztec-nr - noir_aztec::messages::discovery::nonce_discovery
+

Module nonce_discovery

+

Structs

    +
  • A struct with the discovered information of a complete note, required for delivery to PXE. Note that this is not +the complete note information, since it does not include content, storage slot, etc.
  • +
+

Functions

    +
  • Searches for note nonces that will result in a note that was emitted in a transaction. While rare, it is possible +for multiple notes to have the exact same packed content and storage slot but different nonces, resulting in +different unique note hashes. Because of this this function returns a vector of discovered notes, though in most +cases it will contain a single element.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/nonce_discovery/struct.DiscoveredNoteInfo.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/nonce_discovery/struct.DiscoveredNoteInfo.html new file mode 100644 index 000000000000..07ace62e591a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/nonce_discovery/struct.DiscoveredNoteInfo.html @@ -0,0 +1,55 @@ + + + + + + +Struct DiscoveredNoteInfo documentation + + + + + +
+ +

Struct DiscoveredNoteInfo

+
pub struct DiscoveredNoteInfo {
+    pub note_nonce: Field,
+    pub note_hash: Field,
+    pub inner_nullifier: Field,
+}
+
+
+

A struct with the discovered information of a complete note, required for delivery to PXE. Note that this is not +the complete note information, since it does not include content, storage slot, etc.

+
+

Fields

+
note_nonce: Field
+
note_hash: Field
+
inner_nullifier: Field
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/partial_notes/fn.fetch_and_process_partial_note_completion_logs.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/partial_notes/fn.fetch_and_process_partial_note_completion_logs.html new file mode 100644 index 000000000000..683eb0ecd6ba --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/partial_notes/fn.fetch_and_process_partial_note_completion_logs.html @@ -0,0 +1,45 @@ + + + + + + +Function fetch_and_process_partial_note_completion_logs documentation + + + + + +
+ +

Function fetch_and_process_partial_note_completion_logs

+
pub unconstrained fn fetch_and_process_partial_note_completion_logs<Env>(
+    contract_address: AztecAddress,
+    compute_note_hash_and_nullifier: ComputeNoteHashAndNullifier<Env>,
+)
+ +
+

Searches for logs that would result in the completion of pending partial notes, ultimately resulting in the notes +being delivered to PXE if completed.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/partial_notes/fn.process_partial_note_private_msg.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/partial_notes/fn.process_partial_note_private_msg.html new file mode 100644 index 000000000000..dfc1369cbfc8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/partial_notes/fn.process_partial_note_private_msg.html @@ -0,0 +1,43 @@ + + + + + + +Function process_partial_note_private_msg documentation + + + + + +
+ +

Function process_partial_note_private_msg

+
pub unconstrained fn process_partial_note_private_msg(
+    contract_address: AztecAddress,
+    recipient: AztecAddress,
+    msg_metadata: u64,
+    msg_content: BoundedVec<Field, 13>,
+)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/partial_notes/global.DELIVERED_PENDING_PARTIAL_NOTE_ARRAY_LENGTH_CAPSULES_SLOT.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/partial_notes/global.DELIVERED_PENDING_PARTIAL_NOTE_ARRAY_LENGTH_CAPSULES_SLOT.html new file mode 100644 index 000000000000..2684e95e38df --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/partial_notes/global.DELIVERED_PENDING_PARTIAL_NOTE_ARRAY_LENGTH_CAPSULES_SLOT.html @@ -0,0 +1,41 @@ + + + + + + +Global DELIVERED_PENDING_PARTIAL_NOTE_ARRAY_LENGTH_CAPSULES_SLOT documentation + + + + + +
+ +

Global DELIVERED_PENDING_PARTIAL_NOTE_ARRAY_LENGTH_CAPSULES_SLOT

+
pub global DELIVERED_PENDING_PARTIAL_NOTE_ARRAY_LENGTH_CAPSULES_SLOT: Field;
+ +
+

The slot in the PXE capsules where we store a CapsuleArray of DeliveredPendingPartialNote.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/partial_notes/global.MAX_PARTIAL_NOTE_PRIVATE_PACKED_LEN.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/partial_notes/global.MAX_PARTIAL_NOTE_PRIVATE_PACKED_LEN.html new file mode 100644 index 000000000000..0b6f8752bd1e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/partial_notes/global.MAX_PARTIAL_NOTE_PRIVATE_PACKED_LEN.html @@ -0,0 +1,42 @@ + + + + + + +Global MAX_PARTIAL_NOTE_PRIVATE_PACKED_LEN documentation + + + + + +
+ +

Global MAX_PARTIAL_NOTE_PRIVATE_PACKED_LEN

+
pub global MAX_PARTIAL_NOTE_PRIVATE_PACKED_LEN: u32;
+ +
+

Partial notes have a maximum packed length of their private fields bound by extra content in their private message +(e.g. the storage slot, note completion log tag, etc.).

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/partial_notes/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/partial_notes/index.html new file mode 100644 index 000000000000..0f295972a670 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/partial_notes/index.html @@ -0,0 +1,60 @@ + + + + + + +Module partial_notes documentation + + + + + +
+ +

Module partial_notes

+

Functions

+

Globals

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/private_events/fn.process_private_event_msg.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/private_events/fn.process_private_event_msg.html new file mode 100644 index 000000000000..9961cffa6f75 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/private_events/fn.process_private_event_msg.html @@ -0,0 +1,42 @@ + + + + + + +Function process_private_event_msg documentation + + + + + +
+ +

Function process_private_event_msg

+
pub unconstrained fn process_private_event_msg(
+    contract_address: AztecAddress,
+    recipient: AztecAddress,
+    msg_metadata: u64,
+    msg_content: BoundedVec<Field, 13>,
+    tx_hash: Field,
+)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/private_events/global.MAX_EVENT_SERIALIZED_LEN.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/private_events/global.MAX_EVENT_SERIALIZED_LEN.html new file mode 100644 index 000000000000..d4440b7212ee --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/private_events/global.MAX_EVENT_SERIALIZED_LEN.html @@ -0,0 +1,40 @@ + + + + + + +Global MAX_EVENT_SERIALIZED_LEN documentation + + + + + +
+ +

Global MAX_EVENT_SERIALIZED_LEN

+
pub global MAX_EVENT_SERIALIZED_LEN: u32;
+ +
+

The maximum length of the packed representation of an event's contents. This is limited by private log size, +encryption overhead and extra fields in the message (e.g. message type id, randomness, etc.).

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/private_events/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/private_events/index.html new file mode 100644 index 000000000000..58253580204c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/private_events/index.html @@ -0,0 +1,57 @@ + + + + + + +Module private_events documentation + + + + + +
+ +

Module private_events

+

Functions

+

Globals

    +
  • The maximum length of the packed representation of an event's contents. This is limited by private log size, +encryption overhead and extra fields in the message (e.g. message type id, randomness, etc.).
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/private_notes/fn.attempt_note_discovery.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/private_notes/fn.attempt_note_discovery.html new file mode 100644 index 000000000000..dfd40f4cc19b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/private_notes/fn.attempt_note_discovery.html @@ -0,0 +1,53 @@ + + + + + + +Function attempt_note_discovery documentation + + + + + +
+ +

Function attempt_note_discovery

+
pub unconstrained fn attempt_note_discovery<Env>(
+    contract_address: AztecAddress,
+    tx_hash: Field,
+    unique_note_hashes_in_tx: BoundedVec<Field, 64>,
+    first_nullifier_in_tx: Field,
+    recipient: AztecAddress,
+    compute_note_hash_and_nullifier: ComputeNoteHashAndNullifier<Env>,
+    owner: AztecAddress,
+    storage_slot: Field,
+    randomness: Field,
+    note_type_id: Field,
+    packed_note: BoundedVec<Field, 10>,
+)
+ +
+

Attempts discovery of a note given information about its contents and the transaction in which it is +suspected the note was created.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/private_notes/fn.process_private_note_msg.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/private_notes/fn.process_private_note_msg.html new file mode 100644 index 000000000000..3f2469af6b63 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/private_notes/fn.process_private_note_msg.html @@ -0,0 +1,46 @@ + + + + + + +Function process_private_note_msg documentation + + + + + +
+ +

Function process_private_note_msg

+
pub unconstrained fn process_private_note_msg<Env>(
+    contract_address: AztecAddress,
+    tx_hash: Field,
+    unique_note_hashes_in_tx: BoundedVec<Field, 64>,
+    first_nullifier_in_tx: Field,
+    recipient: AztecAddress,
+    compute_note_hash_and_nullifier: ComputeNoteHashAndNullifier<Env>,
+    msg_metadata: u64,
+    msg_content: BoundedVec<Field, 13>,
+)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/private_notes/global.MAX_NOTE_PACKED_LEN.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/private_notes/global.MAX_NOTE_PACKED_LEN.html new file mode 100644 index 000000000000..6aba1bf0c8b0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/private_notes/global.MAX_NOTE_PACKED_LEN.html @@ -0,0 +1,41 @@ + + + + + + +Global MAX_NOTE_PACKED_LEN documentation + + + + + +
+ +

Global MAX_NOTE_PACKED_LEN

+
pub global MAX_NOTE_PACKED_LEN: u32;
+ +
+

The maximum length of the packed representation of a note's contents. This is limited by private log size, +encryption overhead and extra fields in the message (e.g. message type id, storage slot, randomness, etc.).

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/private_notes/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/private_notes/index.html new file mode 100644 index 000000000000..ec6028787349 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/private_notes/index.html @@ -0,0 +1,59 @@ + + + + + + +Module private_notes documentation + + + + + +
+ +

Module private_notes

+

Functions

+

Globals

    +
  • The maximum length of the packed representation of a note's contents. This is limited by private log size, +encryption overhead and extra fields in the message (e.g. message type id, storage slot, randomness, etc.).
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/process_message/fn.process_message_ciphertext.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/process_message/fn.process_message_ciphertext.html new file mode 100644 index 000000000000..126dcda0fc4f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/process_message/fn.process_message_ciphertext.html @@ -0,0 +1,50 @@ + + + + + + +Function process_message_ciphertext documentation + + + + + +
+ +

Function process_message_ciphertext

+
pub unconstrained fn process_message_ciphertext<Env>(
+    contract_address: AztecAddress,
+    compute_note_hash_and_nullifier: ComputeNoteHashAndNullifier<Env>,
+    message_ciphertext: BoundedVec<Field, 17>,
+    message_context: MessageContext,
+)
+ +
+

Processes a message that can contain notes, partial notes, or events.

+

Notes result in nonce discovery being performed prior to delivery, which requires knowledge of the transaction hash +in which the notes would've been created (typically the same transaction in which the log was emitted), along with +the list of unique note hashes in said transaction and the compute_note_hash_and_nullifier function. Once +discovered, the notes are enqueued for validation.

+

Partial notes result in a pending partial note entry being stored in a PXE capsule, which will later be retrieved to +search for the note's completion public log.

+

Events are processed by computing an event commitment from the serialized event data and its randomness field, then +enqueueing the event data and commitment for validation.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/process_message/fn.process_message_plaintext.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/process_message/fn.process_message_plaintext.html new file mode 100644 index 000000000000..bdda9bd65946 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/process_message/fn.process_message_plaintext.html @@ -0,0 +1,39 @@ + + + + + + +Function process_message_plaintext documentation + + + + + +
+ +

Function process_message_plaintext

+
pub unconstrained fn process_message_plaintext<Env>(
+    contract_address: AztecAddress,
+    compute_note_hash_and_nullifier: ComputeNoteHashAndNullifier<Env>,
+    message_plaintext: BoundedVec<Field, 14>,
+    message_context: MessageContext,
+)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/process_message/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/process_message/index.html new file mode 100644 index 000000000000..dc710bfc1a21 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/process_message/index.html @@ -0,0 +1,53 @@ + + + + + + +Module process_message documentation + + + + + +
+
aztec-nr - noir_aztec::messages::discovery::process_message
+

Module process_message

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/struct.NoteHashAndNullifier.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/struct.NoteHashAndNullifier.html new file mode 100644 index 000000000000..340ff924c65d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/struct.NoteHashAndNullifier.html @@ -0,0 +1,64 @@ + + + + + + +Struct NoteHashAndNullifier documentation + + + + + +
+ +

Struct NoteHashAndNullifier

+
pub struct NoteHashAndNullifier {
+    pub note_hash: Field,
+    pub inner_nullifier: Field,
+}
+
+

Fields

+
note_hash: Field
+
+

The result of NoteHash::compute_note_hash

+
+
inner_nullifier: Field
+
+

The result of NoteHash::compute_nullifier_unconstrained (since all of message discovery is unconstrained)

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/type.ComputeNoteHashAndNullifier.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/type.ComputeNoteHashAndNullifier.html new file mode 100644 index 000000000000..ac6193a5f4c9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/discovery/type.ComputeNoteHashAndNullifier.html @@ -0,0 +1,78 @@ + + + + + + +Type alias ComputeNoteHashAndNullifier documentation + + + + + +
+ +

Type alias ComputeNoteHashAndNullifier

+
pub type ComputeNoteHashAndNullifier<Env> = unconstrained fn[Env](BoundedVec<Field, 10>, AztecAddress, Field, Field, AztecAddress, Field, Field) -> Option<NoteHashAndNullifier>;
+ +
+

A function which takes a note's packed content, address of the emitting contract, note nonce, storage slot and note +type ID and attempts to compute its note hash (not hashed by note nonce nor siloed by address) and inner nullifier +(not siloed by address).

+

This function must be user-provided as its implementation requires knowledge of how note type IDs are allocated in a +contract. The #[aztec] macro automatically creates such a contract library method called +_compute_note_hash_and_nullifier, which looks something like this:

+
|packed_note, owner, storage_slot, note_type_id, contract_address, randomness, note_nonce| {
+    if note_type_id == MyNoteType::get_id() {
+        assert(packed_note.len() == MY_NOTE_TYPE_SERIALIZATION_LENGTH);
+
+        let note = MyNoteType::unpack(aztec::utils::array::subarray(packed_note.storage(), 0));
+
+        let note_hash = note.compute_note_hash(owner, storage_slot, randomness);
+        let note_hash_for_nullification = aztec::note::utils::compute_note_hash_for_nullification(
+            RetrievedNote{ note, contract_address, metadata: SettledNoteMetadata::new(note_nonce).into() },
+            storage_slot
+        );
+
+        let inner_nullifier = note.compute_nullifier_unconstrained(owner, note_hash_for_nullification);
+
+        Option::some(
+            aztec::messages::discovery::NoteHashAndNullifier {
+                note_hash, inner_nullifier
+            }
+        )
+    } else if note_type_id == MyOtherNoteType::get_id() {
+          ... // Similar to above but calling MyOtherNoteType::unpack_content
+    } else {
+        Option::none() // Unknown note type ID
+    };
+}
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encoding/fn.decode_message.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encoding/fn.decode_message.html new file mode 100644 index 000000000000..d3c6da9bed59 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encoding/fn.decode_message.html @@ -0,0 +1,50 @@ + + + + + + +Function decode_message documentation + + + + + +
+ +

Function decode_message

+
pub unconstrained fn decode_message(
+    message: BoundedVec<Field, 14>,
+) -> (u64, u64, BoundedVec<Field, 13>)
+ +
+

Decodes a standard aztec-nr message, i.e. one created via encode_message, returning the original encoded values.

+

Note that encode_message returns a fixed size array while this function takes a BoundedVec: this is because +prior to decoding the message type is unknown, and consequentially not known at compile time. If working with +fixed-size messages, consider using BoundedVec::from_array to convert them.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encoding/fn.encode_message.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encoding/fn.encode_message.html new file mode 100644 index 000000000000..8040ebba6acb --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encoding/fn.encode_message.html @@ -0,0 +1,58 @@ + + + + + + +Function encode_message documentation + + + + + +
+ +

Function encode_message

+
pub fn encode_message<let N: u32>(
+    msg_type: u64,
+    msg_metadata: u64,
+    msg_content: [Field; N],
+) -> [Field; N + 1]
+ +
+

Encodes a message following aztec-nr's standard message encoding. This message can later be decoded with +decode_message to retrieve the original values.

+
    +
  • The msg_type is an identifier that groups types of messages that are all processed the same way, e.g. private +notes or events. Possible values are defined in aztec::messages::msg_type.
  • +
  • The msg_metadata and msg_content are the values stored in the message, whose meaning depends on the +msg_type. The only special thing about msg_metadata that separates it from msg_content is that it is a u64 +instead of a full Field (due to details of how messages are encoded), allowing applications that can fit values into +this smaller variable to achieve higher data efficiency.
  • +
+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encoding/global.EPH_PK_SIGN_BYTE_SIZE_IN_BYTES.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encoding/global.EPH_PK_SIGN_BYTE_SIZE_IN_BYTES.html new file mode 100644 index 000000000000..034142b9a774 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encoding/global.EPH_PK_SIGN_BYTE_SIZE_IN_BYTES.html @@ -0,0 +1,42 @@ + + + + + + +Global EPH_PK_SIGN_BYTE_SIZE_IN_BYTES documentation + + + + + +
+ +

Global EPH_PK_SIGN_BYTE_SIZE_IN_BYTES

+
pub global EPH_PK_SIGN_BYTE_SIZE_IN_BYTES: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encoding/global.EPH_PK_X_SIZE_IN_FIELDS.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encoding/global.EPH_PK_X_SIZE_IN_FIELDS.html new file mode 100644 index 000000000000..8588a8306de4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encoding/global.EPH_PK_X_SIZE_IN_FIELDS.html @@ -0,0 +1,42 @@ + + + + + + +Global EPH_PK_X_SIZE_IN_FIELDS documentation + + + + + +
+ +

Global EPH_PK_X_SIZE_IN_FIELDS

+
pub global EPH_PK_X_SIZE_IN_FIELDS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encoding/global.MAX_MESSAGE_CONTENT_LEN.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encoding/global.MAX_MESSAGE_CONTENT_LEN.html new file mode 100644 index 000000000000..a538ed20028d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encoding/global.MAX_MESSAGE_CONTENT_LEN.html @@ -0,0 +1,45 @@ + + + + + + +Global MAX_MESSAGE_CONTENT_LEN documentation + + + + + +
+ +

Global MAX_MESSAGE_CONTENT_LEN

+
pub global MAX_MESSAGE_CONTENT_LEN: u32;
+ +
+

The maximum length of a message's content, i.e. not including the expanded message metadata.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encoding/global.MESSAGE_CIPHERTEXT_LEN.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encoding/global.MESSAGE_CIPHERTEXT_LEN.html new file mode 100644 index 000000000000..69010ea2f855 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encoding/global.MESSAGE_CIPHERTEXT_LEN.html @@ -0,0 +1,42 @@ + + + + + + +Global MESSAGE_CIPHERTEXT_LEN documentation + + + + + +
+ +

Global MESSAGE_CIPHERTEXT_LEN

+
pub global MESSAGE_CIPHERTEXT_LEN: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encoding/global.MESSAGE_EXPANDED_METADATA_LEN.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encoding/global.MESSAGE_EXPANDED_METADATA_LEN.html new file mode 100644 index 000000000000..a410b8433b67 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encoding/global.MESSAGE_EXPANDED_METADATA_LEN.html @@ -0,0 +1,42 @@ + + + + + + +Global MESSAGE_EXPANDED_METADATA_LEN documentation + + + + + +
+ +

Global MESSAGE_EXPANDED_METADATA_LEN

+
pub global MESSAGE_EXPANDED_METADATA_LEN: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encoding/global.MESSAGE_PLAINTEXT_LEN.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encoding/global.MESSAGE_PLAINTEXT_LEN.html new file mode 100644 index 000000000000..fd1246ff0c9c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encoding/global.MESSAGE_PLAINTEXT_LEN.html @@ -0,0 +1,42 @@ + + + + + + +Global MESSAGE_PLAINTEXT_LEN documentation + + + + + +
+ +

Global MESSAGE_PLAINTEXT_LEN

+
pub global MESSAGE_PLAINTEXT_LEN: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encoding/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encoding/index.html new file mode 100644 index 000000000000..acc2d2f65433 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encoding/index.html @@ -0,0 +1,57 @@ + + + + + + +Module encoding documentation + + + + + +
+ +

Module encoding

+

Functions

    +
  • Decodes a standard aztec-nr message, i.e. one created via encode_message, returning the original encoded values.
  • +
  • Encodes a message following aztec-nr's standard message encoding. This message can later be decoded with +decode_message to retrieve the original values.
  • +
+

Globals

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encryption/aes128/fn.derive_aes_symmetric_key_and_iv_from_ecdh_shared_secret_using_poseidon2_unsafe.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encryption/aes128/fn.derive_aes_symmetric_key_and_iv_from_ecdh_shared_secret_using_poseidon2_unsafe.html new file mode 100644 index 000000000000..be75a7936c59 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encryption/aes128/fn.derive_aes_symmetric_key_and_iv_from_ecdh_shared_secret_using_poseidon2_unsafe.html @@ -0,0 +1,38 @@ + + + + + + +Function derive_aes_symmetric_key_and_iv_from_ecdh_shared_secret_using_poseidon2_unsafe documentation + + + + + +
+ +

Function derive_aes_symmetric_key_and_iv_from_ecdh_shared_secret_using_poseidon2_unsafe

+
pub fn derive_aes_symmetric_key_and_iv_from_ecdh_shared_secret_using_poseidon2_unsafe<let N: u32>(
+    shared_secret: EmbeddedCurvePoint,
+) -> [([u8; 16], [u8; 16]); N]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encryption/aes128/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encryption/aes128/index.html new file mode 100644 index 000000000000..f6196e5885ea --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encryption/aes128/index.html @@ -0,0 +1,45 @@ + + + + + + +Module aes128 documentation + + + + + +
+ +

Module aes128

+

Structs

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encryption/aes128/struct.AES128.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encryption/aes128/struct.AES128.html new file mode 100644 index 000000000000..a828ef7e79e8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encryption/aes128/struct.AES128.html @@ -0,0 +1,54 @@ + + + + + + +Struct AES128 documentation + + + + + +
+ +

Struct AES128

+
pub struct AES128 {}
+
+

Trait implementations

+

impl MessageEncryption for AES128

+ +
pub fn encrypt<let PlaintextLen: u32>( + plaintext: [Field; PlaintextLen], + recipient: AztecAddress, +) -> [Field; 17] + +pub unconstrained fn decrypt( + ciphertext: BoundedVec<Field, 17>, + recipient: AztecAddress, +) -> Option<BoundedVec<Field, 14>> + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encryption/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encryption/index.html new file mode 100644 index 000000000000..cd4350d63f96 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encryption/index.html @@ -0,0 +1,48 @@ + + + + + + +Module encryption documentation + + + + + +
+ +

Module encryption

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encryption/message_encryption/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encryption/message_encryption/index.html new file mode 100644 index 000000000000..1a1365f4645f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encryption/message_encryption/index.html @@ -0,0 +1,41 @@ + + + + + + +Module message_encryption documentation + + + + + +
+
aztec-nr - noir_aztec::messages::encryption::message_encryption
+

Module message_encryption

+

Traits

    +
  • Trait for encrypting and decrypting messages in the Aztec protocol.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encryption/message_encryption/trait.MessageEncryption.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encryption/message_encryption/trait.MessageEncryption.html new file mode 100644 index 000000000000..ab6265f06ad4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encryption/message_encryption/trait.MessageEncryption.html @@ -0,0 +1,98 @@ + + + + + + +Trait MessageEncryption documentation + + + + + +
+ +

Trait MessageEncryption

+
pub trait MessageEncryption {
+    // Required methods
+    pub fn encrypt<let PlaintextLen: u32>(
+        plaintext: [Field; PlaintextLen],
+        recipient: AztecAddress,
+    ) -> [Field; 17];
+    pub unconstrained fn decrypt(
+        ciphertext: BoundedVec<Field, 17>,
+        recipient: AztecAddress,
+    ) -> Option<BoundedVec<Field, 14>>;
+}
+ +
+

Trait for encrypting and decrypting messages in the Aztec protocol.

+

This trait defines the interface for encrypting plaintext data into messages that are delivered either onchain (via +logs) or offchain, as well as decrypting those messages back into their original plaintext.

+

Type Parameters

+
    +
  • PLAINTEXT_LEN: Length of the plaintext array in fields
  • +
  • MESSAGE_CIPHERTEXT_LEN: Fixed length of encrypted message (defined globally)
  • +
  • MESSAGE_PLAINTEXT_LEN: Maximum size of decrypted plaintext (defined globally)
  • +
+

Note on privacy sets

+

To preserve privacy, MessageEncryption::encrypt returns a fixed-length array ensuring all log types are +indistinguishable onchain. Implementations of this trait must handle padding the encrypted log to match this +standardized length.

+

Required methods

+
pub fn encrypt<let PlaintextLen: u32>( + plaintext: [Field; PlaintextLen], + recipient: AztecAddress, +) -> [Field; 17] + +
+

Encrypts a plaintext message (a field array) such that only recipient can decrypt it.

+

The returned message ciphertext can be passed to MessageEncryption::decrypt in order to obtain the original +plaintext.

+

Privacy

+

Knowledge of the returned ciphertext provides no information to third parties - recipients encryption keys +(specifically their ivsk and pre-address) are required in order to decrypt. Additionally, [encrypt] adds random +padding in order to always produce equal length message ciphertexts regardless of the input, hiding its length.

+

These properties make it secure to distribute the ciphertext publicly, e.g. on blockchain logs (assuming the +encryption function is itself secure).

+
pub unconstrained fn decrypt( + ciphertext: BoundedVec<Field, 17>, + recipient: AztecAddress, +) -> Option<BoundedVec<Field, 14>> + +
+

Decrypts a message ciphertext obtained via MessageEncryption::encrypt to recipient back into its original +plaintext.

+

Note that this function is unconstrained: decryption typically happens when processing messages in utility +functions.

+

Not all ciphertexts are valid - among other things, the ephemeral public key included in it may not correspond +to a point on the curve. In all such cases, Option::none is returned instead.

+

Implementors

+

impl MessageEncryption for AES128

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encryption/poseidon2/fn.poseidon2_decrypt.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encryption/poseidon2/fn.poseidon2_decrypt.html new file mode 100644 index 000000000000..2dc9b650945b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encryption/poseidon2/fn.poseidon2_decrypt.html @@ -0,0 +1,38 @@ + + + + + + +Function poseidon2_decrypt documentation + + + + + +
+ +

Function poseidon2_decrypt

+
pub fn poseidon2_decrypt<let L: u32>(
+    ciphertext: [Field; L + 2 / 3 * 3 + 1],
+    shared_secret: EmbeddedCurvePoint,
+    encryption_nonce: Field,
+) -> Option<[Field; L]>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encryption/poseidon2/fn.poseidon2_encrypt.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encryption/poseidon2/fn.poseidon2_encrypt.html new file mode 100644 index 000000000000..a65ae837474c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encryption/poseidon2/fn.poseidon2_encrypt.html @@ -0,0 +1,56 @@ + + + + + + +Function poseidon2_encrypt documentation + + + + + +
+ +

Function poseidon2_encrypt

+
pub fn poseidon2_encrypt<let L: u32>(
+    msg: [Field; L],
+    shared_secret: EmbeddedCurvePoint,
+    encryption_nonce: Field,
+) -> [Field; L + 2 / 3 * 3 + 1]
+ +
+

Poseidon2 Encryption.

+

~160 constraints to encrypt 8 fields. Use this hash if you favour proving speed over long-term privacy for your users.

+

WARNING: Poseidon2 as an encryption scheme isn't considered as secure as more battle-tested encryption schemes, e.g. AES128. +This is because:

+
    +
  • it's relatively new;
  • +
  • it isn't used much in the wild, so there's less incentive for hackers or bounty hunters to try to break it;
  • +
  • it doesn't provide post-quantum privacy.
  • +
+

If you want to protect your users' privacy decades into the future, it might be prudent to choose +a more 'traditional' encryption scheme. +If your app is "lower stakes", and your users will only care about their privacy in the near future or immediate future, then +this encryption scheme might be for you!

+

See the paper: https://drive.google.com/file/d/1EVrP3DzoGbmzkRmYnyEDcIQcXVU7GlOd/view

+

Note: The return length is: L padded to the next multiple of 3, plus 1 for a message auth code of s[1].

+

@param encryption_nonce is only needed if your use case needs to protect against replay attacks.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encryption/poseidon2/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encryption/poseidon2/index.html new file mode 100644 index 000000000000..8986413105b8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/encryption/poseidon2/index.html @@ -0,0 +1,42 @@ + + + + + + +Module poseidon2 documentation + + + + + +
+ +

Module poseidon2

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/index.html new file mode 100644 index 000000000000..b439b8418fb1 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/index.html @@ -0,0 +1,60 @@ + + + + + + +Module messages documentation + + + + + +
+
aztec-nr - noir_aztec::messages
+

Module messages

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/logs/arithmetic_generics_utils/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/logs/arithmetic_generics_utils/index.html new file mode 100644 index 000000000000..b6c57488116c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/logs/arithmetic_generics_utils/index.html @@ -0,0 +1,33 @@ + + + + + + +Module arithmetic_generics_utils documentation + + + + + +
+
aztec-nr - noir_aztec::messages::logs::arithmetic_generics_utils
+

Module arithmetic_generics_utils

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/logs/event/fn.private_event_to_message_plaintext.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/logs/event/fn.private_event_to_message_plaintext.html new file mode 100644 index 000000000000..71bacd34d828 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/logs/event/fn.private_event_to_message_plaintext.html @@ -0,0 +1,40 @@ + + + + + + +Function private_event_to_message_plaintext documentation + + + + + +
+ +

Function private_event_to_message_plaintext

+
pub fn private_event_to_message_plaintext<Event>(
+    event: Event,
+    randomness: Field,
+) -> [Field; <Event as Serialize>::N + 2]
+
where + Event: EventInterface, + Event: Serialize
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/logs/event/fn.to_encrypted_private_event_message.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/logs/event/fn.to_encrypted_private_event_message.html new file mode 100644 index 000000000000..5e13f59dfc5e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/logs/event/fn.to_encrypted_private_event_message.html @@ -0,0 +1,44 @@ + + + + + + +Function to_encrypted_private_event_message documentation + + + + + +
+ +

Function to_encrypted_private_event_message

+
pub fn to_encrypted_private_event_message<Event>(
+    event: Event,
+    recipient: AztecAddress,
+) -> ([Field; 17], Field)
+
where + Event: EventInterface, + Event: Serialize
+ +
+

Creates an encrypted private event message (i.e. one of type PRIVATE_EVENT_MSG_TYPE_ID) by encoding the contents +of the event and then encrypting them for recipient.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/logs/event/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/logs/event/index.html new file mode 100644 index 000000000000..9c3fcf05a981 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/logs/event/index.html @@ -0,0 +1,42 @@ + + + + + + +Module event documentation + + + + + +
+ +

Module event

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/logs/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/logs/index.html new file mode 100644 index 000000000000..9bf32782c045 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/logs/index.html @@ -0,0 +1,47 @@ + + + + + + +Module logs documentation + + + + + +
+ +

Module logs

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/logs/note/fn.compute_partial_note_private_content_log.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/logs/note/fn.compute_partial_note_private_content_log.html new file mode 100644 index 000000000000..618acbfc6449 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/logs/note/fn.compute_partial_note_private_content_log.html @@ -0,0 +1,44 @@ + + + + + + +Function compute_partial_note_private_content_log documentation + + + + + +
+ +

Function compute_partial_note_private_content_log

+
pub fn compute_partial_note_private_content_log<PartialNotePrivateContent>(
+    partial_note_private_content: PartialNotePrivateContent,
+    owner: AztecAddress,
+    storage_slot: Field,
+    randomness: Field,
+    recipient: AztecAddress,
+) -> [Field; 18]
+
where + PartialNotePrivateContent: NoteType, + PartialNotePrivateContent: Packable
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/logs/note/fn.partial_note_private_content_to_message_plaintext.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/logs/note/fn.partial_note_private_content_to_message_plaintext.html new file mode 100644 index 000000000000..3d04d5d78890 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/logs/note/fn.partial_note_private_content_to_message_plaintext.html @@ -0,0 +1,43 @@ + + + + + + +Function partial_note_private_content_to_message_plaintext documentation + + + + + +
+ +

Function partial_note_private_content_to_message_plaintext

+
pub fn partial_note_private_content_to_message_plaintext<PartialNotePrivateContent>(
+    partial_note_private_content: PartialNotePrivateContent,
+    owner: AztecAddress,
+    storage_slot: Field,
+    randomness: Field,
+) -> [Field; <PartialNotePrivateContent as Packable>::N + 4]
+
where + PartialNotePrivateContent: NoteType, + PartialNotePrivateContent: Packable
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/logs/note/fn.private_note_to_message_plaintext.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/logs/note/fn.private_note_to_message_plaintext.html new file mode 100644 index 000000000000..227817a3db1c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/logs/note/fn.private_note_to_message_plaintext.html @@ -0,0 +1,43 @@ + + + + + + +Function private_note_to_message_plaintext documentation + + + + + +
+ +

Function private_note_to_message_plaintext

+
pub fn private_note_to_message_plaintext<Note>(
+    note: Note,
+    owner: AztecAddress,
+    storage_slot: Field,
+    randomness: Field,
+) -> [Field; <Note as Packable>::N + 4]
+
where + Note: NoteType, + Note: Packable
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/logs/note/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/logs/note/index.html new file mode 100644 index 000000000000..2e91e65e7f83 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/logs/note/index.html @@ -0,0 +1,42 @@ + + + + + + +Module note documentation + + + + + +
+ +

Module note

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/logs/utils/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/logs/utils/index.html new file mode 100644 index 000000000000..0e8814e5ce4b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/logs/utils/index.html @@ -0,0 +1,33 @@ + + + + + + +Module utils documentation + + + + + +
+ +

Module utils

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/message_delivery/global.MessageDelivery.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/message_delivery/global.MessageDelivery.html new file mode 100644 index 000000000000..530a48d26a92 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/message_delivery/global.MessageDelivery.html @@ -0,0 +1,36 @@ + + + + + + +Global MessageDelivery documentation + + + + + +
+ +

Global MessageDelivery

+
pub global MessageDelivery: MessageDeliveryEnum;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/message_delivery/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/message_delivery/index.html new file mode 100644 index 000000000000..a1397429da5b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/message_delivery/index.html @@ -0,0 +1,50 @@ + + + + + + +Module message_delivery documentation + + + + + +
+
aztec-nr - noir_aztec::messages::message_delivery
+

Module message_delivery

+

Structs

    +
  • Specifies the configuration parameters for message delivery. There are two fundamental aspects to consider:
  • +
+

Globals

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/message_delivery/struct.MessageDeliveryEnum.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/message_delivery/struct.MessageDeliveryEnum.html new file mode 100644 index 000000000000..c8a6e2156164 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/message_delivery/struct.MessageDeliveryEnum.html @@ -0,0 +1,126 @@ + + + + + + +Struct MessageDeliveryEnum documentation + + + + + +
+ +

Struct MessageDeliveryEnum

+
pub struct MessageDeliveryEnum {
+    pub CONSTRAINED_ONCHAIN: u8,
+    pub UNCONSTRAINED_ONCHAIN: u8,
+    pub UNCONSTRAINED_OFFCHAIN: u8,
+}
+
+
+

Specifies the configuration parameters for message delivery. There are two fundamental aspects to consider:

+

+----------------------------------------------------------------------------------------------------------+ +| 1. Delivery Mechanism | +| - Messages can be delivered either onchain or offchain | +| - Onchain delivery uses the Aztec protocol's private log stream, submitted to L1 blobs and consuming DA | +| - Offchain delivery is implemented by the application (e.g. storing ciphertexts in cloud storage) | +| - Offchain delivery cannot have any cryptographic constraints since messages are never stored onchain| ++----------------------------------------------------------------------------------------------------------+

+

For onchain delivery, we must also consider:

+

+----------------------------------------------------------------------------------------------------------+ +| 2. Message Encryption and Tagging | +| - Messages can use either constrained or unconstrained encryption | +| - Constrained encryption guarantees the ciphertext is formed correctly but costs more in constraints, | +| which results in slower proving times | +| - Unconstrained encryption trusts the sender but is cheaper constraint-wise and hence faster to prove | +| - Tagging is an indexing mechanism that helps recipients locate their messages | +| - If tagging is not performed correctly by the sender, the recipient will not be able to find the message| ++----------------------------------------------------------------------------------------------------------+

+

For offchain delivery, constrained encryption is not relevant since it doesn't provide any additional guarantees +over unconstrained encryption and is slower to prove (requiring more constraints).

+

There are three available delivery modes described below.

+
+

Fields

+
CONSTRAINED_ONCHAIN: u8
+
+
    +
  1. Constrained Onchain
  2. +
+
    +
  • Uses constrained encryption and in the future constrained tagging (issue #14565) with onchain delivery
  • +
  • Provides cryptographic guarantees that recipients can discover and decrypt messages (once #14565 is tackled)
  • +
  • Slowest proving times since encryption is constrained
  • +
  • Expensive since it consumes L1 blob space
  • +
  • Use when smart contracts need to make decisions based on message contents
  • +
  • Example 1: An escrow contract facilitating a private NFT sale that needs to verify payment before releasing +the NFT to the buyer.
  • +
  • Example 2: An application with private configuration where changes must be broadcast to all participants. +This ensures every user can access the latest configuration. Without notification of config changes, +users would be unable to read updated variables and therefore blocked from using the application's +functions. This pattern applies to all critical events that require universal broadcast.
  • +
+

Safety: Despite being called CONSTRAINED_ONCHAIN, this delivery mode is currently NOT fully constrained. +The tag prefixing is unconstrained, meaning a malicious sender could manipulate the tag to prevent +recipient decryption. TODO(#14565): Implement proper constrained tag prefixing.

+
+
UNCONSTRAINED_ONCHAIN: u8
+
+
    +
  1. Unconstrained Onchain
  2. +
+
    +
  • Uses unconstrained encryption and tagging with onchain delivery
  • +
  • Faster proving times since no constraints are used for encryption
  • +
  • Expensive since it consumes L1 blob space
  • +
  • Suitable when recipients can verify message validity through other means
  • +
  • Use this if you don't need the cryptographic guarantees of constrained encryption and tagging but +don't want to deal with setting up offchain delivery infrastructure as required by mode 3
  • +
  • Example: Depositing a privately-held NFT into an NFT-sale escrow contract. The buyers know the escrow +contract's decryption keys, they receive the message onchain and are willing to buy the NFT only if the NFT +contained in the message is legitimate.
  • +
+
+
UNCONSTRAINED_OFFCHAIN: u8
+
+
    +
  1. Offchain
  2. +
+
    +
  • Uses unconstrained encryption with offchain delivery
  • +
  • Lowest cost since no onchain storage is needed and short proving times since no constraints are used +for encryption
  • +
  • Suitable when recipients can verify message validity through other means
  • +
  • Requires setting up custom infrastructure for handling offchain delivery (e.g. cloud storage)
  • +
  • Example: A payment app where a merchant receives the message offchain and is willing to release the goods +once he verifies that the payment is correct (i.e. can decrypt the message and verify that it contains +a legitimate token note - note with note commitment in the note hash tree).
  • +
+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/msg_type/global.PARTIAL_NOTE_PRIVATE_MSG_TYPE_ID.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/msg_type/global.PARTIAL_NOTE_PRIVATE_MSG_TYPE_ID.html new file mode 100644 index 000000000000..67e1f4da1dfe --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/msg_type/global.PARTIAL_NOTE_PRIVATE_MSG_TYPE_ID.html @@ -0,0 +1,35 @@ + + + + + + +Global PARTIAL_NOTE_PRIVATE_MSG_TYPE_ID documentation + + + + + +
+ +

Global PARTIAL_NOTE_PRIVATE_MSG_TYPE_ID

+
pub global PARTIAL_NOTE_PRIVATE_MSG_TYPE_ID: u64;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/msg_type/global.PRIVATE_EVENT_MSG_TYPE_ID.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/msg_type/global.PRIVATE_EVENT_MSG_TYPE_ID.html new file mode 100644 index 000000000000..2e43b59792b1 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/msg_type/global.PRIVATE_EVENT_MSG_TYPE_ID.html @@ -0,0 +1,35 @@ + + + + + + +Global PRIVATE_EVENT_MSG_TYPE_ID documentation + + + + + +
+ +

Global PRIVATE_EVENT_MSG_TYPE_ID

+
pub global PRIVATE_EVENT_MSG_TYPE_ID: u64;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/msg_type/global.PRIVATE_NOTE_MSG_TYPE_ID.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/msg_type/global.PRIVATE_NOTE_MSG_TYPE_ID.html new file mode 100644 index 000000000000..c9cdf510969a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/msg_type/global.PRIVATE_NOTE_MSG_TYPE_ID.html @@ -0,0 +1,35 @@ + + + + + + +Global PRIVATE_NOTE_MSG_TYPE_ID documentation + + + + + +
+ +

Global PRIVATE_NOTE_MSG_TYPE_ID

+
pub global PRIVATE_NOTE_MSG_TYPE_ID: u64;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/msg_type/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/msg_type/index.html new file mode 100644 index 000000000000..81b78ed066fc --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/msg_type/index.html @@ -0,0 +1,48 @@ + + + + + + +Module msg_type documentation + + + + + +
+ +

Module msg_type

+

Globals

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/offchain_messages/fn.deliver_offchain_message.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/offchain_messages/fn.deliver_offchain_message.html new file mode 100644 index 000000000000..28883a07523d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/offchain_messages/fn.deliver_offchain_message.html @@ -0,0 +1,60 @@ + + + + + + +Function deliver_offchain_message documentation + + + + + +
+ +

Function deliver_offchain_message

+
pub fn deliver_offchain_message(ciphertext: [Field; 17], recipient: AztecAddress)
+ +
+

Emits a message that will be delivered offchain rather than through the data availability layer.

+

Sends data through an alternative app-specific channel without incurring data availability (DA) costs. After +receiving the message, the recipient is expected to call the process_message function implemented on the +contract that originally emitted the message.

+

Example use case

+

A typical use case would be a payment app where the notes and events do not need to be delivered via DA because +the payment is considered successful by the recipient once he receives the notes and events offchain. Hence +having the guaranteed delivery via DA is not necessary.

+

When not to use

+

This function should not be used when an onchain guarantee of successful delivery is required. This is the case +when a smart contract (rather than a person) needs to make decisions based on the message. For example, consider +a contract that escrows a privately-stored NFT (i.e. an NFT represented by a note) and releases it to a buyer only +after receiving a payment in a specific token. Without onchain delivery, the buyer could potentially obtain the +NFT without sending the payment token message (the note hash preimage) to the seller, rugging the seller.

+

To clarify the above, while the malicious buyer's payment token would still be deducted from their balance, they +would obtain the NFT while the seller would be unable to spend the payment token, keeping the payment token note +in limbo.

+

Arguments

+
    +
  • message - The message to emit.
  • +
  • recipient - The address of the recipient.
  • +
+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/offchain_messages/global.OFFCHAIN_MESSAGE_IDENTIFIER.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/offchain_messages/global.OFFCHAIN_MESSAGE_IDENTIFIER.html new file mode 100644 index 000000000000..c2f068b37aee --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/offchain_messages/global.OFFCHAIN_MESSAGE_IDENTIFIER.html @@ -0,0 +1,36 @@ + + + + + + +Global OFFCHAIN_MESSAGE_IDENTIFIER documentation + + + + + +
+ +

Global OFFCHAIN_MESSAGE_IDENTIFIER

+
pub global OFFCHAIN_MESSAGE_IDENTIFIER: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/offchain_messages/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/offchain_messages/index.html new file mode 100644 index 000000000000..0cf3d142ceb0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/offchain_messages/index.html @@ -0,0 +1,50 @@ + + + + + + +Module offchain_messages documentation + + + + + +
+
aztec-nr - noir_aztec::messages::offchain_messages
+

Module offchain_messages

+

Functions

    +
  • Emits a message that will be delivered offchain rather than through the data availability layer.
  • +
+

Globals

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/processing/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/processing/index.html new file mode 100644 index 000000000000..b6775bf0fc7b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/processing/index.html @@ -0,0 +1,46 @@ + + + + + + +Module processing documentation + + + + + +
+ +

Module processing

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/processing/message_context/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/processing/message_context/index.html new file mode 100644 index 000000000000..a96fd73e0099 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/processing/message_context/index.html @@ -0,0 +1,39 @@ + + + + + + +Module message_context documentation + + + + + +
+
aztec-nr - noir_aztec::messages::processing::message_context
+

Module message_context

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/processing/message_context/struct.MessageContext.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/processing/message_context/struct.MessageContext.html new file mode 100644 index 000000000000..4bb16b32936d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/messages/processing/message_context/struct.MessageContext.html @@ -0,0 +1,71 @@ + + + + + + +Struct MessageContext documentation + + + + + +
+ +

Struct MessageContext

+
pub struct MessageContext {
+    pub tx_hash: Field,
+    pub unique_note_hashes_in_tx: BoundedVec<Field, 64>,
+    pub first_nullifier_in_tx: Field,
+    pub recipient: AztecAddress,
+}
+
+
+

Additional information needed to process a message.

+

All messages exist in the context of a transaction, and information about that transaction is typically required +in order to perform validation, store results, etc. For example, messages containing notes require knowledge of note +hashes and the first nullifier in order to find the note's nonce.

+
+

Fields

+
tx_hash: Field
+
unique_note_hashes_in_tx: BoundedVec<Field, 64>
+
first_nullifier_in_tx: Field
+
recipient: AztecAddress
+

Trait implementations

+

impl Deserialize for MessageContext

+ +
pub fn deserialize(serialized: [Field; 68]) -> Self + +

impl Eq for MessageContext

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/constants/global.MAX_NOTES_PER_PAGE.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/constants/global.MAX_NOTES_PER_PAGE.html new file mode 100644 index 000000000000..3b94e3b542a9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/constants/global.MAX_NOTES_PER_PAGE.html @@ -0,0 +1,33 @@ + + + + + + +Global MAX_NOTES_PER_PAGE documentation + + + + + +
+ +

Global MAX_NOTES_PER_PAGE

+
pub global MAX_NOTES_PER_PAGE: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/constants/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/constants/index.html new file mode 100644 index 000000000000..7e224c342bbe --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/constants/index.html @@ -0,0 +1,48 @@ + + + + + + +Module constants documentation + + + + + +
+
aztec-nr - noir_aztec::note::constants
+

Module constants

+

Globals

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/index.html new file mode 100644 index 000000000000..0adcd08027a1 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/index.html @@ -0,0 +1,62 @@ + + + + + + +Module note documentation + + + + + +
+ +

Module note

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/lifecycle/fn.create_note.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/lifecycle/fn.create_note.html new file mode 100644 index 000000000000..4583cbe3aa32 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/lifecycle/fn.create_note.html @@ -0,0 +1,47 @@ + + + + + + +Function create_note documentation + + + + + +
+ +

Function create_note

+
pub fn create_note<Note>(
+    context: &mut PrivateContext,
+    owner: AztecAddress,
+    storage_slot: Field,
+    note: Note,
+) -> NoteMessage<Note>
+
where + Note: NoteType, + Note: NoteHash, + Note: Packable
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/lifecycle/fn.destroy_note.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/lifecycle/fn.destroy_note.html new file mode 100644 index 000000000000..df4b43afe0ae --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/lifecycle/fn.destroy_note.html @@ -0,0 +1,43 @@ + + + + + + +Function destroy_note documentation + + + + + +
+ +

Function destroy_note

+
pub fn destroy_note<Note>(
+    context: &mut PrivateContext,
+    retrieved_note: RetrievedNote<Note>,
+)
+
where + Note: NoteHash
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/lifecycle/fn.destroy_note_unsafe.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/lifecycle/fn.destroy_note_unsafe.html new file mode 100644 index 000000000000..49e62e94e248 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/lifecycle/fn.destroy_note_unsafe.html @@ -0,0 +1,44 @@ + + + + + + +Function destroy_note_unsafe documentation + + + + + +
+ +

Function destroy_note_unsafe

+
pub fn destroy_note_unsafe<Note>(
+    context: &mut PrivateContext,
+    retrieved_note: RetrievedNote<Note>,
+    note_hash_read: NoteHashRead,
+)
+
where + Note: NoteHash
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/lifecycle/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/lifecycle/index.html new file mode 100644 index 000000000000..00130cd5df0f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/lifecycle/index.html @@ -0,0 +1,54 @@ + + + + + + +Module lifecycle documentation + + + + + +
+
aztec-nr - noir_aztec::note::lifecycle
+

Module lifecycle

+

Structs

    +
  • A note that was created in the current contract call.
  • +
+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/lifecycle/struct.NewNote.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/lifecycle/struct.NewNote.html new file mode 100644 index 000000000000..75db70978a88 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/lifecycle/struct.NewNote.html @@ -0,0 +1,46 @@ + + + + + + +Struct NewNote documentation + + + + + +
+ +

Struct NewNote

+
pub struct NewNote<Note>
+{ /* private fields */ }
+
+
+

A note that was created in the current contract call.

+
+

Implementations

+

impl<Note> NewNote<Note>

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter/fn.get_note.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter/fn.get_note.html new file mode 100644 index 000000000000..717062882df3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter/fn.get_note.html @@ -0,0 +1,44 @@ + + + + + + +Function get_note documentation + + + + + +
+ +

Function get_note

+
pub fn get_note<Note>(
+    context: &mut PrivateContext,
+    owner: Option<AztecAddress>,
+    storage_slot: Field,
+) -> (RetrievedNote<Note>, NoteHashRead)
+
where + Note: NoteType, + Note: NoteHash, + Note: Packable
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter/fn.get_notes.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter/fn.get_notes.html new file mode 100644 index 000000000000..961fa23b7995 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter/fn.get_notes.html @@ -0,0 +1,54 @@ + + + + + + +Function get_notes documentation + + + + + +
+ +

Function get_notes

+
pub fn get_notes<Note, let M: u32, PreprocessorArgs, FilterArgs>(
+    context: &mut PrivateContext,
+    storage_slot: Field,
+    options: NoteGetterOptions<Note, M, PreprocessorArgs, FilterArgs>,
+) -> (BoundedVec<RetrievedNote<Note>, 16>, BoundedVec<NoteHashRead, 16>)
+
where + Note: NoteType, + Note: NoteHash, + Note: Eq, + Note: Packable<N = M>
+ +
+

Returns a BoundedVec of notes that have been proven to have been created by this contract, either in the current or +past transactions (i.e. pending or settled notes). A second BoundedVec contains the note hashes used for the read +requests, which can save constraints when computing the note's nullifiers.

+

WARNING: recall that notes are never destroyed! Note existence therefore does not imply that the note is current +or valid - this typically requires also emitting the note's nullifier to prove that it had not been emitted +before. Because of this, calling this function directly from end-user applications should be discouraged, and safe +abstractions such as aztec-nr's state variables should be used instead.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter/fn.view_note.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter/fn.view_note.html new file mode 100644 index 000000000000..6024ca49572a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter/fn.view_note.html @@ -0,0 +1,42 @@ + + + + + + +Function view_note documentation + + + + + +
+ +

Function view_note

+
pub unconstrained fn view_note<Note>(
+    owner: Option<AztecAddress>,
+    storage_slot: Field,
+) -> RetrievedNote<Note>
+
where + Note: NoteType, + Note: Packable
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter/fn.view_notes.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter/fn.view_notes.html new file mode 100644 index 000000000000..4204ff934bcc --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter/fn.view_notes.html @@ -0,0 +1,48 @@ + + + + + + +Function view_notes documentation + + + + + +
+ +

Function view_notes

+
pub unconstrained fn view_notes<Note, let M: u32>(
+    storage_slot: Field,
+    options: NoteViewerOptions<Note, M>,
+) -> BoundedVec<Note, 10>
+
where + Note: NoteType, + Note: Packable<N = M>, + Note: Eq
+ +
+

Unconstrained variant of get_notes, meant to be used in unconstrained execution contexts. Notably only the note +content is returned, and not any of the information used when proving its existence (e.g. note nonce, note hash, +etc.).

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter/index.html new file mode 100644 index 000000000000..df91d38d1c21 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter/index.html @@ -0,0 +1,59 @@ + + + + + + +Module note_getter documentation + + + + + +
+
aztec-nr - noir_aztec::note::note_getter
+

Module note_getter

+

Re-exports

+

Functions

    +
  • +
  • Returns a BoundedVec of notes that have been proven to have been created by this contract, either in the current or +past transactions (i.e. pending or settled notes). A second BoundedVec contains the note hashes used for the read +requests, which can save constraints when computing the note's nullifiers.
  • +
  • +
  • Unconstrained variant of get_notes, meant to be used in unconstrained execution contexts. Notably only the note +content is returned, and not any of the information used when proving its existence (e.g. note nonce, note hash, +etc.).
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter_options/global.NoteStatus.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter_options/global.NoteStatus.html new file mode 100644 index 000000000000..3009c53082d0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter_options/global.NoteStatus.html @@ -0,0 +1,42 @@ + + + + + + +Global NoteStatus documentation + + + + + +
+ +

Global NoteStatus

+
pub global NoteStatus: NoteStatusEnum;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter_options/global.SortOrder.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter_options/global.SortOrder.html new file mode 100644 index 000000000000..0cd8742d725f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter_options/global.SortOrder.html @@ -0,0 +1,42 @@ + + + + + + +Global SortOrder documentation + + + + + +
+ +

Global SortOrder

+
pub global SortOrder: SortOrderEnum;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter_options/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter_options/index.html new file mode 100644 index 000000000000..fefe13e9ec19 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter_options/index.html @@ -0,0 +1,58 @@ + + + + + + +Module note_getter_options documentation + + + + + +
+
aztec-nr - noir_aztec::note::note_getter_options
+

Module note_getter_options

+

Structs

+

Globals

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter_options/struct.NoteGetterOptions.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter_options/struct.NoteGetterOptions.html new file mode 100644 index 000000000000..938883f15841 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter_options/struct.NoteGetterOptions.html @@ -0,0 +1,139 @@ + + + + + + +Struct NoteGetterOptions documentation + + + + + +
+ +

Struct NoteGetterOptions

+
pub struct NoteGetterOptions<Note, let N: u32, PreprocessorArgs, FilterArgs> {
+    pub selects: BoundedVec<Option<Select>, N>,
+    pub sorts: BoundedVec<Option<Sort>, N>,
+    pub limit: u32,
+    pub offset: u32,
+    pub owner: Option<AztecAddress>,
+    pub preprocessor: fn([Option<RetrievedNote<Note>>; 16], PreprocessorArgs) -> [Option<RetrievedNote<Note>>; 16],
+    pub preprocessor_args: PreprocessorArgs,
+    pub filter: fn([Option<RetrievedNote<Note>>; 16], FilterArgs) -> [Option<RetrievedNote<Note>>; 16],
+    pub filter_args: FilterArgs,
+    pub status: u8,
+}
+
+

Fields

+
selects: BoundedVec<Option<Select>, N>
+
sorts: BoundedVec<Option<Sort>, N>
+
limit: u32
+
offset: u32
+
+
preprocessor: fn([Option<RetrievedNote<Note>>; 16], PreprocessorArgs) -> [Option<RetrievedNote<Note>>; 16]
+
preprocessor_args: PreprocessorArgs
+
filter: fn([Option<RetrievedNote<Note>>; 16], FilterArgs) -> [Option<RetrievedNote<Note>>; 16]
+
filter_args: FilterArgs
+
status: u8
+

Implementations

+

impl<let M: u32, Note> NoteGetterOptions<Note, M, Field, Field>

+ +
pub fn new() -> Self +
where + Note: NoteType, + Note: Packable<N = M>
+ +

impl<FilterArgs, let M: u32, Note> NoteGetterOptions<Note, M, Field, FilterArgs>

+ +
pub fn with_filter( + filter: fn([Option<RetrievedNote<Note>>; 16], FilterArgs) -> [Option<RetrievedNote<Note>>; 16], + filter_args: FilterArgs, +) -> Self +
where + Note: NoteType, + Note: Packable<N = M>
+ +

impl<FilterArgs, let N: u32, Note, PreprocessorArgs> NoteGetterOptions<Note, N, PreprocessorArgs, FilterArgs>

+ +
pub fn select<T>( + &mut self, + property_selector: PropertySelector, + comparator: u8, + value: T, +) -> Self +
where + T: ToField
+ +pub fn sort(&mut self, property_selector: PropertySelector, order: u8) -> Self + +pub fn set_limit(&mut self, limit: u32) -> Self + +pub fn set_offset(&mut self, offset: u32) -> Self + +pub fn set_status(&mut self, status: u8) -> Self + +pub fn set_owner(&mut self, owner: AztecAddress) -> Self + +

impl<let M: u32, Note, PreprocessorArgs> NoteGetterOptions<Note, M, PreprocessorArgs, Field>

+ +
pub fn with_preprocessor( + preprocessor: fn([Option<RetrievedNote<Note>>; 16], PreprocessorArgs) -> [Option<RetrievedNote<Note>>; 16], + preprocessor_args: PreprocessorArgs, +) -> Self +
where + Note: NoteType, + Note: Packable<N = M>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter_options/struct.NoteStatusEnum.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter_options/struct.NoteStatusEnum.html new file mode 100644 index 000000000000..15623195807e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter_options/struct.NoteStatusEnum.html @@ -0,0 +1,54 @@ + + + + + + +Struct NoteStatusEnum documentation + + + + + +
+ +

Struct NoteStatusEnum

+
pub struct NoteStatusEnum {
+    pub ACTIVE: u8,
+    pub ACTIVE_OR_NULLIFIED: u8,
+}
+
+

Fields

+
ACTIVE: u8
+
ACTIVE_OR_NULLIFIED: u8
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter_options/struct.PropertySelector.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter_options/struct.PropertySelector.html new file mode 100644 index 000000000000..e82d68ffe46b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter_options/struct.PropertySelector.html @@ -0,0 +1,57 @@ + + + + + + +Struct PropertySelector documentation + + + + + +
+ +

Struct PropertySelector

+
pub struct PropertySelector {
+    pub index: u8,
+    pub offset: u8,
+    pub length: u8,
+}
+
+

Fields

+
index: u8
+
offset: u8
+
length: u8
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter_options/struct.Select.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter_options/struct.Select.html new file mode 100644 index 000000000000..a5c4e4cdeaeb --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter_options/struct.Select.html @@ -0,0 +1,53 @@ + + + + + + +Struct Select documentation + + + + + +
+ +

Struct Select

+
pub struct Select
+{ /* private fields */ }
+
+

Implementations

+

impl Select

+ +
pub fn new(property_selector: PropertySelector, comparator: u8, value: Field) -> Self + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter_options/struct.Sort.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter_options/struct.Sort.html new file mode 100644 index 000000000000..3bfe7ba7e56d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter_options/struct.Sort.html @@ -0,0 +1,53 @@ + + + + + + +Struct Sort documentation + + + + + +
+ +

Struct Sort

+
pub struct Sort
+{ /* private fields */ }
+
+

Implementations

+

impl Sort

+ +
pub fn new(property_selector: PropertySelector, order: u8) -> Self + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter_options/struct.SortOrderEnum.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter_options/struct.SortOrderEnum.html new file mode 100644 index 000000000000..53fe31c69c26 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_getter_options/struct.SortOrderEnum.html @@ -0,0 +1,54 @@ + + + + + + +Struct SortOrderEnum documentation + + + + + +
+ +

Struct SortOrderEnum

+
pub struct SortOrderEnum {
+    pub DESC: u8,
+    pub ASC: u8,
+}
+
+

Fields

+
DESC: u8
+
ASC: u8
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_interface/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_interface/index.html new file mode 100644 index 000000000000..e68c42048035 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_interface/index.html @@ -0,0 +1,51 @@ + + + + + + +Module note_interface documentation + + + + + +
+
aztec-nr - noir_aztec::note::note_interface
+

Module note_interface

+

Traits

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_interface/trait.NoteHash.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_interface/trait.NoteHash.html new file mode 100644 index 000000000000..ece23538aa2a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_interface/trait.NoteHash.html @@ -0,0 +1,122 @@ + + + + + + +Trait NoteHash documentation + + + + + +
+ +

Trait NoteHash

+
pub trait NoteHash {
+    // Required methods
+    pub fn compute_note_hash(
+        self,
+        owner: AztecAddress,
+        storage_slot: Field,
+        randomness: Field,
+    ) -> Field;
+    pub fn compute_nullifier(
+        self,
+        context: &mut PrivateContext,
+        owner: AztecAddress,
+        note_hash_for_nullification: Field,
+    ) -> Field;
+    pub unconstrained fn compute_nullifier_unconstrained(
+        self,
+        owner: AztecAddress,
+        note_hash_for_nullification: Field,
+    ) -> Field;
+}
+ +

Required methods

+
pub fn compute_note_hash( + self, + owner: AztecAddress, + storage_slot: Field, + randomness: Field, +) -> Field + +
+

Returns the non-siloed note hash, i.e. the inner hash computed by the contract during private execution. Note +hashes are later siloed by contract address and hashed with note nonce by the kernels before being committed to +the state tree.

+

This should be a commitment to the packed note, including the storage slot (for indexing) and some random +value (to prevent brute force trial-hashing attacks).

+
+
pub fn compute_nullifier( + self, + context: &mut PrivateContext, + owner: AztecAddress, + note_hash_for_nullification: Field, +) -> Field + +
+

Returns the non-siloed nullifier (also called inner-nullifier), which will be later siloed by contract address +by the kernels before being committed to the state tree.

+

This function MUST be called with the correct note hash for consumption! It will otherwise silently fail and +compute an incorrect value. The reason why we receive this as an argument instead of computing it ourselves +directly is because the caller will typically already have computed this note hash, and we can reuse that value +to reduce the total gate count of the circuit.

+

This function receives the context since nullifier computation typically involves proving nullifying keys, and +we require the kernel's assistance to do this in order to prevent having to reveal private keys to application +circuits.

+
+
pub unconstrained fn compute_nullifier_unconstrained( + self, + owner: AztecAddress, + note_hash_for_nullification: Field, +) -> Field + +
+

Like compute_nullifier, except this variant is unconstrained: there are no guarantees on the returned value +being correct. Because of that it doesn't need to take a context (since it won't perform any kernel key +validation requests).

+
+

Implementors

+

impl NoteHash for AddressNote

+ +

impl NoteHash for FieldNote

+ +

impl NoteHash for MockNote

+ +

impl NoteHash for UintNote

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_interface/trait.NoteProperties.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_interface/trait.NoteProperties.html new file mode 100644 index 000000000000..caa5512e5803 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_interface/trait.NoteProperties.html @@ -0,0 +1,60 @@ + + + + + + +Trait NoteProperties documentation + + + + + +
+ +

Trait NoteProperties

+
pub trait NoteProperties<T> {
+    // Required methods
+    pub fn properties() -> T;
+}
+ +

Required methods

+
pub fn properties() -> T + +

Implementors

+

impl NoteProperties<AddressNoteProperties> for AddressNote

+ +

impl NoteProperties<FieldNoteProperties> for FieldNote

+ +

impl NoteProperties<UintNoteProperties> for UintNote

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_interface/trait.NoteType.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_interface/trait.NoteType.html new file mode 100644 index 000000000000..87734f9534d9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_interface/trait.NoteType.html @@ -0,0 +1,66 @@ + + + + + + +Trait NoteType documentation + + + + + +
+ +

Trait NoteType

+
pub trait NoteType {
+    // Required methods
+    pub fn get_id() -> Field;
+}
+ +

Required methods

+
pub fn get_id() -> Field + +
+

Returns the unique identifier for the note type. This is typically used when processing note logs.

+
+

Implementors

+

impl NoteType for AddressNote

+ +

impl NoteType for FieldNote

+ +

impl NoteType for MockNote

+ +

impl NoteType for UintNote

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_interface/trait.PartialNote.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_interface/trait.PartialNote.html new file mode 100644 index 000000000000..48e87bcbf686 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_interface/trait.PartialNote.html @@ -0,0 +1,54 @@ + + + + + + +Trait PartialNote documentation + + + + + +
+ +

Trait PartialNote

+
pub trait PartialNote<S, F>
+
where + S: Empty, + F: Empty
{ + // Required methods + pub fn setup_payload() -> S; + pub fn finalization_payload() -> F; +}
+ +

Required methods

+
pub fn setup_payload() -> S + +pub fn finalization_payload() -> F + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_message/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_message/index.html new file mode 100644 index 000000000000..25e36e468dd7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_message/index.html @@ -0,0 +1,52 @@ + + + + + + +Module note_message documentation + + + + + +
+
aztec-nr - noir_aztec::note::note_message
+

Module note_message

+

Structs

    +
  • Same as NoteMessage, except this type also handles the possibility where the note may not have been actually +created depending on runtime conditions (e.g. a token transfer change note is not created if there is no change). +Other than that, it and [MaybeNoteMessage::delivery] behave the exact same way as NoteMessage.
  • +
  • A message with information about a note that was created in the current contract call. This message MUST be +delivered to a recipient in order to not lose the private note information.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_message/struct.MaybeNoteMessage.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_message/struct.MaybeNoteMessage.html new file mode 100644 index 000000000000..2c014ccaf065 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_message/struct.MaybeNoteMessage.html @@ -0,0 +1,81 @@ + + + + + + +Struct MaybeNoteMessage documentation + + + + + +
+ +

Struct MaybeNoteMessage

+
pub struct MaybeNoteMessage<Note>
+{ /* private fields */ }
+
+
+

Same as NoteMessage, except this type also handles the possibility where the note may not have been actually +created depending on runtime conditions (e.g. a token transfer change note is not created if there is no change). +Other than that, it and [MaybeNoteMessage::delivery] behave the exact same way as NoteMessage.

+

Implementations

+

impl<Note> MaybeNoteMessage<Note>

+ +
pub fn new(maybe_new_note: Option<NewNote<Note>>, context: &mut PrivateContext) -> Self +
where + Note: NoteType, + Note: Packable
+ +pub fn deliver(self, delivery_mode: u8) +
where + Note: NoteType, + Note: Packable
+ +
+

Same as NoteMessage::deliver, except the message will only be delivered if it actually exists.

+

Messages delivered using crate::messages::message_delivery::MessageDeliveryEnum::CONSTRAINED_ONCHAIN will pay +proving costs regardless of whether the message exists or not.

+
pub fn deliver_to(self, recipient: AztecAddress, delivery_mode: u8) +
where + Note: NoteType, + Note: Packable
+ +
+

Same as NoteMessage::deliver_to, except the message will only be delivered if it actually exists.

+

Messages delivered using crate::messages::message_delivery::MessageDeliveryEnum::CONSTRAINED_ONCHAIN will pay +proving costs regardless of whether the message exists or not.

+
pub fn get_note(self) -> Option<Note> +
where + Note: NoteType, + Note: Packable
+ +
+

Returns the note contained in the message.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_message/struct.NoteMessage.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_message/struct.NoteMessage.html new file mode 100644 index 000000000000..4036b6603280 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_message/struct.NoteMessage.html @@ -0,0 +1,107 @@ + + + + + + +Struct NoteMessage documentation + + + + + +
+ +

Struct NoteMessage

+
pub struct NoteMessage<Note>
+{ /* private fields */ }
+
+
+

A message with information about a note that was created in the current contract call. This message MUST be +delivered to a recipient in order to not lose the private note information.

+

Use NoteMessage::deliver to select a delivery mechanism. The same message can be delivered to multiple +recipients.

+

Implementations

+

impl<Note> NoteMessage<Note>

+ +
pub fn new(new_note: NewNote<Note>, context: &mut PrivateContext) -> Self +
where + Note: NoteType, + Note: Packable
+ +pub fn deliver(self, delivery_mode: u8) +
where + Note: NoteType, + Note: Packable
+ +
+

Delivers the note message to its owner, providing them access to the private note information.

+

The message is first encrypted to the owner's public key, ensuring no other actor can read it.

+

The delivery_mode must be one of crate::messages::message_delivery::MessageDeliveryEnum, and will inform +costs (both proving time and TX fees) as well as delivery guarantees. This value must be a compile-time +constant.

+

To deliver the message to a recipient that is not the note's owner, use NoteMessage::deliver_to instead.

+

Invalid Recipients

+

If the note's owner is an invalid address, then a random public key is selected and message delivery continues +as normal. This prevents both 'king of the hill' attacks (where a sender would otherwise fail to deliver a note +to an invalid recipient) and forced privacy leaks (where an invalid recipient results in a unique transaction +fingerprint, e.g. one lacking the private logs that would correspond to message delivery).

+
pub fn deliver_to(self, recipient: AztecAddress, delivery_mode: u8) +
where + Note: NoteType, + Note: Packable
+ +
+

Same as NoteMessage::deliver, except the message gets delivered to an arbitrary recipient instead of the +note owner.

+

Note that recipient getting the message does not let them use the note, it only means that thy will know +about it, including the transaction in which it was created, and prove it exists. They will also not be able to +know when or if the note is used (i.e. nullified), assuming the standard note nullifier function.

+

Use Cases

+

This feature enables many design patterns that diverge in how notes are traditionally handled. For example, +an institutional contract may require to have some actor receive all notes created for compliance purposes. Or a +low value application like a game might deliver all notes offchain to a centralized server that then serves them +via the app, bypassing the need for contract sync and improving UX.

+
pub fn get_note(self) -> Note +
where + Note: NoteType, + Note: Packable
+ +
+

Returns the note contained in the message.

+
+
pub fn get_new_note(self) -> NewNote<Note> +
where + Note: NoteType, + Note: Packable
+ +
+

Returns the NewNote container in the message.

+

This is an advanced function, typically needed only when creating new kinds of state variables that need to +create MaybeNoteMessage values.

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_metadata/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_metadata/index.html new file mode 100644 index 000000000000..2c0262994a09 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_metadata/index.html @@ -0,0 +1,55 @@ + + + + + + +Module note_metadata documentation + + + + + +
+
aztec-nr - noir_aztec::note::note_metadata
+

Module note_metadata

+

Structs

    +
  • The metadata required to both prove a note's existence and destroy it, by computing the correct note hash for kernel +read requests, as well as the correct nullifier to avoid double-spends.
  • +
  • The metadata required to both prove a note's existence and destroy it, by computing the correct note hash for kernel +read requests, as well as the correct nullifier to avoid double-spends.
  • +
  • The metadata required to both prove a note's existence and destroy it, by computing the correct note hash for kernel +read requests, as well as the correct nullifier to avoid double-spends.
  • +
  • The metadata required to both prove a note's existence and destroy it, by computing the correct note hash for kernel +read requests, as well as the correct nullifier to avoid double-spends.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_metadata/struct.NoteMetadata.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_metadata/struct.NoteMetadata.html new file mode 100644 index 000000000000..01348c8d85f3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_metadata/struct.NoteMetadata.html @@ -0,0 +1,140 @@ + + + + + + +Struct NoteMetadata documentation + + + + + +
+ +

Struct NoteMetadata

+
pub struct NoteMetadata
+{ /* private fields */ }
+
+
+

The metadata required to both prove a note's existence and destroy it, by computing the correct note hash for kernel +read requests, as well as the correct nullifier to avoid double-spends.

+

This represents a note in any of the three valid stages (pending same phase, pending previous phase, or settled). In +order to access the underlying fields callers must first find the appropriate stage (e.g. via is_settled()) and +then convert this into the appropriate type (e.g. via to_settled()).

+
+

Implementations

+

impl NoteMetadata

+ +
pub fn from_raw_data(nonzero_note_hash_counter: bool, maybe_note_nonce: Field) -> Self + +
+

Constructs a NoteMetadata object from optional note hash counter and nonce. Both a zero note hash counter and +a zero nonce are invalid, so those are used to signal non-existent values.

+
+
pub fn is_pending_same_phase(self) -> bool + +
+

Returns true if the note is pending and from the same phase, i.e. if it's been created in the current +transaction during the current execution phase (either non-revertible or revertible).

+
+
pub fn is_pending_previous_phase(self) -> bool + +
+

Returns true if the note is pending and from the previous phase, i.e. if it's been created in the current +transaction during an execution phase prior to the current one. Because private execution only has two phases +with strict ordering, this implies that the note was created in the non-revertible phase, and that the current +phase is the revertible phase.

+
+
pub fn is_settled(self) -> bool + +
+

Returns true if the note is settled, i.e. if it's been created in a prior transaction and is therefore already +in the note hash tree.

+
+
pub fn to_pending_same_phase(self) -> PendingSamePhaseNoteMetadata + +
+

Asserts that the metadata is that of a pending note from the same phase and converts it accordingly.

+
+
pub fn to_pending_previous_phase(self) -> PendingPreviousPhaseNoteMetadata + +
+

Asserts that the metadata is that of a pending note from a previous phase and converts it accordingly.

+
+
pub fn to_settled(self) -> SettledNoteMetadata + +
+

Asserts that the metadata is that of a settled note and converts it accordingly.

+
+

Trait implementations

+

impl Deserialize for NoteMetadata

+ +
pub fn deserialize(serialized: [Field; 2]) -> Self + +

impl Eq for NoteMetadata

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl From<PendingPreviousPhaseNoteMetadata> for NoteMetadata

+ +
pub fn from(value: PendingPreviousPhaseNoteMetadata) -> Self + +

impl From<PendingSamePhaseNoteMetadata> for NoteMetadata

+ +
pub fn from(_value: PendingSamePhaseNoteMetadata) -> Self + +

impl From<SettledNoteMetadata> for NoteMetadata

+ +
pub fn from(value: SettledNoteMetadata) -> Self + +

impl Packable for NoteMetadata

+ +
pub fn pack(self) -> [Field; 2] + +pub fn unpack(packed: [Field; 2]) -> Self + +

impl Serialize for NoteMetadata

+ +
pub fn serialize(self) -> [Field; 2] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_metadata/struct.PendingPreviousPhaseNoteMetadata.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_metadata/struct.PendingPreviousPhaseNoteMetadata.html new file mode 100644 index 000000000000..badb185dcef9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_metadata/struct.PendingPreviousPhaseNoteMetadata.html @@ -0,0 +1,58 @@ + + + + + + +Struct PendingPreviousPhaseNoteMetadata documentation + + + + + +
+ +

Struct PendingPreviousPhaseNoteMetadata

+
pub struct PendingPreviousPhaseNoteMetadata
+{ /* private fields */ }
+
+
+

The metadata required to both prove a note's existence and destroy it, by computing the correct note hash for kernel +read requests, as well as the correct nullifier to avoid double-spends.

+

This represents a pending previous phase note, i.e. a note that was created in the transaction that is currently +being executed, during the previous execution phase. Because there are only two phases and their order is always the +same (first non-revertible and then revertible) this implies that the note was created in the non-revertible phase, +and that the current phase is the revertible phase.

+
+

Implementations

+

impl PendingPreviousPhaseNoteMetadata

+ +
pub fn new(note_nonce: Field) -> Self + +pub fn note_nonce(self) -> Field + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_metadata/struct.PendingSamePhaseNoteMetadata.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_metadata/struct.PendingSamePhaseNoteMetadata.html new file mode 100644 index 000000000000..97e5f183b942 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_metadata/struct.PendingSamePhaseNoteMetadata.html @@ -0,0 +1,52 @@ + + + + + + +Struct PendingSamePhaseNoteMetadata documentation + + + + + +
+ +

Struct PendingSamePhaseNoteMetadata

+
pub struct PendingSamePhaseNoteMetadata {}
+
+
+

The metadata required to both prove a note's existence and destroy it, by computing the correct note hash for kernel +read requests, as well as the correct nullifier to avoid double-spends.

+

This represents a pending same phase note, i.e. a note that was created in the transaction that is currently being +executed during the current execution phase (either non-revertible or revertible).

+
+

Implementations

+

impl PendingSamePhaseNoteMetadata

+ +
pub fn new() -> Self + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_metadata/struct.SettledNoteMetadata.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_metadata/struct.SettledNoteMetadata.html new file mode 100644 index 000000000000..48d41990c55f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_metadata/struct.SettledNoteMetadata.html @@ -0,0 +1,56 @@ + + + + + + +Struct SettledNoteMetadata documentation + + + + + +
+ +

Struct SettledNoteMetadata

+
pub struct SettledNoteMetadata
+{ /* private fields */ }
+
+
+

The metadata required to both prove a note's existence and destroy it, by computing the correct note hash for kernel +read requests, as well as the correct nullifier to avoid double-spends.

+

This represents a settled note, i.e. a note that was created in a prior transaction and is therefore already in the +note hash tree.

+
+

Implementations

+

impl SettledNoteMetadata

+ +
pub fn new(note_nonce: Field) -> Self + +pub fn note_nonce(self) -> Field + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_viewer_options/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_viewer_options/index.html new file mode 100644 index 000000000000..d632fbf161a7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_viewer_options/index.html @@ -0,0 +1,48 @@ + + + + + + +Module note_viewer_options documentation + + + + + +
+
aztec-nr - noir_aztec::note::note_viewer_options
+

Module note_viewer_options

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_viewer_options/struct.NoteViewerOptions.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_viewer_options/struct.NoteViewerOptions.html new file mode 100644 index 000000000000..3e6503c6acba --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/note_viewer_options/struct.NoteViewerOptions.html @@ -0,0 +1,94 @@ + + + + + + +Struct NoteViewerOptions documentation + + + + + +
+ +

Struct NoteViewerOptions

+
pub struct NoteViewerOptions<Note, let M: u32> {
+    pub selects: BoundedVec<Option<Select>, M>,
+    pub sorts: BoundedVec<Option<Sort>, M>,
+    pub limit: u32,
+    pub offset: u32,
+    pub owner: Option<AztecAddress>,
+    pub status: u8,
+}
+
+

Fields

+
selects: BoundedVec<Option<Select>, M>
+
sorts: BoundedVec<Option<Sort>, M>
+
limit: u32
+
offset: u32
+
+
status: u8
+

Implementations

+

impl<let M: u32, Note> NoteViewerOptions<Note, M>

+ +
pub fn new() -> Self +
where + Note: NoteType, + Note: Packable<N = M>
+ +pub fn select<T>( + &mut self, + property_selector: PropertySelector, + comparator: u8, + value: T, +) -> Self +
where + T: ToField
+ +pub fn sort(&mut self, property_selector: PropertySelector, order: u8) -> Self + +pub fn set_limit(&mut self, limit: u32) -> Self + +pub fn set_offset(&mut self, offset: u32) -> Self + +pub fn set_status(&mut self, status: u8) -> Self + +pub fn set_owner(&mut self, owner: AztecAddress) -> Self + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/retrieved_note/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/retrieved_note/index.html new file mode 100644 index 000000000000..c8304f8b8ae5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/retrieved_note/index.html @@ -0,0 +1,49 @@ + + + + + + +Module retrieved_note documentation + + + + + +
+
aztec-nr - noir_aztec::note::retrieved_note
+

Module retrieved_note

+

Structs

    +
  • A container for a note and the corresponding metadata that can be used to prove the note's existence, regardless of +whether the note is pending (created in the current transaction) or settled (created in a previous transaction).
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/retrieved_note/struct.RetrievedNote.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/retrieved_note/struct.RetrievedNote.html new file mode 100644 index 000000000000..b7533f191868 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/retrieved_note/struct.RetrievedNote.html @@ -0,0 +1,97 @@ + + + + + + +Struct RetrievedNote documentation + + + + + +
+ +

Struct RetrievedNote

+
pub struct RetrievedNote<Note> {
+    pub note: Note,
+    pub contract_address: AztecAddress,
+    pub owner: AztecAddress,
+    pub randomness: Field,
+    pub storage_slot: Field,
+    pub metadata: NoteMetadata,
+}
+
+
+

A container for a note and the corresponding metadata that can be used to prove the note's existence, regardless of +whether the note is pending (created in the current transaction) or settled (created in a previous transaction).

+
+

Fields

+
note: Note
+
contract_address: AztecAddress
+
+
randomness: Field
+
storage_slot: Field
+
metadata: NoteMetadata
+

Trait implementations

+

impl<Note> Deserialize for RetrievedNote<Note> +
where + Note: Deserialize

+ +
pub fn deserialize( + serialized: [Field; <(resolved type) as Deserialize>::N + 6], +) -> Self + +

impl<Note> Eq for RetrievedNote<Note> +
where + Note: Eq

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl<Note> Packable for RetrievedNote<Note> +
where + Note: Packable

+ +
pub fn pack(self) -> [Field; <(resolved type) as Packable>::N + 6] + +pub fn unpack(packed: [Field; <(resolved type) as Packable>::N + 6]) -> Self + +

impl<Note> Serialize for RetrievedNote<Note> +
where + Note: Serialize

+ +
pub fn serialize(self) -> [Field; <(resolved type) as Serialize>::N + 6] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/utils/fn.compute_note_hash_for_nullification.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/utils/fn.compute_note_hash_for_nullification.html new file mode 100644 index 000000000000..236a25233726 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/utils/fn.compute_note_hash_for_nullification.html @@ -0,0 +1,44 @@ + + + + + + +Function compute_note_hash_for_nullification documentation + + + + + +
+ +

Function compute_note_hash_for_nullification

+
pub fn compute_note_hash_for_nullification<Note>(
+    retrieved_note: RetrievedNote<Note>,
+) -> Field
+
where + Note: NoteHash
+ +
+

Returns the note hash that must be used to compute a note's nullifier when calling NoteHash::compute_nullifier or +NoteHash::compute_nullifier_unconstrained.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/utils/fn.compute_note_hash_for_nullification_from_note_hash_read.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/utils/fn.compute_note_hash_for_nullification_from_note_hash_read.html new file mode 100644 index 000000000000..2a50e1ea0f67 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/utils/fn.compute_note_hash_for_nullification_from_note_hash_read.html @@ -0,0 +1,44 @@ + + + + + + +Function compute_note_hash_for_nullification_from_note_hash_read documentation + + + + + +
+ +

Function compute_note_hash_for_nullification_from_note_hash_read

+
pub fn compute_note_hash_for_nullification_from_note_hash_read<Note>(
+    retrieved_note: RetrievedNote<Note>,
+    note_hash_read: NoteHashRead,
+) -> Field
+ +
+

Same as compute_note_hash_for_nullification, except it takes the note hash used in a read request (i.e. what +compute_note_hash_read would return). This is useful in scenarios where that hash has already been +computed to reduce constraints by reusing this value.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/utils/fn.compute_note_hash_read.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/utils/fn.compute_note_hash_read.html new file mode 100644 index 000000000000..2076dcab10e1 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/utils/fn.compute_note_hash_read.html @@ -0,0 +1,41 @@ + + + + + + +Function compute_note_hash_read documentation + + + + + +
+ +

Function compute_note_hash_read

+
pub fn compute_note_hash_read<Note>(retrieved_note: RetrievedNote<Note>) -> NoteHashRead
+
where + Note: NoteHash
+ +
+

Returns the note hash that must be used to issue a private kernel read request for a note.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/utils/fn.compute_siloed_note_nullifier.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/utils/fn.compute_siloed_note_nullifier.html new file mode 100644 index 000000000000..cd0bf2619e78 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/utils/fn.compute_siloed_note_nullifier.html @@ -0,0 +1,44 @@ + + + + + + +Function compute_siloed_note_nullifier documentation + + + + + +
+ +

Function compute_siloed_note_nullifier

+
pub fn compute_siloed_note_nullifier<Note>(
+    retrieved_note: RetrievedNote<Note>,
+    context: &mut PrivateContext,
+) -> Field
+
where + Note: NoteHash
+ +
+

Computes a note's siloed nullifier, i.e. the one that will be inserted into the nullifier tree.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/utils/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/utils/index.html new file mode 100644 index 000000000000..a45c0545272a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/note/utils/index.html @@ -0,0 +1,54 @@ + + + + + + +Module utils documentation + + + + + +
+ +

Module utils

+

Functions

    +
  • Returns the note hash that must be used to compute a note's nullifier when calling NoteHash::compute_nullifier or +NoteHash::compute_nullifier_unconstrained.
  • +
  • Same as compute_note_hash_for_nullification, except it takes the note hash used in a read request (i.e. what +compute_note_hash_read would return). This is useful in scenarios where that hash has already been +computed to reduce constraints by reusing this value.
  • +
  • Returns the note hash that must be used to issue a private kernel read request for a note.
  • +
  • Computes a note's siloed nullifier, i.e. the one that will be inserted into the nullifier tree.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/aes128_decrypt/fn.aes128_decrypt_oracle.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/aes128_decrypt/fn.aes128_decrypt_oracle.html new file mode 100644 index 000000000000..61c5ea25ce66 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/aes128_decrypt/fn.aes128_decrypt_oracle.html @@ -0,0 +1,46 @@ + + + + + + +Function aes128_decrypt_oracle documentation + + + + + +
+ +

Function aes128_decrypt_oracle

+
pub unconstrained fn aes128_decrypt_oracle<let N: u32>(
+    ciphertext: BoundedVec<u8, N>,
+    iv: [u8; 16],
+    sym_key: [u8; 16],
+) -> BoundedVec<u8, N>
+ +
+

Decrypts a ciphertext, using AES128.

+

Returns a BoundedVec containing the plaintext.

+

It's up to the calling function to determine whether decryption succeeded or failed. +See the tests below for an example of how.

+

Note that we accept ciphertext as a BoundedVec, not as an array. This is because this function is typically used +when processing logs and at that point we don't have a comptime information about the length of the ciphertext +as the log is not specific to any individual note.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/aes128_decrypt/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/aes128_decrypt/index.html new file mode 100644 index 000000000000..597227b1f93f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/aes128_decrypt/index.html @@ -0,0 +1,64 @@ + + + + + + +Module aes128_decrypt documentation + + + + + +
+
aztec-nr - noir_aztec::oracle::aes128_decrypt
+

Module aes128_decrypt

+
+

Oracles module

+
+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/auth_witness/fn.get_auth_witness.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/auth_witness/fn.get_auth_witness.html new file mode 100644 index 000000000000..9374e0f2a294 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/auth_witness/fn.get_auth_witness.html @@ -0,0 +1,38 @@ + + + + + + +Function get_auth_witness documentation + + + + + +
+ +

Function get_auth_witness

+
pub unconstrained fn get_auth_witness<let N: u32>(message_hash: Field) -> [Field; N]
+ +
+

Oracle wrapper to fetch an auth_witness for a given message_hash from the PXE.

+

@param message_hash The hash of the message for which the auth_witness is to be fetched. +@return The auth_witness for the given message_hash as Field array.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/auth_witness/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/auth_witness/index.html new file mode 100644 index 000000000000..57f6fd9aba4c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/auth_witness/index.html @@ -0,0 +1,61 @@ + + + + + + +Module auth_witness documentation + + + + + +
+
aztec-nr - noir_aztec::oracle::auth_witness
+

Module auth_witness

+

Functions

    +
  • Oracle wrapper to fetch an auth_witness for a given message_hash from the PXE.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/block_header/fn.get_block_header_at.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/block_header/fn.get_block_header_at.html new file mode 100644 index 000000000000..a1a1b0db34c0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/block_header/fn.get_block_header_at.html @@ -0,0 +1,33 @@ + + + + + + +Function get_block_header_at documentation + + + + + +
+ +

Function get_block_header_at

+
pub fn get_block_header_at(block_number: u32, context: PrivateContext) -> BlockHeader
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/block_header/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/block_header/index.html new file mode 100644 index 000000000000..ca4d32511d2b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/block_header/index.html @@ -0,0 +1,61 @@ + + + + + + +Module block_header documentation + + + + + +
+
aztec-nr - noir_aztec::oracle::block_header
+

Module block_header

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/call_private_function/fn.call_private_function_internal.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/call_private_function/fn.call_private_function_internal.html new file mode 100644 index 000000000000..fd24f5316d4e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/call_private_function/fn.call_private_function_internal.html @@ -0,0 +1,39 @@ + + + + + + +Function call_private_function_internal documentation + + + + + +
+ +

Function call_private_function_internal

+
pub unconstrained fn call_private_function_internal(
+    contract_address: AztecAddress,
+    function_selector: FunctionSelector,
+    args_hash: Field,
+    start_side_effect_counter: u32,
+    is_static_call: bool,
+) -> (u32, Field)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/call_private_function/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/call_private_function/index.html new file mode 100644 index 000000000000..1d9a7620e7b5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/call_private_function/index.html @@ -0,0 +1,61 @@ + + + + + + +Module call_private_function documentation + + + + + +
+
aztec-nr - noir_aztec::oracle::call_private_function
+

Module call_private_function

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/capsules/fn.copy.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/capsules/fn.copy.html new file mode 100644 index 000000000000..696fe22d8579 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/capsules/fn.copy.html @@ -0,0 +1,47 @@ + + + + + + +Function copy documentation + + + + + +
+ +

Function copy

+
pub unconstrained fn copy(
+    contract_address: AztecAddress,
+    src_slot: Field,
+    dst_slot: Field,
+    num_entries: u32,
+)
+ +
+

Copies a number of contiguous entries in the per-contract non-volatile database. This allows for efficient data +structures by avoiding repeated calls to loadCapsule and storeCapsule. +Supports overlapping source and destination regions (which will result in the overlapped source values being +overwritten). All copied slots must exist in the database (i.e. have been stored and not deleted)

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/capsules/fn.delete.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/capsules/fn.delete.html new file mode 100644 index 000000000000..21db0b8172ba --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/capsules/fn.delete.html @@ -0,0 +1,39 @@ + + + + + + +Function delete documentation + + + + + +
+ +

Function delete

+
pub unconstrained fn delete(contract_address: AztecAddress, slot: Field)
+ +
+

Deletes data in the per-contract non-volatile database. Does nothing if no data was present.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/capsules/fn.load.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/capsules/fn.load.html new file mode 100644 index 000000000000..7b2bda53bc7d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/capsules/fn.load.html @@ -0,0 +1,42 @@ + + + + + + +Function load documentation + + + + + +
+ +

Function load

+
pub unconstrained fn load<T>(contract_address: AztecAddress, slot: Field) -> Option<T>
+
where + T: Deserialize
+ +
+

Returns data previously stored via storeCapsule in the per-contract non-volatile database. Returns Option::none() if +nothing was stored at the given slot.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/capsules/fn.store.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/capsules/fn.store.html new file mode 100644 index 000000000000..2cc0b6a12607 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/capsules/fn.store.html @@ -0,0 +1,42 @@ + + + + + + +Function store documentation + + + + + +
+ +

Function store

+
pub unconstrained fn store<T>(contract_address: AztecAddress, slot: Field, value: T)
+
where + T: Serialize
+ +
+

Stores arbitrary information in a per-contract non-volatile database, which can later be retrieved with load. If +data was already stored at this slot, it is overwritten.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/capsules/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/capsules/index.html new file mode 100644 index 000000000000..039e1b7cede2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/capsules/index.html @@ -0,0 +1,69 @@ + + + + + + +Module capsules documentation + + + + + +
+ +

Module capsules

+

Functions

    +
  • Copies a number of contiguous entries in the per-contract non-volatile database. This allows for efficient data +structures by avoiding repeated calls to loadCapsule and storeCapsule. +Supports overlapping source and destination regions (which will result in the overlapped source values being +overwritten). All copied slots must exist in the database (i.e. have been stored and not deleted)
  • +
  • Deletes data in the per-contract non-volatile database. Does nothing if no data was present.
  • +
  • Returns data previously stored via storeCapsule in the per-contract non-volatile database. Returns Option::none() if +nothing was stored at the given slot.
  • +
  • Stores arbitrary information in a per-contract non-volatile database, which can later be retrieved with load. If +data was already stored at this slot, it is overwritten.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/enqueue_public_function_call/fn.is_side_effect_counter_revertible_oracle_wrapper.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/enqueue_public_function_call/fn.is_side_effect_counter_revertible_oracle_wrapper.html new file mode 100644 index 000000000000..a65f6528cfff --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/enqueue_public_function_call/fn.is_side_effect_counter_revertible_oracle_wrapper.html @@ -0,0 +1,39 @@ + + + + + + +Function is_side_effect_counter_revertible_oracle_wrapper documentation + + + + + +
+ +

Function is_side_effect_counter_revertible_oracle_wrapper

+
pub unconstrained fn is_side_effect_counter_revertible_oracle_wrapper(
+    counter: u32,
+) -> bool
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/enqueue_public_function_call/fn.notify_enqueued_public_function_call.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/enqueue_public_function_call/fn.notify_enqueued_public_function_call.html new file mode 100644 index 000000000000..8e1ed041a755 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/enqueue_public_function_call/fn.notify_enqueued_public_function_call.html @@ -0,0 +1,42 @@ + + + + + + +Function notify_enqueued_public_function_call documentation + + + + + +
+ +

Function notify_enqueued_public_function_call

+
pub fn notify_enqueued_public_function_call(
+    contract_address: AztecAddress,
+    calldata_hash: Field,
+    side_effect_counter: u32,
+    is_static_call: bool,
+)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/enqueue_public_function_call/fn.notify_set_min_revertible_side_effect_counter.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/enqueue_public_function_call/fn.notify_set_min_revertible_side_effect_counter.html new file mode 100644 index 000000000000..9e8bc9baaa15 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/enqueue_public_function_call/fn.notify_set_min_revertible_side_effect_counter.html @@ -0,0 +1,37 @@ + + + + + + +Function notify_set_min_revertible_side_effect_counter documentation + + + + + +
+ +

Function notify_set_min_revertible_side_effect_counter

+
pub fn notify_set_min_revertible_side_effect_counter(counter: u32)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/enqueue_public_function_call/fn.notify_set_min_revertible_side_effect_counter_oracle_wrapper.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/enqueue_public_function_call/fn.notify_set_min_revertible_side_effect_counter_oracle_wrapper.html new file mode 100644 index 000000000000..1fa417187ac9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/enqueue_public_function_call/fn.notify_set_min_revertible_side_effect_counter_oracle_wrapper.html @@ -0,0 +1,39 @@ + + + + + + +Function notify_set_min_revertible_side_effect_counter_oracle_wrapper documentation + + + + + +
+ +

Function notify_set_min_revertible_side_effect_counter_oracle_wrapper

+
pub unconstrained fn notify_set_min_revertible_side_effect_counter_oracle_wrapper(
+    counter: u32,
+)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/enqueue_public_function_call/fn.notify_set_public_teardown_function_call.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/enqueue_public_function_call/fn.notify_set_public_teardown_function_call.html new file mode 100644 index 000000000000..26c4a4579ade --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/enqueue_public_function_call/fn.notify_set_public_teardown_function_call.html @@ -0,0 +1,42 @@ + + + + + + +Function notify_set_public_teardown_function_call documentation + + + + + +
+ +

Function notify_set_public_teardown_function_call

+
pub fn notify_set_public_teardown_function_call(
+    contract_address: AztecAddress,
+    calldata_hash: Field,
+    side_effect_counter: u32,
+    is_static_call: bool,
+)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/enqueue_public_function_call/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/enqueue_public_function_call/index.html new file mode 100644 index 000000000000..4b98c7553928 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/enqueue_public_function_call/index.html @@ -0,0 +1,65 @@ + + + + + + +Module enqueue_public_function_call documentation + + + + + +
+
aztec-nr - noir_aztec::oracle::enqueue_public_function_call
+

Module enqueue_public_function_call

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/execution/fn.get_utility_context.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/execution/fn.get_utility_context.html new file mode 100644 index 000000000000..da03ebe29c55 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/execution/fn.get_utility_context.html @@ -0,0 +1,37 @@ + + + + + + +Function get_utility_context documentation + + + + + +
+ +

Function get_utility_context

+
pub unconstrained fn get_utility_context() -> UtilityContext
+ +
+

Returns a utility context built from the global variables of anchor block and the contract address of the function +being executed.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/execution/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/execution/index.html new file mode 100644 index 000000000000..7109f93f0d8b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/execution/index.html @@ -0,0 +1,62 @@ + + + + + + +Module execution documentation + + + + + +
+
aztec-nr - noir_aztec::oracle::execution
+

Module execution

+

Functions

    +
  • Returns a utility context built from the global variables of anchor block and the contract address of the function +being executed.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/execution_cache/fn.load.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/execution_cache/fn.load.html new file mode 100644 index 000000000000..1b95fc3d8a2c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/execution_cache/fn.load.html @@ -0,0 +1,34 @@ + + + + + + +Function load documentation + + + + + +
+ +

Function load

+
pub unconstrained fn load<let N: u32>(hash: Field) -> [Field; N]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/execution_cache/fn.store.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/execution_cache/fn.store.html new file mode 100644 index 000000000000..79db46db01f8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/execution_cache/fn.store.html @@ -0,0 +1,37 @@ + + + + + + +Function store documentation + + + + + +
+ +

Function store

+
pub fn store<let N: u32>(values: [Field; N], hash: Field)
+ +
+

Stores values represented as slice in execution cache to be later obtained by its hash.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/execution_cache/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/execution_cache/index.html new file mode 100644 index 000000000000..eb9c0ff20380 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/execution_cache/index.html @@ -0,0 +1,62 @@ + + + + + + +Module execution_cache documentation + + + + + +
+
aztec-nr - noir_aztec::oracle::execution_cache
+

Module execution_cache

+

Functions

    +
  • +
  • Stores values represented as slice in execution cache to be later obtained by its hash.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_contract_instance/fn.get_contract_instance.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_contract_instance/fn.get_contract_instance.html new file mode 100644 index 000000000000..9ad48ce8a30c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_contract_instance/fn.get_contract_instance.html @@ -0,0 +1,36 @@ + + + + + + +Function get_contract_instance documentation + + + + + +
+ +

Function get_contract_instance

+
pub fn get_contract_instance(address: AztecAddress) -> ContractInstance
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_contract_instance/fn.get_contract_instance_class_id_avm.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_contract_instance/fn.get_contract_instance_class_id_avm.html new file mode 100644 index 000000000000..2e4b5d5f2511 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_contract_instance/fn.get_contract_instance_class_id_avm.html @@ -0,0 +1,38 @@ + + + + + + +Function get_contract_instance_class_id_avm documentation + + + + + +
+ +

Function get_contract_instance_class_id_avm

+
pub fn get_contract_instance_class_id_avm(
+    address: AztecAddress,
+) -> Option<ContractClassId>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_contract_instance/fn.get_contract_instance_deployer_avm.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_contract_instance/fn.get_contract_instance_deployer_avm.html new file mode 100644 index 000000000000..0fdc955ea3be --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_contract_instance/fn.get_contract_instance_deployer_avm.html @@ -0,0 +1,36 @@ + + + + + + +Function get_contract_instance_deployer_avm documentation + + + + + +
+ +

Function get_contract_instance_deployer_avm

+
pub fn get_contract_instance_deployer_avm(address: AztecAddress) -> Option<AztecAddress>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_contract_instance/fn.get_contract_instance_initialization_hash_avm.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_contract_instance/fn.get_contract_instance_initialization_hash_avm.html new file mode 100644 index 000000000000..7e647b0fa7be --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_contract_instance/fn.get_contract_instance_initialization_hash_avm.html @@ -0,0 +1,38 @@ + + + + + + +Function get_contract_instance_initialization_hash_avm documentation + + + + + +
+ +

Function get_contract_instance_initialization_hash_avm

+
pub fn get_contract_instance_initialization_hash_avm(
+    address: AztecAddress,
+) -> Option<Field>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_contract_instance/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_contract_instance/index.html new file mode 100644 index 000000000000..69e87871f0db --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_contract_instance/index.html @@ -0,0 +1,64 @@ + + + + + + +Module get_contract_instance documentation + + + + + +
+
aztec-nr - noir_aztec::oracle::get_contract_instance
+

Module get_contract_instance

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_l1_to_l2_membership_witness/fn.get_l1_to_l2_membership_witness.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_l1_to_l2_membership_witness/fn.get_l1_to_l2_membership_witness.html new file mode 100644 index 000000000000..b9bd7cfd3fae --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_l1_to_l2_membership_witness/fn.get_l1_to_l2_membership_witness.html @@ -0,0 +1,41 @@ + + + + + + +Function get_l1_to_l2_membership_witness documentation + + + + + +
+ +

Function get_l1_to_l2_membership_witness

+
pub unconstrained fn get_l1_to_l2_membership_witness(
+    contract_address: AztecAddress,
+    message_hash: Field,
+    secret: Field,
+) -> (Field, [Field; 36])
+ +
+

Returns the leaf index and sibling path of an entry in the L1 to L2 messaging tree, which can then be used to prove +its existence.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_l1_to_l2_membership_witness/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_l1_to_l2_membership_witness/index.html new file mode 100644 index 000000000000..5ed53411bbc6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_l1_to_l2_membership_witness/index.html @@ -0,0 +1,62 @@ + + + + + + +Module get_l1_to_l2_membership_witness documentation + + + + + +
+
aztec-nr - noir_aztec::oracle::get_l1_to_l2_membership_witness
+

Module get_l1_to_l2_membership_witness

+

Functions

    +
  • Returns the leaf index and sibling path of an entry in the L1 to L2 messaging tree, which can then be used to prove +its existence.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_membership_witness/fn.get_archive_membership_witness.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_membership_witness/fn.get_archive_membership_witness.html new file mode 100644 index 000000000000..04d72f2bb766 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_membership_witness/fn.get_archive_membership_witness.html @@ -0,0 +1,40 @@ + + + + + + +Function get_archive_membership_witness documentation + + + + + +
+ +

Function get_archive_membership_witness

+
pub unconstrained fn get_archive_membership_witness(
+    block_number: u32,
+    leaf_value: Field,
+) -> MembershipWitness<30, 31>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_membership_witness/fn.get_note_hash_membership_witness.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_membership_witness/fn.get_note_hash_membership_witness.html new file mode 100644 index 000000000000..31b3e122936f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_membership_witness/fn.get_note_hash_membership_witness.html @@ -0,0 +1,40 @@ + + + + + + +Function get_note_hash_membership_witness documentation + + + + + +
+ +

Function get_note_hash_membership_witness

+
pub unconstrained fn get_note_hash_membership_witness(
+    block_number: u32,
+    leaf_value: Field,
+) -> MembershipWitness<42, 43>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_membership_witness/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_membership_witness/index.html new file mode 100644 index 000000000000..f8d80c9cf4af --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_membership_witness/index.html @@ -0,0 +1,66 @@ + + + + + + +Module get_membership_witness documentation + + + + + +
+
aztec-nr - noir_aztec::oracle::get_membership_witness
+

Module get_membership_witness

+

Structs

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_membership_witness/struct.MembershipWitness.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_membership_witness/struct.MembershipWitness.html new file mode 100644 index 000000000000..0400e05d89c3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_membership_witness/struct.MembershipWitness.html @@ -0,0 +1,68 @@ + + + + + + +Struct MembershipWitness documentation + + + + + +
+ +

Struct MembershipWitness

+
pub struct MembershipWitness<let N: u32, let M: u32> {
+    pub index: Field,
+    pub path: [Field; N],
+}
+
+

Fields

+
index: Field
+
path: [Field; N]
+

Trait implementations

+

impl<let M: u32, let N: u32> Deserialize for MembershipWitness<N, M>

+ +
pub fn deserialize(serialized: [Field; N + 1]) -> Self + +

impl<let M: u32, let N: u32> Eq for MembershipWitness<N, M>

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl<let M: u32, let N: u32> Serialize for MembershipWitness<N, M>

+ +
pub fn serialize(self) -> [Field; N + 1] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_nullifier_membership_witness/fn.get_low_nullifier_membership_witness.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_nullifier_membership_witness/fn.get_low_nullifier_membership_witness.html new file mode 100644 index 000000000000..fdee9124a82a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_nullifier_membership_witness/fn.get_low_nullifier_membership_witness.html @@ -0,0 +1,40 @@ + + + + + + +Function get_low_nullifier_membership_witness documentation + + + + + +
+ +

Function get_low_nullifier_membership_witness

+
pub unconstrained fn get_low_nullifier_membership_witness(
+    block_number: u32,
+    nullifier: Field,
+) -> NullifierMembershipWitness
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_nullifier_membership_witness/fn.get_nullifier_membership_witness.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_nullifier_membership_witness/fn.get_nullifier_membership_witness.html new file mode 100644 index 000000000000..dbc3815d77c7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_nullifier_membership_witness/fn.get_nullifier_membership_witness.html @@ -0,0 +1,40 @@ + + + + + + +Function get_nullifier_membership_witness documentation + + + + + +
+ +

Function get_nullifier_membership_witness

+
pub unconstrained fn get_nullifier_membership_witness(
+    block_number: u32,
+    nullifier: Field,
+) -> NullifierMembershipWitness
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_nullifier_membership_witness/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_nullifier_membership_witness/index.html new file mode 100644 index 000000000000..c86c361ecff7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_nullifier_membership_witness/index.html @@ -0,0 +1,66 @@ + + + + + + +Module get_nullifier_membership_witness documentation + + + + + +
+
aztec-nr - noir_aztec::oracle::get_nullifier_membership_witness
+

Module get_nullifier_membership_witness

+

Structs

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_nullifier_membership_witness/struct.NullifierMembershipWitness.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_nullifier_membership_witness/struct.NullifierMembershipWitness.html new file mode 100644 index 000000000000..63f2d7a1fced --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_nullifier_membership_witness/struct.NullifierMembershipWitness.html @@ -0,0 +1,71 @@ + + + + + + +Struct NullifierMembershipWitness documentation + + + + + +
+ +

Struct NullifierMembershipWitness

+
pub struct NullifierMembershipWitness {
+    pub index: Field,
+    pub leaf_preimage: NullifierLeafPreimage,
+    pub path: [Field; 42],
+}
+
+

Fields

+
index: Field
+
leaf_preimage: NullifierLeafPreimage
+
path: [Field; 42]
+

Trait implementations

+

impl Deserialize for NullifierMembershipWitness

+ +
pub fn deserialize(serialized: [Field; 46]) -> Self + +

impl Eq for NullifierMembershipWitness

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for NullifierMembershipWitness

+ +
pub fn serialize(self) -> [Field; 46] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_public_data_witness/fn.get_public_data_witness.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_public_data_witness/fn.get_public_data_witness.html new file mode 100644 index 000000000000..363e3e9ea03a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_public_data_witness/fn.get_public_data_witness.html @@ -0,0 +1,39 @@ + + + + + + +Function get_public_data_witness documentation + + + + + +
+ +

Function get_public_data_witness

+
pub unconstrained fn get_public_data_witness(
+    block_number: u32,
+    public_data_tree_index: Field,
+) -> PublicDataWitness
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_public_data_witness/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_public_data_witness/index.html new file mode 100644 index 000000000000..21f3d7e6cff9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_public_data_witness/index.html @@ -0,0 +1,65 @@ + + + + + + +Module get_public_data_witness documentation + + + + + +
+
aztec-nr - noir_aztec::oracle::get_public_data_witness
+

Module get_public_data_witness

+

Structs

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_public_data_witness/struct.PublicDataWitness.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_public_data_witness/struct.PublicDataWitness.html new file mode 100644 index 000000000000..d10764264af8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/get_public_data_witness/struct.PublicDataWitness.html @@ -0,0 +1,70 @@ + + + + + + +Struct PublicDataWitness documentation + + + + + +
+ +

Struct PublicDataWitness

+
pub struct PublicDataWitness {
+    pub index: Field,
+    pub leaf_preimage: PublicDataTreeLeafPreimage,
+    pub path: [Field; 40],
+}
+
+

Fields

+
index: Field
+
+
path: [Field; 40]
+

Trait implementations

+

impl Deserialize for PublicDataWitness

+ +
pub fn deserialize(serialized: [Field; 45]) -> Self + +

impl Eq for PublicDataWitness

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for PublicDataWitness

+ +
pub fn serialize(self) -> [Field; 45] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/index.html new file mode 100644 index 000000000000..2571b183328f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/index.html @@ -0,0 +1,79 @@ + + + + + + +Module oracle documentation + + + + + +
+ +

Module oracle

+

Re-exports

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/key_validation_request/fn.get_key_validation_request.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/key_validation_request/fn.get_key_validation_request.html new file mode 100644 index 000000000000..f3049cf7d29d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/key_validation_request/fn.get_key_validation_request.html @@ -0,0 +1,36 @@ + + + + + + +Function get_key_validation_request documentation + + + + + +
+ +

Function get_key_validation_request

+
pub unconstrained fn get_key_validation_request(
+    pk_m_hash: Field,
+    key_index: Field,
+) -> KeyValidationRequest
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/key_validation_request/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/key_validation_request/index.html new file mode 100644 index 000000000000..74cf93d88d44 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/key_validation_request/index.html @@ -0,0 +1,61 @@ + + + + + + +Module key_validation_request documentation + + + + + +
+
aztec-nr - noir_aztec::oracle::key_validation_request
+

Module key_validation_request

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/keys/fn.get_public_keys_and_partial_address.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/keys/fn.get_public_keys_and_partial_address.html new file mode 100644 index 000000000000..98ee20dc7530 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/keys/fn.get_public_keys_and_partial_address.html @@ -0,0 +1,35 @@ + + + + + + +Function get_public_keys_and_partial_address documentation + + + + + +
+ +

Function get_public_keys_and_partial_address

+
pub unconstrained fn get_public_keys_and_partial_address(
+    address: AztecAddress,
+) -> (PublicKeys, PartialAddress)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/keys/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/keys/index.html new file mode 100644 index 000000000000..efc15d8317d5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/keys/index.html @@ -0,0 +1,61 @@ + + + + + + +Module keys documentation + + + + + +
+ +

Module keys

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/logs/fn.notify_created_contract_class_log.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/logs/fn.notify_created_contract_class_log.html new file mode 100644 index 000000000000..2bc401a19b2b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/logs/fn.notify_created_contract_class_log.html @@ -0,0 +1,41 @@ + + + + + + +Function notify_created_contract_class_log documentation + + + + + +
+ +

Function notify_created_contract_class_log

+
pub unconstrained fn notify_created_contract_class_log<let N: u32>(
+    contract_address: AztecAddress,
+    message: [Field; N],
+    length: u32,
+    counter: u32,
+)
+ +
+

The below only exists to broadcast the raw log, so we can provide it to the base rollup later to be constrained.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/logs/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/logs/index.html new file mode 100644 index 000000000000..3a743047b88a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/logs/index.html @@ -0,0 +1,61 @@ + + + + + + +Module logs documentation + + + + + +
+ +

Module logs

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/message_processing/fn.fetch_tagged_logs.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/message_processing/fn.fetch_tagged_logs.html new file mode 100644 index 000000000000..c9450659ceb0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/message_processing/fn.fetch_tagged_logs.html @@ -0,0 +1,37 @@ + + + + + + +Function fetch_tagged_logs documentation + + + + + +
+ +

Function fetch_tagged_logs

+
pub unconstrained fn fetch_tagged_logs(pending_tagged_log_array_base_slot: Field)
+ +
+

Finds new private logs that may have been sent to all registered accounts in PXE in the current contract and makes +them available for later processing in Noir by storing them in a capsule array.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/message_processing/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/message_processing/index.html new file mode 100644 index 000000000000..69a2da2c5b9a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/message_processing/index.html @@ -0,0 +1,62 @@ + + + + + + +Module message_processing documentation + + + + + +
+
aztec-nr - noir_aztec::oracle::message_processing
+

Module message_processing

+

Functions

    +
  • Finds new private logs that may have been sent to all registered accounts in PXE in the current contract and makes +them available for later processing in Noir by storing them in a capsule array.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/notes/fn.check_nullifier_exists.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/notes/fn.check_nullifier_exists.html new file mode 100644 index 000000000000..a1d6d706a183 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/notes/fn.check_nullifier_exists.html @@ -0,0 +1,46 @@ + + + + + + +Function check_nullifier_exists documentation + + + + + +
+ +

Function check_nullifier_exists

+
pub unconstrained fn check_nullifier_exists(inner_nullifier: Field) -> bool
+ +
+

Returns true if the nullifier exists. Note that a true value can be constrained by proving existence of the +nullifier, but a false value should not be relied upon since other transactions may emit this nullifier before the +current transaction is included in a block. While this might seem of little use at first, certain design patterns +benefit from this abstraction (see e.g. PrivateMutable).

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/notes/fn.get_next_app_tag_as_sender.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/notes/fn.get_next_app_tag_as_sender.html new file mode 100644 index 000000000000..2ac3e7efad9b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/notes/fn.get_next_app_tag_as_sender.html @@ -0,0 +1,51 @@ + + + + + + +Function get_next_app_tag_as_sender documentation + + + + + +
+ +

Function get_next_app_tag_as_sender

+
pub unconstrained fn get_next_app_tag_as_sender(
+    sender: AztecAddress,
+    recipient: AztecAddress,
+) -> Field
+ +
+

Returns the next app tag for a given sender and recipient pair.

+

This also notifies the simulator that a tag has been used in a note, and to therefore increment the +associated index so that future notes get a different tag and can be discovered by the recipient. +This change should only be persisted in a non-volatile database if the tagged log is found in an actual block - +otherwise e.g. a reverting transaction can cause the sender to accidentally skip indices and later produce notes +that are not found by the recipient.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/notes/fn.get_notes.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/notes/fn.get_notes.html new file mode 100644 index 000000000000..cd21ef2713e5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/notes/fn.get_notes.html @@ -0,0 +1,59 @@ + + + + + + +Function get_notes documentation + + + + + +
+ +

Function get_notes

+
pub unconstrained fn get_notes<Note, let M: u32, let MaxNotes: u32>(
+    owner: Option<AztecAddress>,
+    storage_slot: Field,
+    num_selects: u8,
+    select_by_indexes: [u8; M],
+    select_by_offsets: [u8; M],
+    select_by_lengths: [u8; M],
+    select_values: [Field; M],
+    select_comparators: [u8; M],
+    sort_by_indexes: [u8; M],
+    sort_by_offsets: [u8; M],
+    sort_by_lengths: [u8; M],
+    sort_order: [u8; M],
+    limit: u32,
+    offset: u32,
+    status: u8,
+) -> [Option<RetrievedNote<Note>>; MaxNotes]
+
where + Note: NoteType, + Note: Packable
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/notes/fn.get_sender_for_tags.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/notes/fn.get_sender_for_tags.html new file mode 100644 index 000000000000..f3e4a7746622 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/notes/fn.get_sender_for_tags.html @@ -0,0 +1,48 @@ + + + + + + +Function get_sender_for_tags documentation + + + + + +
+ +

Function get_sender_for_tags

+
pub unconstrained fn get_sender_for_tags() -> Option<AztecAddress>
+ +
+

Gets the sender for tags.

+

This unconstrained value is used as the sender when computing an unconstrained shared secret +for a tag in order to emit a log. Constrained tagging should not use this as there is no +guarantee that the recipient knows about the sender, and hence about the shared secret.

+

The value persists through nested calls, meaning all calls down the stack will use the same +'senderForTags' value (unless it is replaced).

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/notes/fn.notify_created_note.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/notes/fn.notify_created_note.html new file mode 100644 index 000000000000..b811f1257361 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/notes/fn.notify_created_note.html @@ -0,0 +1,52 @@ + + + + + + +Function notify_created_note documentation + + + + + +
+ +

Function notify_created_note

+
pub fn notify_created_note<let N: u32>(
+    owner: AztecAddress,
+    storage_slot: Field,
+    randomness: Field,
+    note_type_id: Field,
+    packed_note: [Field; N],
+    note_hash: Field,
+    counter: u32,
+)
+ +
+

Notifies the simulator that a note has been created, so that it can be returned in future read requests in the same +transaction. This note should only be added to the non-volatile database if found in an actual block.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/notes/fn.notify_created_nullifier.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/notes/fn.notify_created_nullifier.html new file mode 100644 index 000000000000..623879e4a669 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/notes/fn.notify_created_nullifier.html @@ -0,0 +1,43 @@ + + + + + + +Function notify_created_nullifier documentation + + + + + +
+ +

Function notify_created_nullifier

+
pub fn notify_created_nullifier(nullifier: Field)
+ +
+

Notifies the simulator that a non-note nullifier has been created, so that it can be used for note nonces.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/notes/fn.notify_nullified_note.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/notes/fn.notify_nullified_note.html new file mode 100644 index 000000000000..028f193d0589 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/notes/fn.notify_nullified_note.html @@ -0,0 +1,45 @@ + + + + + + +Function notify_nullified_note documentation + + + + + +
+ +

Function notify_nullified_note

+
pub fn notify_nullified_note(nullifier: Field, note_hash: Field, counter: u32)
+ +
+

Notifies the simulator that a note has been nullified, so that it is no longer returned in future read requests in +the same transaction. This note should only be removed to the non-volatile database if its nullifier is found in an +actual block.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/notes/fn.set_sender_for_tags.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/notes/fn.set_sender_for_tags.html new file mode 100644 index 000000000000..64fe9b0f83f3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/notes/fn.set_sender_for_tags.html @@ -0,0 +1,49 @@ + + + + + + +Function set_sender_for_tags documentation + + + + + +
+ +

Function set_sender_for_tags

+
pub unconstrained fn set_sender_for_tags(sender_for_tags: AztecAddress)
+ +
+

Sets the sender for tags.

+

This unconstrained value is used as the sender when computing an unconstrained shared secret +for a tag in order to emit a log. Constrained tagging should not use this as there is no +guarantee that the recipient knows about the sender, and hence about the shared secret.

+

Account contracts typically set this value before calling other contracts. The value persists +through nested calls, meaning all calls down the stack will use the same 'senderForTags' +value (unless it is replaced by another call to this setter).

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/notes/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/notes/index.html new file mode 100644 index 000000000000..732e9e401658 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/notes/index.html @@ -0,0 +1,74 @@ + + + + + + +Module notes documentation + + + + + +
+ +

Module notes

+

Functions

    +
  • Returns true if the nullifier exists. Note that a true value can be constrained by proving existence of the +nullifier, but a false value should not be relied upon since other transactions may emit this nullifier before the +current transaction is included in a block. While this might seem of little use at first, certain design patterns +benefit from this abstraction (see e.g. PrivateMutable).
  • +
  • Returns the next app tag for a given sender and recipient pair.
  • +
  • +
  • Gets the sender for tags.
  • +
  • Notifies the simulator that a note has been created, so that it can be returned in future read requests in the same +transaction. This note should only be added to the non-volatile database if found in an actual block.
  • +
  • Notifies the simulator that a non-note nullifier has been created, so that it can be used for note nonces.
  • +
  • Notifies the simulator that a note has been nullified, so that it is no longer returned in future read requests in +the same transaction. This note should only be removed to the non-volatile database if its nullifier is found in an +actual block.
  • +
  • Sets the sender for tags.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/offchain_effect/fn.emit_offchain_effect.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/offchain_effect/fn.emit_offchain_effect.html new file mode 100644 index 000000000000..e60698fb14a7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/offchain_effect/fn.emit_offchain_effect.html @@ -0,0 +1,43 @@ + + + + + + +Function emit_offchain_effect documentation + + + + + +
+ +

Function emit_offchain_effect

+
pub unconstrained fn emit_offchain_effect<T>(data: T)
+
where + T: Serialize
+ +
+

Emits data that will be delivered to PXE unaltered. This data can be interpreted freely by a +downstream consumer (such as a wallet).

+

Arguments

+
    +
  • data - The data to emit.
  • +
+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/offchain_effect/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/offchain_effect/index.html new file mode 100644 index 000000000000..2a07d248d8ca --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/offchain_effect/index.html @@ -0,0 +1,62 @@ + + + + + + +Module offchain_effect documentation + + + + + +
+
aztec-nr - noir_aztec::oracle::offchain_effect
+

Module offchain_effect

+

Functions

    +
  • Emits data that will be delivered to PXE unaltered. This data can be interpreted freely by a +downstream consumer (such as a wallet).
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/random/fn.random.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/random/fn.random.html new file mode 100644 index 000000000000..a23236cfabe5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/random/fn.random.html @@ -0,0 +1,39 @@ + + + + + + +Function random documentation + + + + + +
+ +

Function random

+
pub unconstrained fn random() -> Field
+ +
+

Returns an unconstrained random value. Note that it is not possible to constrain this value to prove that it is +truly random: we assume that the oracle is cooperating and returning random values. +In some applications this behavior might not be acceptable and other techniques might be more suitable, such as +producing pseudo-random values by hashing values outside of user control (like block hashes) or secrets.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/random/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/random/index.html new file mode 100644 index 000000000000..0c695cd578c9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/random/index.html @@ -0,0 +1,64 @@ + + + + + + +Module random documentation + + + + + +
+ +

Module random

+

Functions

    +
  • Returns an unconstrained random value. Note that it is not possible to constrain this value to prove that it is +truly random: we assume that the oracle is cooperating and returning random values. +In some applications this behavior might not be acceptable and other techniques might be more suitable, such as +producing pseudo-random values by hashing values outside of user control (like block hashes) or secrets.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/shared_secret/fn.get_shared_secret.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/shared_secret/fn.get_shared_secret.html new file mode 100644 index 000000000000..c1a3aab0c69b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/shared_secret/fn.get_shared_secret.html @@ -0,0 +1,46 @@ + + + + + + +Function get_shared_secret documentation + + + + + +
+ +

Function get_shared_secret

+
pub unconstrained fn get_shared_secret(
+    address: AztecAddress,
+    ephPk: EmbeddedCurvePoint,
+) -> EmbeddedCurvePoint
+ +
+

Returns an app-siloed shared secret between address and someone who knows the secret key behind an +ephemeral public key ephPk. The app-siloing means that contracts cannot retrieve secrets that belong to +other contracts, and therefore cannot e.g. decrypt their messages. This is an important security consideration +given that both the address and ephPk are public information.

+

The shared secret S is computed as: +let S = (ivsk + h) * ephPk +where ivsk + h is the 'preaddress' i.e. the preimage of the address, also called the address secret. +TODO(#12656): app-silo this secret

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/shared_secret/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/shared_secret/index.html new file mode 100644 index 000000000000..3de7b8dc7a1c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/shared_secret/index.html @@ -0,0 +1,64 @@ + + + + + + +Module shared_secret documentation + + + + + +
+
aztec-nr - noir_aztec::oracle::shared_secret
+

Module shared_secret

+

Functions

    +
  • Returns an app-siloed shared secret between address and someone who knows the secret key behind an +ephemeral public key ephPk. The app-siloing means that contracts cannot retrieve secrets that belong to +other contracts, and therefore cannot e.g. decrypt their messages. This is an important security consideration +given that both the address and ephPk are public information.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/storage/fn.raw_storage_read.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/storage/fn.raw_storage_read.html new file mode 100644 index 000000000000..8e597b88f49f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/storage/fn.raw_storage_read.html @@ -0,0 +1,38 @@ + + + + + + +Function raw_storage_read documentation + + + + + +
+ +

Function raw_storage_read

+
pub unconstrained fn raw_storage_read<let N: u32>(
+    address: AztecAddress,
+    storage_slot: Field,
+    block_number: u32,
+) -> [Field; N]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/storage/fn.storage_read.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/storage/fn.storage_read.html new file mode 100644 index 000000000000..2d0289e55925 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/storage/fn.storage_read.html @@ -0,0 +1,40 @@ + + + + + + +Function storage_read documentation + + + + + +
+ +

Function storage_read

+
pub unconstrained fn storage_read<T>(
+    address: AztecAddress,
+    storage_slot: Field,
+    block_number: u32,
+) -> T
+
where + T: Packable
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/storage/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/storage/index.html new file mode 100644 index 000000000000..2a336db5ccba --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/storage/index.html @@ -0,0 +1,62 @@ + + + + + + +Module storage documentation + + + + + +
+ +

Module storage

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/version/fn.assert_compatible_oracle_version.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/version/fn.assert_compatible_oracle_version.html new file mode 100644 index 000000000000..3d876b31890c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/version/fn.assert_compatible_oracle_version.html @@ -0,0 +1,39 @@ + + + + + + +Function assert_compatible_oracle_version documentation + + + + + +
+ +

Function assert_compatible_oracle_version

+
pub fn assert_compatible_oracle_version()
+ +
+

Asserts that the version of the oracle is compatible with the version expected by the contract.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/version/global.ORACLE_VERSION.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/version/global.ORACLE_VERSION.html new file mode 100644 index 000000000000..c67de762ad9f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/version/global.ORACLE_VERSION.html @@ -0,0 +1,43 @@ + + + + + + +Global ORACLE_VERSION documentation + + + + + +
+ +

Global ORACLE_VERSION

+
pub global ORACLE_VERSION: Field;
+ +
+

The ORACLE_VERSION constant is used to check that the oracle interface is in sync between PXE and Aztec.nr. We need +to version the oracle interface to ensure that developers get a reasonable error message if they use incompatible +versions of Aztec.nr and PXE. The TypeScript counterpart is in oracle_version.ts.

+

@dev Whenever a contract function or Noir test is run, the utilityAssertCompatibleOracleVersion oracle is called and +if the oracle version is incompatible an error is thrown.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/version/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/version/index.html new file mode 100644 index 000000000000..b3882cd55735 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/oracle/version/index.html @@ -0,0 +1,67 @@ + + + + + + +Module version documentation + + + + + +
+ +

Module version

+

Functions

+

Globals

    +
  • The ORACLE_VERSION constant is used to check that the oracle interface is in sync between PXE and Aztec.nr. We need +to version the oracle interface to ensure that developers get a reasonable error message if they use incompatible +versions of Aztec.nr and PXE. The TypeScript counterpart is in oracle_version.ts.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/publish_contract_instance/fn.publish_contract_instance_for_public_execution.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/publish_contract_instance/fn.publish_contract_instance_for_public_execution.html new file mode 100644 index 000000000000..2ee6fb67afb6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/publish_contract_instance/fn.publish_contract_instance_for_public_execution.html @@ -0,0 +1,36 @@ + + + + + + +Function publish_contract_instance_for_public_execution documentation + + + + + +
+ +

Function publish_contract_instance_for_public_execution

+
pub fn publish_contract_instance_for_public_execution(
+    context: &mut PrivateContext,
+    target: AztecAddress,
+)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/publish_contract_instance/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/publish_contract_instance/index.html new file mode 100644 index 000000000000..a26bf3cf76b3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/publish_contract_instance/index.html @@ -0,0 +1,53 @@ + + + + + + +Module publish_contract_instance documentation + + + + + +
+
aztec-nr - noir_aztec::publish_contract_instance
+

Module publish_contract_instance

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/delayed_public_mutable/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/delayed_public_mutable/index.html new file mode 100644 index 000000000000..f70ad4699591 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/delayed_public_mutable/index.html @@ -0,0 +1,51 @@ + + + + + + +Module delayed_public_mutable documentation + + + + + +
+
aztec-nr - noir_aztec::state_vars::delayed_public_mutable
+

Module delayed_public_mutable

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/delayed_public_mutable/struct.DelayedPublicMutable.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/delayed_public_mutable/struct.DelayedPublicMutable.html new file mode 100644 index 000000000000..6513ba5107aa --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/delayed_public_mutable/struct.DelayedPublicMutable.html @@ -0,0 +1,112 @@ + + + + + + +Struct DelayedPublicMutable documentation + + + + + +
+ +

Struct DelayedPublicMutable

+
pub struct DelayedPublicMutable<T, let InitialDelay: u64, Context>
+{ /* private fields */ }
+
+

Implementations

+

impl<let InitialDelay: u64, T> DelayedPublicMutable<T, InitialDelay, &mut PrivateContext>

+ +
pub fn get_current_value(self) -> T +
where + T: Packable, + T: Eq
+ +

impl<let InitialDelay: u64, T> DelayedPublicMutable<T, InitialDelay, PublicContext>

+ +
pub fn schedule_value_change(self, new_value: T) +
where + T: Packable, + T: Eq
+ +pub fn schedule_and_return_value_change(self, new_value: T) -> ScheduledValueChange<T> +
where + T: Packable, + T: Eq
+ +pub fn schedule_delay_change(self, new_delay: u64) +
where + T: Packable, + T: Eq
+ +pub fn get_current_value(self) -> T +
where + T: Packable, + T: Eq
+ +pub fn get_current_delay(self) -> u64 +
where + T: Packable, + T: Eq
+ +pub fn get_scheduled_value(self) -> (T, u64) +
where + T: Packable, + T: Eq
+ +pub fn get_scheduled_delay(self) -> (u64, u64) +
where + T: Packable, + T: Eq
+ +

impl<let InitialDelay: u64, T> DelayedPublicMutable<T, InitialDelay, UtilityContext>

+ +
pub unconstrained fn get_current_value(self) -> T +
where + T: Packable, + T: Eq
+ +

Trait implementations

+

impl<Context, let InitialDelay: u64, let M: u32, T> StateVariable<M + 1, Context> for DelayedPublicMutable<T, InitialDelay, Context> +
where + DelayedPublicMutableValues<T, InitialDelay>: Packable<N = M>

+ +
pub fn new(context: Context, storage_slot: Field) -> Self + +pub fn get_storage_slot(self) -> Field + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/index.html new file mode 100644 index 000000000000..2540256a940f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/index.html @@ -0,0 +1,80 @@ + + + + + + +Module state_vars documentation + + + + + +
+
aztec-nr - noir_aztec::state_vars
+

Module state_vars

+

Re-exports

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/map/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/map/index.html new file mode 100644 index 000000000000..acecd764a2f2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/map/index.html @@ -0,0 +1,51 @@ + + + + + + +Module map documentation + + + + + +
+ +

Module map

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/map/struct.Map.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/map/struct.Map.html new file mode 100644 index 000000000000..93bde14f7d5b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/map/struct.Map.html @@ -0,0 +1,161 @@ + + + + + + +Struct Map documentation + + + + + +
+ +

Struct Map

+
pub struct Map<K, V, Context> {
+    pub context: Context,
+    /* private fields */
+}
+
+
+

Map

+

A key-value storage container that maps keys to state variables, similar +to Solidity mappings.

+

Map enables you to associate keys (like addresses or other identifiers) +with state variables in your Aztec smart contract. This is conceptually +similar to Solidity's mapping(K => V) syntax, where you can store and +retrieve values by their associated keys.

+

You can declare a state variable contained within a Map in your contract's +#[storage] struct.

+

For example, you might use +Map<AztecAddress, PublicMutable<FieldNote, Context>, Context> to track +token balances for different users, similar to how you'd use +mapping(address => uint256) in Solidity.

+
+

Aside: the verbose Context in the declaration is a consequence of +leveraging Noir's regular syntax for generics to ensure that certain +state variable methods can only be called in some contexts (private, +public, utility).

+
+

The methods of Map are:

+
    +
  • at (access state variable for a given key) +(see the method's own doc comments for more info).
  • +
+

Generic Parameters

+
    +
  • K: The key type (must implement ToField trait for hashing)
  • +
  • V: The value type: +
      +
    • any Aztec state variable (variable that implements the StateVariable trait): +
        +
      • PublicMutable
      • +
      • PublicImmutable
      • +
      • DelayedPublicMutable
      • +
      • Map
      • +
      +
    • +
    +
  • +
  • Context: The execution context (handles private/public function +contexts)
  • +
+

Usage

+

Maps are typically declared in your contract's #[storage] struct and +accessed +using the at(key) method to get the state variable for a specific key. +The resulting state variable can then be read from or written to using its +own methods.

+

Note that maps cannot be used with owned state variables (variables that +implement the OwnedStateVariable trait) - those need to be wrapped in an +Owned state variable instead.

+

Advanced

+

Internally, Map uses a single base storage slot to represent the +mapping +itself, similar to Solidity's approach. Individual key-value pairs are +stored at derived storage slots computed by hashing the base storage +slot +with the key using Poseidon2. This ensures:

+
    +
  • No storage slot collisions between different keys
  • +
  • Uniform distribution of storage slots across the storage space
  • +
  • Compatibility with Aztec's storage tree structure
  • +
  • Gas-efficient storage access patterns similar to Solidity mappings
  • +
+

The storage slot derivation uses derive_storage_slot_in_map(base_slot, key) which computes poseidon2_hash([base_slot, key.to_field()]), +ensuring cryptographically secure slot separation.

+

docs:start:map

+
+

Fields

+
context: Context
+

Implementations

+

impl<Context, K, V> Map<K, V, Context>

+ +
pub fn at<let N: u32>(self, key: K) -> V +
where + K: ToField, + V: StateVariable<N, Context>
+ +
+

Returns the state variable associated with the given key.

+

This is equivalent to accessing mapping[key] in Solidity. It returns +the state variable instance for the specified key, which can then be +used to read or write the value at that key.

+

Unlike Solidity mappings which return the value directly, this returns +the state variable wrapper (like PublicMutable, nested Map etc.) +that you then call methods on to interact with the actual value.

+

Arguments

+
    +
  • key - The key to look up in the map. Must implement the ToField +trait (which most basic Noir & Aztec types do).
  • +
+

Returns

+
    +
  • V - The state variable instance for this key. You can then call +methods like .read(), .write(), .get_note(), etc. on this +depending on the specific state variable type.
  • +
+

Example

+
// Get a user's balance (assuming PrivateMutable<FieldNote>)
+let user_balance = self.storage.balances.at(user_address);
+let current_note = user_balance.get_note();
+
+// Update the balance
+user_balance.replace(new_note);
+

Trait implementations

+

impl<Context, K, V> StateVariable<1, Context> for Map<K, V, Context>

+ +
pub fn new(context: Context, storage_slot: Field) -> Self + +pub fn get_storage_slot(self) -> Field + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/owned/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/owned/index.html new file mode 100644 index 000000000000..870e2ed393c9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/owned/index.html @@ -0,0 +1,51 @@ + + + + + + +Module owned documentation + + + + + +
+ +

Module owned

+

Structs

    +
  • A wrapper state variable that is to be used with variables that implement the OwnedStateVariable trait.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/owned/struct.Owned.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/owned/struct.Owned.html new file mode 100644 index 000000000000..648ea6d81b2f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/owned/struct.Owned.html @@ -0,0 +1,84 @@ + + + + + + +Struct Owned documentation + + + + + +
+ +

Struct Owned

+
pub struct Owned<V, Context> {
+    pub context: Context,
+    /* private fields */
+}
+
+
+

A wrapper state variable that is to be used with variables that implement the OwnedStateVariable trait.

+

Example usage:

+
#[storage]
+struct Storage {
+    balance: Owned<PrivateSet<UintNote, Context>, Context>,
+}
+

To access the underlying owned state variable for a specific owner, use the at method:

+
let user_balance = storage.balance.at(user_address);
+

For more information on ownership, see the documentation for the OwnedStateVariable trait.

+

Type Parameters

+
    +
  • V - The underlying type that implements OwnedStateVariable<Context> (e.g., PrivateSet, PrivateMutable).
  • +
  • Context - The execution context type (e.g., PublicContext, PrivateContext, UtilityContext). The context +determines which methods of the state variable are available.
  • +
+

Fields

+
context: Context
+

Implementations

+

impl<Context, V> Owned<V, Context>

+ +
pub fn at(self, owner: AztecAddress) -> V +
where + V: OwnedStateVariable<Context>
+ +
+

Returns an instance of the underlying owned state variable for a given owner.

+
+

Trait implementations

+

impl<Context, V> StateVariable<1, Context> for Owned<V, Context>

+ +
pub fn new(context: Context, storage_slot: Field) -> Self + +pub fn get_storage_slot(self) -> Field + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/owned_state_variable/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/owned_state_variable/index.html new file mode 100644 index 000000000000..6f8ec8f4d629 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/owned_state_variable/index.html @@ -0,0 +1,52 @@ + + + + + + +Module owned_state_variable documentation + + + + + +
+
aztec-nr - noir_aztec::state_vars::owned_state_variable
+

Module owned_state_variable

+

Traits

    +
  • A trait that defines the interface for Aztec state variables that have an owner. Unlike regular state variables, +owned state variables need to be wrapped in Owned state variable when placed in storage:
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/owned_state_variable/trait.OwnedStateVariable.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/owned_state_variable/trait.OwnedStateVariable.html new file mode 100644 index 000000000000..ddaffe93dcf6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/owned_state_variable/trait.OwnedStateVariable.html @@ -0,0 +1,93 @@ + + + + + + +Trait OwnedStateVariable documentation + + + + + +
+ +

Trait OwnedStateVariable

+
pub trait OwnedStateVariable<Context> {
+    // Required methods
+    pub fn new(context: Context, storage_slot: Field, owner: AztecAddress) -> Self;
+}
+ +
+

A trait that defines the interface for Aztec state variables that have an owner. Unlike regular state variables, +owned state variables need to be wrapped in Owned state variable when placed in storage:

+
#[storage]
+struct Storage {
+    balance: Owned<PrivateSet<UintNote, Context>, Context>,
+}
+

Owned state variables are only used when working with private data because, in the public context, write permissions +are solely defined by the contract logic, and anyone can read data. In private, however, modifying state (nullifying +private notes) requires both knowledge of the note (the note commitment preimage) and possession of the +corresponding nullifier secret key.

+

So what is an Owner?

+

An owner is generally the entity that:

+
    +
  1. Can decrypt the message in which the given note pertaining to the state variable was sent,
  2. +
  3. has the ability to nullify (spend/destroy) those notes.
  4. +
+

(Note that point 1 does not necessarily have to be true; for example, the note message could be encrypted for a +decrypting service address, which could then deliver the note to the actual owner via offchain communication.)

+

Type Parameters

+
    +
  • Context - The execution context type (e.g., PublicContext, PrivateContext, UtilityContext). The context +determines which methods of the state variable are available and controls whether the variable can +be accessed in public, private or utility functions.
  • +
+

Required methods

+
pub fn new(context: Context, storage_slot: Field, owner: AztecAddress) -> Self + +
+

Initializes a new owned state variable with a given storage slot and owner. The storage slot is inherited from +the Owned state variable unchanged. The Owned state variable calls this function when its at method is +invoked.

+
+

Implementors

+

impl<Context> OwnedStateVariable<Context> for BalanceSet<Context>

+ +

impl<Context, Note> OwnedStateVariable<Context> for PrivateImmutable<Note, Context>

+ +

impl<Context, Note> OwnedStateVariable<Context> for PrivateMutable<Note, Context>

+ +

impl<Context, Note> OwnedStateVariable<Context> for PrivateSet<Note, Context>

+ +

impl<Context> OwnedStateVariable<Context> for SingleUseClaim<Context>

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/private_immutable/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/private_immutable/index.html new file mode 100644 index 000000000000..92e7365435d7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/private_immutable/index.html @@ -0,0 +1,53 @@ + + + + + + +Module private_immutable documentation + + + + + +
+
aztec-nr - noir_aztec::state_vars::private_immutable
+

Module private_immutable

+

Structs

    +
  • PrivateImmutable is an owned state variable type that represents a private value that is set once and remains +unchanged forever. Because it is "owned," you must wrap a PrivateImmutable inside an Owned state variable when +storing it:
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/private_immutable/struct.PrivateImmutable.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/private_immutable/struct.PrivateImmutable.html new file mode 100644 index 000000000000..e5890fc9c3d3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/private_immutable/struct.PrivateImmutable.html @@ -0,0 +1,133 @@ + + + + + + +Struct PrivateImmutable documentation + + + + + +
+ +

Struct PrivateImmutable

+
pub struct PrivateImmutable<Note, Context>
+{ /* private fields */ }
+
+
+

PrivateImmutable is an owned state variable type that represents a private value that is set once and remains +unchanged forever. Because it is "owned," you must wrap a PrivateImmutable inside an Owned state variable when +storing it:

+
#[storage]
+struct Storage<Context> {
+    your_variable: Owned<PrivateImmutable<YourNote, Context>, Context>,
+}
+

For more details on what "owned" means, see the documentation for the OwnedStateVariable trait.

+

The value of a PrivateImmutable is stored in the Aztec's private state and hence is represented as a note.

+

The PrivateImmutable type facilitates: inserting the permanent note during initialization, and reading that note.

+

Example

+

A user's permanent configuration can be represented as a PrivateImmutable. For example, in a vesting contract, each +user's vesting parameters (start date, total amount, etc.) could be stored as a PrivateImmutable owned by that user. +Once initialized during registration, these parameters remain constant for that specific user, while different users +can have their own distinct parameters.

+

Note: For contract-wide configuration (one value for the entire contract), use SinglePrivateImmutable instead.

+

Generic Parameters:

+
    +
  • Note - A single note of this type will represent the PrivateImmutable's +value at the given storage_slot.
  • +
  • Context - The execution context (PrivateContext or UtilityContext).
  • +
+

Implementations

+

impl<Note> PrivateImmutable<Note, &mut PrivateContext>

+ +
pub fn initialize(self, note: Note) -> NoteMessage<Note> +
where + Note: NoteType, + Note: NoteHash, + Note: Packable
+ +
+

Initializes a PrivateImmutable state variable instance with a permanent note and returns a [NoteEmission] that +allows you to decide what method of note message delivery to use.

+

This function inserts the single, permanent note for this state variable. It can only be called once per +PrivateImmutable. Subsequent calls will fail because the initialization nullifier will already exist.

+

Unlike PrivateMutable, this note will never be nullified or replaced through the state variable interface

+
    +
  • it persists for the lifetime of the state variable.
  • +
+
+
pub fn get_note(self) -> Note +
where + Note: NoteType, + Note: NoteHash, + Note: Packable
+ +
+

Reads the permanent note of a PrivateImmutable state variable instance.

+

If this PrivateImmutable state variable has not yet been initialized, no note will exist: the call will fail and +the transaction will not be provable.

+

Since the note is immutable, there's no risk of reading stale data or race conditions - the note never changes +after initialization.

+
+

impl<Context, Note> PrivateImmutable<Note, Context>

+ +

impl<Note> PrivateImmutable<Note, UtilityContext>

+ +
pub unconstrained fn is_initialized(self) -> bool +
where + Note: NoteType, + Note: NoteHash, + Note: Eq
+ +
+

Returns whether this PrivateImmutable has been initialized.

+
+
pub unconstrained fn view_note(self) -> Note +
where + Note: Packable, + Note: NoteType, + Note: NoteHash, + Note: Eq
+ +
+

Returns the permanent note in this PrivateImmutable without consuming it.

+

This function is only available in a UtilityContext (unconstrained environment) and is typically used for +offchain queries, view functions, or testing.

+

Unlike the constrained get_note(), this function does not push read requests or perform validation. It simply +reads the note from the PXE's database.

+
+

Trait implementations

+

impl<Context, Note> OwnedStateVariable<Context> for PrivateImmutable<Note, Context>

+ +
pub fn new(context: Context, storage_slot: Field, owner: AztecAddress) -> Self + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/private_mutable/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/private_mutable/index.html new file mode 100644 index 000000000000..7493b19bcc44 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/private_mutable/index.html @@ -0,0 +1,52 @@ + + + + + + +Module private_mutable documentation + + + + + +
+
aztec-nr - noir_aztec::state_vars::private_mutable
+

Module private_mutable

+

Structs

    +
  • PrivateMutable is an owned state variable type that represents a private value that can be changed. Because it is +"owned," you must wrap a PrivateMutable inside an Owned state variable when storing it:
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/private_mutable/struct.PrivateMutable.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/private_mutable/struct.PrivateMutable.html new file mode 100644 index 000000000000..76631be7c0eb --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/private_mutable/struct.PrivateMutable.html @@ -0,0 +1,295 @@ + + + + + + +Struct PrivateMutable documentation + + + + + +
+ +

Struct PrivateMutable

+
pub struct PrivateMutable<Note, Context>
+{ /* private fields */ }
+
+
+

PrivateMutable is an owned state variable type that represents a private value that can be changed. Because it is +"owned," you must wrap a PrivateMutable inside an Owned state variable when storing it:

+

E.g.:

+
#[storage]
+struct Storage<Context> {
+    your_variable: Owned<PrivateMutable<YourNote, Context>, Context>,
+}
+

For more details on what "owned" means, see the documentation for the OwnedStateVariable trait.

+

A PrivateMutable state variable is initialized by inserting a very first note. Subsequently, the PrivateMutable can +make changes to the state variable's value by nullifying the current note and inserting a replacement note.

+

Example

+

A user's account nonce can be represented as a PrivateMutable. The "current value" of the user's nonce is +the value contained within the single not-yet-nullified note in the user's view of the PrivateMutable.

+

When the nonce needs to be incremented, the current note gets nullified and a new note with the incremented nonce +gets inserted. The new note then becomes the "current value" of the PrivateMutable state variable.

+

This is similar to how uint256 nonce would work in Solidity: there's always exactly one current value, and +updating it overwrites the previous value.

+

When to choose PrivateMutable vs PrivateSet:

+
    +
  • Use PrivateMutable when you want exactly one note to represent the state variable's current value, similar to +regular variables in Solidity.
  • +
  • Use PrivateMutable when you want only the 'owner' of the private state to be able to make changes to it.
  • +
  • Use PrivateSet when you want multiple notes to collectively represent the state variable's current value (like a +collection of token balance notes).
  • +
  • Use PrivateSet when you want to allow "other people" (beyond the owner) to insert notes into the state variable.
  • +
+

Only the 'owner' of the given PrivateMutable state variable can mutate it, because every mutation requires +nullifying the current note, and only the owner knows both the note's content and the secret necessary to compute +its nullifier.

+

Privacy

+

The methods of a PrivateMutable are only executable in a PrivateContext, and are designed to not leak anything about +which state variable was read/modified/initialized, to the outside world.

+

Generic Parameters:

+
    +
  • Note - A single note of this type will represent the PrivateMutable's current value at the given storage_slot.
  • +
  • Context - The execution context (PrivateContext or UtilityContext).
  • +
+

Implementations

+

impl<Note> PrivateMutable<Note, UtilityContext>

+ +
pub unconstrained fn is_initialized(self) -> bool +
where + Note: NoteType, + Note: NoteHash, + Note: Eq
+ +
+

Checks whether this PrivateMutable has been initialized.

+

Notice that this function is executable only within a UtilityContext, which +is an unconstrained environment on the user's local device.

+

Returns

+
    +
  • bool - true if the PrivateMutable has been initialized (the initialization +nullifier exists), false otherwise.
  • +
+
+
pub unconstrained fn view_note(self) -> Note +
where + Note: Packable, + Note: NoteType, + Note: NoteHash, + Note: Eq
+ +
+

Returns the current note in this PrivateMutable without consuming it.

+

This function is only available in a UtilityContext (unconstrained environment) +and is typically used for offchain queries, view functions, or testing.

+

Unlike get_note(), this function does NOT nullify and recreate the note. +It simply reads the current note from the PXE's database without modifying +the state. This makes it suitable for read-only operations.

+

Returns

+
    +
  • Note - The current note stored in this PrivateMutable.
  • +
+

docs:start:view_note

+
+

impl<Context, Note> PrivateMutable<Note, Context>

+ +

impl<Note> PrivateMutable<Note, &mut PrivateContext>

+ +
pub fn initialize(self, note: Note) -> NoteMessage<Note> +
where + Note: Packable, + Note: NoteType, + Note: NoteHash
+ +
+

Initializes a PrivateMutable state variable instance with its first note.

+

This function creates the very first note for this state variable. It can +only be called once per PrivateMutable. Subsequent calls will fail because +the initialization nullifier will already exist.

+

This is conceptually similar to setting an initial value for a variable in +Ethereum smart contracts under a user's address in a mapping, except that in Aztec +the "value" is represented as a private note.

+

Arguments

+
    +
  • note - The initial note to store in this PrivateMutable. This note +becomes the "current value" of the state variable.
  • +
+

Returns

+
    +
  • NoteMessage<Note> - A type-safe wrapper that requires you to decide +whether to encrypt and send the note to someone. +You can call .deliver() on it to encrypt and deliver the note. See NoteMessage for more details.
  • +
+

Advanced

+

This function performs the following operations:

+
    +
  • Creates and emits an initialization nullifier to mark this storage slot +as initialized. This prevents double-initialization.
  • +
  • Inserts the provided note into the protocol's Note Hash Tree.
  • +
  • Returns a NoteMessage type that allows the caller to decide how to encrypt +and deliver the note to its intended recipient.
  • +
+

The initialization nullifier is deterministically computed from the storage +slot and can leak privacy information (see compute_initialization_nullifier +documentation).

+
+
pub fn replace<Env>(self, f: fn[Env](Note) -> Note) -> NoteMessage<Note> +
where + Note: Packable, + Note: NoteType, + Note: NoteHash
+ +
+

Reads the current note of a PrivateMutable state variable, nullifies it, +and inserts a new note produced by a user-provided function.

+

This function implements a "read-and-replace" pattern for updating private state +in Aztec. It first retrieves the current note, then nullifies it (marking it as spent), +and finally inserts a new_note produced by the user-provided function f.

+

This function can only be called after the PrivateMutable has been initialized. +If called on an uninitialized PrivateMutable, it will fail because there is +no current note to replace. If you don't know if the state variable has been +initialized already, you can use initialize_or_replace to handle both cases.

+

Arguments

+
    +
  • f - A function that takes the current Note and returns a new Note that +will replace it and become the "current value".
  • +
+

Returns

+
    +
  • NoteMessage<Note> - A type-safe wrapper that requires you to decide +whether to encrypt and send the note to someone. +You can call .deliver() on it to encrypt and log +the note. +See NoteMessage documentation for more details.
  • +
+

Advanced

+

This function performs the following operations:

+
    +
  • Retrieves the current note from the PXE via an oracle call
  • +
  • Validates that the current note exists and belongs to this storage slot
  • +
  • Computes the nullifier for the current note and pushes it to the context
  • +
  • Calls the user-provided function f to produce a new note
  • +
  • Inserts the resulting new_note into the Note Hash Tree using 'create_note'
  • +
  • Returns a NoteMessage type for the new_note, that allows the caller to +decide how to encrypt and deliver this note to its intended recipient.
  • +
+

The nullification of the previous note ensures that it cannot be used again, +maintaining the invariant that a PrivateMutable has exactly one current note.

+
+
pub fn initialize_or_replace<Env>( + self, + f: fn[Env](Option<Note>) -> Note, +) -> NoteMessage<Note> +
where + Note: Packable, + Note: NoteType, + Note: NoteHash
+ +
+

Initializes the PrivateMutable if it's uninitialized, or replaces the current note +using a transform function.

+

If uninitialized, init_note is used to initialize. If already initialized, the transform_fn +is passed to replace, which retrieves the current note, nullifies it, and inserts the transformed note.

+

Arguments

+
    +
  • +

    f - A function that takes an Option with the current Note and returns the Note to insert. This allows +you to transform the current note before it is reinserted. The Option is none if the state variable +was not initialized.

    +
  • +
+

Returns

+
    +
  • NoteMessage<Note> - A type-safe wrapper that requires you to decide +whether to encrypt and send the note to someone. +You can call .deliver() on it to encrypt and log +the note. +See NoteMessage documentation for more details.
  • +
+
+
pub fn get_note(self) -> NoteMessage<Note> +
where + Note: Packable, + Note: NoteType, + Note: NoteHash
+ +
+

Reads the current note of a PrivateMutable state variable instance.

+

This function retrieves the current note, but with an important caveat: reading +a "current" note requires nullifying it to ensure that it is indeed current, +and that it and hasn't been nullified by some earlier transaction. +Having nullified the note, we then need to re-insert a new note with equal +value, so that this value remains available for future functions to read it +as "current".

+

This is different from reading variables in Ethereum, where reading doesn't +modify the state. In Aztec's private state model, reading a "current" note +"consumes" it and creates a new note of equal value but with fresh +randomness.

+

The returned note has the same content as the original but is actually the +newly-created note.

+

Returns

+
    +
  • NoteMessage<Note> - A type-safe wrapper containing the newly-created note. +You still need to decide whether to encrypt and send +the note to someone. You can call .deliver() on it to +encrypt and log the note. See NoteMessage +documentation for more details.
  • +
+

Advanced

+

This function performs the "nullify-and-recreate" pattern:

+
    +
  • Retrieves the current note from the PXE via an oracle call
  • +
  • Validates that the note exists and belongs to this contract address and +storage slot
  • +
  • Nullifies the current note to ensure that it is indeed current
  • +
  • Creates a new note with identical content but with fresh randomness
  • +
  • Returns a NoteMessage for the new note
  • +
+

This pattern ensures that:

+
    +
  • You're always reading the most up-to-date note
  • +
  • Concurrent transactions can't create race conditions
  • +
  • The note remains available for future reads (via the fresh copy)
  • +
+

The kernel will inject a unique nonce into the newly-created note, which means +the new note will have a different nullifier, allowing it to be consumed in +the future.

+

docs:start:get_note

+
+

Trait implementations

+

impl<Context, Note> OwnedStateVariable<Context> for PrivateMutable<Note, Context>

+ +
pub fn new(context: Context, storage_slot: Field, owner: AztecAddress) -> Self + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/private_set/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/private_set/index.html new file mode 100644 index 000000000000..ece560692e3c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/private_set/index.html @@ -0,0 +1,52 @@ + + + + + + +Module private_set documentation + + + + + +
+ +

Module private_set

+

Structs

    +
  • PrivateSet is an owned state variable type, which enables you to read, mutate, and write private state. Because it +is "owned," you must wrap a PrivateSet inside an Owned state variable when storing it:
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/private_set/struct.PrivateSet.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/private_set/struct.PrivateSet.html new file mode 100644 index 000000000000..446d557357f9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/private_set/struct.PrivateSet.html @@ -0,0 +1,473 @@ + + + + + + +Struct PrivateSet documentation + + + + + +
+ +

Struct PrivateSet

+
pub struct PrivateSet<Note, Context> {
+    pub context: Context,
+    pub storage_slot: Field,
+    pub owner: AztecAddress,
+}
+
+
+

PrivateSet is an owned state variable type, which enables you to read, mutate, and write private state. Because it +is "owned," you must wrap a PrivateSet inside an Owned state variable when storing it:

+

E.g.:

+
#[storage]
+struct Storage {
+    your_variable: Owned, Context>,
+}
+
+For more details on what "owned" means, see the documentation for the [OwnedStateVariable] trait.
+
+The PrivateSet facilitates: the insertion of new notes, the reading of existing notes, and the nullification of
+existing notes.
+
+The "current value" of a PrivateSet is the collection of all _not-yet-nullified_ account's notes in the set.
+
+
+## Example.
+
+A user's token balance can be represented as a PrivateSet of multiple notes,
+where the note type contains a value.
+The "current value" of the user's token balance (the PrivateSet state variable)
+can be interpreted as the summation of the values contained within all
+not-yet-nullified notes (aka "current notes") in the PrivateSet.
+
+This is similar to a physical wallet containing five $10 notes: the owner's
+wallet balance is the sum of all those $10 notes: $50.
+To spend $2, they can get one $10 note, nullify it, and insert one $8 note as
+change. Their new wallet balance will then be interpreted as the new summation: $48.
+
+The interpretation doesn't always have to be a "summation of values". When
+`get_notes` is called, PrivateSet does not attempt to interpret the notes at all;
+it's up to the custom code of the smart contract to make an interpretation.
+
+For example: a set of notes could instead represent a moving average; or a modal
+value; or some other single statistic. Or the set of notes might not be
+collapsible into a single statistic: it could be a disjoint collection of NFTs
+which are housed under the same "storage slot".
+
+It's worth noting that a user can prove existence of _at least_ some subset
+of notes in a PrivateSet, but they cannot prove existence of _all_ notes
+in a PrivateSet.
+The physical wallet is a good example: a user can prove that there are five
+$10 notes in their wallet by furnishing those notes. But because we cannot
+_see_ the entirety of their wallet, they might have many more notes that
+they're choosing to not showing us.
+
+## When to choose PrivateSet vs PrivateMutable:
+
+- If you want _someone else_ (other than the owner of the private state) to be
+  able to make edits (insert notes).
+- If you don't want to leak the storage_slot being initialized (see the
+  PrivateMutable file).
+- If you find yourself needing to re-initialize a PrivateMutable (see that file).
+
+The 'current' value of a _PrivateMutable_ state variable is only ever represented
+by _one_ note at a time. To mutate the current value of a PrivateMutable, the
+current note always gets nullified, and a new, replacement note gets inserted.
+So if nullification is always required to mutate a PrivateMutable, that means
+only the 'owner' of a given PrivateMutable state variable can ever mutate it.
+For some use cases, this can be too limiting: A key feature of some smart contract
+functions is that _multiple people_ are able to mutate a particular state
+variable.
+
+PrivateSet enables "other people" (other than the owner of the private state) to
+mutate the 'current' value, with some limitations:
+The 'owner' is still the only person with the ability to `remove` notes from the
+the set.
+"Other people" can `insert` notes into the set.
+
+## Privacy
+
+The methods of a PrivateSet are only executable in a PrivateContext, and are
+designed to not leak anything about _which_ state variable was read/modified/
+inserted, to the outside world.
+
+## Struct Fields:
+
+* context - The execution context (PrivateContext or UtilityContext).
+* storage_slot -  All notes that "belong" to a given PrivateSet state variable
+                  are augmented with a common `storage_slot` field, as a way of
+  identifying which set they belong to. (Management of `storage_slot` is handled
+  within the innards of the PrivateSet impl, so you shouldn't need to think about
+  this any further).
+
+
+## Generic Parameters:
+
+* `Note` - Many notes of this type will collectively form the PrivateSet at the
+           given storage_slot.
+* `Context` - The execution context (PrivateContext or UtilityContext).
+

Fields

+
context: Context
+
storage_slot: Field
+
+

Implementations

+

impl<Note> PrivateSet<Note, &mut PrivateContext>

+ +
pub fn insert(self, note: Note) -> NoteMessage<Note> +
where + Note: Packable, + Note: NoteType, + Note: NoteHash, + Note: Eq
+ +
+

Inserts a new note into the PrivateSet.

+

Arguments

+
    +
  • note - A newly-created note that you would like to insert into this +PrivateSet.
  • +
+

Returns

+
    +
  • NoteMessage - A type-safe wrapper which makes it clear to the +smart contract dev that they now have a choice: they +need to decide whether they would like to send the contents of the newly- +created note to someone, or not. If they would like to, they have some +further choices: +
      +
    • What kind of log to use? (Private log, or offchain log).
    • +
    • What kind of encryption scheme to use? (Currently only AES128 is supported)
    • +
    • Whether to constrain delivery of the note, or not. +At the moment, aztec-nr provides limited options. +You can call .deliver() on the returned type to encrypt and log the note. +See NoteMessage for more details.
    • +
    +
    +

    Note: We're planning a significant refactor of this syntax, to make the +syntax of how to encrypt and deliver notes much clearer, and to make the +default options much clearer to developers. We will also be enabling +easier ways to customize your own note encryption options.

    +
    +
  • +
+

Advanced:

+

Ultimately, this function inserts the note into the protocol's Note Hash +Tree. +Behind the scenes, we do the following:

+
    +
  • Augment the note with the storage_slot of this PrivateSet, to +convey which set it belongs to.
  • +
  • Augment the note with a note_type_id, so that it can be correctly filed- +away when it is eventually discovered, decrypted, and processed by its +intended recipient. +(The note_type_id is usually allocated by the #[note] macro).
  • +
  • Provide the contents of the (augmented) note to the PXE, so that it can +store all notes created by the user executing this function. +
      +
    • The note is also kept in the PXE's memory during execution, in case this +newly-created note gets read in some later execution frame of this +transaction. In such a case, we feed hints to the kernel to squash: +the so-called "transient note", its note log (if applicable), and the +nullifier that gets created by the reading function.
    • +
    +
  • +
  • Hash the (augmented) note into a single Field, via the note's own +compute_note_hash method.
  • +
  • Push the note_hash to the PrivateContext. From here, the protocol's +kernel circuits will take over and insert the note_hash into the protocol's +"note hash tree". +
      +
    • Before insertion, the protocol will: +
        +
      • "Silo" the note_hash with the contract_address of the calling +function, to yield a siloed_note_hash. This prevents state collisions +between different smart contracts.
      • +
      • Ensure uniqueness of the siloed_note_hash, to prevent Faerie-Gold +attacks, by hashing the siloed_note_hash with a unique value, to +yield a unique_siloed_note_hash (see the protocol spec for more).
      • +
      +
    • +
    +
  • +
+
+
pub fn pop_notes<PreprocessorArgs, FilterArgs, let M: u32>( + self, + options: NoteGetterOptions<Note, M, PreprocessorArgs, FilterArgs>, +) -> BoundedVec<Note, 16> +
where + Note: Packable<N = M>, + Note: NoteType, + Note: NoteHash, + Note: Eq
+ +
+

Pops a collection of "current" notes (i.e. not-yet-nullified notes) which +belong to this PrivateSet.

+

"Pop" indicates that, conceptually, the returned notes will get permanently +removed (nullified) from the PrivateSet by this method.

+

The act of nullifying convinces us that the returned notes are indeed +"current" (because if they can be nullified, it means they haven't been +nullified already, because a note can only be nullified once).

+

This means that -- whilst the returned notes should be considered "current" +within the currently-executing execution frame of the tx -- they will be not +be considered "current" by any later execution frame of this tx (or any +future tx).

+

Notes will be selected from the PXE's database, via an oracle call, according +to the filtering options provided.

+

Arguments

+
    +
  • options - See NoteGetterOptions. Enables the caller to specify the +properties of the notes that must be returned by the oracle +call to the PXE. +The NoteGetterOptions are designed to contain functions which +constrain that the returned notes do indeed adhere to the +specified options. Those functions are executed within this +pop_notes call.
  • +
+

Returns

+
    +
  • BoundedVec<Note, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL> +
      +
    • A vector of "current" notes, that have been constrained to satisfy the +retrieval criteria specified by the given options.
    • +
    +
  • +
+

Generic Parameters

+
    +
  • PreprocessorArgs - See NoteGetterOptions.
  • +
  • FilterArgs - See NoteGetterOptions.
  • +
  • M - The length of the note (in Fields), when packed by the Packable trait.
  • +
+

Advanced:

+

Reads the notes:

+
    +
  • Gets notes from the PXE, via an oracle call, according to the filtering +options provided.
  • +
  • Constrains that the returned notes do indeed adhere to the options. +(Note: the options contain constrained functions that get invoked +within this function).
  • +
  • Asserts that the notes do indeed belong to this calling function's +contract_address, and to this PrivateSet's storage_slot.
  • +
  • Computes the note_hash for each note, using the storage_slot and +contract_address of this PrivateSet instance.
  • +
  • Asserts that the note_hash does indeed exist: +
      +
    • For settled notes: makes a request to the kernel to perform a merkle +membership check against the historical Note Hashes Tree that this tx +is referencing.
    • +
    • For transient notes: makes a request to the kernel to ensure that the +note was indeed emitted by some earlier execution frame of this tx.
    • +
    +
  • +
+

Nullifies the notes:

+
    +
  • Computes the nullifier for each note. +
      +
    • (The nullifier computation differs depending on whether the note is +settled or transient).
    • +
    +
  • +
  • Pushes the nullifiers to the PrivateContext. From here, the protocol's +kernel circuits will take over and insert the nullifiers into the +protocol's "nullifier tree". +
      +
    • Before insertion, the protocol will: +
        +
      • "Silo" each nullifier with the contract_address of the calling +function, to yield a siloed_nullifier. This prevents nullifier +collisions between different smart contracts.
      • +
      • Ensure that each siloed_nullifier does not already exist in the +nullifier tree. The nullifier tree is an indexed merkle tree, which +supports efficient non-membership proofs.
      • +
      +
    • +
    +
  • +
+
+
pub fn remove(self, retrieved_note: RetrievedNote<Note>) +
where + Note: NoteType, + Note: NoteHash, + Note: Eq
+ +
+

Permanently removes (conceptually) the given note from this PrivateSet, +by nullifying it.

+

Note that if you obtained the note via get_notes it's much better to use +pop_notes, as pop_notes results in significantly fewer constraints, +due to avoiding an extra hash and read request check.

+

Arguments

+
    +
  • retrieved_note - A note which -- earlier in the calling function's +execution -- has been retrieved from the PXE. +The retrieved_note is constrained to have been read +from the i
  • +
+

Returns

+
    +
  • NoteMessage - A type-safe wrapper which makes it clear to the +smart contract dev that they now have a choice: they +need to decide whether they would like to send the contents of the newly- +created note to someone, or not. If they would like to, they have some +further choices: +
      +
    • What kind of log to use? (Private log, or offchain log).
    • +
    • What kind of encryption scheme to use? (Currently only AES128 is supported)
    • +
    • Whether to constrain delivery of the note, or not. +At the moment, aztec-nr provides limited options. +See NoteMessage for further details.
    • +
    +
    +

    Note: We're planning a significant refactor of this syntax, to make the +syntax of how to encrypt and deliver notes much clearer, and to make the +default options much clearer to developers. We will also be enabling +easier ways to customize your own note encryption options.

    +
    +
  • +
+
+
pub fn get_notes<PreprocessorArgs, FilterArgs, let M: u32>( + self, + options: NoteGetterOptions<Note, M, PreprocessorArgs, FilterArgs>, +) -> BoundedVec<RetrievedNote<Note>, 16> +
where + Note: Packable<N = M>, + Note: NoteType, + Note: NoteHash, + Note: Eq
+ +
+

Returns a filtered collection of notes from the set.

+

DANGER: the returned notes do not get nullified within this get_notes +function, and so they cannot necessarily be considered "current" notes. +I.e. you might be reading notes that have already been nullified. It is +this which distinguishes get_notes from pop_notes.

+

Note that if you later on remove the note it's much better to use +pop_notes as pop_notes results in significantly fewer constrains +due to avoiding 1 read request check. +If you need for your app to see the notes before it can decide which to +nullify (which ideally would not be the case, and you'd be able to rely +on the filter and preprocessor to do this), then you have no resort but +to call get_notes and then remove.

+

Notes will be selected from the PXE's database, via an oracle call, according +to the filtering options provided.

+

Arguments

+
    +
  • options - See NoteGetterOptions. Enables the caller to specify the +properties of the notes that must be returned by the oracle +call to the PXE. +The NoteGetterOptions are designed to contain functions which +constrain that the returned notes do indeed adhere to the +specified options. Those functions are executed within this +pop_notes call.
  • +
+

Returns

+
    +
  • BoundedVec<Note, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL> +
      +
    • A vector of "current" notes, that have been constrained to satisfy the +retrieval criteria specified by the given options.
    • +
    +
  • +
+

Generic Parameters

+
    +
  • PreprocessorArgs - See NoteGetterOptions.
  • +
  • FilterArgs - See NoteGetterOptions.
  • +
  • M - The length of the note (in Fields), when packed by the Packable trait.
  • +
+

Advanced:

+

Reads the notes:

+
    +
  • Gets notes from the PXE, via an oracle call, according to the filtering +options provided.
  • +
  • Constrains that the returned notes do indeed adhere to the options. +(Note: the options contain constrained functions that get invoked +within this function).
  • +
  • Asserts that the notes do indeed belong to this calling function's +contract_address, and to this PrivateSet's storage_slot.
  • +
  • Computes the note_hash for each note, using the storage_slot and +contract_address of this PrivateSet instance.
  • +
  • Asserts that the note_hash does indeed exist: +
      +
    • For settled notes: makes a request to the kernel to perform a merkle +membership check against the historical Note Hashes Tree that this tx +is referencing.
    • +
    • For transient notes: makes a request to the kernel to ensure that the +note was indeed emitted by some earlier execution frame of this tx.
    • +
    +
  • +
+
+

impl<Note> PrivateSet<Note, UtilityContext>

+ +
pub unconstrained fn view_notes( + self, + options: NoteViewerOptions<Note, <Note as Packable>::N>, +) -> BoundedVec<Note, 10> +
where + Note: Packable, + Note: NoteType, + Note: NoteHash, + Note: Eq
+ +
+

Returns a collection of notes which belong to this PrivateSet, according +to the given selection options.

+

Notice that this function is executable only within a UtilityContext, which +is an unconstrained environment on the user's local device.

+

Arguments

+
    +
  • options - See NoteGetterOptions. Enables the caller to specify the +properties of the notes that must be returned by the oracle +call to the PXE.
  • +
+
+

Trait implementations

+

impl<Context, Note> OwnedStateVariable<Context> for PrivateSet<Note, Context>

+ +
pub fn new(context: Context, storage_slot: Field, owner: AztecAddress) -> Self + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/public_immutable/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/public_immutable/index.html new file mode 100644 index 000000000000..5a22f3cacfe9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/public_immutable/index.html @@ -0,0 +1,51 @@ + + + + + + +Module public_immutable documentation + + + + + +
+
aztec-nr - noir_aztec::state_vars::public_immutable
+

Module public_immutable

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/public_immutable/struct.PublicImmutable.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/public_immutable/struct.PublicImmutable.html new file mode 100644 index 000000000000..af639267a2d5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/public_immutable/struct.PublicImmutable.html @@ -0,0 +1,228 @@ + + + + + + +Struct PublicImmutable documentation + + + + + +
+ +

Struct PublicImmutable

+
pub struct PublicImmutable<T, Context>
+{ /* private fields */ }
+
+
+

PublicImmutable

+

PublicImmutable is a public state variable type for values that are set once +during initialization and remain permanently unchanged.

+

You can declare a state variable of type PublicImmutable within your contract's +#[storage] struct:

+

E.g.: +your_variable: PublicImmutable<T, Context>

+

PublicImmutable stores an immutable value in public state which can be read +from public, utility and even private execution contexts.

+

The methods of PublicImmutable are:

+
    +
  • initialize
  • +
  • read +(see the methods' own doc comments for more info).
  • +
+

Generic Parameters:

+
    +
  • T - The type of value stored (must implement Packable).
  • +
  • Context - The execution context (PublicContext, PrivateContext, or UtilityContext).
  • +
+

Advanced

+

PublicImmutable leverages WithHash<T> to enable efficient private reads of +public storage. The WithHash wrapper optimizes reads by hashing values that would +be larger than a single field into a single field, then proving inclusion of only +the hash in public storage.

+

This optimization is particularly valuable when T packs to multiple fields, +as it maintains "almost constant" verification overhead regardless of the +original data size.

+

Optimizing private reads in your contract

+

Since reading T from public immutable storage in private contexts has "almost +constant" constraint costs regardless of T's size, it's recommended to group +multiple values into a single struct when they are to be read together. This is +typically useful for configuration data set during contract initialization. E.g.:

+
use dep::aztec::protocol_types::{address::AztecAddress, traits::Packable};
+use std::meta::derive;
+
+#[derive(Eq, Packable)]
+pub struct Config \{
+    pub address_1: AztecAddress,
+    pub value_1: u128,
+    pub value_2: u64,
+    ...
+}
+

Implementations

+

impl<T> PublicImmutable<T, UtilityContext>

+ +
pub unconstrained fn read(self) -> T +
where + T: Packable, + T: Eq
+ +
+

Reads the permanent value stored in this PublicImmutable state variable.

+

Notice that this function is executable only within a UtilityContext, which +is an unconstrained environment on the user's local device.

+

Returns

+
    +
  • T - The permanent value stored in this PublicImmutable.
  • +
+
+

impl<T> PublicImmutable<T, &mut PrivateContext>

+ +
pub fn read(self) -> T +
where + T: Packable, + T: Eq
+ +
+

Reads the permanent value stored in this PublicImmutable from the anchor +block.

+

Private functions execute asynchronously and offchain. When a user begins +private execution, their view of the chain 'branches off' from the current +public state, since public state continues to advance while they execute +privately. Therefore, private functions read from a historical snapshot of +public state rather than the current state.

+

Returns

+
    +
  • T - The permanent value stored in this PublicImmutable at the historical +block referenced by the private context.
  • +
+

Advanced

+

This function performs a historical read using the block header from the private +context. The WithHash optimization is particularly valuable here because it +reduces the number of required inclusion proofs by proving membership of +only the hash instead of the full packed value.

+

The historical read mechanism:

+
    +
  • Uses an oracle to obtain the value from the anchor block
  • +
  • Proves inclusion of the value's hash in the public data tree
  • +
  • Proves that the root of this public data tree is correct, relative to the +anchor block header.
  • +
  • Verifies that the oracle-provided value matches the stored hash
  • +
+
+

impl<T> PublicImmutable<T, PublicContext>

+ +
pub fn initialize(self, value: T) +
where + T: Packable, + T: Eq
+ +
+

Initializes a PublicImmutable state variable instance with a permanent value.

+

This function sets the immutable value for this state variable. It can only +be called once per PublicImmutable. Subsequent calls will fail because the +initialization nullifier will already exist.

+

Arguments

+
    +
  • value - The permanent value to store in this PublicImmutable.
  • +
+

Panics

+

Panics if the value is already initialized.

+

Advanced

+

This function performs the following operations:

+
    +
  • Creates and emits an initialization nullifier to mark this storage slot +as initialized. This prevents double-initialization.
  • +
  • Wraps the value in WithHash<T> for efficient private reads.
  • +
  • Stores the wrapped value in Aztec's public data tree.
  • +
+

docs:start:public_immutable_struct_write

+
+
pub fn read(self) -> T +
where + T: Packable, + T: Eq
+ +
+

Reads the permanent value stored in this PublicImmutable state variable.

+

Returns

+
    +
  • T - The permanent value stored in this PublicImmutable.
  • +
+

Panics

+

Panics if the value is not initialized.

+

Advanced

+

This function performs the following operations:

+
    +
  • Checks that the state variable has been initialized by verifying the +initialization nullifier exists
  • +
  • Reads the WithHash<T> wrapper from public storage
  • +
  • Extracts and returns the original value T
  • +
+

The function will panic if called on an uninitialized PublicImmutable.

+

docs:start:public_immutable_struct_read

+
+
pub fn read_unsafe(self) -> T +
where + T: Packable, + T: Eq
+ +
+

Reads the value stored in this PublicImmutable without checking if the value +is initialized.

+

This function bypasses the initialization check and directly reads from +storage. +If the PublicImmutable has not been initialized, this will return a +zeroed value. +However, if the variable is known to be initialized, this is cheaper +to call than read.

+

Returns

+
    +
  • T - The value stored in this PublicImmutable, or empty/default values if +uninitialized.
  • +
+
+

impl<Context, T> PublicImmutable<T, Context>

+ +

Trait implementations

+

impl<Context, let M: u32, T> StateVariable<M + 1, Context> for PublicImmutable<T, Context> +
where + T: Packable<N = M>

+ +
pub fn new(context: Context, storage_slot: Field) -> Self + +pub fn get_storage_slot(self) -> Field + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/public_mutable/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/public_mutable/index.html new file mode 100644 index 000000000000..c95b843e43f4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/public_mutable/index.html @@ -0,0 +1,51 @@ + + + + + + +Module public_mutable documentation + + + + + +
+
aztec-nr - noir_aztec::state_vars::public_mutable
+

Module public_mutable

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/public_mutable/struct.PublicMutable.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/public_mutable/struct.PublicMutable.html new file mode 100644 index 000000000000..e451c205dd86 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/public_mutable/struct.PublicMutable.html @@ -0,0 +1,131 @@ + + + + + + +Struct PublicMutable documentation + + + + + +
+ +

Struct PublicMutable

+
pub struct PublicMutable<T, Context>
+{ /* private fields */ }
+
+
+

PublicMutable

+

PublicMutable is a public state variable type for values that can be read +and written within #[external("public")] functions of your smart contract.

+

You can declare a state variable of type PublicMutable within your contract's +#[storage] struct:

+

E.g.: +your_variable: PublicMutable<T, Context> +or: +your_mapping: Map<Field, PublicMutable<T, Context>>

+

The methods of PublicMutable are:

+
    +
  • read
  • +
  • write +(see the methods' own doc comments for more info).
  • +
+

Example.

+

A voting contract's proposal count can be represented as a PublicMutable. +The count can be read by anyone to see how many proposals exist, and incremented +when new proposals are submitted.

+

Generic Parameters:

+
    +
  • T - The type of value stored (must implement Packable).
  • +
  • Context - The execution context (PublicContext or UtilityContext).
  • +
+

Advanced

+

Unlike private state variables which use notes, PublicMutable stores values +directly in Aztec's public data tree. This enables direct read and write +access to the current state during public function execution.

+

docs:start:public_mutable_struct

+
+

Implementations

+

impl<T> PublicMutable<T, PublicContext>

+ +
pub fn read(self) -> T +
where + T: Packable
+ +
+

Reads the current value stored in this PublicMutable state variable.

+

Returns

+
    +
  • T - The current value stored in this PublicMutable.
  • +
+

docs:start:public_mutable_struct_read

+
+
pub fn write(self, value: T) +
where + T: Packable
+ +
+

Writes a new value to this PublicMutable state variable.

+

Arguments

+
    +
  • value - The new value to store in this PublicMutable.
  • +
+

Advanced

+

This function updates the value stored in Aztec's public data tree. +The new value becomes immediately available to subsequent reads within +the same transaction.

+

docs:start:public_mutable_struct_write

+
+

impl<T> PublicMutable<T, UtilityContext>

+ +
pub unconstrained fn read(self) -> T +
where + T: Packable
+ +
+

Reads the current value stored in this PublicMutable state variable.

+

Notice that this function is executable only within a UtilityContext, which +is an unconstrained environment on the user's local device.

+

Returns

+
    +
  • T - The current value stored in this PublicMutable.
  • +
+
+

Trait implementations

+

impl<Context, let M: u32, T> StateVariable<M, Context> for PublicMutable<T, Context> +
where + T: Packable<N = M>

+ +
pub fn new(context: Context, storage_slot: Field) -> Self + +pub fn get_storage_slot(self) -> Field + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/single_private_immutable/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/single_private_immutable/index.html new file mode 100644 index 000000000000..185081f4f497 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/single_private_immutable/index.html @@ -0,0 +1,53 @@ + + + + + + +Module single_private_immutable documentation + + + + + +
+
aztec-nr - noir_aztec::state_vars::single_private_immutable
+

Module single_private_immutable

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/single_private_immutable/struct.SinglePrivateImmutable.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/single_private_immutable/struct.SinglePrivateImmutable.html new file mode 100644 index 000000000000..a06450d9f2b9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/single_private_immutable/struct.SinglePrivateImmutable.html @@ -0,0 +1,127 @@ + + + + + + +Struct SinglePrivateImmutable documentation + + + + + +
+ +

Struct SinglePrivateImmutable

+
pub struct SinglePrivateImmutable<Note, Context>
+{ /* private fields */ }
+
+
+

A state variable that holds a single private value that is set once and remains unchanged forever (unlike +crate::state_vars::private_immutable::PrivateImmutable, which holds one private value per account - hence +the name 'single').

+

Because this private value has no semantic owner, it is up to the application to determine which accounts will +learn of its existence via crate::note::note_message::NoteMessage::deliver_to.

+

Usage

+

Unlike crate::state_vars::private_immutable::PrivateImmutable which is "owned" (requiring wrapping in an +crate::state_vars::owned::Owned state variable), SinglePrivateImmutable is used directly in storage:

+
#[storage]
+struct Storage<Context> {
+    your_variable: SinglePrivateImmutable<YourNote, Context>,
+}
+

Example

+

A contract's configuration parameters can be represented as a SinglePrivateImmutable. Once set during contract +deployment or initial setup, these parameters remain constant for the lifetime of the contract. For example, an +account contract's signing public key is typically stored using SinglePrivateImmutable. Note that the configuration +would be visible only to the parties to which the NoteMessage returned from the initialize(...) function is +delivered.

+

Requirements

+

The contract that holds this state variable must have keys associated with it. This is because the initialization +nullifier includes the contract's nullifying secret key (nsk) in its preimage and because the contract is set as +the owner of the underlying note. This is expected to not ever be a problem because the contracts that use +SinglePrivateImmutable generally have keys associated with them (account contracts or escrow contracts).

+

Implementations

+

impl<Note> SinglePrivateImmutable<Note, UtilityContext>

+ +
pub unconstrained fn is_initialized(self) -> bool +
where + Note: NoteType, + Note: NoteHash, + Note: Eq
+ +
+

Returns whether this SinglePrivateImmutable has been initialized.

+
+
pub unconstrained fn view_note(self) -> Note +
where + Note: Packable, + Note: NoteType, + Note: NoteHash, + Note: Eq
+ +
+

Returns the permanent note in this SinglePrivateImmutable state variable instance.

+
+

impl<Note> SinglePrivateImmutable<Note, &mut PrivateContext>

+ +
pub fn initialize(self, note: Note) -> NoteMessage<Note> +
where + Note: NoteType, + Note: NoteHash, + Note: Packable
+ +
+

Initializes a SinglePrivateImmutable state variable instance with a permanent note and returns a +NoteMessage that allows you to decide what method of note message delivery to use.

+

This function inserts the single, permanent note for this state variable. It can only be called once per +SinglePrivateImmutable. Subsequent calls will fail because the initialization nullifier will already exist.

+
pub fn get_note(self) -> Note +
where + Note: NoteType, + Note: NoteHash, + Note: Packable
+ +
+

Reads the permanent note of a SinglePrivateImmutable state variable instance.

+

If this SinglePrivateImmutable state variable has not yet been initialized, no note will exist: the call will +fail and the transaction will not be provable.

+

Since the note is immutable, there's no risk of reading stale data or race conditions - the note never changes +after initialization.

+
+

impl<Context, Note> SinglePrivateImmutable<Note, Context>

+ +

Trait implementations

+

impl<Context, Note> StateVariable<1, Context> for SinglePrivateImmutable<Note, Context>

+ +
pub fn new(context: Context, storage_slot: Field) -> Self + +pub fn get_storage_slot(self) -> Field + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/single_use_claim/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/single_use_claim/index.html new file mode 100644 index 000000000000..d062e4a2fc06 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/single_use_claim/index.html @@ -0,0 +1,51 @@ + + + + + + +Module single_use_claim documentation + + + + + +
+
aztec-nr - noir_aztec::state_vars::single_use_claim
+

Module single_use_claim

+

Structs

    +
  • A private state variable type that represents a right each user can exercise at most once.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/single_use_claim/struct.SingleUseClaim.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/single_use_claim/struct.SingleUseClaim.html new file mode 100644 index 000000000000..03a0cd7e48d3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/single_use_claim/struct.SingleUseClaim.html @@ -0,0 +1,121 @@ + + + + + + +Struct SingleUseClaim documentation + + + + + +
+ +

Struct SingleUseClaim

+
pub struct SingleUseClaim<Context>
+{ /* private fields */ }
+
+
+

A private state variable type that represents a right each user can exercise at most once.

+

Because it is owned, you must wrap a SingleUseClaim inside an crate::state_vars::owned::Owned state variable +when using it in storage.

+

Example

+

The right to vote at most once can be implemented using SingleUseClaim as a primitive.

+
#[derive(Serialize, Deserialize)]
+struct ElectionId { id: Field }
+
+#[storage]
+struct Storage<Context> {
+    // election => candidate => number of votes
+    tally: Map<ElectionId, Map<Field, PublicMutable<Field, Context>, Context>, Context>,
+    // track right to vote at most once per election
+    vote_claims: Map<ElectionId, Owned<SingleUseClaim<Context>, Context>, Context>,
+}
+
+#[external("private")]
+fn cast_vote(election_id: ElectionId, candidate: Field) {
+    let voter = self.msg_sender().unwrap();
+
+    // `claim` will only succeed if `voter` hasn't already claimed for this `election_id` before.
+    self.storage.vote_claims.at(election_id).at(voter).claim();
+
+    // Now that we checked that the voter is entitled to vote,
+    // we can enqueue the corresponding public effect
+    self.enqueue_self.add_to_tally_public(election_id, candidate);
+}
+

For more details on what owned means, see the documentation for the OwnedStateVariable trait.

+

Cost

+

Exercising a claim (via the SingleUseClaim::claim function) emits one nullifier.

+

Privacy considerations

+

The SingleUseClaim::claim function emits a public nullifier per owner: it's fully private, +hidden behind the owner's app-siloed nullifier secret key (aka nsk).

+

Public effects you emit alongside a claim (e.g. a public function call to update a tally) +may still let observers infer who likely exercised the claim, so consider that when designing flows.

+
+

Implementations

+

impl SingleUseClaim<UtilityContext>

+ +
pub unconstrained fn has_claimed(self) -> bool + +
+

Returns whether an owner has claimed this single use claim.

+
+

impl<Context> SingleUseClaim<Context>

+ +

impl SingleUseClaim<&mut PrivateContext>

+ +
pub fn claim(self) + +
+

Records the fact that the owner in scope has claimed this single use claim.

+

This function succeeds at most once for a given owner. Any subsequent calls with same owner are +guaranteed to fail.

+

Note that, by itself, calling this function doesn't do anything other than prevent it being called again +with the same owner. Its invocation is typically accompanied by other contract actions, e.g. minting tokens, +casting a vote, etc.

+

Advanced

+

The implementation of this function emits a nullifier derived from +the owner's nullifier secret key and the storage slot of the underlying state variable.

+
+
pub fn assert_claimed(self) + +
+

Asserts that the owner has already claimed this single use claim +(i.e. that SingleUseClaim::claim has been called).

+

Advanced

+

This function generates a kernel nullifier read request, so it can even assert the existence of +pending claims, i.e. when SingleUseClaim::claim was called in the same transaction as +SingleUseClaim::assert_claimed.

+

Trait implementations

+

impl<Context> OwnedStateVariable<Context> for SingleUseClaim<Context>

+ +
pub fn new(context: Context, storage_slot: Field, owner: AztecAddress) -> Self + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/state_variable/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/state_variable/index.html new file mode 100644 index 000000000000..4fb9a0853cab --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/state_variable/index.html @@ -0,0 +1,53 @@ + + + + + + +Module state_variable documentation + + + + + +
+
aztec-nr - noir_aztec::state_vars::state_variable
+

Module state_variable

+

Traits

    +
  • A trait that defines the common interface for all Aztec state variables. State variables are variables that can be +stored in the contract's storage. Examples of state variables are Owned, PublicMutable, Map or +DelayedPublicMutable.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/state_variable/trait.StateVariable.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/state_variable/trait.StateVariable.html new file mode 100644 index 000000000000..ff04e877bd59 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/state_variable/trait.StateVariable.html @@ -0,0 +1,97 @@ + + + + + + +Trait StateVariable documentation + + + + + +
+ +

Trait StateVariable

+
pub trait StateVariable<let N: u32, Context> {
+    // Required methods
+    pub fn new(context: Context, storage_slot: Field) -> Self;
+    pub fn get_storage_slot(self) -> Field;
+}
+ +
+

A trait that defines the common interface for all Aztec state variables. State variables are variables that can be +stored in the contract's storage. Examples of state variables are Owned, PublicMutable, Map or +DelayedPublicMutable.

+

Type Parameters

+
    +
  • N - A compile-time constant that determines how many storage slots need to be reserved for this state variable.
  • +
  • Context - The execution context type (e.g., PublicContext, PrivateContext, UtilityContext). The context +determines which methods of the state variable are available and controls whether the variable can +be accessed in public, private or utility functions.
  • +
+
+

Required methods

+
pub fn new(context: Context, storage_slot: Field) -> Self + +
+

Initializes a new state variable at a given storage slot.

+

This function is automatically called within the #[storage] macro and needs to be manually called only when +#[storage_no_init] is used.

+
+
pub fn get_storage_slot(self) -> Field + +
+

Returns the storage slot at which the state variable is placed. Typically used only when testing the contract or +when using a lower-level API like get_notes function.

+
+

Implementors

+

impl<Context, let InitialDelay: u64, let M: u32, T> StateVariable<M + 1, Context> for DelayedPublicMutable<T, InitialDelay, Context> +
where + DelayedPublicMutableValues<T, InitialDelay>: Packable<N = M>

+ +

impl<Context, K, V> StateVariable<1, Context> for Map<K, V, Context>

+ +

impl<Context, V> StateVariable<1, Context> for Owned<V, Context>

+ +

impl<Context, let M: u32, T> StateVariable<M + 1, Context> for PublicImmutable<T, Context> +
where + T: Packable<N = M>

+ +

impl<Context, let M: u32, T> StateVariable<M, Context> for PublicMutable<T, Context> +
where + T: Packable<N = M>

+ +

impl<Context, Note> StateVariable<1, Context> for SinglePrivateImmutable<Note, Context>

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/storage/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/storage/index.html new file mode 100644 index 000000000000..8805310f295d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/storage/index.html @@ -0,0 +1,51 @@ + + + + + + +Module storage documentation + + + + + +
+ +

Module storage

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/storage/struct.Storable.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/storage/struct.Storable.html new file mode 100644 index 000000000000..1a016197490b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/state_vars/storage/struct.Storable.html @@ -0,0 +1,42 @@ + + + + + + +Struct Storable documentation + + + + + +
+ +

Struct Storable

+
pub struct Storable {
+    pub slot: Field,
+}
+
+

Fields

+
slot: Field
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/authwit/fn.add_private_authwit_from_call.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/authwit/fn.add_private_authwit_from_call.html new file mode 100644 index 000000000000..67b30b4127bf --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/authwit/fn.add_private_authwit_from_call.html @@ -0,0 +1,39 @@ + + + + + + +Function add_private_authwit_from_call documentation + + + + + +
+ +

Function add_private_authwit_from_call

+
pub unconstrained fn add_private_authwit_from_call<let M: u32, let N: u32, T>(
+    env: TestEnvironment,
+    on_behalf_of: AztecAddress,
+    caller: AztecAddress,
+    call: PrivateCall<M, N, T>,
+)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/authwit/fn.add_public_authwit_from_call.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/authwit/fn.add_public_authwit_from_call.html new file mode 100644 index 000000000000..9c9b4b0a1cd6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/authwit/fn.add_public_authwit_from_call.html @@ -0,0 +1,39 @@ + + + + + + +Function add_public_authwit_from_call documentation + + + + + +
+ +

Function add_public_authwit_from_call

+
pub unconstrained fn add_public_authwit_from_call<let M: u32, let N: u32, T>(
+    env: TestEnvironment,
+    on_behalf_of: AztecAddress,
+    caller: AztecAddress,
+    call: PublicCall<M, N, T>,
+)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/authwit/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/authwit/index.html new file mode 100644 index 000000000000..b5ab3d46f871 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/authwit/index.html @@ -0,0 +1,43 @@ + + + + + + +Module authwit documentation + + + + + +
+ +

Module authwit

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/index.html new file mode 100644 index 000000000000..d5a7b6abdd30 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/index.html @@ -0,0 +1,43 @@ + + + + + + +Module helpers documentation + + + + + +
+ +

Module helpers

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/test_environment/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/test_environment/index.html new file mode 100644 index 000000000000..e578f1ef6901 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/test_environment/index.html @@ -0,0 +1,47 @@ + + + + + + +Module test_environment documentation + + + + + +
+
aztec-nr - noir_aztec::test::helpers::test_environment
+

Module test_environment

+

Structs

    +
  • Configuration values for TestEnvironment::private_context_opts. Meant to be used by calling new and then +chaining methods setting each value, e.g.:

    +
    env.private_context_opts(PrivateContextOptions::new().at_anchor_block_number(5), ...);
  • +
  • This represents an Aztec test run, and contains all the methods utilized during one to interact with the network and +manipulate its state (e.g. create accounts, make contract calls, etc.). Each test is expected to have its own +instance of TestEnvironment, as tests execute in parallel and so cannot share this object.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/test_environment/struct.PrivateContextOptions.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/test_environment/struct.PrivateContextOptions.html new file mode 100644 index 000000000000..c6e670bc4032 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/test_environment/struct.PrivateContextOptions.html @@ -0,0 +1,69 @@ + + + + + + +Struct PrivateContextOptions documentation + + + + + +
+ +

Struct PrivateContextOptions

+
pub struct PrivateContextOptions
+{ /* private fields */ }
+
+
+

Configuration values for TestEnvironment::private_context_opts. Meant to be used by calling new and then +chaining methods setting each value, e.g.:

+
env.private_context_opts(PrivateContextOptions::new().at_anchor_block_number(5), ...);
+

Implementations

+

impl PrivateContextOptions

+ +
pub fn new() -> Self + +
+

Creates a new PrivateContextOptions with default values, i.e. the same as if using the private_context +method instead of private_context_opts. Use the at_anchor_block_number and other methods to set the +desired configuration values.

+
+
pub fn at_anchor_block_number(&mut self, anchor_block_number: u32) -> Self + +
+

Sets the desired anchor block number to base the private context in. Only past block numbers can be +specified.

+

If not set, defaults to the last block number.

+
+
pub fn at_contract_address(&mut self, contract_address: AztecAddress) -> Self + +
+

Sets the contract address in which the private context will execute, which will affect note and nullifier +siloing, storage access, etc.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/test_environment/struct.TestEnvironment.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/test_environment/struct.TestEnvironment.html new file mode 100644 index 000000000000..75a3fa03b0c2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/test_environment/struct.TestEnvironment.html @@ -0,0 +1,465 @@ + + + + + + +Struct TestEnvironment documentation + + + + + +
+ +

Struct TestEnvironment

+
pub struct TestEnvironment
+{ /* private fields */ }
+
+
+

This represents an Aztec test run, and contains all the methods utilized during one to interact with the network and +manipulate its state (e.g. create accounts, make contract calls, etc.). Each test is expected to have its own +instance of TestEnvironment, as tests execute in parallel and so cannot share this object.

+

Most tests will begin by creating a TestEnvironment variable, and then make multiple calls to its different +methods. E.g.:

+
#[test]
+fn sample_test() {
+    let mut env = TestEnvironment::new();
+
+    // Create an account to call contracts from
+    let account = env.create_light_account();
+    // Deploy a compiled contract
+    let contract_addr = env.deploy("MyContract").without_initializer();
+
+    // Call a contract private function and get the return value
+    let result = env.private_call(account, MyContract::at(contract_addr).sample_private_function());
+    assert_eq(result, expected);
+}
+

Implementations

+

impl TestEnvironment

+ +
pub unconstrained fn new() -> Self + +
+

Creates a new TestEnvironment. This function should only be called once per test.

+
+
pub unconstrained fn public_context<Env, T>( + self, + f: unconstrained fn[Env](PublicContext) -> T, +) -> T + +
+

Creates a PublicContext, which allows using aztec-nr features as if inside a public contract function. Useful +for low-level testing of public state variables and utilities.

+

A new block is automatically mined once public_context returns, containing all of the side effects caused by +its execution (e.g. public storage writes). It is however NOT possible to make any contract calls from this +public context - use call_public for testing contract calls (though usage of call_public is forbidden while +inside public_context).

+

Receives a callback function which is called with the created PublicContext - this function is where testing +logic is expected to reside. Any values returned by it are bubbled-up and returned to the caller of +public_context. Do NOT return the PublicContext from the callback function, or use it in any way outside +of it - it becomes invalid once public_context returns.

+

See public_context_at for a variant that allows specifying the contract address.

+

Sample usage

+
env.public_context(|context| {
+  let state_var = PublicMutable::new(context, STORAGE_SLOT);
+  state_var.write(some_value);
+  assert_eq(state_var.read(), some_value);
+});
+

Advanced usage with returns

+
let read_value = env.public_context(|context| {
+  let state_var = PublicMutable::new(context, STORAGE_SLOT);
+  state_var.read()
+});
+
pub unconstrained fn public_context_at<Env, T>( + self, + addr: AztecAddress, + f: unconstrained fn[Env](PublicContext) -> T, +) -> T + +
+

Variant of public_context which allows specifying the contract address in which the public context will +execute, which will affect note and nullifier siloing, storage access, etc.

+
+
pub unconstrained fn private_context<Env, T>( + self, + f: unconstrained fn[Env](&mut PrivateContext) -> T, +) -> T + +
+

Creates a PrivateContext, which allows using aztec-nr features as if inside a private contract function. +Useful for low-level testing of private state variables and utilities.

+

A new block is automatically mined once private_context returns, containing all of the side effects caused by +its execution (e.g. note and nullifier emission). It is however NOT possible to make any contract calls from this +private context, neither private nor enqueued public calls - use call_private and call_public for testing +contract calls (though usage of these is forbidden while inside private_context).

+

Receives a callback function which is called with the created PrivateContext - this function is where testing +logic is expected to reside. Any values returned by it are bubbled-up and returned to the caller of +private_context. Do NOT return the PrivateContext from the callback function, or use it in any way +outside of it - it becomes invalid once private_context returns.

+

See private_context_at for a variant that allows specifying the contract address, or private_context_opts +for even more configurability.

+

Sample usage

+
env.private_context(|context| {
+  let state_var = PrivateMutable::new(context, STORAGE_SLOT);
+  let note = SampleNote::new(some_value);
+  state_var.initialize(note);
+  assert_eq(state_var.get_note(), note);
+});
+

Advanced usage with returns

+
let note = env.private_context(|context| {
+  let state_var = PrivateMutable::new(context, STORAGE_SLOT);
+  state_var.get_note()
+});
+
pub unconstrained fn private_context_at<Env, T>( + self, + addr: AztecAddress, + f: unconstrained fn[Env](&mut PrivateContext) -> T, +) -> T + +
+

Variant of private_context which allows specifying the contract address in which the private context will +execute, which will affect note and nullifier siloing, storage access, etc.

+
+
pub unconstrained fn private_context_opts<Env, T>( + _self: Self, + opts: PrivateContextOptions, + f: unconstrained fn[Env](&mut PrivateContext) -> T, +) -> T + +
+

Variant of private_context which allows specifying multiple configuration values via PrivateContextOptions.

+
+
pub unconstrained fn utility_context<Env, T>( + self, + f: unconstrained fn[Env](UtilityContext) -> T, +) -> T + +
+

Creates a UtilityContext, which allows using aztec-nr features as if inside a utility contract function. +Useful for low-level testing of private and public state variable utilities.

+

Receives a callback function which is called with the created Utility - this function is where testing +logic is expected to reside. Any values returned by it are bubbled-up and returned to the caller of +utility_context. Do NOT return the Utility from the callback function, or use it in any way outside of +it - it becomes invalid once utility_context returns.

+

See utility_context_at for a variant that allows specifying the contract address.

+

Sample usage

+
env.utility_context(|context| {
+  let state_var = PrivateMutable::new(context, STORAGE_SLOT);
+  let note = SampleNote::new(some_value);
+  assert_eq(state_var.view_note(), note);
+});
+

Advanced usage with returns

+
let note = env.utility_context(|context| {
+  let state_var = PrivateMutable::new(context, STORAGE_SLOT);
+  state_var.view_note()
+});
+
pub unconstrained fn utility_context_at<Env, T>( + self, + addr: AztecAddress, + f: unconstrained fn[Env](UtilityContext) -> T, +) -> T + +
+

Variant of utility_context which allows specifying the contract address in which the utility context will +execute, which will affect note and storage access.

+
+
pub unconstrained fn next_block_number(_self: Self) -> u32 + +
+

Returns the number of the next block to be mined.

+
+
pub unconstrained fn last_block_number(_self: Self) -> u32 + +
+

Returns the number of the last mined block. This is the default anchor block for private_context and +private_call.

+
+
pub unconstrained fn last_block_timestamp(_self: Self) -> u64 + +
+

Returns the timestamp of the last mined block. Note that block timestamps do not automatically advance - this +must be done by calling mine_block_at or set_next_block_timestamp.

+
+
pub unconstrained fn mine_block_at(self, timestamp: u64) + +
+

Mines an empty block (i.e. with no transactions) at timestamp, causing followup public executions to occur at +that timestamp (e.g. via call_public or public_context), and making it possible to create private executions +at the specified timestamp (e.g. via call_private or private_context).

+
+
pub unconstrained fn set_next_block_timestamp(self, timestamp: u64) + +
+

Sets the timestamp of the next block to be mined, causing followup public executions to occur at that timestamp +(e.g. via call_public or public_context).

+
+
pub unconstrained fn mine_block(_self: Self) + +
+

Mines an empty block (i.e. with no transactions). Note that block timestamps do not automatically advance - this +must be done by calling mine_block_at or set_next_block_timestamp.

+
+
pub unconstrained fn advance_next_block_timestamp_by(_self: Self, duration: u64) + +
+

Sets the timestamp of the next block to be mined to be ahead of the last one by duration.

+
+
pub unconstrained fn create_contract_account(&mut self) -> AztecAddress + +
+

Creates a new account that can be used as the from parameter in contract calls, e.g. in private_call or +public_call, or be made the owner or recipient of notes in private_context.

+

The returned account has a full set of privacy keys, so it can nullify notes, receive messages, etc. It also has +an associated SchnorrAccount contract that can process authwit requests - the authwits can be added via the +add_private_authwit_from_call and add_public_authwit_from_call helper functions. If +authwits are not required, consider using create_light_account instead, which is a faster variant of this +function.

+

Each call to create_contract_account will return a different address, and so it can be called repeatedly to +generate multiple addresses. These addresses are also different from the ones that create_light_account +returns, and so these two functions can be mixed and match to create a set of unique accounts.

+
+
pub unconstrained fn create_light_account(&mut self) -> AztecAddress + +
+

Creates a new account that can be used as the from parameter in contract calls, e.g. in private_call or +public_call, or be made the owner or recipient of notes in private_context. This is a faster variant of +create_contract_account, but comes with reduced capabilities.

+

The returned account has a full set of privacy keys, so it can nullify notes, receive messages, etc. It doesn't +however have an associated account contract, so it cannot process private authwit requests. If calling contracts +that rely on private authwits, use create_contract_account instead.

+

Each call to create_light_account will return a different address, and so it can be called repeatedly to +generate multiple addresses. These addresses are also different from the ones that create_contract_account +returns, and so these two functions can be mixed and match to create a set of unique accounts.

+
+
pub unconstrained fn deploy<let N: u32>( + &mut self, + path: str<N>, +) -> ContractDeployment<N> + +
+

Prepares a contract for deployment, so that its private, public and utility functions can be called. The +contract must be already compiled before tests are run, and must be recompiled if changed for the tests +to deploy the updated version.

+

In order to finalize the deployment, the proper initializer function must be specified via one of the associated +methods. For more information on how to specify the path and initialization, read the sections below.

+

Path

+

Contracts can be deployed from either the same crate as the test, from a different crate in the same workspace, +or from an altogether independent crate.

+

If deploying contracts from the same crate as the test, just refer to it by its name:

+
TestEnvironment::new().deploy("MyContract");
+

If deploying contracts from a different crate in the same workspace, use @crate_name/contract_name:

+
TestEnvironment::new().deploy("@my_contract_crate/MyContract");
+

If deploying contracts from a crate not in the workspace, use path_to_crate/contract_name, with the crate path +relative to the current workspace:

+
TestEnvironment::new().deploy("../my_other_crate/MyContract");
+

Initialization

+

If no initializer function needs to be called, use without_initializer:

+
let my_contract = TestEnvironment::new().deploy("MyContract").without_initializer();
+

For private initializers, use with_private_initializer:

+
let my_contract = TestEnvironment::new().deploy("MyContract").with_private_initializer(
+  PrivateInitContract::interface().private_init_fn(init_args)
+);
+

For public initializers, use with_public_initializer:

+
let my_contract = TestEnvironment::new().deploy("MyContract").with_public_initializer(
+  PublicInitContract::interface().public_init_fn(init_args)
+);
+
pub unconstrained fn call_private<let M: u32, let N: u32, T>( + _self: Self, + from: AztecAddress, + call: PrivateCall<M, N, T>, +) -> T +
where + T: Deserialize
+ +
+

Performs a private contract function call, including the processing of any nested private calls and enqueued +public calls. Returns the result of the called function.

+

The function is called by the from address - use create_contract_account or create_light_account to +generate sender addresses, depending on whether support for private authwit verification is required or not. +Note that execution will begin directly in the called function - no entrypoint function in from will be +executed.

+

A transaction is created containing all side effects of the call, which is then included in a block that gets +mined by the time call_private returns. It is therefore possible to chain multiple private or public function +calls that operate on the result of prior calls.

+

The call value can be obtained by calling the appropriate method on a contract type. E.g.:

+
let caller = env.create_light_account();
+let contract_addr = env.deploy("SampleContract").without_initializer();
+let return_value = env.call_private(caller, SampleContract::at(contract_addr).sample_private_function());
+
pub unconstrained fn view_private<let M: u32, let N: u32, T>( + _self: Self, + call: PrivateStaticCall<M, N, T>, +) -> T +
where + T: Deserialize
+ +
+

Variant of call_private for private #[view] functions.

+

Unlike call_private, no transaction is created and no block is mined (since #[view] functions are only +executable in a static context, and these produce no side effects).

+
+
pub unconstrained fn simulate_utility<let M: u32, let N: u32, T>( + _self: Self, + call: UtilityCall<M, N, T>, +) -> T +
where + T: Deserialize
+ +
+

Performs a utility contract function call and returns the result of the called function.

+

The call value can be obtained by calling the appropriate method on a contract type. E.g.:

+
let caller = env.create_light_account();
+let contract_addr = env.deploy("SampleContract").without_initializer();
+let return_value = env.simulate_utility(SampleContract::at(contract_addr).sample_utility_function());
+
pub unconstrained fn call_public<let M: u32, let N: u32, T>( + _self: Self, + from: AztecAddress, + call: PublicCall<M, N, T>, +) -> T +
where + T: Deserialize
+ +
+

Performs a public contract function call, including the processing of any nested public calls. Returns the +result of the called function.

+

The function is called by the from address - use create_contract_account or create_light_account to +generate sender addresses. Note that execution will begin directly in the called function - no private +entrypoint function in from will be executed - in fact no private execution of any kind will be performed.

+

A transaction is created containing all side effects of the call, which is then included in a block that gets +mined by the time call_public returns. It is therefore possible to chain multiple private or public function +calls that operate on the result of prior calls.

+

The call value can be obtained by calling the appropriate method on a contract type. E.g.:

+
let caller = env.create_light_account();
+let contract_addr = env.deploy("SampleContract").without_initializer();
+let return_value = env.call_public(caller, SampleContract::at(contract_addr).sample_public_function());
+
pub unconstrained fn call_public_incognito<let M: u32, let N: u32, T>( + _self: Self, + from: AztecAddress, + call: PublicCall<M, N, T>, +) -> T +
where + T: Deserialize
+ +
+

Performs a public contract function call, including the processing of any nested public calls. Returns the +result of the called function. +Variant of call_public, but the from address (msg_sender) is set to "null".

+
+
pub unconstrained fn view_public<let M: u32, let N: u32, T>( + _self: Self, + call: PublicStaticCall<M, N, T>, +) -> T +
where + T: Deserialize
+ +
+

Variant of call_public for public #[view] functions.

+

Unlike call_public, no transaction is created and no block is mined (since #[view] functions are only +executable in a static context, and these produce no side effects).

+
+
pub unconstrained fn view_public_incognito<let M: u32, let N: u32, T>( + _self: Self, + call: PublicStaticCall<M, N, T>, +) -> T +
where + T: Deserialize
+ +
+

Variant of view_public, but the from address (msg_sender) is set to "null"

+

Unlike call_public, no transaction is created and no block is mined (since #[view] functions are only +executable in a static context, and these produce no side effects).

+
+
pub unconstrained fn discover_note<Note>(self, note_message: NoteMessage<Note>) +
where + Note: Packable, + Note: NoteType, + Note: NoteHash
+ +
+

Discovers a note from a [NewNoteMessage], which is expected to have been created in the last transaction +(typically via private_context()) so that it can be retrieved in later transactions. This mimics the normal +note discovery process that takes place automatically in contracts.

+

[NewNoteMessage] values are typically returned by aztec-nr state variables that create notes and need to notify +a recipient of their existence. Instead of going through the message encoding, encryption and delivery that +would regularly take place in a contract, this function simply takes the [NewNoteMessage] and processes it as +needed to discover the underlying note.

+

See TestEnvironment::discover_note_at for a variant that allows specifying the contract address the note +belongs to.

+

Sample usage

+

The most common way to invoke this function is to obtain a note message created during the execution of a +private_context:

+
let note_message = env.private_context(|context| create_note(context, storage_slot, note));
+
+env.discover_note(note_message);
+
+env.private_context(|context| { let (retrieved_note, _) = get_note::<MockNote>(context, storage_slot); });
+
pub unconstrained fn discover_note_at<Note>( + self, + addr: AztecAddress, + note_message: NoteMessage<Note>, +) +
where + Note: Packable, + Note: NoteType, + Note: NoteHash
+ +
+

Variant of discover_note which allows specifying the contract address the note belongs to, which is required +when the note was not emitted in the default address used by private_context.

+
let note_message = env.private_context_at(contract_address, |context| {
+    create_note(context, storage_slot, note)
+});
+
+env.discover_note_at(contract_address, note_message);
+
+env.private_context_at(contract_address, |context| {
+    let (retrieved_note, _) = get_note::<MockNote>(context, storage_slot);
+});
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.add_account.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.add_account.html new file mode 100644 index 000000000000..d0437dc672ad --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.add_account.html @@ -0,0 +1,50 @@ + + + + + + +Function add_account documentation + + + + + +
+ +

Function add_account

+
pub unconstrained fn add_account(secret: Field) -> TestAccount
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.add_authwit.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.add_authwit.html new file mode 100644 index 000000000000..700c66235b28 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.add_authwit.html @@ -0,0 +1,50 @@ + + + + + + +Function add_authwit documentation + + + + + +
+ +

Function add_authwit

+
pub unconstrained fn add_authwit(address: AztecAddress, message_hash: Field)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.advance_blocks_by.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.advance_blocks_by.html new file mode 100644 index 000000000000..0db7ff5e168f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.advance_blocks_by.html @@ -0,0 +1,50 @@ + + + + + + +Function advance_blocks_by documentation + + + + + +
+ +

Function advance_blocks_by

+
pub unconstrained fn advance_blocks_by(blocks: u32)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.advance_timestamp_by.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.advance_timestamp_by.html new file mode 100644 index 000000000000..4da4626108be --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.advance_timestamp_by.html @@ -0,0 +1,50 @@ + + + + + + +Function advance_timestamp_by documentation + + + + + +
+ +

Function advance_timestamp_by

+
pub unconstrained fn advance_timestamp_by(duration: u64)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.create_account.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.create_account.html new file mode 100644 index 000000000000..fe5964b6b760 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.create_account.html @@ -0,0 +1,50 @@ + + + + + + +Function create_account documentation + + + + + +
+ +

Function create_account

+
pub unconstrained fn create_account(secret: Field) -> TestAccount
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.deploy.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.deploy.html new file mode 100644 index 000000000000..64ceacea3a16 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.deploy.html @@ -0,0 +1,55 @@ + + + + + + +Function deploy documentation + + + + + +
+ +

Function deploy

+
pub unconstrained fn deploy<let M: u32, let N: u32, let P: u32>(
+    path: str<N>,
+    initializer: str<P>,
+    args: [Field; M],
+    secret: Field,
+) -> ContractInstance
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.deploy_oracle.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.deploy_oracle.html new file mode 100644 index 000000000000..c3f25fa58cd0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.deploy_oracle.html @@ -0,0 +1,55 @@ + + + + + + +Function deploy_oracle documentation + + + + + +
+ +

Function deploy_oracle

+
pub unconstrained fn deploy_oracle<let N: u32, let P: u32>(
+    path: str<N>,
+    initializer: str<P>,
+    args: [Field],
+    secret: Field,
+) -> [Field; 16]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.get_last_block_timestamp.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.get_last_block_timestamp.html new file mode 100644 index 000000000000..e55537bef659 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.get_last_block_timestamp.html @@ -0,0 +1,50 @@ + + + + + + +Function get_last_block_timestamp documentation + + + + + +
+ +

Function get_last_block_timestamp

+
pub unconstrained fn get_last_block_timestamp() -> u64
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.get_last_tx_effects.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.get_last_tx_effects.html new file mode 100644 index 000000000000..375cdb176759 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.get_last_tx_effects.html @@ -0,0 +1,51 @@ + + + + + + +Function get_last_tx_effects documentation + + + + + +
+ +

Function get_last_tx_effects

+
pub unconstrained fn get_last_tx_effects(
+) -> (Field, BoundedVec<Field, 64>, BoundedVec<Field, 64>)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.get_next_block_number.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.get_next_block_number.html new file mode 100644 index 000000000000..4f35bbb07c30 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.get_next_block_number.html @@ -0,0 +1,50 @@ + + + + + + +Function get_next_block_number documentation + + + + + +
+ +

Function get_next_block_number

+
pub unconstrained fn get_next_block_number() -> u32
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.get_next_block_timestamp.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.get_next_block_timestamp.html new file mode 100644 index 000000000000..8ec8c44e756a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.get_next_block_timestamp.html @@ -0,0 +1,50 @@ + + + + + + +Function get_next_block_timestamp documentation + + + + + +
+ +

Function get_next_block_timestamp

+
pub unconstrained fn get_next_block_timestamp() -> u64
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.private_call_new_flow.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.private_call_new_flow.html new file mode 100644 index 000000000000..0e62b619e6b2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.private_call_new_flow.html @@ -0,0 +1,57 @@ + + + + + + +Function private_call_new_flow documentation + + + + + +
+ +

Function private_call_new_flow

+
pub unconstrained fn private_call_new_flow<let M: u32, let N: u32>(
+    from: AztecAddress,
+    contract_address: AztecAddress,
+    function_selector: FunctionSelector,
+    args: [Field; M],
+    args_hash: Field,
+    is_static_call: bool,
+) -> [Field; N]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.public_call_new_flow.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.public_call_new_flow.html new file mode 100644 index 000000000000..a6ecaae42d98 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.public_call_new_flow.html @@ -0,0 +1,56 @@ + + + + + + +Function public_call_new_flow documentation + + + + + +
+ +

Function public_call_new_flow

+
pub unconstrained fn public_call_new_flow<let M: u32, let N: u32>(
+    from: Option<AztecAddress>,
+    contract_address: AztecAddress,
+    function_selector: FunctionSelector,
+    args: [Field; M],
+    is_static_call: bool,
+) -> [Field; N]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.set_private_txe_context.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.set_private_txe_context.html new file mode 100644 index 000000000000..67ca2c69ca96 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.set_private_txe_context.html @@ -0,0 +1,53 @@ + + + + + + +Function set_private_txe_context documentation + + + + + +
+ +

Function set_private_txe_context

+
pub unconstrained fn set_private_txe_context(
+    contract_address: Option<AztecAddress>,
+    anchor_block_number: Option<u32>,
+) -> PrivateContextInputs
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.set_public_txe_context.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.set_public_txe_context.html new file mode 100644 index 000000000000..76ea306c5dcc --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.set_public_txe_context.html @@ -0,0 +1,50 @@ + + + + + + +Function set_public_txe_context documentation + + + + + +
+ +

Function set_public_txe_context

+
pub unconstrained fn set_public_txe_context(contract_address: Option<AztecAddress>)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.set_top_level_txe_context.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.set_top_level_txe_context.html new file mode 100644 index 000000000000..5382ab0659d3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.set_top_level_txe_context.html @@ -0,0 +1,50 @@ + + + + + + +Function set_top_level_txe_context documentation + + + + + +
+ +

Function set_top_level_txe_context

+
pub unconstrained fn set_top_level_txe_context()
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.set_utility_txe_context.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.set_utility_txe_context.html new file mode 100644 index 000000000000..c1b8f97fd380 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.set_utility_txe_context.html @@ -0,0 +1,50 @@ + + + + + + +Function set_utility_txe_context documentation + + + + + +
+ +

Function set_utility_txe_context

+
pub unconstrained fn set_utility_txe_context(contract_address: Option<AztecAddress>)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.simulate_utility_function.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.simulate_utility_function.html new file mode 100644 index 000000000000..6f5141ad2478 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/fn.simulate_utility_function.html @@ -0,0 +1,54 @@ + + + + + + +Function simulate_utility_function documentation + + + + + +
+ +

Function simulate_utility_function

+
pub unconstrained fn simulate_utility_function<let M: u32, let N: u32>(
+    contract_address: AztecAddress,
+    function_selector: FunctionSelector,
+    args: [Field; M],
+) -> [Field; N]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/index.html new file mode 100644 index 000000000000..269ab65e4ac9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/txe_oracles/index.html @@ -0,0 +1,59 @@ + + + + + + +Module txe_oracles documentation + + + + + +
+
aztec-nr - noir_aztec::test::helpers::txe_oracles
+

Module txe_oracles

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/utils/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/utils/index.html new file mode 100644 index 000000000000..20e86d86c1fb --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/utils/index.html @@ -0,0 +1,43 @@ + + + + + + +Module utils documentation + + + + + +
+ +

Module utils

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/utils/struct.ContractDeployment.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/utils/struct.ContractDeployment.html new file mode 100644 index 000000000000..70a2ad19b444 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/utils/struct.ContractDeployment.html @@ -0,0 +1,116 @@ + + + + + + +Struct ContractDeployment documentation + + + + + +
+ +

Struct ContractDeployment

+
pub struct ContractDeployment<let O: u32> {
+    pub env: TestEnvironment,
+    pub path: str<O>,
+    pub secret: Field,
+}
+
+

Fields

+ +
path: str<O>
+
secret: Field
+

Implementations

+

impl<let O: u32> ContractDeployment<O>

+ +
pub unconstrained fn with_private_initializer<let M: u32, let N: u32, T>( + self, + from: AztecAddress, + initializer_call: PrivateCall<M, N, T>, +) -> AztecAddress +
where + T: Deserialize
+ +
+

Finalizes a contract deployment prepared via TestEnvironment::deploy by calling a private initializer function +from the from account.

+

The initializer_call is created by calling the intended private initializer function inside the contract's +interface() with its arguments:

+
contract MyContract {
+  #[external("private")]
+  #[initializer]
+  fn init_fn(owner: AztecAddress) { ... }
+}
+
+#[test]
+unconstrained fn test_deployment() {
+  let contract_address = TestEnvironment::new().deploy("MyContract").with_private_initializer(
+    MyContract::interface().init_fn(owner)
+  );
+}
+
pub unconstrained fn with_public_initializer<let M: u32, let N: u32, T>( + self, + from: AztecAddress, + initializer_call: PublicCall<M, N, T>, +) -> AztecAddress +
where + T: Deserialize
+ +
+

Finalizes a contract deployment prepared via TestEnvironment::deploy by calling a public initializer function +from the from account.

+

The initializer_call is created by calling the intended public initializer function inside the contract's +interface() with its arguments:

+
contract MyContract {
+  #[external("public")]
+  #[initializer]
+  fn init_fn(owner: AztecAddress) { ... }
+}
+
+#[test]
+unconstrained fn test_deployment() {
+  let contract_address = TestEnvironment::new().deploy("MyContract").with_public_initializer(
+    MyContract::interface().init_fn(owner)
+  );
+}
+
pub unconstrained fn without_initializer(self) -> AztecAddress + +
+

Finalizes a contract deployment prepared via TestEnvironment::deploy without calling any initializer function.

+

Note that initializers cannot be manually called once this function returns, since the contract address itself +contains a commitment to the lack of initialization arguments as per the protocol rules. Initializers can only +be invoked by using the with_private_initializer or with_public_initializer functions.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/utils/struct.TestAccount.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/utils/struct.TestAccount.html new file mode 100644 index 000000000000..8ae142da1999 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/helpers/utils/struct.TestAccount.html @@ -0,0 +1,60 @@ + + + + + + +Struct TestAccount documentation + + + + + +
+ +

Struct TestAccount

+
pub struct TestAccount {
+    pub address: AztecAddress,
+    pub keys: PublicKeys,
+}
+
+

Fields

+
address: AztecAddress
+
+

Trait implementations

+

impl Deserialize for TestAccount

+ +
pub fn deserialize(serialized: [Field; 13]) -> Self + +

impl Serialize for TestAccount

+ +
pub fn serialize(self) -> [Field; 13] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/index.html new file mode 100644 index 000000000000..032e4592837b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/index.html @@ -0,0 +1,54 @@ + + + + + + +Module test documentation + + + + + +
+ +

Module test

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/mocks/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/mocks/index.html new file mode 100644 index 000000000000..db76e1d69adc --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/mocks/index.html @@ -0,0 +1,40 @@ + + + + + + +Module mocks documentation + + + + + +
+ +

Module mocks

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/mocks/mock_note/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/mocks/mock_note/index.html new file mode 100644 index 000000000000..a01afac5a7bc --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/mocks/mock_note/index.html @@ -0,0 +1,32 @@ + + + + + + +Module mock_note documentation + + + + + +
+
aztec-nr - noir_aztec::test::mocks::mock_note
+

Module mock_note

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/mocks/mock_struct/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/mocks/mock_struct/index.html new file mode 100644 index 000000000000..7373b32f4e99 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/mocks/mock_struct/index.html @@ -0,0 +1,39 @@ + + + + + + +Module mock_struct documentation + + + + + +
+
aztec-nr - noir_aztec::test::mocks::mock_struct
+

Module mock_struct

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/mocks/mock_struct/struct.MockStruct.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/mocks/mock_struct/struct.MockStruct.html new file mode 100644 index 000000000000..654788628a6e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/test/mocks/mock_struct/struct.MockStruct.html @@ -0,0 +1,83 @@ + + + + + + +Struct MockStruct documentation + + + + + +
+ +

Struct MockStruct

+
pub struct MockStruct {
+    pub a: Field,
+    pub b: Field,
+}
+
+

Fields

+ +
+

Implementations

+

impl MockStruct

+ +

Trait implementations

+

impl Deserialize for MockStruct

+ +
pub fn deserialize(fields: [Field; 2]) -> Self + +

impl Empty for MockStruct

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for MockStruct

+ +
pub fn eq(self, other: Self) -> bool + +

impl Packable for MockStruct

+ +
pub fn pack(self) -> [Field; 2] + +pub fn unpack(fields: [Field; 2]) -> Self + +

impl Serialize for MockStruct

+ +
pub fn serialize(self) -> [Field; 2] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/array/append/fn.append.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/array/append/fn.append.html new file mode 100644 index 000000000000..cbda7e2a5a37 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/array/append/fn.append.html @@ -0,0 +1,40 @@ + + + + + + +Function append documentation + + + + + +
+ +

Function append

+
pub fn append<T, let ALen: u32, let BLen: u32, let DstLen: u32>(
+    a: BoundedVec<T, ALen>,
+    b: BoundedVec<T, BLen>,
+) -> BoundedVec<T, DstLen>
+ +
+

Appends the elements of the second BoundedVec to the end of the first one. The resulting BoundedVec can have any arbitrary maximum length, but it must be +large enough to fit all of the elements of both the first and second vectors.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/array/append/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/array/append/index.html new file mode 100644 index 000000000000..5178e1eb86a4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/array/append/index.html @@ -0,0 +1,43 @@ + + + + + + +Module append documentation + + + + + +
+ +

Module append

+

Functions

    +
  • Appends the elements of the second BoundedVec to the end of the first one. The resulting BoundedVec can have any arbitrary maximum length, but it must be +large enough to fit all of the elements of both the first and second vectors.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/array/collapse/fn.collapse.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/array/collapse/fn.collapse.html new file mode 100644 index 000000000000..fdc239a8f9ea --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/array/collapse/fn.collapse.html @@ -0,0 +1,43 @@ + + + + + + +Function collapse documentation + + + + + +
+ +

Function collapse

+
pub fn collapse<T, let N: u32>(input: [Option<T>; N]) -> BoundedVec<T, N>
+
where + T: Eq
+ +
+

Collapses an array of Options with sparse Some values into a BoundedVec, essentially unwrapping the Options +and removing the None values.

+

For example, given: +input: [some(3), none(), some(1)] +this returns +collapsed: [3, 1]

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/array/collapse/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/array/collapse/index.html new file mode 100644 index 000000000000..a7df18a34d31 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/array/collapse/index.html @@ -0,0 +1,43 @@ + + + + + + +Module collapse documentation + + + + + +
+ +

Module collapse

+

Functions

    +
  • Collapses an array of Options with sparse Some values into a BoundedVec, essentially unwrapping the Options +and removing the None values.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/array/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/array/index.html new file mode 100644 index 000000000000..0732fe1cc784 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/array/index.html @@ -0,0 +1,56 @@ + + + + + + +Module array documentation + + + + + +
+ +

Module array

+

Re-exports

    +
  • pub use noir_aztec::utils::array::append::append;
  • +
  • pub use noir_aztec::utils::array::collapse::collapse;
  • +
  • pub use noir_aztec::utils::array::subarray::subarray;
  • +
  • pub use noir_aztec::utils::array::subbvec::subbvec;
  • +
+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/array/subarray/fn.subarray.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/array/subarray/fn.subarray.html new file mode 100644 index 000000000000..4e0708b2fe3e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/array/subarray/fn.subarray.html @@ -0,0 +1,44 @@ + + + + + + +Function subarray documentation + + + + + +
+ +

Function subarray

+
pub fn subarray<T, let SrcLen: u32, let DstLen: u32>(
+    src: [T; SrcLen],
+    offset: u32,
+) -> [T; DstLen]
+ +
+

Returns DstLen elements from a source array, starting at offset. DstLen must not be larger than the number +of elements past offset.

+

Examples:

+
let foo: [Field; 2] = subarray([1, 2, 3, 4, 5], 2);
+assert_eq(foo, [3, 4]);
+
+let bar: [Field; 5] = subarray([1, 2, 3, 4, 5], 2); // fails - we can't return 5 elements since only 3 remain
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/array/subarray/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/array/subarray/index.html new file mode 100644 index 000000000000..45f6ced52c44 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/array/subarray/index.html @@ -0,0 +1,43 @@ + + + + + + +Module subarray documentation + + + + + +
+ +

Module subarray

+

Functions

    +
  • Returns DstLen elements from a source array, starting at offset. DstLen must not be larger than the number +of elements past offset.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/array/subbvec/fn.subbvec.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/array/subbvec/fn.subbvec.html new file mode 100644 index 000000000000..5174c9fb4472 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/array/subbvec/fn.subbvec.html @@ -0,0 +1,48 @@ + + + + + + +Function subbvec documentation + + + + + +
+ +

Function subbvec

+
pub fn subbvec<T, let SrcMaxLen: u32, let DstMaxLen: u32>(
+    bvec: BoundedVec<T, SrcMaxLen>,
+    offset: u32,
+) -> BoundedVec<T, DstMaxLen>
+ +
+

Returns DstMaxLen elements from a source BoundedVec, starting at offset. offset must not be larger than the +original length, and DstLen must not be larger than the total number of elements past offset (including the +zeroed elements past len()).

+

Only elements at the beginning of the vector can be removed: it is not possible to also remove elements at the end +of the vector by passing a value for DstLen that is smaller than len() - offset.

+

Examples:

+
let foo = BoundedVec::<_, 10>::from_array([1, 2, 3, 4, 5]);
+assert_eq(subbvec(foo, 2), BoundedVec::<_, 8>::from_array([3, 4, 5]));
+
+let bar: BoundedVec<_, 1> = subbvec(foo, 2); // fails - we can't return just 1 element since 3 remain
+let baz: BoundedVec<_, 10> = subbvec(foo, 3); // fails - we can't return 10 elements since only 7 remain
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/array/subbvec/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/array/subbvec/index.html new file mode 100644 index 000000000000..cd4d9a4a0bf5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/array/subbvec/index.html @@ -0,0 +1,44 @@ + + + + + + +Module subbvec documentation + + + + + +
+ +

Module subbvec

+

Functions

    +
  • Returns DstMaxLen elements from a source BoundedVec, starting at offset. offset must not be larger than the +original length, and DstLen must not be larger than the total number of elements past offset (including the +zeroed elements past len()).
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/comparison/fn.compare.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/comparison/fn.compare.html new file mode 100644 index 000000000000..fd78eff927f7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/comparison/fn.compare.html @@ -0,0 +1,36 @@ + + + + + + +Function compare documentation + + + + + +
+ +

Function compare

+
pub fn compare(lhs: Field, operation: u8, rhs: Field) -> bool
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/comparison/global.Comparator.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/comparison/global.Comparator.html new file mode 100644 index 000000000000..7022fa404682 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/comparison/global.Comparator.html @@ -0,0 +1,36 @@ + + + + + + +Global Comparator documentation + + + + + +
+ +

Global Comparator

+
pub global Comparator: ComparatorEnum;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/comparison/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/comparison/index.html new file mode 100644 index 000000000000..e76882c94e60 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/comparison/index.html @@ -0,0 +1,50 @@ + + + + + + +Module comparison documentation + + + + + +
+
aztec-nr - noir_aztec::utils::comparison
+

Module comparison

+

Functions

+

Globals

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/conversion/bytes_to_fields/fn.bytes_from_fields.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/conversion/bytes_to_fields/fn.bytes_from_fields.html new file mode 100644 index 000000000000..159a05175b41 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/conversion/bytes_to_fields/fn.bytes_from_fields.html @@ -0,0 +1,44 @@ + + + + + + +Function bytes_from_fields documentation + + + + + +
+ +

Function bytes_from_fields

+
pub fn bytes_from_fields<let N: u32>(
+    fields: BoundedVec<Field, N>,
+) -> BoundedVec<u8, N * 31>
+ +
+

Converts an input BoundedVec of fields into a BoundedVec of bytes in big-endian order. Arbitrary Field arrays +are not allowed: this is assumed to be an array obtained via bytes_to_fields, i.e. one that actually represents +bytes. To convert a Field array into bytes, use fields_to_bytes.

+

Each input field must contain at most 31 bytes (this is constrained to be so). +Each field is converted into 31 big-endian bytes, and the resulting 31-byte chunks are concatenated +back together in the order of the original fields.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/conversion/bytes_to_fields/fn.bytes_to_fields.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/conversion/bytes_to_fields/fn.bytes_to_fields.html new file mode 100644 index 000000000000..b1c433594d8b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/conversion/bytes_to_fields/fn.bytes_to_fields.html @@ -0,0 +1,42 @@ + + + + + + +Function bytes_to_fields documentation + + + + + +
+ +

Function bytes_to_fields

+
pub fn bytes_to_fields<let N: u32>(bytes: [u8; N]) -> [Field; N / 31]
+ +
+

Converts the input bytes into an array of fields. A Field is ~254 bits meaning that each field can store 31 whole +bytes. Use bytes_from_fields to obtain the original bytes array.

+

The input bytes are chunked into chunks of 31 bytes. Each 31-byte chunk is viewed as big-endian, and is converted +into a Field. +For example, [1, 10, 3, ..., 0] (31 bytes) is encoded as [1 * 256^30 + 10 * 256^29 + 3 * 256^28 + ... + 0] +Note: N must be a multiple of 31 bytes

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/conversion/bytes_to_fields/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/conversion/bytes_to_fields/index.html new file mode 100644 index 000000000000..96c4b59d20ad --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/conversion/bytes_to_fields/index.html @@ -0,0 +1,44 @@ + + + + + + +Module bytes_to_fields documentation + + + + + +
+
aztec-nr - noir_aztec::utils::conversion::bytes_to_fields
+

Module bytes_to_fields

+

Functions

    +
  • Converts an input BoundedVec of fields into a BoundedVec of bytes in big-endian order. Arbitrary Field arrays +are not allowed: this is assumed to be an array obtained via bytes_to_fields, i.e. one that actually represents +bytes. To convert a Field array into bytes, use fields_to_bytes.
  • +
  • Converts the input bytes into an array of fields. A Field is ~254 bits meaning that each field can store 31 whole +bytes. Use bytes_from_fields to obtain the original bytes array.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/conversion/fields_to_bytes/fn.fields_from_bytes.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/conversion/fields_to_bytes/fn.fields_from_bytes.html new file mode 100644 index 000000000000..6454aba842b2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/conversion/fields_to_bytes/fn.fields_from_bytes.html @@ -0,0 +1,44 @@ + + + + + + +Function fields_from_bytes documentation + + + + + +
+ +

Function fields_from_bytes

+
pub fn fields_from_bytes<let N: u32>(bytes: BoundedVec<u8, N>) -> BoundedVec<Field, N / 32>
+ +
+

Converts an input BoundedVec of bytes into a BoundedVec of fields. Arbitrary byte arrays are not allowed: this +is assumed to be an array obtained via fields_to_bytes, i.e. one that actually represents fields. To convert +a byte array into Fields, use bytes_to_fields.

+

The input bytes are chunked into chunks of 32 bytes. Each 32-byte chunk is viewed as big-endian, and is converted +into a Field. +For example, [1, 10, 3, ..., 0] (32 bytes) is encoded as [1 * 256^31 + 10 * 256^30 + 3 * 256^29 + ... + 0] +Note 1: N must be a multiple of 32 bytes +Note 2: The max value check code was taken from std::field::to_be_bytes function.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/conversion/fields_to_bytes/fn.fields_to_bytes.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/conversion/fields_to_bytes/fn.fields_to_bytes.html new file mode 100644 index 000000000000..0e247bfa80e6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/conversion/fields_to_bytes/fn.fields_to_bytes.html @@ -0,0 +1,45 @@ + + + + + + +Function fields_to_bytes documentation + + + + + +
+ +

Function fields_to_bytes

+
pub fn fields_to_bytes<let N: u32>(fields: [Field; N]) -> [u8; N * 32]
+ +
+

Converts an input array of fields into a single array of bytes. Use fields_from_bytes to obtain the original +field array. +Each field is converted to a 32-byte big-endian array.

+

For example, if you have a field array [123, 456], it will be converted to a 64-byte array: +[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,123, // First field (32 bytes) +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,200] // Second field (32 bytes)

+

Since a field is ~254 bits, you'll end up with a subtle 2-bit "gap" at the big end, every 32 bytes. Be careful +that such a gap doesn't leak information! This could happen if you for example expected the output to be +indistinguishable from random bytes.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/conversion/fields_to_bytes/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/conversion/fields_to_bytes/index.html new file mode 100644 index 000000000000..040b2c79af08 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/conversion/fields_to_bytes/index.html @@ -0,0 +1,45 @@ + + + + + + +Module fields_to_bytes documentation + + + + + +
+
aztec-nr - noir_aztec::utils::conversion::fields_to_bytes
+

Module fields_to_bytes

+

Functions

    +
  • Converts an input BoundedVec of bytes into a BoundedVec of fields. Arbitrary byte arrays are not allowed: this +is assumed to be an array obtained via fields_to_bytes, i.e. one that actually represents fields. To convert +a byte array into Fields, use bytes_to_fields.
  • +
  • Converts an input array of fields into a single array of bytes. Use fields_from_bytes to obtain the original +field array. +Each field is converted to a 32-byte big-endian array.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/conversion/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/conversion/index.html new file mode 100644 index 000000000000..cdbb7590487b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/conversion/index.html @@ -0,0 +1,54 @@ + + + + + + +Module conversion documentation + + + + + +
+
aztec-nr - noir_aztec::utils::conversion
+

Module conversion

+

Re-exports

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/index.html new file mode 100644 index 000000000000..c374699ce666 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/index.html @@ -0,0 +1,60 @@ + + + + + + +Module utils documentation + + + + + +
+ +

Module utils

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/point/fn.get_sign_of_point.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/point/fn.get_sign_of_point.html new file mode 100644 index 000000000000..d45932a2e395 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/point/fn.get_sign_of_point.html @@ -0,0 +1,39 @@ + + + + + + +Function get_sign_of_point documentation + + + + + +
+ +

Function get_sign_of_point

+
pub fn get_sign_of_point(p: EmbeddedCurvePoint) -> bool
+ +
+

Returns: true if p.y <= MOD_DIV_2, else false.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/point/fn.point_from_x_coord.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/point/fn.point_from_x_coord.html new file mode 100644 index 000000000000..ef544f867310 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/point/fn.point_from_x_coord.html @@ -0,0 +1,42 @@ + + + + + + +Function point_from_x_coord documentation + + + + + +
+ +

Function point_from_x_coord

+
pub fn point_from_x_coord(x: Field) -> Option<EmbeddedCurvePoint>
+ +
+

Returns a Point in the Grumpkin curve given its x coordinate.

+

Because not all values in the field are valid x coordinates of points in the curve (i.e. there +is no corresponding y value in the field that satisfies the curve equation), it may not be +possible to reconstruct a Point. Option::none() is returned in such cases.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/point/fn.point_from_x_coord_and_sign.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/point/fn.point_from_x_coord_and_sign.html new file mode 100644 index 000000000000..d8108c0f22e5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/point/fn.point_from_x_coord_and_sign.html @@ -0,0 +1,44 @@ + + + + + + +Function point_from_x_coord_and_sign documentation + + + + + +
+ +

Function point_from_x_coord_and_sign

+
pub fn point_from_x_coord_and_sign(x: Field, sign: bool) -> Option<EmbeddedCurvePoint>
+ +
+

Returns a Point in the Grumpkin curve given its x coordinate and sign for the y coordinate.

+

Because not all values in the field are valid x coordinates of points in the curve (i.e. there +is no corresponding y value in the field that satisfies the curve equation), it may not be +possible to reconstruct a Point. Option::none() is returned in such cases.

+

@param x - The x coordinate of the point +@param sign - The "sign" of the y coordinate - determines whether y <= (Fr.MODULUS - 1) / 2

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/point/fn.point_to_bytes.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/point/fn.point_to_bytes.html new file mode 100644 index 000000000000..838b3ee8427e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/point/fn.point_to_bytes.html @@ -0,0 +1,41 @@ + + + + + + +Function point_to_bytes documentation + + + + + +
+ +

Function point_to_bytes

+
pub fn point_to_bytes(p: EmbeddedCurvePoint) -> [u8; 32]
+ +
+

Converts a point to a byte array.

+

We don't serialize the point at infinity flag because this function is used in situations where we do not want +to waste the extra byte (encrypted log).

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/point/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/point/index.html new file mode 100644 index 000000000000..8982dd62a3fd --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/point/index.html @@ -0,0 +1,49 @@ + + + + + + +Module point documentation + + + + + +
+ +

Module point

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/random/fn.get_random_bytes.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/random/fn.get_random_bytes.html new file mode 100644 index 000000000000..3f39f2ee7027 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/random/fn.get_random_bytes.html @@ -0,0 +1,36 @@ + + + + + + +Function get_random_bytes documentation + + + + + +
+ +

Function get_random_bytes

+
pub unconstrained fn get_random_bytes<let N: u32>() -> [u8; N]
+ +
+

Returns as many random bytes as specified through N.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/random/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/random/index.html new file mode 100644 index 000000000000..691510c50317 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/random/index.html @@ -0,0 +1,46 @@ + + + + + + +Module random documentation + + + + + +
+ +

Module random

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/remove_constraints/fn.remove_constraints.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/remove_constraints/fn.remove_constraints.html new file mode 100644 index 000000000000..d6beadb2bd25 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/remove_constraints/fn.remove_constraints.html @@ -0,0 +1,38 @@ + + + + + + +Function remove_constraints documentation + + + + + +
+ +

Function remove_constraints

+
pub unconstrained fn remove_constraints<Env, T>(f: fn[Env]() -> T) -> T
+ +
+

Calls a function and returns its return value, but removes any constraints associated with calling the function, +behaving as if the function was unconstrained.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/remove_constraints/fn.remove_constraints_if.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/remove_constraints/fn.remove_constraints_if.html new file mode 100644 index 000000000000..7c6244667746 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/remove_constraints/fn.remove_constraints_if.html @@ -0,0 +1,39 @@ + + + + + + +Function remove_constraints_if documentation + + + + + +
+ +

Function remove_constraints_if

+
pub fn remove_constraints_if<Env, T>(condition: bool, f: fn[Env]() -> T) -> T
+ +
+

Calls a function and returns its return value, removing any constraints associated with calling the function if +condition is true, behaving as if the function was unconstrained.

+

Requires condition to be a compile time constant.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/remove_constraints/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/remove_constraints/index.html new file mode 100644 index 000000000000..50a3df9ba0b5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/remove_constraints/index.html @@ -0,0 +1,49 @@ + + + + + + +Module remove_constraints documentation + + + + + +
+
aztec-nr - noir_aztec::utils::remove_constraints
+

Module remove_constraints

+

Functions

    +
  • Calls a function and returns its return value, but removes any constraints associated with calling the function, +behaving as if the function was unconstrained.
  • +
  • Calls a function and returns its return value, removing any constraints associated with calling the function if +condition is true, behaving as if the function was unconstrained.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/to_bytes/fn.arr_to_be_bytes_arr.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/to_bytes/fn.arr_to_be_bytes_arr.html new file mode 100644 index 000000000000..6813d6d6b464 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/to_bytes/fn.arr_to_be_bytes_arr.html @@ -0,0 +1,34 @@ + + + + + + +Function arr_to_be_bytes_arr documentation + + + + + +
+ +

Function arr_to_be_bytes_arr

+
pub fn arr_to_be_bytes_arr<let L: u32>(fields: [Field; L]) -> [u8; L * 32]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/to_bytes/fn.str_to_be_bytes_arr.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/to_bytes/fn.str_to_be_bytes_arr.html new file mode 100644 index 000000000000..dc163c1896d3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/to_bytes/fn.str_to_be_bytes_arr.html @@ -0,0 +1,34 @@ + + + + + + +Function str_to_be_bytes_arr documentation + + + + + +
+ +

Function str_to_be_bytes_arr

+
pub fn str_to_be_bytes_arr<let L: u32>(string: str<L>) -> [u8; L * 32]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/to_bytes/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/to_bytes/index.html new file mode 100644 index 000000000000..3c5abc8f748d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/to_bytes/index.html @@ -0,0 +1,47 @@ + + + + + + +Module to_bytes documentation + + + + + +
+ +

Module to_bytes

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/with_hash/index.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/with_hash/index.html new file mode 100644 index 000000000000..f9bc9660626b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/with_hash/index.html @@ -0,0 +1,46 @@ + + + + + + +Module with_hash documentation + + + + + +
+
aztec-nr - noir_aztec::utils::with_hash
+

Module with_hash

+

Structs

    +
  • A struct that allows for efficient reading of value T from public storage in private.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/with_hash/struct.WithHash.html b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/with_hash/struct.WithHash.html new file mode 100644 index 000000000000..20cc04b89f3b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/noir_aztec/utils/with_hash/struct.WithHash.html @@ -0,0 +1,108 @@ + + + + + + +Struct WithHash documentation + + + + + +
+ +

Struct WithHash

+
pub struct WithHash<T, let M: u32>
+{ /* private fields */ }
+
+
+

A struct that allows for efficient reading of value T from public storage in private.

+

The efficient reads are achieved by verifying large values through a single hash check +and then proving inclusion only of the hash in public storage. This reduces the number +of required tree inclusion proofs from M to 1.

+

Type Parameters

+
    +
  • T: The underlying type being wrapped, must implement Packable<N>
  • +
  • M: The number of field elements required to pack values of type T
  • +
+
+

Implementations

+

impl<let M: u32, T> WithHash<T, M>

+ +
pub fn new(value: T) -> Self +
where + T: Packable<N = M>, + T: Eq
+ +pub fn get_value(self) -> T +
where + T: Packable<N = M>, + T: Eq
+ +pub fn get_hash(self) -> Field +
where + T: Packable<N = M>, + T: Eq
+ +pub fn public_storage_read(context: PublicContext, storage_slot: Field) -> T +
where + T: Packable<N = M>, + T: Eq
+ +pub unconstrained fn utility_public_storage_read( + context: UtilityContext, + storage_slot: Field, +) -> T +
where + T: Packable<N = M>, + T: Eq
+ +pub fn historical_public_storage_read( + header: BlockHeader, + address: AztecAddress, + storage_slot: Field, +) -> T +
where + T: Packable<N = M>, + T: Eq
+ +

Trait implementations

+

impl<let M: u32, T> Packable for WithHash<T, M> +
where + T: Packable<N = M>

+ +
pub fn pack(self) -> [Field; M + 1] + +pub fn unpack(packed: [Field; M + 1]) -> Self + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/index.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/index.html new file mode 100644 index 000000000000..ed1f0d8f9ef6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/index.html @@ -0,0 +1,48 @@ + + + + + + +Crate poseidon documentation + + + + + +
+
aztec-nr - poseidon
+

Crate poseidon

+

Re-exports

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_10_config.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_10_config.html new file mode 100644 index 000000000000..aa96026f4b4c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_10_config.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_10_config documentation + + + + + +
+ +

Function x5_10_config

+
pub fn x5_10_config() -> PoseidonConfig<10, 140, 1140>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_11_config.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_11_config.html new file mode 100644 index 000000000000..22bd9640fd7c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_11_config.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_11_config documentation + + + + + +
+ +

Function x5_11_config

+
pub fn x5_11_config() -> PoseidonConfig<11, 154, 1386>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_12_config.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_12_config.html new file mode 100644 index 000000000000..8e7b0162f96d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_12_config.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_12_config documentation + + + + + +
+ +

Function x5_12_config

+
pub fn x5_12_config() -> PoseidonConfig<12, 156, 1380>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_13_config.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_13_config.html new file mode 100644 index 000000000000..ab457d4e332c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_13_config.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_13_config documentation + + + + + +
+ +

Function x5_13_config

+
pub fn x5_13_config() -> PoseidonConfig<13, 169, 1625>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_14_config.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_14_config.html new file mode 100644 index 000000000000..f8007506902c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_14_config.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_14_config documentation + + + + + +
+ +

Function x5_14_config

+
pub fn x5_14_config() -> PoseidonConfig<14, 182, 1890>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_15_config.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_15_config.html new file mode 100644 index 000000000000..b3e6c6632b6b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_15_config.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_15_config documentation + + + + + +
+ +

Function x5_15_config

+
pub fn x5_15_config() -> PoseidonConfig<15, 180, 1740>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_16_config.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_16_config.html new file mode 100644 index 000000000000..6cdaa7aa192e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_16_config.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_16_config documentation + + + + + +
+ +

Function x5_16_config

+
pub fn x5_16_config() -> PoseidonConfig<16, 192, 1984>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_17_config.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_17_config.html new file mode 100644 index 000000000000..a8f3f35cb0e9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_17_config.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_17_config documentation + + + + + +
+ +

Function x5_17_config

+
pub fn x5_17_config() -> PoseidonConfig<17, 204, 2244>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_2_config.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_2_config.html new file mode 100644 index 000000000000..83ac3109ffa9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_2_config.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_2_config documentation + + + + + +
+ +

Function x5_2_config

+
pub fn x5_2_config() -> PoseidonConfig<2, 72, 168>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_3_config.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_3_config.html new file mode 100644 index 000000000000..2affc3755789 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_3_config.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_3_config documentation + + + + + +
+ +

Function x5_3_config

+
pub fn x5_3_config() -> PoseidonConfig<3, 81, 285>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_4_config.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_4_config.html new file mode 100644 index 000000000000..b76a7ae269fd --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_4_config.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_4_config documentation + + + + + +
+ +

Function x5_4_config

+
pub fn x5_4_config() -> PoseidonConfig<4, 88, 392>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_5_config.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_5_config.html new file mode 100644 index 000000000000..d81d1995730a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_5_config.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_5_config documentation + + + + + +
+ +

Function x5_5_config

+
pub fn x5_5_config() -> PoseidonConfig<5, 100, 540>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_6_config.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_6_config.html new file mode 100644 index 000000000000..43b21a8037f8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_6_config.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_6_config documentation + + + + + +
+ +

Function x5_6_config

+
pub fn x5_6_config() -> PoseidonConfig<6, 108, 660>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_7_config.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_7_config.html new file mode 100644 index 000000000000..12cef397babb --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_7_config.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_7_config documentation + + + + + +
+ +

Function x5_7_config

+
pub fn x5_7_config() -> PoseidonConfig<7, 119, 819>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_8_config.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_8_config.html new file mode 100644 index 000000000000..9b4b355346a1 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_8_config.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_8_config documentation + + + + + +
+ +

Function x5_8_config

+
pub fn x5_8_config() -> PoseidonConfig<8, 128, 960>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_9_config.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_9_config.html new file mode 100644 index 000000000000..958df6d4fa7a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/fn.x5_9_config.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_9_config documentation + + + + + +
+ +

Function x5_9_config

+
pub fn x5_9_config() -> PoseidonConfig<9, 135, 1071>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/index.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/index.html new file mode 100644 index 000000000000..a008b6b79d7d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/consts/index.html @@ -0,0 +1,74 @@ + + + + + + +Module consts documentation + + + + + +
+ +

Module consts

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_1.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_1.html new file mode 100644 index 000000000000..1db66cf9fdac --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_1.html @@ -0,0 +1,53 @@ + + + + + + +Function hash_1 documentation + + + + + +
+ +

Function hash_1

+
pub fn hash_1(input: [Field; 1]) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_10.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_10.html new file mode 100644 index 000000000000..d7cba1a0f3b0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_10.html @@ -0,0 +1,53 @@ + + + + + + +Function hash_10 documentation + + + + + +
+ +

Function hash_10

+
pub fn hash_10(input: [Field; 10]) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_11.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_11.html new file mode 100644 index 000000000000..eef50c7c3866 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_11.html @@ -0,0 +1,53 @@ + + + + + + +Function hash_11 documentation + + + + + +
+ +

Function hash_11

+
pub fn hash_11(input: [Field; 11]) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_12.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_12.html new file mode 100644 index 000000000000..e94e3e42e581 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_12.html @@ -0,0 +1,53 @@ + + + + + + +Function hash_12 documentation + + + + + +
+ +

Function hash_12

+
pub fn hash_12(input: [Field; 12]) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_13.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_13.html new file mode 100644 index 000000000000..e86dd7c34e8f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_13.html @@ -0,0 +1,53 @@ + + + + + + +Function hash_13 documentation + + + + + +
+ +

Function hash_13

+
pub fn hash_13(input: [Field; 13]) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_14.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_14.html new file mode 100644 index 000000000000..516e9af2a0de --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_14.html @@ -0,0 +1,53 @@ + + + + + + +Function hash_14 documentation + + + + + +
+ +

Function hash_14

+
pub fn hash_14(input: [Field; 14]) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_15.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_15.html new file mode 100644 index 000000000000..e16455a5bf8c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_15.html @@ -0,0 +1,53 @@ + + + + + + +Function hash_15 documentation + + + + + +
+ +

Function hash_15

+
pub fn hash_15(input: [Field; 15]) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_16.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_16.html new file mode 100644 index 000000000000..e8380d0f56f8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_16.html @@ -0,0 +1,53 @@ + + + + + + +Function hash_16 documentation + + + + + +
+ +

Function hash_16

+
pub fn hash_16(input: [Field; 16]) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_2.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_2.html new file mode 100644 index 000000000000..6723bff172cf --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_2.html @@ -0,0 +1,53 @@ + + + + + + +Function hash_2 documentation + + + + + +
+ +

Function hash_2

+
pub fn hash_2(input: [Field; 2]) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_3.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_3.html new file mode 100644 index 000000000000..da0c0d29064a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_3.html @@ -0,0 +1,53 @@ + + + + + + +Function hash_3 documentation + + + + + +
+ +

Function hash_3

+
pub fn hash_3(input: [Field; 3]) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_4.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_4.html new file mode 100644 index 000000000000..ad10514c85c9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_4.html @@ -0,0 +1,53 @@ + + + + + + +Function hash_4 documentation + + + + + +
+ +

Function hash_4

+
pub fn hash_4(input: [Field; 4]) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_5.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_5.html new file mode 100644 index 000000000000..c006dd8c181c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_5.html @@ -0,0 +1,53 @@ + + + + + + +Function hash_5 documentation + + + + + +
+ +

Function hash_5

+
pub fn hash_5(input: [Field; 5]) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_6.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_6.html new file mode 100644 index 000000000000..99d1ad0f70b2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_6.html @@ -0,0 +1,53 @@ + + + + + + +Function hash_6 documentation + + + + + +
+ +

Function hash_6

+
pub fn hash_6(input: [Field; 6]) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_7.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_7.html new file mode 100644 index 000000000000..8973a69b1226 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_7.html @@ -0,0 +1,53 @@ + + + + + + +Function hash_7 documentation + + + + + +
+ +

Function hash_7

+
pub fn hash_7(input: [Field; 7]) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_8.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_8.html new file mode 100644 index 000000000000..209ee5789bc0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_8.html @@ -0,0 +1,53 @@ + + + + + + +Function hash_8 documentation + + + + + +
+ +

Function hash_8

+
pub fn hash_8(input: [Field; 8]) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_9.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_9.html new file mode 100644 index 000000000000..769f8e6386f8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.hash_9.html @@ -0,0 +1,53 @@ + + + + + + +Function hash_9 documentation + + + + + +
+ +

Function hash_9

+
pub fn hash_9(input: [Field; 9]) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.sponge.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.sponge.html new file mode 100644 index 000000000000..40ecc5d2e2b8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/fn.sponge.html @@ -0,0 +1,53 @@ + + + + + + +Function sponge documentation + + + + + +
+ +

Function sponge

+
pub fn sponge<let N: u32>(msg: [Field; N]) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/index.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/index.html new file mode 100644 index 000000000000..e6a0e603be9f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/index.html @@ -0,0 +1,68 @@ + + + + + + +Module bn254 documentation + + + + + +
+ +

Module bn254

+

Modules

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_10.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_10.html new file mode 100644 index 000000000000..04623d2522f4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_10.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_10 documentation + + + + + +
+ +

Function x5_10

+
pub fn x5_10(state: [Field; 10]) -> [Field; 10]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_11.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_11.html new file mode 100644 index 000000000000..88e537f4d6ba --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_11.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_11 documentation + + + + + +
+ +

Function x5_11

+
pub fn x5_11(state: [Field; 11]) -> [Field; 11]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_12.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_12.html new file mode 100644 index 000000000000..43e8556db03d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_12.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_12 documentation + + + + + +
+ +

Function x5_12

+
pub fn x5_12(state: [Field; 12]) -> [Field; 12]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_13.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_13.html new file mode 100644 index 000000000000..bd5d2cea9ddc --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_13.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_13 documentation + + + + + +
+ +

Function x5_13

+
pub fn x5_13(state: [Field; 13]) -> [Field; 13]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_14.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_14.html new file mode 100644 index 000000000000..4fdfb883c0f8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_14.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_14 documentation + + + + + +
+ +

Function x5_14

+
pub fn x5_14(state: [Field; 14]) -> [Field; 14]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_15.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_15.html new file mode 100644 index 000000000000..150f80ca5427 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_15.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_15 documentation + + + + + +
+ +

Function x5_15

+
pub fn x5_15(state: [Field; 15]) -> [Field; 15]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_16.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_16.html new file mode 100644 index 000000000000..86177447b413 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_16.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_16 documentation + + + + + +
+ +

Function x5_16

+
pub fn x5_16(state: [Field; 16]) -> [Field; 16]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_17.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_17.html new file mode 100644 index 000000000000..7d31ae108fea --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_17.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_17 documentation + + + + + +
+ +

Function x5_17

+
pub fn x5_17(state: [Field; 17]) -> [Field; 17]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_2.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_2.html new file mode 100644 index 000000000000..8de79db229e8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_2.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_2 documentation + + + + + +
+ +

Function x5_2

+
pub fn x5_2(state: [Field; 2]) -> [Field; 2]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_3.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_3.html new file mode 100644 index 000000000000..4a8d01839adc --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_3.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_3 documentation + + + + + +
+ +

Function x5_3

+
pub fn x5_3(state: [Field; 3]) -> [Field; 3]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_4.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_4.html new file mode 100644 index 000000000000..87df2cdeb528 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_4.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_4 documentation + + + + + +
+ +

Function x5_4

+
pub fn x5_4(state: [Field; 4]) -> [Field; 4]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_5.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_5.html new file mode 100644 index 000000000000..6921f5ffec36 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_5.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_5 documentation + + + + + +
+ +

Function x5_5

+
pub fn x5_5(state: [Field; 5]) -> [Field; 5]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_6.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_6.html new file mode 100644 index 000000000000..204a2bfce601 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_6.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_6 documentation + + + + + +
+ +

Function x5_6

+
pub fn x5_6(state: [Field; 6]) -> [Field; 6]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_7.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_7.html new file mode 100644 index 000000000000..254185bcf05d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_7.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_7 documentation + + + + + +
+ +

Function x5_7

+
pub fn x5_7(state: [Field; 7]) -> [Field; 7]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_8.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_8.html new file mode 100644 index 000000000000..9f188bf968db --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_8.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_8 documentation + + + + + +
+ +

Function x5_8

+
pub fn x5_8(state: [Field; 8]) -> [Field; 8]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_9.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_9.html new file mode 100644 index 000000000000..a65a4d610ea7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/fn.x5_9.html @@ -0,0 +1,48 @@ + + + + + + +Function x5_9 documentation + + + + + +
+ +

Function x5_9

+
pub fn x5_9(state: [Field; 9]) -> [Field; 9]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/index.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/index.html new file mode 100644 index 000000000000..099b8d3e71dc --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/bn254/perm/index.html @@ -0,0 +1,74 @@ + + + + + + +Module perm documentation + + + + + +
+ +

Module perm

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/fn.config.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/fn.config.html new file mode 100644 index 000000000000..bd9c7a904509 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/fn.config.html @@ -0,0 +1,50 @@ + + + + + + +Function config documentation + + + + + +
+ +

Function config

+
pub fn config<let T: u32, let N: u32, let X: u32>(
+    t: Field,
+    rf: u8,
+    rp: u8,
+    alpha: Field,
+    round_constants: [Field; N],
+    mds: [[Field; T]; T],
+    presparse_mds: [[Field; T]; T],
+    sparse_mds: [Field; X],
+) -> PoseidonConfig<T, N, X>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/fn.permute.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/fn.permute.html new file mode 100644 index 000000000000..2810bf5053e1 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/fn.permute.html @@ -0,0 +1,44 @@ + + + + + + +Function permute documentation + + + + + +
+ +

Function permute

+
pub fn permute<let T: u32, let N: u32, let X: u32>(
+    pos_conf: PoseidonConfig<T, N, X>,
+    state: [Field; T],
+) -> [Field; T]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/index.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/index.html new file mode 100644 index 000000000000..fe1f8895f0b5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/index.html @@ -0,0 +1,50 @@ + + + + + + +Module poseidon documentation + + + + + +
+
aztec-nr - poseidon::poseidon
+

Module poseidon

+

Modules

+

Structs

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/struct.PoseidonConfig.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/struct.PoseidonConfig.html new file mode 100644 index 000000000000..47f005fc9d2b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/struct.PoseidonConfig.html @@ -0,0 +1,43 @@ + + + + + + +Struct PoseidonConfig documentation + + + + + +
+ +

Struct PoseidonConfig

+
pub struct PoseidonConfig<let T: u32, let N: u32, let X: u32>
+{ /* private fields */ }
+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/struct.PoseidonHasher.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/struct.PoseidonHasher.html new file mode 100644 index 000000000000..5c6a216ebf1d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon/struct.PoseidonHasher.html @@ -0,0 +1,59 @@ + + + + + + +Struct PoseidonHasher documentation + + + + + +
+ +

Struct PoseidonHasher

+
pub struct PoseidonHasher
+{ /* private fields */ }
+
+

Trait implementations

+

impl Default for PoseidonHasher

+ +
pub fn default() -> Self + +

impl Hasher for PoseidonHasher

+ +
pub fn finish(self) -> Field + +pub fn write(&mut self, input: Field) + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon2/index.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon2/index.html new file mode 100644 index 000000000000..e85848dd88a2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon2/index.html @@ -0,0 +1,41 @@ + + + + + + +Module poseidon2 documentation + + + + + +
+
aztec-nr - poseidon::poseidon2
+

Module poseidon2

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon2/struct.Poseidon2.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon2/struct.Poseidon2.html new file mode 100644 index 000000000000..d6ad1124ccdb --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon2/struct.Poseidon2.html @@ -0,0 +1,45 @@ + + + + + + +Struct Poseidon2 documentation + + + + + +
+ +

Struct Poseidon2

+
pub struct Poseidon2
+{ /* private fields */ }
+
+

Implementations

+

impl Poseidon2

+ +
pub fn hash<let N: u32>(input: [Field; N], message_size: u32) -> Field + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon2/struct.Poseidon2Hasher.html b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon2/struct.Poseidon2Hasher.html new file mode 100644 index 000000000000..24f1892859f7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/poseidon/poseidon2/struct.Poseidon2Hasher.html @@ -0,0 +1,52 @@ + + + + + + +Struct Poseidon2Hasher documentation + + + + + +
+ +

Struct Poseidon2Hasher

+
pub struct Poseidon2Hasher
+{ /* private fields */ }
+
+

Trait implementations

+

impl Default for Poseidon2Hasher

+ +
pub fn default() -> Self + +

impl Hasher for Poseidon2Hasher

+ +
pub fn finish(self) -> Field + +pub fn write(&mut self, input: Field) + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/avm_accumulated_data/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/avm_accumulated_data/index.html new file mode 100644 index 000000000000..f00dd2c61734 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/avm_accumulated_data/index.html @@ -0,0 +1,44 @@ + + + + + + +Module avm_accumulated_data documentation + + + + + +
+
aztec-nr - protocol_types::abis::accumulated_data::avm_accumulated_data
+

Module avm_accumulated_data

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/avm_accumulated_data/struct.AvmAccumulatedData.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/avm_accumulated_data/struct.AvmAccumulatedData.html new file mode 100644 index 000000000000..d0c8c3af3dd9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/avm_accumulated_data/struct.AvmAccumulatedData.html @@ -0,0 +1,83 @@ + + + + + + +Struct AvmAccumulatedData documentation + + + + + +
+ +

Struct AvmAccumulatedData

+
pub struct AvmAccumulatedData {
+    pub note_hashes: [Field; 64],
+    pub nullifiers: [Field; 64],
+    pub l2_to_l1_msgs: [Scoped<L2ToL1Message>; 8],
+    pub public_logs: PublicLogs,
+    pub public_data_writes: [PublicDataWrite; 64],
+}
+
+

Fields

+
note_hashes: [Field; 64]
+
nullifiers: [Field; 64]
+
l2_to_l1_msgs: [Scoped<L2ToL1Message>; 8]
+
public_logs: PublicLogs
+
public_data_writes: [PublicDataWrite; 64]
+

Trait implementations

+

impl Deserialize for AvmAccumulatedData

+ +
pub fn deserialize(serialized: [Field; 4377]) -> Self + +

impl Empty for AvmAccumulatedData

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for AvmAccumulatedData

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for AvmAccumulatedData

+ +
pub fn serialize(self) -> [Field; 4377] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/avm_accumulated_data/struct.AvmAccumulatedDataArrayLengths.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/avm_accumulated_data/struct.AvmAccumulatedDataArrayLengths.html new file mode 100644 index 000000000000..8eb6ccdbc262 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/avm_accumulated_data/struct.AvmAccumulatedDataArrayLengths.html @@ -0,0 +1,89 @@ + + + + + + +Struct AvmAccumulatedDataArrayLengths documentation + + + + + +
+ +

Struct AvmAccumulatedDataArrayLengths

+
pub struct AvmAccumulatedDataArrayLengths {
+    pub note_hashes: u32,
+    pub nullifiers: u32,
+    pub l2_to_l1_msgs: u32,
+    pub public_data_writes: u32,
+}
+
+

Fields

+
note_hashes: u32
+
nullifiers: u32
+
l2_to_l1_msgs: u32
+
public_data_writes: u32
+

Implementations

+

impl AvmAccumulatedDataArrayLengths

+ +
pub fn new(data: AvmAccumulatedData) -> Self + +

Trait implementations

+

impl Deserialize for AvmAccumulatedDataArrayLengths

+ +
pub fn deserialize(serialized: [Field; 4]) -> Self + +

impl Empty for AvmAccumulatedDataArrayLengths

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for AvmAccumulatedDataArrayLengths

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for AvmAccumulatedDataArrayLengths

+ +
pub fn serialize(self) -> [Field; 4] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/index.html new file mode 100644 index 000000000000..3152031176c5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/index.html @@ -0,0 +1,91 @@ + + + + + + +Module accumulated_data documentation + + + + + +
+
aztec-nr - protocol_types::abis::accumulated_data
+

Module accumulated_data

+

Re-exports

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/private_accumulated_data/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/private_accumulated_data/index.html new file mode 100644 index 000000000000..285f179b0865 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/private_accumulated_data/index.html @@ -0,0 +1,43 @@ + + + + + + +Module private_accumulated_data documentation + + + + + +
+
aztec-nr - protocol_types::abis::accumulated_data::private_accumulated_data
+

Module private_accumulated_data

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/private_accumulated_data/struct.PrivateAccumulatedData.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/private_accumulated_data/struct.PrivateAccumulatedData.html new file mode 100644 index 000000000000..f270cebda3bc --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/private_accumulated_data/struct.PrivateAccumulatedData.html @@ -0,0 +1,78 @@ + + + + + + +Struct PrivateAccumulatedData documentation + + + + + +
+ +

Struct PrivateAccumulatedData

+
pub struct PrivateAccumulatedData {
+    pub note_hashes: ClaimedLengthArray<Scoped<Counted<NoteHash>>, 64>,
+    pub nullifiers: ClaimedLengthArray<Scoped<Counted<Nullifier>>, 64>,
+    pub l2_to_l1_msgs: ClaimedLengthArray<Scoped<Counted<L2ToL1Message>>, 8>,
+    pub private_logs: ClaimedLengthArray<Scoped<Counted<PrivateLogData>>, 64>,
+    pub contract_class_logs_hashes: ClaimedLengthArray<Scoped<Counted<LogHash>>, 1>,
+    pub public_call_requests: ClaimedLengthArray<Counted<PublicCallRequest>, 32>,
+    pub private_call_stack: ClaimedLengthArray<PrivateCallRequest, 16>,
+}
+
+

Fields

+ +
+
+
+
contract_class_logs_hashes: ClaimedLengthArray<Scoped<Counted<LogHash>>, 1>
+
public_call_requests: ClaimedLengthArray<Counted<PublicCallRequest>, 32>
+
private_call_stack: ClaimedLengthArray<PrivateCallRequest, 16>
+

Trait implementations

+

impl Empty for PrivateAccumulatedData

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for PrivateAccumulatedData

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/private_to_avm_accumulated_data/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/private_to_avm_accumulated_data/index.html new file mode 100644 index 000000000000..c169db3bc800 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/private_to_avm_accumulated_data/index.html @@ -0,0 +1,44 @@ + + + + + + +Module private_to_avm_accumulated_data documentation + + + + + +
+
aztec-nr - protocol_types::abis::accumulated_data::private_to_avm_accumulated_data
+

Module private_to_avm_accumulated_data

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/private_to_avm_accumulated_data/struct.PrivateToAvmAccumulatedData.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/private_to_avm_accumulated_data/struct.PrivateToAvmAccumulatedData.html new file mode 100644 index 000000000000..efbee3ecca6d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/private_to_avm_accumulated_data/struct.PrivateToAvmAccumulatedData.html @@ -0,0 +1,77 @@ + + + + + + +Struct PrivateToAvmAccumulatedData documentation + + + + + +
+ +

Struct PrivateToAvmAccumulatedData

+
pub struct PrivateToAvmAccumulatedData {
+    pub note_hashes: [Field; 64],
+    pub nullifiers: [Field; 64],
+    pub l2_to_l1_msgs: [Scoped<L2ToL1Message>; 8],
+}
+
+

Fields

+
note_hashes: [Field; 64]
+
nullifiers: [Field; 64]
+
l2_to_l1_msgs: [Scoped<L2ToL1Message>; 8]
+

Trait implementations

+

impl Deserialize for PrivateToAvmAccumulatedData

+ +
pub fn deserialize(serialized: [Field; 152]) -> Self + +

impl Empty for PrivateToAvmAccumulatedData

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for PrivateToAvmAccumulatedData

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for PrivateToAvmAccumulatedData

+ +
pub fn serialize(self) -> [Field; 152] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/private_to_avm_accumulated_data/struct.PrivateToAvmAccumulatedDataArrayLengths.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/private_to_avm_accumulated_data/struct.PrivateToAvmAccumulatedDataArrayLengths.html new file mode 100644 index 000000000000..91444013ded7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/private_to_avm_accumulated_data/struct.PrivateToAvmAccumulatedDataArrayLengths.html @@ -0,0 +1,86 @@ + + + + + + +Struct PrivateToAvmAccumulatedDataArrayLengths documentation + + + + + +
+ +

Struct PrivateToAvmAccumulatedDataArrayLengths

+
pub struct PrivateToAvmAccumulatedDataArrayLengths {
+    pub note_hashes: u32,
+    pub nullifiers: u32,
+    pub l2_to_l1_msgs: u32,
+}
+
+

Fields

+
note_hashes: u32
+
nullifiers: u32
+
l2_to_l1_msgs: u32
+

Implementations

+

impl PrivateToAvmAccumulatedDataArrayLengths

+ +
pub fn new(data: PrivateToAvmAccumulatedData) -> Self + +

Trait implementations

+

impl Deserialize for PrivateToAvmAccumulatedDataArrayLengths

+ +
pub fn deserialize(serialized: [Field; 3]) -> Self + +

impl Empty for PrivateToAvmAccumulatedDataArrayLengths

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for PrivateToAvmAccumulatedDataArrayLengths

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for PrivateToAvmAccumulatedDataArrayLengths

+ +
pub fn serialize(self) -> [Field; 3] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/private_to_public_accumulated_data/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/private_to_public_accumulated_data/index.html new file mode 100644 index 000000000000..ea4764037950 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/private_to_public_accumulated_data/index.html @@ -0,0 +1,43 @@ + + + + + + +Module private_to_public_accumulated_data documentation + + + + + +
+
aztec-nr - protocol_types::abis::accumulated_data::private_to_public_accumulated_data
+

Module private_to_public_accumulated_data

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/private_to_public_accumulated_data/struct.PrivateToPublicAccumulatedData.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/private_to_public_accumulated_data/struct.PrivateToPublicAccumulatedData.html new file mode 100644 index 000000000000..1a2c5bcaf378 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/private_to_public_accumulated_data/struct.PrivateToPublicAccumulatedData.html @@ -0,0 +1,85 @@ + + + + + + +Struct PrivateToPublicAccumulatedData documentation + + + + + +
+ +

Struct PrivateToPublicAccumulatedData

+
pub struct PrivateToPublicAccumulatedData {
+    pub note_hashes: [Field; 64],
+    pub nullifiers: [Field; 64],
+    pub l2_to_l1_msgs: [Scoped<L2ToL1Message>; 8],
+    pub private_logs: [PrivateLog; 64],
+    pub contract_class_logs_hashes: [Scoped<LogHash>; 1],
+    pub public_call_requests: [PublicCallRequest; 32],
+}
+
+

Fields

+
note_hashes: [Field; 64]
+
nullifiers: [Field; 64]
+
l2_to_l1_msgs: [Scoped<L2ToL1Message>; 8]
+
private_logs: [PrivateLog; 64]
+
contract_class_logs_hashes: [Scoped<LogHash>; 1]
+
public_call_requests: [PublicCallRequest; 32]
+

Trait implementations

+

impl Deserialize for PrivateToPublicAccumulatedData

+ +
pub fn deserialize(serialized: [Field; 1499]) -> Self + +

impl Empty for PrivateToPublicAccumulatedData

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for PrivateToPublicAccumulatedData

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for PrivateToPublicAccumulatedData

+ +
pub fn serialize(self) -> [Field; 1499] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/private_to_rollup_accumulated_data/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/private_to_rollup_accumulated_data/index.html new file mode 100644 index 000000000000..26f2780cdffa --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/private_to_rollup_accumulated_data/index.html @@ -0,0 +1,43 @@ + + + + + + +Module private_to_rollup_accumulated_data documentation + + + + + +
+
aztec-nr - protocol_types::abis::accumulated_data::private_to_rollup_accumulated_data
+

Module private_to_rollup_accumulated_data

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/private_to_rollup_accumulated_data/struct.PrivateToRollupAccumulatedData.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/private_to_rollup_accumulated_data/struct.PrivateToRollupAccumulatedData.html new file mode 100644 index 000000000000..dfb3a8dc2588 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/accumulated_data/private_to_rollup_accumulated_data/struct.PrivateToRollupAccumulatedData.html @@ -0,0 +1,82 @@ + + + + + + +Struct PrivateToRollupAccumulatedData documentation + + + + + +
+ +

Struct PrivateToRollupAccumulatedData

+
pub struct PrivateToRollupAccumulatedData {
+    pub note_hashes: [Field; 64],
+    pub nullifiers: [Field; 64],
+    pub l2_to_l1_msgs: [Scoped<L2ToL1Message>; 8],
+    pub private_logs: [PrivateLog; 64],
+    pub contract_class_logs_hashes: [Scoped<LogHash>; 1],
+}
+
+

Fields

+
note_hashes: [Field; 64]
+
nullifiers: [Field; 64]
+
l2_to_l1_msgs: [Scoped<L2ToL1Message>; 8]
+
private_logs: [PrivateLog; 64]
+
contract_class_logs_hashes: [Scoped<LogHash>; 1]
+

Trait implementations

+

impl Deserialize for PrivateToRollupAccumulatedData

+ +
pub fn deserialize(serialized: [Field; 1371]) -> Self + +

impl Empty for PrivateToRollupAccumulatedData

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for PrivateToRollupAccumulatedData

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for PrivateToRollupAccumulatedData

+ +
pub fn serialize(self) -> [Field; 1371] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/append_only_tree_snapshot/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/append_only_tree_snapshot/index.html new file mode 100644 index 000000000000..e4f5f9e0416f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/append_only_tree_snapshot/index.html @@ -0,0 +1,79 @@ + + + + + + +Module append_only_tree_snapshot documentation + + + + + +
+
aztec-nr - protocol_types::abis::append_only_tree_snapshot
+

Module append_only_tree_snapshot

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/append_only_tree_snapshot/struct.AppendOnlyTreeSnapshot.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/append_only_tree_snapshot/struct.AppendOnlyTreeSnapshot.html new file mode 100644 index 000000000000..16f1a6aa2346 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/append_only_tree_snapshot/struct.AppendOnlyTreeSnapshot.html @@ -0,0 +1,73 @@ + + + + + + +Struct AppendOnlyTreeSnapshot documentation + + + + + +
+ +

Struct AppendOnlyTreeSnapshot

+
pub struct AppendOnlyTreeSnapshot {
+    pub root: Field,
+    pub next_available_leaf_index: Field,
+}
+
+

Fields

+
root: Field
+
next_available_leaf_index: Field
+

Trait implementations

+

impl Deserialize for AppendOnlyTreeSnapshot

+ +
pub fn deserialize(serialized: [Field; 2]) -> Self + +

impl Empty for AppendOnlyTreeSnapshot

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for AppendOnlyTreeSnapshot

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for AppendOnlyTreeSnapshot

+ +
pub fn serialize(self) -> [Field; 2] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/avm_circuit_public_inputs/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/avm_circuit_public_inputs/index.html new file mode 100644 index 000000000000..27a7323fcdf1 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/avm_circuit_public_inputs/index.html @@ -0,0 +1,79 @@ + + + + + + +Module avm_circuit_public_inputs documentation + + + + + +
+
aztec-nr - protocol_types::abis::avm_circuit_public_inputs
+

Module avm_circuit_public_inputs

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/avm_circuit_public_inputs/struct.AvmCircuitPublicInputs.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/avm_circuit_public_inputs/struct.AvmCircuitPublicInputs.html new file mode 100644 index 000000000000..dd4f9a2879bf --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/avm_circuit_public_inputs/struct.AvmCircuitPublicInputs.html @@ -0,0 +1,147 @@ + + + + + + +Struct AvmCircuitPublicInputs documentation + + + + + +
+ +

Struct AvmCircuitPublicInputs

+
pub struct AvmCircuitPublicInputs {
+    pub global_variables: GlobalVariables,
+    pub protocol_contracts: ProtocolContracts,
+    pub start_tree_snapshots: TreeSnapshots,
+    pub start_gas_used: Gas,
+    pub gas_settings: GasSettings,
+    pub effective_gas_fees: GasFees,
+    pub fee_payer: AztecAddress,
+    pub prover_id: Field,
+    pub public_call_request_array_lengths: PublicCallRequestArrayLengths,
+    pub public_setup_call_requests: [PublicCallRequest; 32],
+    pub public_app_logic_call_requests: [PublicCallRequest; 32],
+    pub public_teardown_call_request: PublicCallRequest,
+    pub previous_non_revertible_accumulated_data_array_lengths: PrivateToAvmAccumulatedDataArrayLengths,
+    pub previous_revertible_accumulated_data_array_lengths: PrivateToAvmAccumulatedDataArrayLengths,
+    pub previous_non_revertible_accumulated_data: PrivateToAvmAccumulatedData,
+    pub previous_revertible_accumulated_data: PrivateToAvmAccumulatedData,
+    pub end_tree_snapshots: TreeSnapshots,
+    pub end_gas_used: Gas,
+    pub accumulated_data_array_lengths: AvmAccumulatedDataArrayLengths,
+    pub accumulated_data: AvmAccumulatedData,
+    pub transaction_fee: Field,
+    pub reverted: bool,
+}
+
+

Fields

+
global_variables: GlobalVariables
+
protocol_contracts: ProtocolContracts
+
start_tree_snapshots: TreeSnapshots
+
start_gas_used: Gas
+
gas_settings: GasSettings
+
effective_gas_fees: GasFees
+
fee_payer: AztecAddress
+
prover_id: Field
+
public_call_request_array_lengths: PublicCallRequestArrayLengths
+
public_setup_call_requests: [PublicCallRequest; 32]
+
public_app_logic_call_requests: [PublicCallRequest; 32]
+
public_teardown_call_request: PublicCallRequest
+
previous_non_revertible_accumulated_data_array_lengths: PrivateToAvmAccumulatedDataArrayLengths
+
previous_revertible_accumulated_data_array_lengths: PrivateToAvmAccumulatedDataArrayLengths
+
previous_non_revertible_accumulated_data: PrivateToAvmAccumulatedData
+
previous_revertible_accumulated_data: PrivateToAvmAccumulatedData
+
end_tree_snapshots: TreeSnapshots
+
end_gas_used: Gas
+
accumulated_data_array_lengths: AvmAccumulatedDataArrayLengths
+
accumulated_data: AvmAccumulatedData
+
transaction_fee: Field
+
reverted: bool
+

Implementations

+

impl AvmCircuitPublicInputs

+ +
pub fn to_columns(self) -> [[Field; 4685]; 4] + +

Trait implementations

+

impl Deserialize for AvmCircuitPublicInputs

+ +
pub fn deserialize(serialized: [Field; 5008]) -> Self + +

impl Empty for AvmCircuitPublicInputs

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for AvmCircuitPublicInputs

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for AvmCircuitPublicInputs

+ +
pub fn serialize(self) -> [Field; 5008] + +

impl SerializeToColumns<18740> for AvmCircuitPublicInputs

+ +
pub fn serialize_to_columns(self) -> [Field; 18740] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/block_constant_data/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/block_constant_data/index.html new file mode 100644 index 000000000000..a9f285cba01e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/block_constant_data/index.html @@ -0,0 +1,79 @@ + + + + + + +Module block_constant_data documentation + + + + + +
+
aztec-nr - protocol_types::abis::block_constant_data
+

Module block_constant_data

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/block_constant_data/struct.BlockConstantData.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/block_constant_data/struct.BlockConstantData.html new file mode 100644 index 000000000000..a8affed0309b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/block_constant_data/struct.BlockConstantData.html @@ -0,0 +1,85 @@ + + + + + + +Struct BlockConstantData documentation + + + + + +
+ +

Struct BlockConstantData

+
pub struct BlockConstantData {
+    pub last_archive: AppendOnlyTreeSnapshot,
+    pub l1_to_l2_tree_snapshot: AppendOnlyTreeSnapshot,
+    pub vk_tree_root: Field,
+    pub protocol_contracts_hash: Field,
+    pub prover_id: Field,
+    pub global_variables: GlobalVariables,
+}
+
+

Fields

+ +
l1_to_l2_tree_snapshot: AppendOnlyTreeSnapshot
+
vk_tree_root: Field
+
protocol_contracts_hash: Field
+
prover_id: Field
+
global_variables: GlobalVariables
+

Trait implementations

+

impl Deserialize for BlockConstantData

+ +
pub fn deserialize(serialized: [Field; 16]) -> Self + +

impl Empty for BlockConstantData

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for BlockConstantData

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for BlockConstantData

+ +
pub fn serialize(self) -> [Field; 16] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/block_header/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/block_header/index.html new file mode 100644 index 000000000000..4bedb5e6e55b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/block_header/index.html @@ -0,0 +1,79 @@ + + + + + + +Module block_header documentation + + + + + +
+
aztec-nr - protocol_types::abis::block_header
+

Module block_header

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/block_header/struct.BlockHeader.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/block_header/struct.BlockHeader.html new file mode 100644 index 000000000000..00ef67829f3e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/block_header/struct.BlockHeader.html @@ -0,0 +1,90 @@ + + + + + + +Struct BlockHeader documentation + + + + + +
+ +

Struct BlockHeader

+
pub struct BlockHeader {
+    pub last_archive: AppendOnlyTreeSnapshot,
+    pub state: StateReference,
+    pub sponge_blob_hash: Field,
+    pub global_variables: GlobalVariables,
+    pub total_fees: Field,
+    pub total_mana_used: Field,
+}
+
+

Fields

+ +
+
sponge_blob_hash: Field
+
global_variables: GlobalVariables
+
total_fees: Field
+
total_mana_used: Field
+

Trait implementations

+

impl Deserialize for BlockHeader

+ +
pub fn deserialize(serialized: [Field; 22]) -> Self + +

impl Empty for BlockHeader

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for BlockHeader

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Hash for BlockHeader

+ +
pub fn hash(self) -> Field + +

impl Serialize for BlockHeader

+ +
pub fn serialize(self) -> [Field; 22] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/call_context/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/call_context/index.html new file mode 100644 index 000000000000..56bc53a57a2d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/call_context/index.html @@ -0,0 +1,79 @@ + + + + + + +Module call_context documentation + + + + + +
+
aztec-nr - protocol_types::abis::call_context
+

Module call_context

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/call_context/struct.CallContext.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/call_context/struct.CallContext.html new file mode 100644 index 000000000000..c1590d132501 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/call_context/struct.CallContext.html @@ -0,0 +1,79 @@ + + + + + + +Struct CallContext documentation + + + + + +
+ +

Struct CallContext

+
pub struct CallContext {
+    pub msg_sender: AztecAddress,
+    pub contract_address: AztecAddress,
+    pub function_selector: FunctionSelector,
+    pub is_static_call: bool,
+}
+
+

Fields

+
msg_sender: AztecAddress
+
contract_address: AztecAddress
+
function_selector: FunctionSelector
+
is_static_call: bool
+

Trait implementations

+

impl Deserialize for CallContext

+ +
pub fn deserialize(serialized: [Field; 4]) -> Self + +

impl Empty for CallContext

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for CallContext

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for CallContext

+ +
pub fn serialize(self) -> [Field; 4] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/checkpoint_constant_data/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/checkpoint_constant_data/index.html new file mode 100644 index 000000000000..e3a2c567fa1c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/checkpoint_constant_data/index.html @@ -0,0 +1,79 @@ + + + + + + +Module checkpoint_constant_data documentation + + + + + +
+
aztec-nr - protocol_types::abis::checkpoint_constant_data
+

Module checkpoint_constant_data

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/checkpoint_constant_data/struct.CheckpointConstantData.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/checkpoint_constant_data/struct.CheckpointConstantData.html new file mode 100644 index 000000000000..b968d19af03a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/checkpoint_constant_data/struct.CheckpointConstantData.html @@ -0,0 +1,94 @@ + + + + + + +Struct CheckpointConstantData documentation + + + + + +
+ +

Struct CheckpointConstantData

+
pub struct CheckpointConstantData {
+    pub chain_id: Field,
+    pub version: Field,
+    pub vk_tree_root: Field,
+    pub protocol_contracts_hash: Field,
+    pub prover_id: Field,
+    pub slot_number: Field,
+    pub coinbase: EthAddress,
+    pub fee_recipient: AztecAddress,
+    pub gas_fees: GasFees,
+}
+
+

Fields

+
chain_id: Field
+
version: Field
+
vk_tree_root: Field
+
protocol_contracts_hash: Field
+
prover_id: Field
+
slot_number: Field
+
coinbase: EthAddress
+
fee_recipient: AztecAddress
+
gas_fees: GasFees
+

Trait implementations

+

impl Deserialize for CheckpointConstantData

+ +
pub fn deserialize(serialized: [Field; 10]) -> Self + +

impl Empty for CheckpointConstantData

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for CheckpointConstantData

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for CheckpointConstantData

+ +
pub fn serialize(self) -> [Field; 10] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/checkpoint_header/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/checkpoint_header/index.html new file mode 100644 index 000000000000..3dc51625da25 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/checkpoint_header/index.html @@ -0,0 +1,79 @@ + + + + + + +Module checkpoint_header documentation + + + + + +
+
aztec-nr - protocol_types::abis::checkpoint_header
+

Module checkpoint_header

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/checkpoint_header/struct.CheckpointHeader.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/checkpoint_header/struct.CheckpointHeader.html new file mode 100644 index 000000000000..67ed4eeb9855 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/checkpoint_header/struct.CheckpointHeader.html @@ -0,0 +1,108 @@ + + + + + + +Struct CheckpointHeader documentation + + + + + +
+ +

Struct CheckpointHeader

+
pub struct CheckpointHeader {
+    pub last_archive_root: Field,
+    pub block_headers_hash: Field,
+    pub content_commitment: ContentCommitment,
+    pub slot_number: Field,
+    pub timestamp: u64,
+    pub coinbase: EthAddress,
+    pub fee_recipient: AztecAddress,
+    pub gas_fees: GasFees,
+    pub total_mana_used: Field,
+}
+
+

Fields

+
last_archive_root: Field
+
block_headers_hash: Field
+
content_commitment: ContentCommitment
+
slot_number: Field
+
timestamp: u64
+
coinbase: EthAddress
+
fee_recipient: AztecAddress
+
gas_fees: GasFees
+
total_mana_used: Field
+

Implementations

+

impl CheckpointHeader

+ +
pub fn to_be_bytes(self) -> [u8; 316] + +

Trait implementations

+

impl Deserialize for CheckpointHeader

+ +
pub fn deserialize(serialized: [Field; 12]) -> Self + +

impl Empty for CheckpointHeader

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for CheckpointHeader

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Hash for CheckpointHeader

+ +
pub fn hash(self) -> Field + +

impl Serialize for CheckpointHeader

+ +
pub fn serialize(self) -> [Field; 12] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/contract_class_function_leaf_preimage/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/contract_class_function_leaf_preimage/index.html new file mode 100644 index 000000000000..389ce8885dea --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/contract_class_function_leaf_preimage/index.html @@ -0,0 +1,79 @@ + + + + + + +Module contract_class_function_leaf_preimage documentation + + + + + +
+
aztec-nr - protocol_types::abis::contract_class_function_leaf_preimage
+

Module contract_class_function_leaf_preimage

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/contract_class_function_leaf_preimage/struct.ContractClassFunctionLeafPreimage.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/contract_class_function_leaf_preimage/struct.ContractClassFunctionLeafPreimage.html new file mode 100644 index 000000000000..83fe4a8b6755 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/contract_class_function_leaf_preimage/struct.ContractClassFunctionLeafPreimage.html @@ -0,0 +1,54 @@ + + + + + + +Struct ContractClassFunctionLeafPreimage documentation + + + + + +
+ +

Struct ContractClassFunctionLeafPreimage

+
pub struct ContractClassFunctionLeafPreimage {
+    pub selector: FunctionSelector,
+    pub vk_hash: Field,
+}
+
+

Fields

+ +
vk_hash: Field
+

Trait implementations

+

impl Hash for ContractClassFunctionLeafPreimage

+ +
pub fn hash(self) -> Field + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/contract_class_log/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/contract_class_log/index.html new file mode 100644 index 000000000000..14c2c0ea3fc2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/contract_class_log/index.html @@ -0,0 +1,79 @@ + + + + + + +Module contract_class_log documentation + + + + + +
+
aztec-nr - protocol_types::abis::contract_class_log
+

Module contract_class_log

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/contract_class_log/struct.ContractClassLog.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/contract_class_log/struct.ContractClassLog.html new file mode 100644 index 000000000000..02bc5e3a3302 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/contract_class_log/struct.ContractClassLog.html @@ -0,0 +1,63 @@ + + + + + + +Struct ContractClassLog documentation + + + + + +
+ +

Struct ContractClassLog

+
pub struct ContractClassLog {
+    pub log: Log<3023>,
+    pub contract_address: AztecAddress,
+}
+
+

Fields

+
log: Log<3023>
+
contract_address: AztecAddress
+

Trait implementations

+

impl Empty for ContractClassLog

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for ContractClassLog

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/epoch_constant_data/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/epoch_constant_data/index.html new file mode 100644 index 000000000000..3ce5691dede7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/epoch_constant_data/index.html @@ -0,0 +1,79 @@ + + + + + + +Module epoch_constant_data documentation + + + + + +
+
aztec-nr - protocol_types::abis::epoch_constant_data
+

Module epoch_constant_data

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/epoch_constant_data/struct.EpochConstantData.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/epoch_constant_data/struct.EpochConstantData.html new file mode 100644 index 000000000000..d9c5ea8ac060 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/epoch_constant_data/struct.EpochConstantData.html @@ -0,0 +1,82 @@ + + + + + + +Struct EpochConstantData documentation + + + + + +
+ +

Struct EpochConstantData

+
pub struct EpochConstantData {
+    pub chain_id: Field,
+    pub version: Field,
+    pub vk_tree_root: Field,
+    pub protocol_contracts_hash: Field,
+    pub prover_id: Field,
+}
+
+

Fields

+
chain_id: Field
+
version: Field
+
vk_tree_root: Field
+
protocol_contracts_hash: Field
+
prover_id: Field
+

Trait implementations

+

impl Deserialize for EpochConstantData

+ +
pub fn deserialize(serialized: [Field; 5]) -> Self + +

impl Empty for EpochConstantData

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for EpochConstantData

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for EpochConstantData

+ +
pub fn serialize(self) -> [Field; 5] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/fee_recipient/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/fee_recipient/index.html new file mode 100644 index 000000000000..536cbad73689 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/fee_recipient/index.html @@ -0,0 +1,79 @@ + + + + + + +Module fee_recipient documentation + + + + + +
+
aztec-nr - protocol_types::abis::fee_recipient
+

Module fee_recipient

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/fee_recipient/struct.FeeRecipient.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/fee_recipient/struct.FeeRecipient.html new file mode 100644 index 000000000000..64628405ac37 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/fee_recipient/struct.FeeRecipient.html @@ -0,0 +1,73 @@ + + + + + + +Struct FeeRecipient documentation + + + + + +
+ +

Struct FeeRecipient

+
pub struct FeeRecipient {
+    pub recipient: EthAddress,
+    pub value: Field,
+}
+
+

Fields

+
recipient: EthAddress
+
value: Field
+

Trait implementations

+

impl Deserialize for FeeRecipient

+ +
pub fn deserialize(serialized: [Field; 2]) -> Self + +

impl Empty for FeeRecipient

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for FeeRecipient

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for FeeRecipient

+ +
pub fn serialize(self) -> [Field; 2] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/function_data/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/function_data/index.html new file mode 100644 index 000000000000..e9600608857f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/function_data/index.html @@ -0,0 +1,79 @@ + + + + + + +Module function_data documentation + + + + + +
+
aztec-nr - protocol_types::abis::function_data
+

Module function_data

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/function_data/struct.FunctionData.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/function_data/struct.FunctionData.html new file mode 100644 index 000000000000..208380800783 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/function_data/struct.FunctionData.html @@ -0,0 +1,73 @@ + + + + + + +Struct FunctionData documentation + + + + + +
+ +

Struct FunctionData

+
pub struct FunctionData {
+    pub selector: FunctionSelector,
+    pub is_private: bool,
+}
+
+

Fields

+ +
is_private: bool
+

Trait implementations

+

impl Deserialize for FunctionData

+ +
pub fn deserialize(serialized: [Field; 2]) -> Self + +

impl Empty for FunctionData

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for FunctionData

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for FunctionData

+ +
pub fn serialize(self) -> [Field; 2] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/function_selector/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/function_selector/index.html new file mode 100644 index 000000000000..48b51bb2d3d8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/function_selector/index.html @@ -0,0 +1,79 @@ + + + + + + +Module function_selector documentation + + + + + +
+
aztec-nr - protocol_types::abis::function_selector
+

Module function_selector

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/function_selector/struct.FunctionSelector.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/function_selector/struct.FunctionSelector.html new file mode 100644 index 000000000000..9eb8e1ef3dd9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/function_selector/struct.FunctionSelector.html @@ -0,0 +1,95 @@ + + + + + + +Struct FunctionSelector documentation + + + + + +
+ +

Struct FunctionSelector

+
pub struct FunctionSelector {
+    pub inner: u32,
+}
+
+

Fields

+
inner: u32
+

Implementations

+

impl FunctionSelector

+ +
pub fn from_u32(value: u32) -> Self + +pub fn from_signature<let N: u32>(signature: str<N>) -> Self + +pub fn zero() -> Self + +

Trait implementations

+

impl Deserialize for FunctionSelector

+ +
pub fn deserialize(serialized: [Field; 1]) -> Self + +

impl Empty for FunctionSelector

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for FunctionSelector

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl FromField for FunctionSelector

+ +
pub fn from_field(field: Field) -> Self + +

impl Serialize for FunctionSelector

+ +
pub fn serialize(self) -> [Field; 1] + +

impl ToField for FunctionSelector

+ +
pub fn to_field(self) -> Field + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/gas/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/gas/index.html new file mode 100644 index 000000000000..c68694988571 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/gas/index.html @@ -0,0 +1,79 @@ + + + + + + +Module gas documentation + + + + + +
+ +

Module gas

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/gas/struct.Gas.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/gas/struct.Gas.html new file mode 100644 index 000000000000..70e10ace5e49 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/gas/struct.Gas.html @@ -0,0 +1,104 @@ + + + + + + +Struct Gas documentation + + + + + +
+ +

Struct Gas

+
pub struct Gas {
+    pub da_gas: u32,
+    pub l2_gas: u32,
+}
+
+

Fields

+
da_gas: u32
+
l2_gas: u32
+

Implementations

+

impl Gas

+ +
pub fn new(da_gas: u32, l2_gas: u32) -> Self + +pub fn tx_overhead() -> Self + +pub fn compute_fee(self, fees: GasFees) -> Field + +pub fn is_empty(self) -> bool + +pub fn within(self, limits: Self) -> bool + +

Trait implementations

+

impl Add for Gas

+ +
pub fn add(self, other: Self) -> Self + +

impl Deserialize for Gas

+ +
pub fn deserialize(serialized: [Field; 2]) -> Self + +

impl Empty for Gas

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for Gas

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for Gas

+ +
pub fn serialize(self) -> [Field; 2] + +

impl Sub for Gas

+ +
pub fn sub(self, other: Self) -> Self + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/gas_fees/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/gas_fees/index.html new file mode 100644 index 000000000000..64de8cabdd35 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/gas_fees/index.html @@ -0,0 +1,79 @@ + + + + + + +Module gas_fees documentation + + + + + +
+ +

Module gas_fees

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/gas_fees/struct.GasFees.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/gas_fees/struct.GasFees.html new file mode 100644 index 000000000000..0967d9bc2dae --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/gas_fees/struct.GasFees.html @@ -0,0 +1,85 @@ + + + + + + +Struct GasFees documentation + + + + + +
+ +

Struct GasFees

+
pub struct GasFees {
+    pub fee_per_da_gas: u128,
+    pub fee_per_l2_gas: u128,
+}
+
+

Fields

+
fee_per_da_gas: u128
+
fee_per_l2_gas: u128
+

Implementations

+

impl GasFees

+ +
pub fn new(fee_per_da_gas: u128, fee_per_l2_gas: u128) -> Self + +pub fn is_empty(self) -> bool + +

Trait implementations

+

impl Deserialize for GasFees

+ +
pub fn deserialize(serialized: [Field; 2]) -> Self + +

impl Empty for GasFees

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for GasFees

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for GasFees

+ +
pub fn serialize(self) -> [Field; 2] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/gas_settings/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/gas_settings/index.html new file mode 100644 index 000000000000..a8bf04953e1d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/gas_settings/index.html @@ -0,0 +1,79 @@ + + + + + + +Module gas_settings documentation + + + + + +
+
aztec-nr - protocol_types::abis::gas_settings
+

Module gas_settings

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/gas_settings/struct.GasSettings.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/gas_settings/struct.GasSettings.html new file mode 100644 index 000000000000..16f0813002ea --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/gas_settings/struct.GasSettings.html @@ -0,0 +1,93 @@ + + + + + + +Struct GasSettings documentation + + + + + +
+ +

Struct GasSettings

+
pub struct GasSettings {
+    pub gas_limits: Gas,
+    pub teardown_gas_limits: Gas,
+    pub max_fees_per_gas: GasFees,
+    pub max_priority_fees_per_gas: GasFees,
+}
+
+

Fields

+
gas_limits: Gas
+
teardown_gas_limits: Gas
+
max_fees_per_gas: GasFees
+
max_priority_fees_per_gas: GasFees
+

Implementations

+

impl GasSettings

+ +
pub fn new( + gas_limits: Gas, + teardown_gas_limits: Gas, + max_fees_per_gas: GasFees, + max_priority_fees_per_gas: GasFees, +) -> Self + +

Trait implementations

+

impl Deserialize for GasSettings

+ +
pub fn deserialize(serialized: [Field; 8]) -> Self + +

impl Empty for GasSettings

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for GasSettings

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for GasSettings

+ +
pub fn serialize(self) -> [Field; 8] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/global_variables/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/global_variables/index.html new file mode 100644 index 000000000000..626f8264d9c2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/global_variables/index.html @@ -0,0 +1,79 @@ + + + + + + +Module global_variables documentation + + + + + +
+
aztec-nr - protocol_types::abis::global_variables
+

Module global_variables

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/global_variables/struct.GlobalVariables.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/global_variables/struct.GlobalVariables.html new file mode 100644 index 000000000000..4176cdbf8bda --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/global_variables/struct.GlobalVariables.html @@ -0,0 +1,100 @@ + + + + + + +Struct GlobalVariables documentation + + + + + +
+ +

Struct GlobalVariables

+
pub struct GlobalVariables {
+    pub chain_id: Field,
+    pub version: Field,
+    pub block_number: u32,
+    pub slot_number: Field,
+    pub timestamp: u64,
+    pub coinbase: EthAddress,
+    pub fee_recipient: AztecAddress,
+    pub gas_fees: GasFees,
+}
+
+

Fields

+
chain_id: Field
+
version: Field
+
block_number: u32
+
slot_number: Field
+
timestamp: u64
+
coinbase: EthAddress
+
fee_recipient: AztecAddress
+
gas_fees: GasFees
+

Implementations

+

impl GlobalVariables

+ +
pub fn is_empty(self) -> bool + +

Trait implementations

+

impl Deserialize for GlobalVariables

+ +
pub fn deserialize(serialized: [Field; 9]) -> Self + +

impl Empty for GlobalVariables

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for GlobalVariables

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for GlobalVariables

+ +
pub fn serialize(self) -> [Field; 9] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/index.html new file mode 100644 index 000000000000..59a4c482d908 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/index.html @@ -0,0 +1,104 @@ + + + + + + +Module abis documentation + + + + + +
+ +

Module abis

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/kernel_circuit_public_inputs/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/kernel_circuit_public_inputs/index.html new file mode 100644 index 000000000000..8aa404af733d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/kernel_circuit_public_inputs/index.html @@ -0,0 +1,87 @@ + + + + + + +Module kernel_circuit_public_inputs documentation + + + + + +
+
aztec-nr - protocol_types::abis::kernel_circuit_public_inputs
+

Module kernel_circuit_public_inputs

+

Re-exports

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/kernel_circuit_public_inputs/private_kernel_circuit_public_inputs/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/kernel_circuit_public_inputs/private_kernel_circuit_public_inputs/index.html new file mode 100644 index 000000000000..f19bf2bd7468 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/kernel_circuit_public_inputs/private_kernel_circuit_public_inputs/index.html @@ -0,0 +1,41 @@ + + + + + + +Module private_kernel_circuit_public_inputs documentation + + + + + +
+
aztec-nr - protocol_types::abis::kernel_circuit_public_inputs::private_kernel_circuit_public_inputs
+

Module private_kernel_circuit_public_inputs

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/kernel_circuit_public_inputs/private_kernel_circuit_public_inputs/struct.PrivateKernelCircuitPublicInputs.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/kernel_circuit_public_inputs/private_kernel_circuit_public_inputs/struct.PrivateKernelCircuitPublicInputs.html new file mode 100644 index 000000000000..9490b4b27508 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/kernel_circuit_public_inputs/private_kernel_circuit_public_inputs/struct.PrivateKernelCircuitPublicInputs.html @@ -0,0 +1,87 @@ + + + + + + +Struct PrivateKernelCircuitPublicInputs documentation + + + + + +
+ +

Struct PrivateKernelCircuitPublicInputs

+
pub struct PrivateKernelCircuitPublicInputs {
+    pub constants: PrivateTxConstantData,
+    pub min_revertible_side_effect_counter: u32,
+    pub validation_requests: PrivateValidationRequests,
+    pub end: PrivateAccumulatedData,
+    pub public_teardown_call_request: PublicCallRequest,
+    pub fee_payer: AztecAddress,
+    pub include_by_timestamp: u64,
+    pub is_private_only: bool,
+    pub claimed_first_nullifier: Field,
+    pub claimed_revertible_counter: u32,
+}
+
+

Fields

+ +
min_revertible_side_effect_counter: u32
+
validation_requests: PrivateValidationRequests
+
+
public_teardown_call_request: PublicCallRequest
+
fee_payer: AztecAddress
+
include_by_timestamp: u64
+
is_private_only: bool
+
claimed_first_nullifier: Field
+
claimed_revertible_counter: u32
+

Trait implementations

+

impl Empty for PrivateKernelCircuitPublicInputs

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for PrivateKernelCircuitPublicInputs

+ +
pub fn eq(self, other: Self) -> bool + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/kernel_circuit_public_inputs/private_to_public_kernel_circuit_public_inputs/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/kernel_circuit_public_inputs/private_to_public_kernel_circuit_public_inputs/index.html new file mode 100644 index 000000000000..bcad143d4a43 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/kernel_circuit_public_inputs/private_to_public_kernel_circuit_public_inputs/index.html @@ -0,0 +1,41 @@ + + + + + + +Module private_to_public_kernel_circuit_public_inputs documentation + + + + + +
+
aztec-nr - protocol_types::abis::kernel_circuit_public_inputs::private_to_public_kernel_circuit_public_inputs
+

Module private_to_public_kernel_circuit_public_inputs

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/kernel_circuit_public_inputs/private_to_public_kernel_circuit_public_inputs/struct.PrivateToPublicKernelCircuitPublicInputs.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/kernel_circuit_public_inputs/private_to_public_kernel_circuit_public_inputs/struct.PrivateToPublicKernelCircuitPublicInputs.html new file mode 100644 index 000000000000..7ac995d12aed --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/kernel_circuit_public_inputs/private_to_public_kernel_circuit_public_inputs/struct.PrivateToPublicKernelCircuitPublicInputs.html @@ -0,0 +1,93 @@ + + + + + + +Struct PrivateToPublicKernelCircuitPublicInputs documentation + + + + + +
+ +

Struct PrivateToPublicKernelCircuitPublicInputs

+
pub struct PrivateToPublicKernelCircuitPublicInputs {
+    pub constants: TxConstantData,
+    pub non_revertible_accumulated_data: PrivateToPublicAccumulatedData,
+    pub revertible_accumulated_data: PrivateToPublicAccumulatedData,
+    pub public_teardown_call_request: PublicCallRequest,
+    pub gas_used: Gas,
+    pub fee_payer: AztecAddress,
+    pub include_by_timestamp: u64,
+}
+
+

Fields

+
constants: TxConstantData
+
non_revertible_accumulated_data: PrivateToPublicAccumulatedData
+
revertible_accumulated_data: PrivateToPublicAccumulatedData
+
public_teardown_call_request: PublicCallRequest
+
gas_used: Gas
+
fee_payer: AztecAddress
+
include_by_timestamp: u64
+

Trait implementations

+

impl Deserialize for PrivateToPublicKernelCircuitPublicInputs

+ +
pub fn deserialize(serialized: [Field; 3040]) -> Self + +

impl Empty for PrivateToPublicKernelCircuitPublicInputs

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for PrivateToPublicKernelCircuitPublicInputs

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Hash for PrivateToPublicKernelCircuitPublicInputs

+ +
pub fn hash(self) -> Field + +

impl Serialize for PrivateToPublicKernelCircuitPublicInputs

+ +
pub fn serialize(self) -> [Field; 3040] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/kernel_circuit_public_inputs/private_to_rollup_kernel_circuit_public_inputs/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/kernel_circuit_public_inputs/private_to_rollup_kernel_circuit_public_inputs/index.html new file mode 100644 index 000000000000..024803f411de --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/kernel_circuit_public_inputs/private_to_rollup_kernel_circuit_public_inputs/index.html @@ -0,0 +1,41 @@ + + + + + + +Module private_to_rollup_kernel_circuit_public_inputs documentation + + + + + +
+
aztec-nr - protocol_types::abis::kernel_circuit_public_inputs::private_to_rollup_kernel_circuit_public_inputs
+

Module private_to_rollup_kernel_circuit_public_inputs

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/kernel_circuit_public_inputs/private_to_rollup_kernel_circuit_public_inputs/struct.PrivateToRollupKernelCircuitPublicInputs.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/kernel_circuit_public_inputs/private_to_rollup_kernel_circuit_public_inputs/struct.PrivateToRollupKernelCircuitPublicInputs.html new file mode 100644 index 000000000000..4a3eb010e675 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/kernel_circuit_public_inputs/private_to_rollup_kernel_circuit_public_inputs/struct.PrivateToRollupKernelCircuitPublicInputs.html @@ -0,0 +1,87 @@ + + + + + + +Struct PrivateToRollupKernelCircuitPublicInputs documentation + + + + + +
+ +

Struct PrivateToRollupKernelCircuitPublicInputs

+
pub struct PrivateToRollupKernelCircuitPublicInputs {
+    pub constants: TxConstantData,
+    pub end: PrivateToRollupAccumulatedData,
+    pub gas_used: Gas,
+    pub fee_payer: AztecAddress,
+    pub include_by_timestamp: u64,
+}
+
+

Fields

+
constants: TxConstantData
+
+
gas_used: Gas
+
fee_payer: AztecAddress
+
include_by_timestamp: u64
+

Trait implementations

+

impl Deserialize for PrivateToRollupKernelCircuitPublicInputs

+ +
pub fn deserialize(serialized: [Field; 1409]) -> Self + +

impl Empty for PrivateToRollupKernelCircuitPublicInputs

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for PrivateToRollupKernelCircuitPublicInputs

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Hash for PrivateToRollupKernelCircuitPublicInputs

+ +
pub fn hash(self) -> Field + +

impl Serialize for PrivateToRollupKernelCircuitPublicInputs

+ +
pub fn serialize(self) -> [Field; 1409] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/log/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/log/index.html new file mode 100644 index 000000000000..4e85508b5724 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/log/index.html @@ -0,0 +1,79 @@ + + + + + + +Module log documentation + + + + + +
+ +

Module log

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/log/struct.Log.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/log/struct.Log.html new file mode 100644 index 000000000000..d72bf19ed147 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/log/struct.Log.html @@ -0,0 +1,82 @@ + + + + + + +Struct Log documentation + + + + + +
+ +

Struct Log

+
pub struct Log<let N: u32> {
+    pub fields: [Field; N],
+    pub length: u32,
+}
+
+

Fields

+
fields: [Field; N]
+
length: u32
+

Implementations

+

impl<let N: u32> Log<N>

+ +
pub fn new(fields: [Field; N], length: u32) -> Self + +

Trait implementations

+

impl<let N: u32> Deserialize for Log<N>

+ +
pub fn deserialize(serialized: [Field; N + 1]) -> Self + +

impl<let N: u32> Empty for Log<N>

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl<let N: u32> Eq for Log<N>

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl<let N: u32> Serialize for Log<N>

+ +
pub fn serialize(self) -> [Field; N + 1] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/log_hash/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/log_hash/index.html new file mode 100644 index 000000000000..efb443299029 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/log_hash/index.html @@ -0,0 +1,79 @@ + + + + + + +Module log_hash documentation + + + + + +
+ +

Module log_hash

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/log_hash/struct.LogHash.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/log_hash/struct.LogHash.html new file mode 100644 index 000000000000..6d3495046612 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/log_hash/struct.LogHash.html @@ -0,0 +1,85 @@ + + + + + + +Struct LogHash documentation + + + + + +
+ +

Struct LogHash

+
pub struct LogHash {
+    pub value: Field,
+    pub length: u32,
+}
+
+

Fields

+
value: Field
+
length: u32
+

Implementations

+

impl LogHash

+ +
pub fn count(self, counter: u32) -> Counted<Self> + +pub fn scope(self, contract_address: AztecAddress) -> Scoped<Self> + +

Trait implementations

+

impl Deserialize for LogHash

+ +
pub fn deserialize(serialized: [Field; 2]) -> Self + +

impl Empty for LogHash

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for LogHash

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for LogHash

+ +
pub fn serialize(self) -> [Field; 2] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/note_hash/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/note_hash/index.html new file mode 100644 index 000000000000..44099484f354 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/note_hash/index.html @@ -0,0 +1,79 @@ + + + + + + +Module note_hash documentation + + + + + +
+ +

Module note_hash

+

Type aliases

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/note_hash/type.NoteHash.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/note_hash/type.NoteHash.html new file mode 100644 index 000000000000..f105eeb776c5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/note_hash/type.NoteHash.html @@ -0,0 +1,33 @@ + + + + + + +Type alias NoteHash documentation + + + + + +
+ +

Type alias NoteHash

+
pub type NoteHash = Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/note_hash_leaf_preimage/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/note_hash_leaf_preimage/index.html new file mode 100644 index 000000000000..dc57b8396ec9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/note_hash_leaf_preimage/index.html @@ -0,0 +1,79 @@ + + + + + + +Module note_hash_leaf_preimage documentation + + + + + +
+
aztec-nr - protocol_types::abis::note_hash_leaf_preimage
+

Module note_hash_leaf_preimage

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/note_hash_leaf_preimage/struct.NoteHashLeafPreimage.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/note_hash_leaf_preimage/struct.NoteHashLeafPreimage.html new file mode 100644 index 000000000000..199efaf94513 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/note_hash_leaf_preimage/struct.NoteHashLeafPreimage.html @@ -0,0 +1,87 @@ + + + + + + +Struct NoteHashLeafPreimage documentation + + + + + +
+ +

Struct NoteHashLeafPreimage

+
pub struct NoteHashLeafPreimage {
+    pub value: Field,
+}
+
+

Fields

+
value: Field
+

Implementations

+

impl NoteHashLeafPreimage

+ +
pub fn is_empty(self) -> bool + +pub fn serialize(self) -> [Field; 1] + +pub fn deserialize(fields: [Field; 1]) -> Self + +

Trait implementations

+

impl Empty for NoteHashLeafPreimage

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for NoteHashLeafPreimage

+ +
pub fn eq(self, other: Self) -> bool + +

impl LeafPreimage for NoteHashLeafPreimage

+ +
pub fn get_key(self) -> Field + +pub fn as_leaf(self) -> Field + +

impl Readable for NoteHashLeafPreimage

+ +
pub fn assert_match_read_request(self, read_request: Scoped<Counted<Field>>) + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/nullifier/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/nullifier/index.html new file mode 100644 index 000000000000..6ac37ef798e0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/nullifier/index.html @@ -0,0 +1,79 @@ + + + + + + +Module nullifier documentation + + + + + +
+ +

Module nullifier

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/nullifier/struct.Nullifier.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/nullifier/struct.Nullifier.html new file mode 100644 index 000000000000..b3c0347a4f81 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/nullifier/struct.Nullifier.html @@ -0,0 +1,87 @@ + + + + + + +Struct Nullifier documentation + + + + + +
+ +

Struct Nullifier

+
pub struct Nullifier {
+    pub value: Field,
+    pub note_hash: Field,
+}
+
+

Fields

+
value: Field
+
note_hash: Field
+

Implementations

+

impl Nullifier

+ +
pub fn count(self, counter: u32) -> Counted<Self> + +

Trait implementations

+

impl Deserialize for Nullifier

+ +
pub fn deserialize(serialized: [Field; 2]) -> Self + +

impl Empty for Nullifier

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for Nullifier

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Readable for Scoped<Counted<Nullifier>>

+ +
pub fn assert_match_read_request(self, read_request: Scoped<Counted<Field>>) + +

impl Serialize for Nullifier

+ +
pub fn serialize(self) -> [Field; 2] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/nullifier_leaf_preimage/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/nullifier_leaf_preimage/index.html new file mode 100644 index 000000000000..51bcc1f3eded --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/nullifier_leaf_preimage/index.html @@ -0,0 +1,79 @@ + + + + + + +Module nullifier_leaf_preimage documentation + + + + + +
+
aztec-nr - protocol_types::abis::nullifier_leaf_preimage
+

Module nullifier_leaf_preimage

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/nullifier_leaf_preimage/struct.NullifierLeafPreimage.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/nullifier_leaf_preimage/struct.NullifierLeafPreimage.html new file mode 100644 index 000000000000..a2a0b00cf44c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/nullifier_leaf_preimage/struct.NullifierLeafPreimage.html @@ -0,0 +1,115 @@ + + + + + + +Struct NullifierLeafPreimage documentation + + + + + +
+ +

Struct NullifierLeafPreimage

+
pub struct NullifierLeafPreimage {
+    pub nullifier: Field,
+    pub next_nullifier: Field,
+    pub next_index: Field,
+}
+
+

Fields

+
nullifier: Field
+
next_nullifier: Field
+
next_index: Field
+

Implementations

+

impl NullifierLeafPreimage

+ +
pub fn is_empty(self) -> bool + +

Trait implementations

+

impl Deserialize for NullifierLeafPreimage

+ +
pub fn deserialize(serialized: [Field; 3]) -> Self + +

impl Empty for NullifierLeafPreimage

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for NullifierLeafPreimage

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Hash for NullifierLeafPreimage

+ +
pub fn hash(self) -> Field + +

impl IndexedTreeLeafPreimage<Field> for NullifierLeafPreimage

+ +
pub fn get_next_key(self) -> Field + +pub fn points_to_infinity(self) -> bool + +pub fn update_pointers(self, next_key: Field, next_index: Field) -> Self + +pub fn update_value(self, _nullifier: Field) -> Self + +pub fn build_insertion_leaf(nullifier: Field, low_leaf: Self) -> Self + +

impl LeafPreimage for NullifierLeafPreimage

+ +
pub fn get_key(self) -> Field + +pub fn as_leaf(self) -> Field + +

impl Readable for NullifierLeafPreimage

+ +
pub fn assert_match_read_request(self, read_request: Scoped<Counted<Field>>) + +

impl Serialize for NullifierLeafPreimage

+ +
pub fn serialize(self) -> [Field; 3] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/partial_state_reference/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/partial_state_reference/index.html new file mode 100644 index 000000000000..258002a21afa --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/partial_state_reference/index.html @@ -0,0 +1,80 @@ + + + + + + +Module partial_state_reference documentation + + + + + +
+
aztec-nr - protocol_types::abis::partial_state_reference
+

Module partial_state_reference

+

Structs

    +
  • A subset of TreeSnapshots that contains only the trees updated at the tx level. +TODO: Rename to TxStateTreeSnapshots.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/partial_state_reference/struct.PartialStateReference.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/partial_state_reference/struct.PartialStateReference.html new file mode 100644 index 000000000000..f88b47e5903f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/partial_state_reference/struct.PartialStateReference.html @@ -0,0 +1,80 @@ + + + + + + +Struct PartialStateReference documentation + + + + + +
+ +

Struct PartialStateReference

+
pub struct PartialStateReference {
+    pub note_hash_tree: AppendOnlyTreeSnapshot,
+    pub nullifier_tree: AppendOnlyTreeSnapshot,
+    pub public_data_tree: AppendOnlyTreeSnapshot,
+}
+
+
+

A subset of TreeSnapshots that contains only the trees updated at the tx level. +TODO: Rename to TxStateTreeSnapshots.

+
+

Fields

+
note_hash_tree: AppendOnlyTreeSnapshot
+
nullifier_tree: AppendOnlyTreeSnapshot
+
public_data_tree: AppendOnlyTreeSnapshot
+

Trait implementations

+

impl Deserialize for PartialStateReference

+ +
pub fn deserialize(serialized: [Field; 6]) -> Self + +

impl Empty for PartialStateReference

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for PartialStateReference

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for PartialStateReference

+ +
pub fn serialize(self) -> [Field; 6] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_call_request/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_call_request/index.html new file mode 100644 index 000000000000..df31f0dcc197 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_call_request/index.html @@ -0,0 +1,79 @@ + + + + + + +Module private_call_request documentation + + + + + +
+
aztec-nr - protocol_types::abis::private_call_request
+

Module private_call_request

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_call_request/struct.PrivateCallRequest.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_call_request/struct.PrivateCallRequest.html new file mode 100644 index 000000000000..7aad6de90e1d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_call_request/struct.PrivateCallRequest.html @@ -0,0 +1,87 @@ + + + + + + +Struct PrivateCallRequest documentation + + + + + +
+ +

Struct PrivateCallRequest

+
pub struct PrivateCallRequest {
+    pub call_context: CallContext,
+    pub args_hash: Field,
+    pub returns_hash: Field,
+    pub start_side_effect_counter: u32,
+    pub end_side_effect_counter: u32,
+}
+
+

Fields

+
call_context: CallContext
+
args_hash: Field
+
returns_hash: Field
+
start_side_effect_counter: u32
+
end_side_effect_counter: u32
+

Trait implementations

+

impl Deserialize for PrivateCallRequest

+ +
pub fn deserialize(serialized: [Field; 8]) -> Self + +

impl Empty for PrivateCallRequest

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for PrivateCallRequest

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Ordered for PrivateCallRequest

+ +
pub fn counter(self) -> u32 + +

impl Serialize for PrivateCallRequest

+ +
pub fn serialize(self) -> [Field; 8] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_circuit_public_inputs/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_circuit_public_inputs/index.html new file mode 100644 index 000000000000..0bbf5c5ee896 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_circuit_public_inputs/index.html @@ -0,0 +1,79 @@ + + + + + + +Module private_circuit_public_inputs documentation + + + + + +
+
aztec-nr - protocol_types::abis::private_circuit_public_inputs
+

Module private_circuit_public_inputs

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_circuit_public_inputs/struct.PrivateCircuitPublicInputs.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_circuit_public_inputs/struct.PrivateCircuitPublicInputs.html new file mode 100644 index 000000000000..c6df9e3edecd --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_circuit_public_inputs/struct.PrivateCircuitPublicInputs.html @@ -0,0 +1,136 @@ + + + + + + +Struct PrivateCircuitPublicInputs documentation + + + + + +
+ +

Struct PrivateCircuitPublicInputs

+
pub struct PrivateCircuitPublicInputs {
+    pub call_context: CallContext,
+    pub args_hash: Field,
+    pub returns_hash: Field,
+    pub min_revertible_side_effect_counter: u32,
+    pub is_fee_payer: bool,
+    pub include_by_timestamp: u64,
+    pub note_hash_read_requests: ClaimedLengthArray<Scoped<Counted<Field>>, 16>,
+    pub nullifier_read_requests: ClaimedLengthArray<Scoped<Counted<Field>>, 16>,
+    pub key_validation_requests_and_generators: ClaimedLengthArray<KeyValidationRequestAndGenerator, 16>,
+    pub note_hashes: ClaimedLengthArray<Counted<NoteHash>, 16>,
+    pub nullifiers: ClaimedLengthArray<Counted<Nullifier>, 16>,
+    pub private_call_requests: ClaimedLengthArray<PrivateCallRequest, 8>,
+    pub public_call_requests: ClaimedLengthArray<Counted<PublicCallRequest>, 32>,
+    pub public_teardown_call_request: PublicCallRequest,
+    pub l2_to_l1_msgs: ClaimedLengthArray<Counted<L2ToL1Message>, 8>,
+    pub private_logs: ClaimedLengthArray<Counted<PrivateLogData>, 16>,
+    pub contract_class_logs_hashes: ClaimedLengthArray<Counted<LogHash>, 1>,
+    pub start_side_effect_counter: u32,
+    pub end_side_effect_counter: u32,
+    pub expected_non_revertible_side_effect_counter: u32,
+    pub expected_revertible_side_effect_counter: u32,
+    pub anchor_block_header: BlockHeader,
+    pub tx_context: TxContext,
+}
+
+

Fields

+
call_context: CallContext
+
args_hash: Field
+
returns_hash: Field
+
min_revertible_side_effect_counter: u32
+
is_fee_payer: bool
+
include_by_timestamp: u64
+
note_hash_read_requests: ClaimedLengthArray<Scoped<Counted<Field>>, 16>
+
nullifier_read_requests: ClaimedLengthArray<Scoped<Counted<Field>>, 16>
+
key_validation_requests_and_generators: ClaimedLengthArray<KeyValidationRequestAndGenerator, 16>
+
+
+
private_call_requests: ClaimedLengthArray<PrivateCallRequest, 8>
+
public_call_requests: ClaimedLengthArray<Counted<PublicCallRequest>, 32>
+
public_teardown_call_request: PublicCallRequest
+
+
+
contract_class_logs_hashes: ClaimedLengthArray<Counted<LogHash>, 1>
+
start_side_effect_counter: u32
+
end_side_effect_counter: u32
+
expected_non_revertible_side_effect_counter: u32
+
expected_revertible_side_effect_counter: u32
+
anchor_block_header: BlockHeader
+
tx_context: TxContext
+

Trait implementations

+

impl Deserialize for PrivateCircuitPublicInputs

+ +
pub fn deserialize(serialized: [Field; 902]) -> Self + +

impl Empty for PrivateCircuitPublicInputs

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for PrivateCircuitPublicInputs

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for PrivateCircuitPublicInputs

+ +
pub fn serialize(self) -> [Field; 902] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_kernel/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_kernel/index.html new file mode 100644 index 000000000000..fc534e9d2486 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_kernel/index.html @@ -0,0 +1,79 @@ + + + + + + +Module private_kernel documentation + + + + + +
+
aztec-nr - protocol_types::abis::private_kernel
+

Module private_kernel

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_kernel/private_call_data/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_kernel/private_call_data/index.html new file mode 100644 index 000000000000..603d882876ec --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_kernel/private_call_data/index.html @@ -0,0 +1,41 @@ + + + + + + +Module private_call_data documentation + + + + + +
+ +

Module private_call_data

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_kernel/private_call_data/struct.PrivateCallData.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_kernel/private_call_data/struct.PrivateCallData.html new file mode 100644 index 000000000000..54bae11591d0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_kernel/private_call_data/struct.PrivateCallData.html @@ -0,0 +1,63 @@ + + + + + + +Struct PrivateCallData documentation + + + + + +
+ +

Struct PrivateCallData

+
pub struct PrivateCallData {
+    pub public_inputs: PrivateCircuitPublicInputs,
+    pub vk: ChonkVerificationKey,
+    pub verification_key_hints: PrivateVerificationKeyHints,
+}
+
+

Fields

+ +
+
verification_key_hints: PrivateVerificationKeyHints
+

Implementations

+

impl PrivateCallData

+ +
pub fn verify(self, is_first_app: bool) + +
+

Verifies the proof against the verification key and public inputs. +The vk hash is also checked in the backend to match the key.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_kernel/private_call_data/struct.PrivateCallDataWithoutPublicInputs.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_kernel/private_call_data/struct.PrivateCallDataWithoutPublicInputs.html new file mode 100644 index 000000000000..ed2633c77ece --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_kernel/private_call_data/struct.PrivateCallDataWithoutPublicInputs.html @@ -0,0 +1,59 @@ + + + + + + +Struct PrivateCallDataWithoutPublicInputs documentation + + + + + +
+ +

Struct PrivateCallDataWithoutPublicInputs

+
pub struct PrivateCallDataWithoutPublicInputs {
+    pub vk: ChonkVerificationKey,
+    pub verification_key_hints: PrivateVerificationKeyHints,
+}
+
+

Fields

+ +
verification_key_hints: PrivateVerificationKeyHints
+

Implementations

+

impl PrivateCallDataWithoutPublicInputs

+ +
pub fn to_private_call_data( + self, + public_inputs: PrivateCircuitPublicInputs, +) -> PrivateCallData + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_kernel/private_call_data/struct.PrivateVerificationKeyHints.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_kernel/private_call_data/struct.PrivateVerificationKeyHints.html new file mode 100644 index 000000000000..67330543da1a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_kernel/private_call_data/struct.PrivateVerificationKeyHints.html @@ -0,0 +1,65 @@ + + + + + + +Struct PrivateVerificationKeyHints documentation + + + + + +
+ +

Struct PrivateVerificationKeyHints

+
pub struct PrivateVerificationKeyHints {
+    pub salted_initialization_hash: SaltedInitializationHash,
+    pub public_keys: PublicKeys,
+    pub contract_class_artifact_hash: Field,
+    pub contract_class_public_bytecode_commitment: Field,
+    pub function_leaf_membership_witness: MembershipWitness<7>,
+    pub updated_class_id_witness: MembershipWitness<40>,
+    pub updated_class_id_leaf: PublicDataTreeLeafPreimage,
+    pub updated_class_id_delayed_public_mutable_values: [Field; 3],
+}
+
+

Fields

+
salted_initialization_hash: SaltedInitializationHash
+
public_keys: PublicKeys
+
contract_class_artifact_hash: Field
+
contract_class_public_bytecode_commitment: Field
+
function_leaf_membership_witness: MembershipWitness<7>
+
updated_class_id_witness: MembershipWitness<40>
+
updated_class_id_leaf: PublicDataTreeLeafPreimage
+
updated_class_id_delayed_public_mutable_values: [Field; 3]
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_kernel_data/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_kernel_data/index.html new file mode 100644 index 000000000000..925fbc5e181b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_kernel_data/index.html @@ -0,0 +1,80 @@ + + + + + + +Module private_kernel_data documentation + + + + + +
+
aztec-nr - protocol_types::abis::private_kernel_data
+

Module private_kernel_data

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_kernel_data/struct.PrivateKernelData.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_kernel_data/struct.PrivateKernelData.html new file mode 100644 index 000000000000..281aa3afaa19 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_kernel_data/struct.PrivateKernelData.html @@ -0,0 +1,63 @@ + + + + + + +Struct PrivateKernelData documentation + + + + + +
+ +

Struct PrivateKernelData

+
pub struct PrivateKernelData {
+    pub public_inputs: PrivateKernelCircuitPublicInputs,
+    pub vk_data: VkData<127>,
+}
+
+

Fields

+ +
vk_data: VkData<127>
+

Implementations

+

impl PrivateKernelData

+ +
pub fn validate_vk_in_vk_tree<let N: u32>(self, allowed_indices: [u32; N]) + +
+

Validates that the vk hash exists in the vk tree at the expected index. +Note: There's a similar function in vk_data.nr. This function is slightly different but necessary, because it +lets us set only PRIVATE_KERNEL_RESET_INDEX in the allowed_indices to allow all the reset circuits.

+
+
pub fn verify(self, is_last_kernel: bool) + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_kernel_data/struct.PrivateKernelDataWithoutPublicInputs.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_kernel_data/struct.PrivateKernelDataWithoutPublicInputs.html new file mode 100644 index 000000000000..1f6e2e78648b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_kernel_data/struct.PrivateKernelDataWithoutPublicInputs.html @@ -0,0 +1,55 @@ + + + + + + +Struct PrivateKernelDataWithoutPublicInputs documentation + + + + + +
+ +

Struct PrivateKernelDataWithoutPublicInputs

+
pub struct PrivateKernelDataWithoutPublicInputs {
+    pub vk_data: VkData<127>,
+}
+
+

Fields

+
vk_data: VkData<127>
+

Implementations

+

impl PrivateKernelDataWithoutPublicInputs

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_log/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_log/index.html new file mode 100644 index 000000000000..1a63d875404a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_log/index.html @@ -0,0 +1,83 @@ + + + + + + +Module private_log documentation + + + + + +
+
aztec-nr - protocol_types::abis::private_log
+

Module private_log

+

Structs

+

Type aliases

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_log/struct.PrivateLogData.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_log/struct.PrivateLogData.html new file mode 100644 index 000000000000..894179cc45aa --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_log/struct.PrivateLogData.html @@ -0,0 +1,85 @@ + + + + + + +Struct PrivateLogData documentation + + + + + +
+ +

Struct PrivateLogData

+
pub struct PrivateLogData {
+    pub log: Log<18>,
+    pub note_hash_counter: u32,
+}
+
+

Fields

+
log: Log<18>
+
note_hash_counter: u32
+

Implementations

+

impl PrivateLogData

+ +
pub fn count(self, counter: u32) -> Counted<Self> + +

Trait implementations

+

impl Deserialize for PrivateLogData

+ +
pub fn deserialize(serialized: [Field; 20]) -> Self + +

impl Empty for PrivateLogData

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for PrivateLogData

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for PrivateLogData

+ +
pub fn serialize(self) -> [Field; 20] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_log/type.PrivateLog.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_log/type.PrivateLog.html new file mode 100644 index 000000000000..66455ff57e49 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_log/type.PrivateLog.html @@ -0,0 +1,36 @@ + + + + + + +Type alias PrivateLog documentation + + + + + +
+ +

Type alias PrivateLog

+
pub type PrivateLog = Log<18>;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_tx_constant_data/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_tx_constant_data/index.html new file mode 100644 index 000000000000..7583f8a66642 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_tx_constant_data/index.html @@ -0,0 +1,79 @@ + + + + + + +Module private_tx_constant_data documentation + + + + + +
+
aztec-nr - protocol_types::abis::private_tx_constant_data
+

Module private_tx_constant_data

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_tx_constant_data/struct.PrivateTxConstantData.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_tx_constant_data/struct.PrivateTxConstantData.html new file mode 100644 index 000000000000..89b6913659b5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/private_tx_constant_data/struct.PrivateTxConstantData.html @@ -0,0 +1,78 @@ + + + + + + +Struct PrivateTxConstantData documentation + + + + + +
+ +

Struct PrivateTxConstantData

+
pub struct PrivateTxConstantData {
+    pub anchor_block_header: BlockHeader,
+    pub tx_context: TxContext,
+    pub vk_tree_root: Field,
+    pub protocol_contracts: ProtocolContracts,
+}
+
+

Fields

+
anchor_block_header: BlockHeader
+
tx_context: TxContext
+
vk_tree_root: Field
+
protocol_contracts: ProtocolContracts
+

Implementations

+

impl PrivateTxConstantData

+ +

Trait implementations

+

impl Empty for PrivateTxConstantData

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for PrivateTxConstantData

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/protocol_contracts/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/protocol_contracts/index.html new file mode 100644 index 000000000000..6d0e5ccbc179 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/protocol_contracts/index.html @@ -0,0 +1,79 @@ + + + + + + +Module protocol_contracts documentation + + + + + +
+
aztec-nr - protocol_types::abis::protocol_contracts
+

Module protocol_contracts

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/protocol_contracts/struct.ProtocolContracts.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/protocol_contracts/struct.ProtocolContracts.html new file mode 100644 index 000000000000..f3ef337f2e0c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/protocol_contracts/struct.ProtocolContracts.html @@ -0,0 +1,85 @@ + + + + + + +Struct ProtocolContracts documentation + + + + + +
+ +

Struct ProtocolContracts

+
pub struct ProtocolContracts
+{ /* private fields */ }
+
+

Implementations

+

impl ProtocolContracts

+ +
pub fn new(derived_addresses: [AztecAddress; 11]) -> Self + +pub fn is_protocol_contract_address(contract_address: AztecAddress) -> bool + +pub fn get_derived_address(self, protocol_contract_address: AztecAddress) -> AztecAddress + +
+

Obtains the derived address for a given canonical address +Important! This assumes that the called has already validated that the address is indeed a protocol contract address.

+
+
pub fn hash(self) -> Field + +

Trait implementations

+

impl Deserialize for ProtocolContracts

+ +
pub fn deserialize(serialized: [Field; 11 * 1]) -> Self + +

impl Empty for ProtocolContracts

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for ProtocolContracts

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for ProtocolContracts

+ +
pub fn serialize(self) -> [Field; 11 * 1] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/public_call_request/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/public_call_request/index.html new file mode 100644 index 000000000000..e47df861df80 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/public_call_request/index.html @@ -0,0 +1,80 @@ + + + + + + +Module public_call_request documentation + + + + + +
+
aztec-nr - protocol_types::abis::public_call_request
+

Module public_call_request

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/public_call_request/struct.PublicCallRequest.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/public_call_request/struct.PublicCallRequest.html new file mode 100644 index 000000000000..0981f0426948 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/public_call_request/struct.PublicCallRequest.html @@ -0,0 +1,80 @@ + + + + + + +Struct PublicCallRequest documentation + + + + + +
+ +

Struct PublicCallRequest

+
pub struct PublicCallRequest {
+    pub msg_sender: AztecAddress,
+    pub contract_address: AztecAddress,
+    pub is_static_call: bool,
+    pub calldata_hash: Field,
+}
+
+

Fields

+
msg_sender: AztecAddress
+
contract_address: AztecAddress
+
is_static_call: bool
+
calldata_hash: Field
+

Trait implementations

+

impl Deserialize for PublicCallRequest

+ +
pub fn deserialize(serialized: [Field; 4]) -> Self + +

impl Empty for PublicCallRequest

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for PublicCallRequest

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for PublicCallRequest

+ +
pub fn serialize(self) -> [Field; 4] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/public_call_request/struct.PublicCallRequestArrayLengths.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/public_call_request/struct.PublicCallRequestArrayLengths.html new file mode 100644 index 000000000000..d726e2832307 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/public_call_request/struct.PublicCallRequestArrayLengths.html @@ -0,0 +1,90 @@ + + + + + + +Struct PublicCallRequestArrayLengths documentation + + + + + +
+ +

Struct PublicCallRequestArrayLengths

+
pub struct PublicCallRequestArrayLengths {
+    pub setup_calls: u32,
+    pub app_logic_calls: u32,
+    pub teardown_call: bool,
+}
+
+

Fields

+
setup_calls: u32
+
app_logic_calls: u32
+
teardown_call: bool
+

Implementations

+

impl PublicCallRequestArrayLengths

+ +
pub fn new( + setup_call_requests: [PublicCallRequest; 32], + app_logic_call_requests: [PublicCallRequest; 32], + teardown_call_request: PublicCallRequest, +) -> Self + +

Trait implementations

+

impl Deserialize for PublicCallRequestArrayLengths

+ +
pub fn deserialize(serialized: [Field; 3]) -> Self + +

impl Empty for PublicCallRequestArrayLengths

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for PublicCallRequestArrayLengths

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for PublicCallRequestArrayLengths

+ +
pub fn serialize(self) -> [Field; 3] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/public_data_write/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/public_data_write/index.html new file mode 100644 index 000000000000..44c4ae2da394 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/public_data_write/index.html @@ -0,0 +1,79 @@ + + + + + + +Module public_data_write documentation + + + + + +
+
aztec-nr - protocol_types::abis::public_data_write
+

Module public_data_write

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/public_data_write/struct.PublicDataWrite.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/public_data_write/struct.PublicDataWrite.html new file mode 100644 index 000000000000..3b0e6a968963 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/public_data_write/struct.PublicDataWrite.html @@ -0,0 +1,73 @@ + + + + + + +Struct PublicDataWrite documentation + + + + + +
+ +

Struct PublicDataWrite

+
pub struct PublicDataWrite {
+    pub leaf_slot: Field,
+    pub value: Field,
+}
+
+

Fields

+
leaf_slot: Field
+
value: Field
+

Trait implementations

+

impl Deserialize for PublicDataWrite

+ +
pub fn deserialize(serialized: [Field; 2]) -> Self + +

impl Empty for PublicDataWrite

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for PublicDataWrite

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for PublicDataWrite

+ +
pub fn serialize(self) -> [Field; 2] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/public_logs/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/public_logs/index.html new file mode 100644 index 000000000000..71d2bfe02665 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/public_logs/index.html @@ -0,0 +1,79 @@ + + + + + + +Module public_logs documentation + + + + + +
+
aztec-nr - protocol_types::abis::public_logs
+

Module public_logs

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/public_logs/struct.PublicLogs.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/public_logs/struct.PublicLogs.html new file mode 100644 index 000000000000..a65828ddb9c3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/public_logs/struct.PublicLogs.html @@ -0,0 +1,88 @@ + + + + + + +Struct PublicLogs documentation + + + + + +
+ +

Struct PublicLogs

+
pub struct PublicLogs {
+    pub length: u32,
+    pub payload: [Field; 4096],
+}
+
+

Fields

+
length: u32
+
payload: [Field; 4096]
+

Implementations

+

impl PublicLogs

+ +
pub fn new(payload: [Field; 4096], length: u32) -> Self + +pub fn add_log<let N: u32>(&mut self, contract_address: AztecAddress, log: Log<N>) + +
+

Public logs are added in the avm. This function is only for tests.

+
+

Trait implementations

+

impl Deserialize for PublicLogs

+ +
pub fn deserialize(serialized: [Field; 4097]) -> Self + +

impl Empty for PublicLogs

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for PublicLogs

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for PublicLogs

+ +
pub fn serialize(self) -> [Field; 4097] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/state_reference/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/state_reference/index.html new file mode 100644 index 000000000000..491eca5076d0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/state_reference/index.html @@ -0,0 +1,79 @@ + + + + + + +Module state_reference documentation + + + + + +
+
aztec-nr - protocol_types::abis::state_reference
+

Module state_reference

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/state_reference/struct.StateReference.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/state_reference/struct.StateReference.html new file mode 100644 index 000000000000..123a67a58f88 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/state_reference/struct.StateReference.html @@ -0,0 +1,76 @@ + + + + + + +Struct StateReference documentation + + + + + +
+ +

Struct StateReference

+
pub struct StateReference {
+    pub l1_to_l2_message_tree: AppendOnlyTreeSnapshot,
+    pub partial: PartialStateReference,
+}
+
+
+

Deprecated. Use TreeSnapshots instead.

+
+

Fields

+
l1_to_l2_message_tree: AppendOnlyTreeSnapshot
+
+

Trait implementations

+

impl Deserialize for StateReference

+ +
pub fn deserialize(serialized: [Field; 8]) -> Self + +

impl Empty for StateReference

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for StateReference

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for StateReference

+ +
pub fn serialize(self) -> [Field; 8] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/transaction/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/transaction/index.html new file mode 100644 index 000000000000..94677302dd99 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/transaction/index.html @@ -0,0 +1,80 @@ + + + + + + +Module transaction documentation + + + + + +
+
aztec-nr - protocol_types::abis::transaction
+

Module transaction

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/transaction/tx_context/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/transaction/tx_context/index.html new file mode 100644 index 000000000000..248231106ecb --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/transaction/tx_context/index.html @@ -0,0 +1,40 @@ + + + + + + +Module tx_context documentation + + + + + +
+ +

Module tx_context

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/transaction/tx_context/struct.TxContext.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/transaction/tx_context/struct.TxContext.html new file mode 100644 index 000000000000..d3b6eff7dee1 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/transaction/tx_context/struct.TxContext.html @@ -0,0 +1,85 @@ + + + + + + +Struct TxContext documentation + + + + + +
+ +

Struct TxContext

+
pub struct TxContext {
+    pub chain_id: Field,
+    pub version: Field,
+    pub gas_settings: GasSettings,
+}
+
+

Fields

+
chain_id: Field
+
version: Field
+
gas_settings: GasSettings
+

Implementations

+

impl TxContext

+ +
pub fn new(chain_id: Field, version: Field, gas_settings: GasSettings) -> Self + +

Trait implementations

+

impl Deserialize for TxContext

+ +
pub fn deserialize(serialized: [Field; 10]) -> Self + +

impl Empty for TxContext

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for TxContext

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for TxContext

+ +
pub fn serialize(self) -> [Field; 10] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/transaction/tx_request/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/transaction/tx_request/index.html new file mode 100644 index 000000000000..00e5dc827385 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/transaction/tx_request/index.html @@ -0,0 +1,40 @@ + + + + + + +Module tx_request documentation + + + + + +
+ +

Module tx_request

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/transaction/tx_request/struct.TxRequest.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/transaction/tx_request/struct.TxRequest.html new file mode 100644 index 000000000000..d7f8017d2efb --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/transaction/tx_request/struct.TxRequest.html @@ -0,0 +1,87 @@ + + + + + + +Struct TxRequest documentation + + + + + +
+ +

Struct TxRequest

+
pub struct TxRequest {
+    pub origin: AztecAddress,
+    pub args_hash: Field,
+    pub tx_context: TxContext,
+    pub function_data: FunctionData,
+    pub salt: Field,
+}
+
+

Fields

+
origin: AztecAddress
+
args_hash: Field
+
tx_context: TxContext
+
function_data: FunctionData
+
salt: Field
+

Trait implementations

+

impl Deserialize for TxRequest

+ +
pub fn deserialize(serialized: [Field; 15]) -> Self + +

impl Empty for TxRequest

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for TxRequest

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Hash for TxRequest

+ +
pub fn hash(self) -> Field + +

impl Serialize for TxRequest

+ +
pub fn serialize(self) -> [Field; 15] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/tree_snapshots/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/tree_snapshots/index.html new file mode 100644 index 000000000000..df7b2e4c985f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/tree_snapshots/index.html @@ -0,0 +1,79 @@ + + + + + + +Module tree_snapshots documentation + + + + + +
+
aztec-nr - protocol_types::abis::tree_snapshots
+

Module tree_snapshots

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/tree_snapshots/struct.TreeSnapshots.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/tree_snapshots/struct.TreeSnapshots.html new file mode 100644 index 000000000000..0e8def97cc7d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/tree_snapshots/struct.TreeSnapshots.html @@ -0,0 +1,88 @@ + + + + + + +Struct TreeSnapshots documentation + + + + + +
+ +

Struct TreeSnapshots

+
pub struct TreeSnapshots {
+    pub l1_to_l2_message_tree: AppendOnlyTreeSnapshot,
+    pub note_hash_tree: AppendOnlyTreeSnapshot,
+    pub nullifier_tree: AppendOnlyTreeSnapshot,
+    pub public_data_tree: AppendOnlyTreeSnapshot,
+}
+
+

Fields

+
l1_to_l2_message_tree: AppendOnlyTreeSnapshot
+
note_hash_tree: AppendOnlyTreeSnapshot
+
nullifier_tree: AppendOnlyTreeSnapshot
+
public_data_tree: AppendOnlyTreeSnapshot
+

Implementations

+

impl TreeSnapshots

+ +

Trait implementations

+

impl Deserialize for TreeSnapshots

+ +
pub fn deserialize(serialized: [Field; 8]) -> Self + +

impl Empty for TreeSnapshots

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for TreeSnapshots

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for TreeSnapshots

+ +
pub fn serialize(self) -> [Field; 8] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/tx_constant_data/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/tx_constant_data/index.html new file mode 100644 index 000000000000..7f85c992a2cf --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/tx_constant_data/index.html @@ -0,0 +1,79 @@ + + + + + + +Module tx_constant_data documentation + + + + + +
+
aztec-nr - protocol_types::abis::tx_constant_data
+

Module tx_constant_data

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/tx_constant_data/struct.TxConstantData.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/tx_constant_data/struct.TxConstantData.html new file mode 100644 index 000000000000..5fbbc10f28cd --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/tx_constant_data/struct.TxConstantData.html @@ -0,0 +1,79 @@ + + + + + + +Struct TxConstantData documentation + + + + + +
+ +

Struct TxConstantData

+
pub struct TxConstantData {
+    pub anchor_block_header: BlockHeader,
+    pub tx_context: TxContext,
+    pub vk_tree_root: Field,
+    pub protocol_contracts_hash: Field,
+}
+
+

Fields

+
anchor_block_header: BlockHeader
+
tx_context: TxContext
+
vk_tree_root: Field
+
protocol_contracts_hash: Field
+

Trait implementations

+

impl Deserialize for TxConstantData

+ +
pub fn deserialize(serialized: [Field; 34]) -> Self + +

impl Empty for TxConstantData

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for TxConstantData

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for TxConstantData

+ +
pub fn serialize(self) -> [Field; 34] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/validation_requests/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/validation_requests/index.html new file mode 100644 index 000000000000..bc341cd5c6d0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/validation_requests/index.html @@ -0,0 +1,87 @@ + + + + + + +Module validation_requests documentation + + + + + +
+
aztec-nr - protocol_types::abis::validation_requests
+

Module validation_requests

+

Re-exports

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/validation_requests/key_validation_request/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/validation_requests/key_validation_request/index.html new file mode 100644 index 000000000000..eea0c72408cb --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/validation_requests/key_validation_request/index.html @@ -0,0 +1,41 @@ + + + + + + +Module key_validation_request documentation + + + + + +
+
aztec-nr - protocol_types::abis::validation_requests::key_validation_request
+

Module key_validation_request

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/validation_requests/key_validation_request/struct.KeyValidationRequest.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/validation_requests/key_validation_request/struct.KeyValidationRequest.html new file mode 100644 index 000000000000..ea73258959ad --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/validation_requests/key_validation_request/struct.KeyValidationRequest.html @@ -0,0 +1,73 @@ + + + + + + +Struct KeyValidationRequest documentation + + + + + +
+ +

Struct KeyValidationRequest

+
pub struct KeyValidationRequest {
+    pub pk_m: EmbeddedCurvePoint,
+    pub sk_app: Field,
+}
+
+

Fields

+ +
sk_app: Field
+

Trait implementations

+

impl Deserialize for KeyValidationRequest

+ +
pub fn deserialize(serialized: [Field; 4]) -> Self + +

impl Empty for KeyValidationRequest

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for KeyValidationRequest

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for KeyValidationRequest

+ +
pub fn serialize(self) -> [Field; 4] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/validation_requests/key_validation_request_and_generator/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/validation_requests/key_validation_request_and_generator/index.html new file mode 100644 index 000000000000..43954bc5f2c2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/validation_requests/key_validation_request_and_generator/index.html @@ -0,0 +1,41 @@ + + + + + + +Module key_validation_request_and_generator documentation + + + + + +
+
aztec-nr - protocol_types::abis::validation_requests::key_validation_request_and_generator
+

Module key_validation_request_and_generator

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/validation_requests/key_validation_request_and_generator/struct.KeyValidationRequestAndGenerator.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/validation_requests/key_validation_request_and_generator/struct.KeyValidationRequestAndGenerator.html new file mode 100644 index 000000000000..f5349904d074 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/validation_requests/key_validation_request_and_generator/struct.KeyValidationRequestAndGenerator.html @@ -0,0 +1,82 @@ + + + + + + +Struct KeyValidationRequestAndGenerator documentation + + + + + +
+ +

Struct KeyValidationRequestAndGenerator

+
pub struct KeyValidationRequestAndGenerator {
+    pub request: KeyValidationRequest,
+    pub sk_app_generator: Field,
+}
+
+

Fields

+ +
sk_app_generator: Field
+

Implementations

+

impl KeyValidationRequestAndGenerator

+ +
pub fn scope(self, contract_address: AztecAddress) -> Scoped<Self> + +

Trait implementations

+

impl Deserialize for KeyValidationRequestAndGenerator

+ +
pub fn deserialize(serialized: [Field; 5]) -> Self + +

impl Empty for KeyValidationRequestAndGenerator

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for KeyValidationRequestAndGenerator

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for KeyValidationRequestAndGenerator

+ +
pub fn serialize(self) -> [Field; 5] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/validation_requests/private_validation_requests/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/validation_requests/private_validation_requests/index.html new file mode 100644 index 000000000000..2bff55d644e3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/validation_requests/private_validation_requests/index.html @@ -0,0 +1,41 @@ + + + + + + +Module private_validation_requests documentation + + + + + +
+
aztec-nr - protocol_types::abis::validation_requests::private_validation_requests
+

Module private_validation_requests

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/validation_requests/private_validation_requests/struct.PrivateValidationRequests.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/validation_requests/private_validation_requests/struct.PrivateValidationRequests.html new file mode 100644 index 000000000000..ca3bfd2d7c8d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/abis/validation_requests/private_validation_requests/struct.PrivateValidationRequests.html @@ -0,0 +1,66 @@ + + + + + + +Struct PrivateValidationRequests documentation + + + + + +
+ +

Struct PrivateValidationRequests

+
pub struct PrivateValidationRequests {
+    pub note_hash_read_requests: ClaimedLengthArray<Scoped<Counted<Field>>, 64>,
+    pub nullifier_read_requests: ClaimedLengthArray<Scoped<Counted<Field>>, 64>,
+    pub scoped_key_validation_requests_and_generators: ClaimedLengthArray<Scoped<KeyValidationRequestAndGenerator>, 64>,
+}
+
+

Fields

+
note_hash_read_requests: ClaimedLengthArray<Scoped<Counted<Field>>, 64>
+
nullifier_read_requests: ClaimedLengthArray<Scoped<Counted<Field>>, 64>
+
scoped_key_validation_requests_and_generators: ClaimedLengthArray<Scoped<KeyValidationRequestAndGenerator>, 64>
+

Trait implementations

+

impl Empty for PrivateValidationRequests

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for PrivateValidationRequests

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/aztec_address/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/aztec_address/index.html new file mode 100644 index 000000000000..541e17ab583c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/aztec_address/index.html @@ -0,0 +1,43 @@ + + + + + + +Module aztec_address documentation + + + + + +
+
aztec-nr - protocol_types::address::aztec_address
+

Module aztec_address

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/aztec_address/struct.AztecAddress.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/aztec_address/struct.AztecAddress.html new file mode 100644 index 000000000000..5897d13bd0bf --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/aztec_address/struct.AztecAddress.html @@ -0,0 +1,123 @@ + + + + + + +Struct AztecAddress documentation + + + + + +
+ +

Struct AztecAddress

+
pub struct AztecAddress {
+    pub inner: Field,
+}
+
+

Fields

+
inner: Field
+

Implementations

+

impl AztecAddress

+ +
pub fn zero() -> Self + +pub fn to_address_point(self) -> Option<AddressPoint> + +
+

Returns an address's AddressPoint, which can be used to create shared secrets with the owner +of the address. If the address is invalid (i.e. it is not a properly derived Aztec address), then this +returns Option::none(), and no shared secrets can be created.

+
+
pub fn compute(public_keys: PublicKeys, partial_address: PartialAddress) -> Self + +pub fn compute_from_class_id( + contract_class_id: ContractClassId, + salted_initialization_hash: SaltedInitializationHash, + public_keys: PublicKeys, +) -> Self + +pub fn is_protocol_contract(self) -> bool + +pub fn is_zero(self) -> bool + +pub fn assert_is_zero(self) + +

Trait implementations

+

impl Deserialize for AztecAddress

+ +
pub fn deserialize(serialized: [Field; 1]) -> Self + +

impl Empty for AztecAddress

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for AztecAddress

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl FromField for AztecAddress

+ +
pub fn from_field(value: Field) -> Self + +

impl Packable for AztecAddress

+ +
pub fn pack(self) -> [Field; 1] + +pub fn unpack(packed: [Field; 1]) -> Self + +

impl Serialize for AztecAddress

+ +
pub fn serialize(self) -> [Field; 1] + +

impl ToField for AztecAddress

+ +
pub fn to_field(self) -> Field + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/eth_address/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/eth_address/index.html new file mode 100644 index 000000000000..78fbe37586af --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/eth_address/index.html @@ -0,0 +1,43 @@ + + + + + + +Module eth_address documentation + + + + + +
+ +

Module eth_address

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/eth_address/struct.EthAddress.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/eth_address/struct.EthAddress.html new file mode 100644 index 000000000000..dd8f591f898a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/eth_address/struct.EthAddress.html @@ -0,0 +1,96 @@ + + + + + + +Struct EthAddress documentation + + + + + +
+ +

Struct EthAddress

+
pub struct EthAddress
+{ /* private fields */ }
+
+

Implementations

+

impl EthAddress

+ +
pub fn zero() -> Self + +pub fn from_field(field: Field) -> Self + +pub fn is_zero(self) -> bool + +pub fn assert_is_zero(self) + +pub fn to_be_bytes(self) -> [u8; 20] + +

Trait implementations

+

impl Deserialize for EthAddress

+ +
pub fn deserialize(serialized: [Field; 1]) -> Self + +

impl Empty for EthAddress

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for EthAddress

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Packable for EthAddress

+ +
pub fn pack(self) -> [Field; 1] + +pub fn unpack(packed: [Field; 1]) -> Self + +

impl Serialize for EthAddress

+ +
pub fn serialize(self) -> [Field; 1] + +

impl ToField for EthAddress

+ +
pub fn to_field(self) -> Field + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/index.html new file mode 100644 index 000000000000..f2e484f74a82 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/index.html @@ -0,0 +1,76 @@ + + + + + + +Module address documentation + + + + + +
+ +

Module address

+

Re-exports

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/partial_address/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/partial_address/index.html new file mode 100644 index 000000000000..468735568df5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/partial_address/index.html @@ -0,0 +1,43 @@ + + + + + + +Module partial_address documentation + + + + + +
+
aztec-nr - protocol_types::address::partial_address
+

Module partial_address

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/partial_address/struct.PartialAddress.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/partial_address/struct.PartialAddress.html new file mode 100644 index 000000000000..bd56f7c2cd57 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/partial_address/struct.PartialAddress.html @@ -0,0 +1,107 @@ + + + + + + +Struct PartialAddress documentation + + + + + +
+ +

Struct PartialAddress

+
pub struct PartialAddress {
+    pub inner: Field,
+}
+
+

Fields

+
inner: Field
+

Implementations

+

impl PartialAddress

+ +
pub fn from_field(field: Field) -> Self + +pub fn compute( + contract_class_id: ContractClassId, + salt: Field, + initialization_hash: Field, + deployer: AztecAddress, +) -> Self + +pub fn compute_from_salted_initialization_hash( + contract_class_id: ContractClassId, + salted_initialization_hash: SaltedInitializationHash, +) -> Self + +pub fn to_field(self) -> Field + +pub fn is_zero(self) -> bool + +pub fn assert_is_zero(self) + +

Trait implementations

+

impl Deserialize for PartialAddress

+ +
pub fn deserialize(serialized: [Field; 1]) -> Self + +

impl Empty for PartialAddress

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for PartialAddress

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for PartialAddress

+ +
pub fn serialize(self) -> [Field; 1] + +

impl ToField for PartialAddress

+ +
pub fn to_field(self) -> Field + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/public_keys_hash/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/public_keys_hash/index.html new file mode 100644 index 000000000000..ab3189a4b430 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/public_keys_hash/index.html @@ -0,0 +1,43 @@ + + + + + + +Module public_keys_hash documentation + + + + + +
+
aztec-nr - protocol_types::address::public_keys_hash
+

Module public_keys_hash

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/public_keys_hash/struct.PublicKeysHash.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/public_keys_hash/struct.PublicKeysHash.html new file mode 100644 index 000000000000..9d00fcfc52ae --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/public_keys_hash/struct.PublicKeysHash.html @@ -0,0 +1,83 @@ + + + + + + +Struct PublicKeysHash documentation + + + + + +
+ +

Struct PublicKeysHash

+
pub struct PublicKeysHash
+{ /* private fields */ }
+
+

Implementations

+

impl PublicKeysHash

+ +
pub fn from_field(field: Field) -> Self + +pub fn to_field(self) -> Field + +pub fn assert_is_zero(self) + +

Trait implementations

+

impl Deserialize for PublicKeysHash

+ +
pub fn deserialize(serialized: [Field; 1]) -> Self + +

impl Empty for PublicKeysHash

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for PublicKeysHash

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for PublicKeysHash

+ +
pub fn serialize(self) -> [Field; 1] + +

impl ToField for PublicKeysHash

+ +
pub fn to_field(self) -> Field + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/salted_initialization_hash/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/salted_initialization_hash/index.html new file mode 100644 index 000000000000..fae0deb4477c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/salted_initialization_hash/index.html @@ -0,0 +1,43 @@ + + + + + + +Module salted_initialization_hash documentation + + + + + +
+
aztec-nr - protocol_types::address::salted_initialization_hash
+

Module salted_initialization_hash

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/salted_initialization_hash/struct.SaltedInitializationHash.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/salted_initialization_hash/struct.SaltedInitializationHash.html new file mode 100644 index 000000000000..79bb54e6b66d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/address/salted_initialization_hash/struct.SaltedInitializationHash.html @@ -0,0 +1,71 @@ + + + + + + +Struct SaltedInitializationHash documentation + + + + + +
+ +

Struct SaltedInitializationHash

+
pub struct SaltedInitializationHash {
+    pub inner: Field,
+}
+
+

Fields

+
inner: Field
+

Implementations

+

impl SaltedInitializationHash

+ +
pub fn from_field(field: Field) -> Self + +pub fn compute(salt: Field, initialization_hash: Field, deployer: AztecAddress) -> Self + +pub fn assert_is_zero(self) + +

Trait implementations

+

impl Eq for SaltedInitializationHash

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl ToField for SaltedInitializationHash

+ +
pub fn to_field(self) -> Field + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/blob_data/fn.create_block_end_blob_data.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/blob_data/fn.create_block_end_blob_data.html new file mode 100644 index 000000000000..513764d1ecdf --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/blob_data/fn.create_block_end_blob_data.html @@ -0,0 +1,56 @@ + + + + + + +Function create_block_end_blob_data documentation + + + + + +
+ +

Function create_block_end_blob_data

+
pub fn create_block_end_blob_data(
+    global_variables: GlobalVariables,
+    last_archive: AppendOnlyTreeSnapshot,
+    state: StateReference,
+    num_txs: u16,
+    total_mana_used: Field,
+) -> [Field; 7]
+ +
+

Creates the data to be added to the blobs for a block. This is appended after the data for all txs in the block. +It allows components outside the circuits to correctly retrieve the relevant fields from the checkpoint's blob data +and to easily reconstruct the block header without needing to query other sources or rebuild the trees.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/blob_data/fn.create_block_end_marker.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/blob_data/fn.create_block_end_marker.html new file mode 100644 index 000000000000..6f8b50768093 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/blob_data/fn.create_block_end_marker.html @@ -0,0 +1,53 @@ + + + + + + +Function create_block_end_marker documentation + + + + + +
+ +

Function create_block_end_marker

+
pub fn create_block_end_marker(global_variables: GlobalVariables, num_txs: u16) -> Field
+ +
+

Create the field that marks the end of a block. It's a concatenation of: +BLOCK_END_PREFIX | timestamp | block_number | num_txs

+

BLOCK_END_PREFIX occupies the bytes up to the point where timestamp begins. +timestamp occupies 8 bytes. +block_number occupies 4 bytes. +num_txs occupies 2 bytes.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/blob_data/fn.create_block_end_state_field.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/blob_data/fn.create_block_end_state_field.html new file mode 100644 index 000000000000..59671c5c2644 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/blob_data/fn.create_block_end_state_field.html @@ -0,0 +1,55 @@ + + + + + + +Function create_block_end_state_field documentation + + + + + +
+ +

Function create_block_end_state_field

+
pub fn create_block_end_state_field(
+    state: StateReference,
+    total_mana_used: Field,
+) -> Field
+ +
+

Create the field that contains information about the end state of a block. It's a concatenation of: +l1_to_l2_message_next_available_leaf_index | note_hash_next_available_leaf_index | +nullifier_next_available_leaf_index | public_data_next_available_leaf_index | total_mana_used

+

total_mana_used occupies 48 bits: l2_gas of tx is of type u32, and there can be up to 2^16 txs per block. +Each _next_available_leaf_index occupies the number of bits required to represent the tree height.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/blob_data/fn.create_checkpoint_end_marker.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/blob_data/fn.create_checkpoint_end_marker.html new file mode 100644 index 000000000000..9ad5a038e6cb --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/blob_data/fn.create_checkpoint_end_marker.html @@ -0,0 +1,51 @@ + + + + + + +Function create_checkpoint_end_marker documentation + + + + + +
+ +

Function create_checkpoint_end_marker

+
pub fn create_checkpoint_end_marker(num_blob_fields: u32) -> Field
+ +
+

Create the field that marks the end of a checkpoint. It's a concatenation of: +CHECKPOINT_END_PREFIX | num_blob_fields

+

CHECKPOINT_END_PREFIX occupies the bytes up to the point where num_blob_fields begins. +num_blob_fields occupies 4 bytes.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/blob_data/fn.create_tx_start_marker.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/blob_data/fn.create_tx_start_marker.html new file mode 100644 index 000000000000..fd70affaec21 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/blob_data/fn.create_tx_start_marker.html @@ -0,0 +1,64 @@ + + + + + + +Function create_tx_start_marker documentation + + + + + +
+ +

Function create_tx_start_marker

+
pub fn create_tx_start_marker(
+    num_blob_fields: u32,
+    array_lengths: TxEffectArrayLengths,
+    private_logs_length: u32,
+    public_logs_length: u32,
+    contract_class_log_length: u32,
+    revert_code: u8,
+) -> Field
+ +
+

Create the first field that marks the start of a tx. It's a concatenation of: +TX_START_PREFIX | num_note_hashes | num_nullifiers | num_l2_to_l1_msgs | num_public_data_writes | +num_private_logs | private_logs_length | public_logs_length | contract_class_log_length | revert_code | +num_blob_fields

+

TX_START_PREFIX occupies the bytes up to the point where num_note_hashes begins. +num_blob_fields occupies 4 bytes, allowing a maximum of 2 ** 32 fields. +public_logs_length occupies 4 bytes, allowing a maximum of 2 ** 32 fields. +revert_code occupies 1 byte. +Each of the remaining values occupies 2 bytes, allowing a maximum of 2 ** 16 elements each. +A test below ensures they do not exceed these limits.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/blob_data/global.MAX_TX_BLOB_DATA_SIZE_IN_FIELDS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/blob_data/global.MAX_TX_BLOB_DATA_SIZE_IN_FIELDS.html new file mode 100644 index 000000000000..49da053bef15 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/blob_data/global.MAX_TX_BLOB_DATA_SIZE_IN_FIELDS.html @@ -0,0 +1,45 @@ + + + + + + +Global MAX_TX_BLOB_DATA_SIZE_IN_FIELDS documentation + + + + + +
+ +

Global MAX_TX_BLOB_DATA_SIZE_IN_FIELDS

+
pub global MAX_TX_BLOB_DATA_SIZE_IN_FIELDS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/blob_data/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/blob_data/index.html new file mode 100644 index 000000000000..ba67a5da836a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/blob_data/index.html @@ -0,0 +1,88 @@ + + + + + + +Module blob_data documentation + + + + + +
+ +

Module blob_data

+

Structs

+

Functions

    +
  • Creates the data to be added to the blobs for a block. This is appended after the data for all txs in the block. +It allows components outside the circuits to correctly retrieve the relevant fields from the checkpoint's blob data +and to easily reconstruct the block header without needing to query other sources or rebuild the trees.
  • +
  • Create the field that marks the end of a block. It's a concatenation of: +BLOCK_END_PREFIX | timestamp | block_number | num_txs
  • +
  • Create the field that contains information about the end state of a block. It's a concatenation of: +l1_to_l2_message_next_available_leaf_index | note_hash_next_available_leaf_index | +nullifier_next_available_leaf_index | public_data_next_available_leaf_index | total_mana_used
  • +
  • Create the field that marks the end of a checkpoint. It's a concatenation of: +CHECKPOINT_END_PREFIX | num_blob_fields
  • +
  • Create the first field that marks the start of a tx. It's a concatenation of: +TX_START_PREFIX | num_note_hashes | num_nullifiers | num_l2_to_l1_msgs | num_public_data_writes | +num_private_logs | private_logs_length | public_logs_length | contract_class_log_length | revert_code | +num_blob_fields
  • +
+

Globals

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/blob_data/struct.SpongeBlob.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/blob_data/struct.SpongeBlob.html new file mode 100644 index 000000000000..a851ad1c8293 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/blob_data/struct.SpongeBlob.html @@ -0,0 +1,148 @@ + + + + + + +Struct SpongeBlob documentation + + + + + +
+ +

Struct SpongeBlob

+
pub struct SpongeBlob {
+    pub sponge: Poseidon2Sponge,
+    pub num_absorbed_fields: u32,
+}
+
+
+

A Poseidon2 sponge used to accumulate data that will be added to blob(s). +(More accurately called BlobSponge, but that's not as fun).

+

The journey of a SpongeBlob:

+

Tx base: each tx absorbs its effects into the given "start" SpongeBlob and outputs it as the "end" SpongeBlob.

+

Tx merge or block root checks that the start SpongeBlob of a tx matches the end SpongeBlob of the previous tx.

+

Block root: the end SpongeBlob of the last tx absorbs a special block end marker indicating the number of txs in +the block, along with the end state of the block. The block header commits to the value squeezed from this +SpongeBlob. This updated SpongeBlob is then output as the end SpongeBlob of the block root.

+

In block merge or checkpoint root, the start SpongeBlob is checked against the end SpongeBlob of the previous block.

+

Checkpoint root: receives all fields as private inputs and checks that hashing them matches the final hash squeezed +from the end SpongeBlob of the last block, after absorbing a checkpoint end marker indicating the number of fields +absorbed. It also checks that the start SpongeBlob of the first tx in the block does not have any fields absorbed.

+

The final hash is used as part of the blob challenge, proving that all fields of the blob(s) are included.

+

Note: The hash squeezed from the SpongeBlob is NOT a standard poseidon2 hash.

+
+

Fields

+ +
num_absorbed_fields: u32
+

Implementations

+

impl SpongeBlob

+ +
pub fn init() -> Self + +
+

Initialize the sponge with the maximum number of fields allowed in a checkpoint. +This allows proposers to start creating blocks and signing block headers (which contain the hash squeezed from +the this sponge) before receiving all txs in a checkpoint slot.

+
+
pub fn absorb_tx_blob_data( + &mut self, + tx_effect: TxEffect, + array_lengths: TxEffectArrayLengths, +) + +pub fn absorb_block_end_data( + &mut self, + global_variables: GlobalVariables, + last_archive: AppendOnlyTreeSnapshot, + state: StateReference, + num_txs: u16, + total_mana_used: Field, + is_first_block_in_checkpoint: bool, +) + +pub fn absorb_checkpoint_end_marker(&mut self) + +pub fn absorb<let N: u32>(&mut self, input: [Field; N], in_len: u32) + +
+

Absorb the first in_len fields of the input to the sponge. Fields beyond in_len are ignored.

+
+
pub fn squeeze(&mut self) -> Field + +
+

Finalize the sponge and output the non-standard poseidon2 hash of all fields absorbed.

+
+

Trait implementations

+

impl Deserialize for SpongeBlob

+ +
pub fn deserialize(serialized: [Field; 10]) -> Self + +

impl Empty for SpongeBlob

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for SpongeBlob

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for SpongeBlob

+ +
pub fn serialize(self) -> [Field; 10] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/blob_data/struct.TxEffect.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/blob_data/struct.TxEffect.html new file mode 100644 index 000000000000..bbd243c81bf1 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/blob_data/struct.TxEffect.html @@ -0,0 +1,99 @@ + + + + + + +Struct TxEffect documentation + + + + + +
+ +

Struct TxEffect

+
pub struct TxEffect {
+    pub tx_hash: Field,
+    pub revert_code: u8,
+    pub transaction_fee: Field,
+    pub note_hashes: [Field; 64],
+    pub nullifiers: [Field; 64],
+    pub l2_to_l1_msgs: [Field; 8],
+    pub public_data_writes: [PublicDataWrite; 64],
+    pub private_logs: [PrivateLog; 64],
+    pub public_logs: PublicLogs,
+    pub contract_class_logs: [ContractClassLog; 1],
+}
+
+

Fields

+
tx_hash: Field
+
revert_code: u8
+
transaction_fee: Field
+
note_hashes: [Field; 64]
+
nullifiers: [Field; 64]
+
l2_to_l1_msgs: [Field; 8]
+
public_data_writes: [PublicDataWrite; 64]
+
private_logs: [PrivateLog; 64]
+
public_logs: PublicLogs
+
contract_class_logs: [ContractClassLog; 1]
+

Trait implementations

+

impl Empty for TxEffect

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for TxEffect

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/blob_data/struct.TxEffectArrayLengths.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/blob_data/struct.TxEffectArrayLengths.html new file mode 100644 index 000000000000..6d8a4f23c0fc --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/blob_data/struct.TxEffectArrayLengths.html @@ -0,0 +1,69 @@ + + + + + + +Struct TxEffectArrayLengths documentation + + + + + +
+ +

Struct TxEffectArrayLengths

+
pub struct TxEffectArrayLengths {
+    pub note_hashes: u32,
+    pub nullifiers: u32,
+    pub l2_to_l1_msgs: u32,
+    pub public_data_writes: u32,
+    pub private_logs: u32,
+    pub contract_class_logs: u32,
+}
+
+

Fields

+
note_hashes: u32
+
nullifiers: u32
+
l2_to_l1_msgs: u32
+
public_data_writes: u32
+
private_logs: u32
+
contract_class_logs: u32
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.APPEND_ONLY_TREE_SNAPSHOT_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.APPEND_ONLY_TREE_SNAPSHOT_LENGTH.html new file mode 100644 index 000000000000..e4b2e34d7286 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.APPEND_ONLY_TREE_SNAPSHOT_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global APPEND_ONLY_TREE_SNAPSHOT_LENGTH documentation + + + + + +
+ +

Global APPEND_ONLY_TREE_SNAPSHOT_LENGTH

+
pub global APPEND_ONLY_TREE_SNAPSHOT_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.APPEND_ONLY_TREE_SNAPSHOT_LENGTH_BYTES.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.APPEND_ONLY_TREE_SNAPSHOT_LENGTH_BYTES.html new file mode 100644 index 000000000000..8e07db21951e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.APPEND_ONLY_TREE_SNAPSHOT_LENGTH_BYTES.html @@ -0,0 +1,583 @@ + + + + + + +Global APPEND_ONLY_TREE_SNAPSHOT_LENGTH_BYTES documentation + + + + + +
+ +

Global APPEND_ONLY_TREE_SNAPSHOT_LENGTH_BYTES

+
pub global APPEND_ONLY_TREE_SNAPSHOT_LENGTH_BYTES: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.ARCHIVE_HEIGHT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.ARCHIVE_HEIGHT.html new file mode 100644 index 000000000000..21aa1175443b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.ARCHIVE_HEIGHT.html @@ -0,0 +1,602 @@ + + + + + + +Global ARCHIVE_HEIGHT documentation + + + + + +
+ +

Global ARCHIVE_HEIGHT

+
pub global ARCHIVE_HEIGHT: u32;
+ +
+

Convention for constant array lengths are mainly divided in 2 classes:

+
    +
  • FUNCTION CALL
  • +
  • TRANSACTION
  • +
+

Agreed convention is to use MAX_XXX_PER_CALL resp. MAX_XXX_PER_TX, where XXX denotes a type of element such as +commitment, or nullifier, e.g.,:

+
    +
  • MAX_NULLIFIERS_PER_CALL
  • +
  • MAX_NOTE_HASHES_PER_TX
  • +
+

In the kernel circuits, we accumulate elements such as note hashes and the nullifiers from all functions calls in a +transaction. Therefore, we always must have: +MAX_XXX_PER_TX >= MAX_XXX_PER_CALL

+

For instance: +MAX_NOTE_HASHES_PER_TX >= MAX_NOTE_HASHES_PER_CALL +MAX_NULLIFIERS_PER_TX >= MAX_NULLIFIERS_PER_CALL

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.ARCHIVE_TREE_ID.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.ARCHIVE_TREE_ID.html new file mode 100644 index 000000000000..8ddb6fc2cab3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.ARCHIVE_TREE_ID.html @@ -0,0 +1,583 @@ + + + + + + +Global ARCHIVE_TREE_ID documentation + + + + + +
+ +

Global ARCHIVE_TREE_ID

+
pub global ARCHIVE_TREE_ID: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.ARTIFACT_FUNCTION_TREE_MAX_HEIGHT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.ARTIFACT_FUNCTION_TREE_MAX_HEIGHT.html new file mode 100644 index 000000000000..02fcbf257095 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.ARTIFACT_FUNCTION_TREE_MAX_HEIGHT.html @@ -0,0 +1,583 @@ + + + + + + +Global ARTIFACT_FUNCTION_TREE_MAX_HEIGHT documentation + + + + + +
+ +

Global ARTIFACT_FUNCTION_TREE_MAX_HEIGHT

+
pub global ARTIFACT_FUNCTION_TREE_MAX_HEIGHT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_ACCUMULATED_DATA_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_ACCUMULATED_DATA_LENGTH.html new file mode 100644 index 000000000000..25d3f1149ea6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_ACCUMULATED_DATA_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_ACCUMULATED_DATA_LENGTH documentation + + + + + +
+ +

Global AVM_ACCUMULATED_DATA_LENGTH

+
pub global AVM_ACCUMULATED_DATA_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_ADDRESSING_BASE_RESOLUTION_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_ADDRESSING_BASE_RESOLUTION_L2_GAS.html new file mode 100644 index 000000000000..44a5d5ba4699 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_ADDRESSING_BASE_RESOLUTION_L2_GAS.html @@ -0,0 +1,587 @@ + + + + + + +Global AVM_ADDRESSING_BASE_RESOLUTION_L2_GAS documentation + + + + + +
+ +

Global AVM_ADDRESSING_BASE_RESOLUTION_L2_GAS

+
pub global AVM_ADDRESSING_BASE_RESOLUTION_L2_GAS: u32;
+ +
+

GAS COSTS FOR AVM OPCODES +They are used in TS and C++

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_ADDRESSING_INDIRECT_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_ADDRESSING_INDIRECT_L2_GAS.html new file mode 100644 index 000000000000..6f94a963c9bc --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_ADDRESSING_INDIRECT_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_ADDRESSING_INDIRECT_L2_GAS documentation + + + + + +
+ +

Global AVM_ADDRESSING_INDIRECT_L2_GAS

+
pub global AVM_ADDRESSING_INDIRECT_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_ADDRESSING_RELATIVE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_ADDRESSING_RELATIVE_L2_GAS.html new file mode 100644 index 000000000000..21283591c2e2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_ADDRESSING_RELATIVE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_ADDRESSING_RELATIVE_L2_GAS documentation + + + + + +
+ +

Global AVM_ADDRESSING_RELATIVE_L2_GAS

+
pub global AVM_ADDRESSING_RELATIVE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_ADD_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_ADD_BASE_L2_GAS.html new file mode 100644 index 000000000000..e541c680340c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_ADD_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_ADD_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_ADD_BASE_L2_GAS

+
pub global AVM_ADD_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_AND_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_AND_BASE_L2_GAS.html new file mode 100644 index 000000000000..b063c2ecd265 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_AND_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_AND_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_AND_BASE_L2_GAS

+
pub global AVM_AND_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_BITWISE_AND_OP_ID.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_BITWISE_AND_OP_ID.html new file mode 100644 index 000000000000..b7a935fa0c98 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_BITWISE_AND_OP_ID.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_BITWISE_AND_OP_ID documentation + + + + + +
+ +

Global AVM_BITWISE_AND_OP_ID

+
pub global AVM_BITWISE_AND_OP_ID: u8;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_BITWISE_DYN_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_BITWISE_DYN_L2_GAS.html new file mode 100644 index 000000000000..d3f76a708fd1 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_BITWISE_DYN_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_BITWISE_DYN_L2_GAS documentation + + + + + +
+ +

Global AVM_BITWISE_DYN_L2_GAS

+
pub global AVM_BITWISE_DYN_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_BITWISE_OR_OP_ID.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_BITWISE_OR_OP_ID.html new file mode 100644 index 000000000000..3e46b7b36303 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_BITWISE_OR_OP_ID.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_BITWISE_OR_OP_ID documentation + + + + + +
+ +

Global AVM_BITWISE_OR_OP_ID

+
pub global AVM_BITWISE_OR_OP_ID: u8;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_BITWISE_XOR_OP_ID.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_BITWISE_XOR_OP_ID.html new file mode 100644 index 000000000000..3562c962d815 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_BITWISE_XOR_OP_ID.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_BITWISE_XOR_OP_ID documentation + + + + + +
+ +

Global AVM_BITWISE_XOR_OP_ID

+
pub global AVM_BITWISE_XOR_OP_ID: u8;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_CALLDATACOPY_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_CALLDATACOPY_BASE_L2_GAS.html new file mode 100644 index 000000000000..2063c213b535 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_CALLDATACOPY_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_CALLDATACOPY_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_CALLDATACOPY_BASE_L2_GAS

+
pub global AVM_CALLDATACOPY_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_CALLDATACOPY_DYN_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_CALLDATACOPY_DYN_L2_GAS.html new file mode 100644 index 000000000000..031208ae3a0b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_CALLDATACOPY_DYN_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_CALLDATACOPY_DYN_L2_GAS documentation + + + + + +
+ +

Global AVM_CALLDATACOPY_DYN_L2_GAS

+
pub global AVM_CALLDATACOPY_DYN_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_CALL_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_CALL_BASE_L2_GAS.html new file mode 100644 index 000000000000..ec30acad0942 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_CALL_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_CALL_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_CALL_BASE_L2_GAS

+
pub global AVM_CALL_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_CAST_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_CAST_BASE_L2_GAS.html new file mode 100644 index 000000000000..bc8aed3fb11a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_CAST_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_CAST_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_CAST_BASE_L2_GAS

+
pub global AVM_CAST_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_CIRCUIT_PUBLIC_INPUTS_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_CIRCUIT_PUBLIC_INPUTS_LENGTH.html new file mode 100644 index 000000000000..ebf4beaf9f4e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_CIRCUIT_PUBLIC_INPUTS_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_CIRCUIT_PUBLIC_INPUTS_LENGTH documentation + + + + + +
+ +

Global AVM_CIRCUIT_PUBLIC_INPUTS_LENGTH

+
pub global AVM_CIRCUIT_PUBLIC_INPUTS_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_DEBUGLOG_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_DEBUGLOG_BASE_L2_GAS.html new file mode 100644 index 000000000000..637fe81fa139 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_DEBUGLOG_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_DEBUGLOG_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_DEBUGLOG_BASE_L2_GAS

+
pub global AVM_DEBUGLOG_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_DIV_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_DIV_BASE_L2_GAS.html new file mode 100644 index 000000000000..32fe716c3128 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_DIV_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_DIV_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_DIV_BASE_L2_GAS

+
pub global AVM_DIV_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_DYN_GAS_ID_BITWISE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_DYN_GAS_ID_BITWISE.html new file mode 100644 index 000000000000..b22cf3c62ad6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_DYN_GAS_ID_BITWISE.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_DYN_GAS_ID_BITWISE documentation + + + + + +
+ +

Global AVM_DYN_GAS_ID_BITWISE

+
pub global AVM_DYN_GAS_ID_BITWISE: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_DYN_GAS_ID_CALLDATACOPY.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_DYN_GAS_ID_CALLDATACOPY.html new file mode 100644 index 000000000000..edad14c70ceb --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_DYN_GAS_ID_CALLDATACOPY.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_DYN_GAS_ID_CALLDATACOPY documentation + + + + + +
+ +

Global AVM_DYN_GAS_ID_CALLDATACOPY

+
pub global AVM_DYN_GAS_ID_CALLDATACOPY: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_DYN_GAS_ID_EMITUNENCRYPTEDLOG.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_DYN_GAS_ID_EMITUNENCRYPTEDLOG.html new file mode 100644 index 000000000000..374fa9c98ef8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_DYN_GAS_ID_EMITUNENCRYPTEDLOG.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_DYN_GAS_ID_EMITUNENCRYPTEDLOG documentation + + + + + +
+ +

Global AVM_DYN_GAS_ID_EMITUNENCRYPTEDLOG

+
pub global AVM_DYN_GAS_ID_EMITUNENCRYPTEDLOG: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_DYN_GAS_ID_RETURNDATACOPY.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_DYN_GAS_ID_RETURNDATACOPY.html new file mode 100644 index 000000000000..ec88f0ba1e2c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_DYN_GAS_ID_RETURNDATACOPY.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_DYN_GAS_ID_RETURNDATACOPY documentation + + + + + +
+ +

Global AVM_DYN_GAS_ID_RETURNDATACOPY

+
pub global AVM_DYN_GAS_ID_RETURNDATACOPY: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_DYN_GAS_ID_SSTORE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_DYN_GAS_ID_SSTORE.html new file mode 100644 index 000000000000..042c7eb1de24 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_DYN_GAS_ID_SSTORE.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_DYN_GAS_ID_SSTORE documentation + + + + + +
+ +

Global AVM_DYN_GAS_ID_SSTORE

+
pub global AVM_DYN_GAS_ID_SSTORE: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_DYN_GAS_ID_TORADIX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_DYN_GAS_ID_TORADIX.html new file mode 100644 index 000000000000..5704c1a526f7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_DYN_GAS_ID_TORADIX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_DYN_GAS_ID_TORADIX documentation + + + + + +
+ +

Global AVM_DYN_GAS_ID_TORADIX

+
pub global AVM_DYN_GAS_ID_TORADIX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_ECADD_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_ECADD_BASE_L2_GAS.html new file mode 100644 index 000000000000..25b27a50e02d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_ECADD_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_ECADD_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_ECADD_BASE_L2_GAS

+
pub global AVM_ECADD_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EMITNOTEHASH_BASE_DA_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EMITNOTEHASH_BASE_DA_GAS.html new file mode 100644 index 000000000000..b516b86b522d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EMITNOTEHASH_BASE_DA_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EMITNOTEHASH_BASE_DA_GAS documentation + + + + + +
+ +

Global AVM_EMITNOTEHASH_BASE_DA_GAS

+
pub global AVM_EMITNOTEHASH_BASE_DA_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EMITNOTEHASH_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EMITNOTEHASH_BASE_L2_GAS.html new file mode 100644 index 000000000000..aac9960041fd --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EMITNOTEHASH_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EMITNOTEHASH_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_EMITNOTEHASH_BASE_L2_GAS

+
pub global AVM_EMITNOTEHASH_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EMITNULLIFIER_BASE_DA_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EMITNULLIFIER_BASE_DA_GAS.html new file mode 100644 index 000000000000..9fe8e2c4b251 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EMITNULLIFIER_BASE_DA_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EMITNULLIFIER_BASE_DA_GAS documentation + + + + + +
+ +

Global AVM_EMITNULLIFIER_BASE_DA_GAS

+
pub global AVM_EMITNULLIFIER_BASE_DA_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EMITNULLIFIER_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EMITNULLIFIER_BASE_L2_GAS.html new file mode 100644 index 000000000000..56618d567e1c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EMITNULLIFIER_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EMITNULLIFIER_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_EMITNULLIFIER_BASE_L2_GAS

+
pub global AVM_EMITNULLIFIER_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EMITUNENCRYPTEDLOG_BASE_DA_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EMITUNENCRYPTEDLOG_BASE_DA_GAS.html new file mode 100644 index 000000000000..ae1097789371 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EMITUNENCRYPTEDLOG_BASE_DA_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EMITUNENCRYPTEDLOG_BASE_DA_GAS documentation + + + + + +
+ +

Global AVM_EMITUNENCRYPTEDLOG_BASE_DA_GAS

+
pub global AVM_EMITUNENCRYPTEDLOG_BASE_DA_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EMITUNENCRYPTEDLOG_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EMITUNENCRYPTEDLOG_BASE_L2_GAS.html new file mode 100644 index 000000000000..7610ff8323af --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EMITUNENCRYPTEDLOG_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EMITUNENCRYPTEDLOG_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_EMITUNENCRYPTEDLOG_BASE_L2_GAS

+
pub global AVM_EMITUNENCRYPTEDLOG_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EMITUNENCRYPTEDLOG_DYN_DA_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EMITUNENCRYPTEDLOG_DYN_DA_GAS.html new file mode 100644 index 000000000000..7f20cf6fc484 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EMITUNENCRYPTEDLOG_DYN_DA_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EMITUNENCRYPTEDLOG_DYN_DA_GAS documentation + + + + + +
+ +

Global AVM_EMITUNENCRYPTEDLOG_DYN_DA_GAS

+
pub global AVM_EMITUNENCRYPTEDLOG_DYN_DA_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EMITUNENCRYPTEDLOG_DYN_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EMITUNENCRYPTEDLOG_DYN_L2_GAS.html new file mode 100644 index 000000000000..3a7d1e20a6d8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EMITUNENCRYPTEDLOG_DYN_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EMITUNENCRYPTEDLOG_DYN_L2_GAS documentation + + + + + +
+ +

Global AVM_EMITUNENCRYPTEDLOG_DYN_L2_GAS

+
pub global AVM_EMITUNENCRYPTEDLOG_DYN_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EQ_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EQ_BASE_L2_GAS.html new file mode 100644 index 000000000000..c01328f376be --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EQ_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EQ_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_EQ_BASE_L2_GAS

+
pub global AVM_EQ_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_ADD.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_ADD.html new file mode 100644 index 000000000000..fe63088690cb --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_ADD.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_ALU_ADD documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_ALU_ADD

+
pub global AVM_EXEC_OP_ID_ALU_ADD: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_DIV.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_DIV.html new file mode 100644 index 000000000000..2300138a6e9c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_DIV.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_ALU_DIV documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_ALU_DIV

+
pub global AVM_EXEC_OP_ID_ALU_DIV: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_EQ.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_EQ.html new file mode 100644 index 000000000000..59c16355ed41 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_EQ.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_ALU_EQ documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_ALU_EQ

+
pub global AVM_EXEC_OP_ID_ALU_EQ: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_FDIV.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_FDIV.html new file mode 100644 index 000000000000..cc3e6b75b4ff --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_FDIV.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_ALU_FDIV documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_ALU_FDIV

+
pub global AVM_EXEC_OP_ID_ALU_FDIV: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_LT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_LT.html new file mode 100644 index 000000000000..d21c158af1d2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_LT.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_ALU_LT documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_ALU_LT

+
pub global AVM_EXEC_OP_ID_ALU_LT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_LTE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_LTE.html new file mode 100644 index 000000000000..29b20ddc02f4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_LTE.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_ALU_LTE documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_ALU_LTE

+
pub global AVM_EXEC_OP_ID_ALU_LTE: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_MUL.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_MUL.html new file mode 100644 index 000000000000..119e227760c0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_MUL.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_ALU_MUL documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_ALU_MUL

+
pub global AVM_EXEC_OP_ID_ALU_MUL: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_NOT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_NOT.html new file mode 100644 index 000000000000..bc920862cadb --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_NOT.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_ALU_NOT documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_ALU_NOT

+
pub global AVM_EXEC_OP_ID_ALU_NOT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_SHL.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_SHL.html new file mode 100644 index 000000000000..f10f6dc69007 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_SHL.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_ALU_SHL documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_ALU_SHL

+
pub global AVM_EXEC_OP_ID_ALU_SHL: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_SHR.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_SHR.html new file mode 100644 index 000000000000..4bb40cf2549f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_SHR.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_ALU_SHR documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_ALU_SHR

+
pub global AVM_EXEC_OP_ID_ALU_SHR: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_SUB.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_SUB.html new file mode 100644 index 000000000000..73c4a361dc65 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_SUB.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_ALU_SUB documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_ALU_SUB

+
pub global AVM_EXEC_OP_ID_ALU_SUB: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_TRUNCATE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_TRUNCATE.html new file mode 100644 index 000000000000..75a2440569b9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_ALU_TRUNCATE.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_ALU_TRUNCATE documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_ALU_TRUNCATE

+
pub global AVM_EXEC_OP_ID_ALU_TRUNCATE: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_CALL.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_CALL.html new file mode 100644 index 000000000000..140da77214c0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_CALL.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_CALL documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_CALL

+
pub global AVM_EXEC_OP_ID_CALL: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_DEBUGLOG.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_DEBUGLOG.html new file mode 100644 index 000000000000..ad81ac487792 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_DEBUGLOG.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_DEBUGLOG documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_DEBUGLOG

+
pub global AVM_EXEC_OP_ID_DEBUGLOG: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_EMIT_NOTEHASH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_EMIT_NOTEHASH.html new file mode 100644 index 000000000000..3c60e2ced760 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_EMIT_NOTEHASH.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_EMIT_NOTEHASH documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_EMIT_NOTEHASH

+
pub global AVM_EXEC_OP_ID_EMIT_NOTEHASH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_EMIT_NULLIFIER.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_EMIT_NULLIFIER.html new file mode 100644 index 000000000000..cdd0e88a27d5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_EMIT_NULLIFIER.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_EMIT_NULLIFIER documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_EMIT_NULLIFIER

+
pub global AVM_EXEC_OP_ID_EMIT_NULLIFIER: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_GETENVVAR.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_GETENVVAR.html new file mode 100644 index 000000000000..85ab633d252a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_GETENVVAR.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_GETENVVAR documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_GETENVVAR

+
pub global AVM_EXEC_OP_ID_GETENVVAR: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_INTERNALCALL.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_INTERNALCALL.html new file mode 100644 index 000000000000..9fdb77643a36 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_INTERNALCALL.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_INTERNALCALL documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_INTERNALCALL

+
pub global AVM_EXEC_OP_ID_INTERNALCALL: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_INTERNALRETURN.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_INTERNALRETURN.html new file mode 100644 index 000000000000..072a0011cc57 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_INTERNALRETURN.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_INTERNALRETURN documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_INTERNALRETURN

+
pub global AVM_EXEC_OP_ID_INTERNALRETURN: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_JUMP.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_JUMP.html new file mode 100644 index 000000000000..73ef3fd3a522 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_JUMP.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_JUMP documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_JUMP

+
pub global AVM_EXEC_OP_ID_JUMP: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_JUMPI.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_JUMPI.html new file mode 100644 index 000000000000..dec4d08671ae --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_JUMPI.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_JUMPI documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_JUMPI

+
pub global AVM_EXEC_OP_ID_JUMPI: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_L1_TO_L2_MESSAGE_EXISTS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_L1_TO_L2_MESSAGE_EXISTS.html new file mode 100644 index 000000000000..b7d9f631eaf6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_L1_TO_L2_MESSAGE_EXISTS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_L1_TO_L2_MESSAGE_EXISTS documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_L1_TO_L2_MESSAGE_EXISTS

+
pub global AVM_EXEC_OP_ID_L1_TO_L2_MESSAGE_EXISTS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_MOV.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_MOV.html new file mode 100644 index 000000000000..10d8db15cc47 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_MOV.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_MOV documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_MOV

+
pub global AVM_EXEC_OP_ID_MOV: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_NOTEHASH_EXISTS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_NOTEHASH_EXISTS.html new file mode 100644 index 000000000000..acb9feba7722 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_NOTEHASH_EXISTS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_NOTEHASH_EXISTS documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_NOTEHASH_EXISTS

+
pub global AVM_EXEC_OP_ID_NOTEHASH_EXISTS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_NULLIFIER_EXISTS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_NULLIFIER_EXISTS.html new file mode 100644 index 000000000000..604f073bde63 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_NULLIFIER_EXISTS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_NULLIFIER_EXISTS documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_NULLIFIER_EXISTS

+
pub global AVM_EXEC_OP_ID_NULLIFIER_EXISTS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_RETURN.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_RETURN.html new file mode 100644 index 000000000000..820e403d69da --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_RETURN.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_RETURN documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_RETURN

+
pub global AVM_EXEC_OP_ID_RETURN: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_RETURNDATASIZE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_RETURNDATASIZE.html new file mode 100644 index 000000000000..9d85414e1001 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_RETURNDATASIZE.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_RETURNDATASIZE documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_RETURNDATASIZE

+
pub global AVM_EXEC_OP_ID_RETURNDATASIZE: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_REVERT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_REVERT.html new file mode 100644 index 000000000000..947a700e146b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_REVERT.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_REVERT documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_REVERT

+
pub global AVM_EXEC_OP_ID_REVERT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_SENDL2TOL1MSG.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_SENDL2TOL1MSG.html new file mode 100644 index 000000000000..dd284ac76be3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_SENDL2TOL1MSG.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_SENDL2TOL1MSG documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_SENDL2TOL1MSG

+
pub global AVM_EXEC_OP_ID_SENDL2TOL1MSG: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_SLOAD.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_SLOAD.html new file mode 100644 index 000000000000..5ce2b3116dc2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_SLOAD.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_SLOAD documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_SLOAD

+
pub global AVM_EXEC_OP_ID_SLOAD: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_SSTORE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_SSTORE.html new file mode 100644 index 000000000000..6441763e4bb6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_SSTORE.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_SSTORE documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_SSTORE

+
pub global AVM_EXEC_OP_ID_SSTORE: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_STATICCALL.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_STATICCALL.html new file mode 100644 index 000000000000..9f2d3774fcd0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_STATICCALL.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_STATICCALL documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_STATICCALL

+
pub global AVM_EXEC_OP_ID_STATICCALL: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_SUCCESSCOPY.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_SUCCESSCOPY.html new file mode 100644 index 000000000000..fd7309834728 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_EXEC_OP_ID_SUCCESSCOPY.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_EXEC_OP_ID_SUCCESSCOPY documentation + + + + + +
+ +

Global AVM_EXEC_OP_ID_SUCCESSCOPY

+
pub global AVM_EXEC_OP_ID_SUCCESSCOPY: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_FDIV_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_FDIV_BASE_L2_GAS.html new file mode 100644 index 000000000000..1f6a00153294 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_FDIV_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_FDIV_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_FDIV_BASE_L2_GAS

+
pub global AVM_FDIV_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_GETCONTRACTINSTANCE_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_GETCONTRACTINSTANCE_BASE_L2_GAS.html new file mode 100644 index 000000000000..ca9f873b06ad --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_GETCONTRACTINSTANCE_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_GETCONTRACTINSTANCE_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_GETCONTRACTINSTANCE_BASE_L2_GAS

+
pub global AVM_GETCONTRACTINSTANCE_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_GETENVVAR_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_GETENVVAR_BASE_L2_GAS.html new file mode 100644 index 000000000000..6be8b9cb1cc7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_GETENVVAR_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_GETENVVAR_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_GETENVVAR_BASE_L2_GAS

+
pub global AVM_GETENVVAR_BASE_L2_GAS: u16;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_HIGHEST_MEM_ADDRESS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_HIGHEST_MEM_ADDRESS.html new file mode 100644 index 000000000000..72b207211737 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_HIGHEST_MEM_ADDRESS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_HIGHEST_MEM_ADDRESS documentation + + + + + +
+ +

Global AVM_HIGHEST_MEM_ADDRESS

+
pub global AVM_HIGHEST_MEM_ADDRESS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_INTERNALCALL_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_INTERNALCALL_BASE_L2_GAS.html new file mode 100644 index 000000000000..2b61b01c1ce7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_INTERNALCALL_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_INTERNALCALL_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_INTERNALCALL_BASE_L2_GAS

+
pub global AVM_INTERNALCALL_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_INTERNALRETURN_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_INTERNALRETURN_BASE_L2_GAS.html new file mode 100644 index 000000000000..2309ef36d27c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_INTERNALRETURN_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_INTERNALRETURN_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_INTERNALRETURN_BASE_L2_GAS

+
pub global AVM_INTERNALRETURN_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_JUMPI_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_JUMPI_BASE_L2_GAS.html new file mode 100644 index 000000000000..2c714cd51369 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_JUMPI_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_JUMPI_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_JUMPI_BASE_L2_GAS

+
pub global AVM_JUMPI_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_JUMP_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_JUMP_BASE_L2_GAS.html new file mode 100644 index 000000000000..18775ad722f2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_JUMP_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_JUMP_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_JUMP_BASE_L2_GAS

+
pub global AVM_JUMP_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_KECCAKF1600_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_KECCAKF1600_BASE_L2_GAS.html new file mode 100644 index 000000000000..a96aedb584c5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_KECCAKF1600_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_KECCAKF1600_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_KECCAKF1600_BASE_L2_GAS

+
pub global AVM_KECCAKF1600_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_KECCAKF1600_NUM_ROUNDS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_KECCAKF1600_NUM_ROUNDS.html new file mode 100644 index 000000000000..5fe4cc0fe0ac --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_KECCAKF1600_NUM_ROUNDS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_KECCAKF1600_NUM_ROUNDS documentation + + + + + +
+ +

Global AVM_KECCAKF1600_NUM_ROUNDS

+
pub global AVM_KECCAKF1600_NUM_ROUNDS: u8;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_KECCAKF1600_STATE_SIZE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_KECCAKF1600_STATE_SIZE.html new file mode 100644 index 000000000000..fbec59152d56 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_KECCAKF1600_STATE_SIZE.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_KECCAKF1600_STATE_SIZE documentation + + + + + +
+ +

Global AVM_KECCAKF1600_STATE_SIZE

+
pub global AVM_KECCAKF1600_STATE_SIZE: u8;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_L1TOL2MSGEXISTS_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_L1TOL2MSGEXISTS_BASE_L2_GAS.html new file mode 100644 index 000000000000..4d331b31408b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_L1TOL2MSGEXISTS_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_L1TOL2MSGEXISTS_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_L1TOL2MSGEXISTS_BASE_L2_GAS

+
pub global AVM_L1TOL2MSGEXISTS_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_LTE_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_LTE_BASE_L2_GAS.html new file mode 100644 index 000000000000..042b0016b22d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_LTE_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_LTE_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_LTE_BASE_L2_GAS

+
pub global AVM_LTE_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_LT_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_LT_BASE_L2_GAS.html new file mode 100644 index 000000000000..4113b7bd8469 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_LT_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_LT_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_LT_BASE_L2_GAS

+
pub global AVM_LT_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_MAX_OPERANDS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_MAX_OPERANDS.html new file mode 100644 index 000000000000..22a185360041 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_MAX_OPERANDS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_MAX_OPERANDS documentation + + + + + +
+ +

Global AVM_MAX_OPERANDS

+
pub global AVM_MAX_OPERANDS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_MAX_PROCESSABLE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_MAX_PROCESSABLE_L2_GAS.html new file mode 100644 index 000000000000..361d0a31f8c7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_MAX_PROCESSABLE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_MAX_PROCESSABLE_L2_GAS documentation + + + + + +
+ +

Global AVM_MAX_PROCESSABLE_L2_GAS

+
pub global AVM_MAX_PROCESSABLE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_MAX_REGISTERS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_MAX_REGISTERS.html new file mode 100644 index 000000000000..ef439e66d430 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_MAX_REGISTERS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_MAX_REGISTERS documentation + + + + + +
+ +

Global AVM_MAX_REGISTERS

+
pub global AVM_MAX_REGISTERS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_MEMORY_NUM_BITS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_MEMORY_NUM_BITS.html new file mode 100644 index 000000000000..65d3b0a6639b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_MEMORY_NUM_BITS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_MEMORY_NUM_BITS documentation + + + + + +
+ +

Global AVM_MEMORY_NUM_BITS

+
pub global AVM_MEMORY_NUM_BITS: u8;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_MEMORY_SIZE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_MEMORY_SIZE.html new file mode 100644 index 000000000000..ab523115ae97 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_MEMORY_SIZE.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_MEMORY_SIZE documentation + + + + + +
+ +

Global AVM_MEMORY_SIZE

+
pub global AVM_MEMORY_SIZE: u64;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_MOV_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_MOV_BASE_L2_GAS.html new file mode 100644 index 000000000000..302ea0508d57 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_MOV_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_MOV_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_MOV_BASE_L2_GAS

+
pub global AVM_MOV_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_MUL_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_MUL_BASE_L2_GAS.html new file mode 100644 index 000000000000..70264484d0e6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_MUL_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_MUL_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_MUL_BASE_L2_GAS

+
pub global AVM_MUL_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_NOTEHASHEXISTS_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_NOTEHASHEXISTS_BASE_L2_GAS.html new file mode 100644 index 000000000000..3fe3ce1c65b1 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_NOTEHASHEXISTS_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_NOTEHASHEXISTS_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_NOTEHASHEXISTS_BASE_L2_GAS

+
pub global AVM_NOTEHASHEXISTS_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_NOT_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_NOT_BASE_L2_GAS.html new file mode 100644 index 000000000000..738b94237bbf --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_NOT_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_NOT_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_NOT_BASE_L2_GAS

+
pub global AVM_NOT_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_NULLIFIEREXISTS_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_NULLIFIEREXISTS_BASE_L2_GAS.html new file mode 100644 index 000000000000..3aca40696353 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_NULLIFIEREXISTS_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_NULLIFIEREXISTS_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_NULLIFIEREXISTS_BASE_L2_GAS

+
pub global AVM_NULLIFIEREXISTS_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_NUM_PUBLIC_INPUT_COLUMNS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_NUM_PUBLIC_INPUT_COLUMNS.html new file mode 100644 index 000000000000..359d7c948a84 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_NUM_PUBLIC_INPUT_COLUMNS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_NUM_PUBLIC_INPUT_COLUMNS documentation + + + + + +
+ +

Global AVM_NUM_PUBLIC_INPUT_COLUMNS

+
pub global AVM_NUM_PUBLIC_INPUT_COLUMNS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_OR_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_OR_BASE_L2_GAS.html new file mode 100644 index 000000000000..f7d4cb97f1b1 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_OR_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_OR_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_OR_BASE_L2_GAS

+
pub global AVM_OR_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PC_SIZE_IN_BITS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PC_SIZE_IN_BITS.html new file mode 100644 index 000000000000..3d5ba0ba82a0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PC_SIZE_IN_BITS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PC_SIZE_IN_BITS documentation + + + + + +
+ +

Global AVM_PC_SIZE_IN_BITS

+
pub global AVM_PC_SIZE_IN_BITS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_POSEIDON2_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_POSEIDON2_BASE_L2_GAS.html new file mode 100644 index 000000000000..e4110cc8bacb --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_POSEIDON2_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_POSEIDON2_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_POSEIDON2_BASE_L2_GAS

+
pub global AVM_POSEIDON2_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_L2_TO_L1_MSGS_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_L2_TO_L1_MSGS_ROW_IDX.html new file mode 100644 index 000000000000..e9b0772ad642 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_L2_TO_L1_MSGS_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_L2_TO_L1_MSGS_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_L2_TO_L1_MSGS_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_L2_TO_L1_MSGS_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_NOTE_HASHES_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_NOTE_HASHES_ROW_IDX.html new file mode 100644 index 000000000000..fd5f84c1e633 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_NOTE_HASHES_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_NOTE_HASHES_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_NOTE_HASHES_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_NOTE_HASHES_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_NULLIFIERS_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_NULLIFIERS_ROW_IDX.html new file mode 100644 index 000000000000..468bf5538e18 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_NULLIFIERS_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_NULLIFIERS_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_NULLIFIERS_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_NULLIFIERS_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_PUBLIC_DATA_WRITES_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_PUBLIC_DATA_WRITES_ROW_IDX.html new file mode 100644 index 000000000000..6890b4d71021 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_PUBLIC_DATA_WRITES_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_PUBLIC_DATA_WRITES_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_PUBLIC_DATA_WRITES_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_PUBLIC_DATA_WRITES_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_ROW_IDX.html new file mode 100644 index 000000000000..0a609a74819d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_L2_TO_L1_MSGS_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_L2_TO_L1_MSGS_ROW_IDX.html new file mode 100644 index 000000000000..296002f5a605 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_L2_TO_L1_MSGS_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_L2_TO_L1_MSGS_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_L2_TO_L1_MSGS_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_L2_TO_L1_MSGS_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_NOTE_HASHES_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_NOTE_HASHES_ROW_IDX.html new file mode 100644 index 000000000000..a5c333d867c6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_NOTE_HASHES_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_NOTE_HASHES_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_NOTE_HASHES_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_NOTE_HASHES_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_NULLIFIERS_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_NULLIFIERS_ROW_IDX.html new file mode 100644 index 000000000000..e2092d43cd4a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_NULLIFIERS_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_NULLIFIERS_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_NULLIFIERS_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_NULLIFIERS_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_PUBLIC_DATA_WRITES_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_PUBLIC_DATA_WRITES_ROW_IDX.html new file mode 100644 index 000000000000..fb983e026f81 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_PUBLIC_DATA_WRITES_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_PUBLIC_DATA_WRITES_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_PUBLIC_DATA_WRITES_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_PUBLIC_DATA_WRITES_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_PUBLIC_LOGS_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_PUBLIC_LOGS_ROW_IDX.html new file mode 100644 index 000000000000..4f7cc154f9a0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_PUBLIC_LOGS_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_PUBLIC_LOGS_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_PUBLIC_LOGS_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_PUBLIC_LOGS_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ROW_IDX.html new file mode 100644 index 000000000000..c9c79c570650 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_COLUMNS_COMBINED_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_COLUMNS_COMBINED_LENGTH.html new file mode 100644 index 000000000000..916e243e81d3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_COLUMNS_COMBINED_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_COLUMNS_COMBINED_LENGTH documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_COLUMNS_COMBINED_LENGTH

+
pub global AVM_PUBLIC_INPUTS_COLUMNS_COMBINED_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_COLUMNS_MAX_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_COLUMNS_MAX_LENGTH.html new file mode 100644 index 000000000000..23e6546ab4aa --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_COLUMNS_MAX_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_COLUMNS_MAX_LENGTH documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_COLUMNS_MAX_LENGTH

+
pub global AVM_PUBLIC_INPUTS_COLUMNS_MAX_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_EFFECTIVE_GAS_FEES_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_EFFECTIVE_GAS_FEES_ROW_IDX.html new file mode 100644 index 000000000000..e6993f498529 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_EFFECTIVE_GAS_FEES_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_EFFECTIVE_GAS_FEES_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_EFFECTIVE_GAS_FEES_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_EFFECTIVE_GAS_FEES_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_END_GAS_USED_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_END_GAS_USED_ROW_IDX.html new file mode 100644 index 000000000000..3108c84da2c0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_END_GAS_USED_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_END_GAS_USED_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_END_GAS_USED_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_END_GAS_USED_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_L1_TO_L2_MESSAGE_TREE_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_L1_TO_L2_MESSAGE_TREE_ROW_IDX.html new file mode 100644 index 000000000000..cce59baa1e19 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_L1_TO_L2_MESSAGE_TREE_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_L1_TO_L2_MESSAGE_TREE_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_L1_TO_L2_MESSAGE_TREE_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_L1_TO_L2_MESSAGE_TREE_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_NOTE_HASH_TREE_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_NOTE_HASH_TREE_ROW_IDX.html new file mode 100644 index 000000000000..2f7607206444 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_NOTE_HASH_TREE_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_NOTE_HASH_TREE_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_NOTE_HASH_TREE_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_NOTE_HASH_TREE_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_NULLIFIER_TREE_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_NULLIFIER_TREE_ROW_IDX.html new file mode 100644 index 000000000000..c9feec5a5698 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_NULLIFIER_TREE_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_NULLIFIER_TREE_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_NULLIFIER_TREE_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_NULLIFIER_TREE_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_PUBLIC_DATA_TREE_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_PUBLIC_DATA_TREE_ROW_IDX.html new file mode 100644 index 000000000000..fef4fe1fd591 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_PUBLIC_DATA_TREE_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_PUBLIC_DATA_TREE_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_PUBLIC_DATA_TREE_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_PUBLIC_DATA_TREE_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_ROW_IDX.html new file mode 100644 index 000000000000..fc60cf9618ab --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_FEE_PAYER_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_FEE_PAYER_ROW_IDX.html new file mode 100644 index 000000000000..07b8371923bb --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_FEE_PAYER_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_FEE_PAYER_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_FEE_PAYER_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_FEE_PAYER_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GAS_SETTINGS_GAS_LIMITS_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GAS_SETTINGS_GAS_LIMITS_ROW_IDX.html new file mode 100644 index 000000000000..816a35abaa75 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GAS_SETTINGS_GAS_LIMITS_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_GAS_SETTINGS_GAS_LIMITS_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_GAS_SETTINGS_GAS_LIMITS_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_GAS_SETTINGS_GAS_LIMITS_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GAS_SETTINGS_MAX_FEES_PER_GAS_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GAS_SETTINGS_MAX_FEES_PER_GAS_ROW_IDX.html new file mode 100644 index 000000000000..400ab6d18576 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GAS_SETTINGS_MAX_FEES_PER_GAS_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_GAS_SETTINGS_MAX_FEES_PER_GAS_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_GAS_SETTINGS_MAX_FEES_PER_GAS_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_GAS_SETTINGS_MAX_FEES_PER_GAS_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GAS_SETTINGS_MAX_PRIORITY_FEES_PER_GAS_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GAS_SETTINGS_MAX_PRIORITY_FEES_PER_GAS_ROW_IDX.html new file mode 100644 index 000000000000..69a410f6c908 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GAS_SETTINGS_MAX_PRIORITY_FEES_PER_GAS_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_GAS_SETTINGS_MAX_PRIORITY_FEES_PER_GAS_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_GAS_SETTINGS_MAX_PRIORITY_FEES_PER_GAS_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_GAS_SETTINGS_MAX_PRIORITY_FEES_PER_GAS_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GAS_SETTINGS_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GAS_SETTINGS_ROW_IDX.html new file mode 100644 index 000000000000..167e85d0ed1f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GAS_SETTINGS_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_GAS_SETTINGS_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_GAS_SETTINGS_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_GAS_SETTINGS_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GAS_SETTINGS_TEARDOWN_GAS_LIMITS_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GAS_SETTINGS_TEARDOWN_GAS_LIMITS_ROW_IDX.html new file mode 100644 index 000000000000..04d64727163a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GAS_SETTINGS_TEARDOWN_GAS_LIMITS_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_GAS_SETTINGS_TEARDOWN_GAS_LIMITS_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_GAS_SETTINGS_TEARDOWN_GAS_LIMITS_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_GAS_SETTINGS_TEARDOWN_GAS_LIMITS_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_BLOCK_NUMBER_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_BLOCK_NUMBER_ROW_IDX.html new file mode 100644 index 000000000000..7f7985e947c2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_BLOCK_NUMBER_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_BLOCK_NUMBER_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_BLOCK_NUMBER_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_BLOCK_NUMBER_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_CHAIN_ID_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_CHAIN_ID_ROW_IDX.html new file mode 100644 index 000000000000..69a11a6052e4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_CHAIN_ID_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_CHAIN_ID_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_CHAIN_ID_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_CHAIN_ID_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_COINBASE_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_COINBASE_ROW_IDX.html new file mode 100644 index 000000000000..1b97805e5cbd --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_COINBASE_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_COINBASE_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_COINBASE_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_COINBASE_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_FEE_RECIPIENT_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_FEE_RECIPIENT_ROW_IDX.html new file mode 100644 index 000000000000..e1e7cc1e1436 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_FEE_RECIPIENT_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_FEE_RECIPIENT_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_FEE_RECIPIENT_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_FEE_RECIPIENT_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_GAS_FEES_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_GAS_FEES_ROW_IDX.html new file mode 100644 index 000000000000..a0b9345c755c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_GAS_FEES_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_GAS_FEES_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_GAS_FEES_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_GAS_FEES_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_ROW_IDX.html new file mode 100644 index 000000000000..ba9478fb0049 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_SLOT_NUMBER_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_SLOT_NUMBER_ROW_IDX.html new file mode 100644 index 000000000000..af3e167fe0b6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_SLOT_NUMBER_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_SLOT_NUMBER_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_SLOT_NUMBER_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_SLOT_NUMBER_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_TIMESTAMP_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_TIMESTAMP_ROW_IDX.html new file mode 100644 index 000000000000..feeb6f24f831 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_TIMESTAMP_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_TIMESTAMP_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_TIMESTAMP_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_TIMESTAMP_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_VERSION_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_VERSION_ROW_IDX.html new file mode 100644 index 000000000000..a4193a3260d8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_VERSION_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_VERSION_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_VERSION_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_GLOBAL_VARIABLES_VERSION_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_L2_TO_L1_MSGS_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_L2_TO_L1_MSGS_ROW_IDX.html new file mode 100644 index 000000000000..9189aa13f9d3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_L2_TO_L1_MSGS_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_L2_TO_L1_MSGS_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_L2_TO_L1_MSGS_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_L2_TO_L1_MSGS_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_NOTE_HASHES_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_NOTE_HASHES_ROW_IDX.html new file mode 100644 index 000000000000..2693d0008f48 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_NOTE_HASHES_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_NOTE_HASHES_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_NOTE_HASHES_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_NOTE_HASHES_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_NULLIFIERS_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_NULLIFIERS_ROW_IDX.html new file mode 100644 index 000000000000..94242fc321bf --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_NULLIFIERS_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_NULLIFIERS_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_NULLIFIERS_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_NULLIFIERS_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_ROW_IDX.html new file mode 100644 index 000000000000..41724a14b3d9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_L2_TO_L1_MSGS_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_L2_TO_L1_MSGS_ROW_IDX.html new file mode 100644 index 000000000000..8f8b6ea7d84e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_L2_TO_L1_MSGS_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_L2_TO_L1_MSGS_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_L2_TO_L1_MSGS_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_L2_TO_L1_MSGS_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_NOTE_HASHES_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_NOTE_HASHES_ROW_IDX.html new file mode 100644 index 000000000000..494433e23649 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_NOTE_HASHES_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_NOTE_HASHES_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_NOTE_HASHES_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_NOTE_HASHES_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_NULLIFIERS_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_NULLIFIERS_ROW_IDX.html new file mode 100644 index 000000000000..6c13c5099c7f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_NULLIFIERS_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_NULLIFIERS_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_NULLIFIERS_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_NULLIFIERS_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_ROW_IDX.html new file mode 100644 index 000000000000..fc2f534ace41 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_L2_TO_L1_MSGS_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_L2_TO_L1_MSGS_ROW_IDX.html new file mode 100644 index 000000000000..7326f406a00a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_L2_TO_L1_MSGS_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_L2_TO_L1_MSGS_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_L2_TO_L1_MSGS_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_L2_TO_L1_MSGS_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_NOTE_HASHES_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_NOTE_HASHES_ROW_IDX.html new file mode 100644 index 000000000000..d72e7b112906 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_NOTE_HASHES_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_NOTE_HASHES_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_NOTE_HASHES_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_NOTE_HASHES_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_NULLIFIERS_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_NULLIFIERS_ROW_IDX.html new file mode 100644 index 000000000000..8f9d5146a76d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_NULLIFIERS_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_NULLIFIERS_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_NULLIFIERS_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_NULLIFIERS_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_ROW_IDX.html new file mode 100644 index 000000000000..a5f2b8ddf0b1 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_ARRAY_LENGTHS_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_L2_TO_L1_MSGS_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_L2_TO_L1_MSGS_ROW_IDX.html new file mode 100644 index 000000000000..69fc457a17e2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_L2_TO_L1_MSGS_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_L2_TO_L1_MSGS_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_L2_TO_L1_MSGS_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_L2_TO_L1_MSGS_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_NOTE_HASHES_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_NOTE_HASHES_ROW_IDX.html new file mode 100644 index 000000000000..89b183c4d36c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_NOTE_HASHES_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_NOTE_HASHES_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_NOTE_HASHES_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_NOTE_HASHES_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_NULLIFIERS_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_NULLIFIERS_ROW_IDX.html new file mode 100644 index 000000000000..6fab362ee58b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_NULLIFIERS_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_NULLIFIERS_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_NULLIFIERS_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_NULLIFIERS_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_ROW_IDX.html new file mode 100644 index 000000000000..842a13133584 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_PREVIOUS_REVERTIBLE_ACCUMULATED_DATA_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PROTOCOL_CONTRACTS_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PROTOCOL_CONTRACTS_ROW_IDX.html new file mode 100644 index 000000000000..4db115a9580b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PROTOCOL_CONTRACTS_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_PROTOCOL_CONTRACTS_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_PROTOCOL_CONTRACTS_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_PROTOCOL_CONTRACTS_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PROVER_ID_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PROVER_ID_ROW_IDX.html new file mode 100644 index 000000000000..1d35844a0c2a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PROVER_ID_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_PROVER_ID_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_PROVER_ID_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_PROVER_ID_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PUBLIC_APP_LOGIC_CALL_REQUESTS_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PUBLIC_APP_LOGIC_CALL_REQUESTS_ROW_IDX.html new file mode 100644 index 000000000000..0b71b5c429e2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PUBLIC_APP_LOGIC_CALL_REQUESTS_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_PUBLIC_APP_LOGIC_CALL_REQUESTS_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_PUBLIC_APP_LOGIC_CALL_REQUESTS_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_PUBLIC_APP_LOGIC_CALL_REQUESTS_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PUBLIC_CALL_REQUEST_ARRAY_LENGTHS_APP_LOGIC_CALLS_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PUBLIC_CALL_REQUEST_ARRAY_LENGTHS_APP_LOGIC_CALLS_ROW_IDX.html new file mode 100644 index 000000000000..acdb65074ae3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PUBLIC_CALL_REQUEST_ARRAY_LENGTHS_APP_LOGIC_CALLS_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_PUBLIC_CALL_REQUEST_ARRAY_LENGTHS_APP_LOGIC_CALLS_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_PUBLIC_CALL_REQUEST_ARRAY_LENGTHS_APP_LOGIC_CALLS_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_PUBLIC_CALL_REQUEST_ARRAY_LENGTHS_APP_LOGIC_CALLS_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PUBLIC_CALL_REQUEST_ARRAY_LENGTHS_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PUBLIC_CALL_REQUEST_ARRAY_LENGTHS_ROW_IDX.html new file mode 100644 index 000000000000..b996e9e48410 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PUBLIC_CALL_REQUEST_ARRAY_LENGTHS_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_PUBLIC_CALL_REQUEST_ARRAY_LENGTHS_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_PUBLIC_CALL_REQUEST_ARRAY_LENGTHS_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_PUBLIC_CALL_REQUEST_ARRAY_LENGTHS_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PUBLIC_CALL_REQUEST_ARRAY_LENGTHS_SETUP_CALLS_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PUBLIC_CALL_REQUEST_ARRAY_LENGTHS_SETUP_CALLS_ROW_IDX.html new file mode 100644 index 000000000000..81d48230beb7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PUBLIC_CALL_REQUEST_ARRAY_LENGTHS_SETUP_CALLS_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_PUBLIC_CALL_REQUEST_ARRAY_LENGTHS_SETUP_CALLS_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_PUBLIC_CALL_REQUEST_ARRAY_LENGTHS_SETUP_CALLS_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_PUBLIC_CALL_REQUEST_ARRAY_LENGTHS_SETUP_CALLS_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PUBLIC_CALL_REQUEST_ARRAY_LENGTHS_TEARDOWN_CALL_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PUBLIC_CALL_REQUEST_ARRAY_LENGTHS_TEARDOWN_CALL_ROW_IDX.html new file mode 100644 index 000000000000..6c984f991e54 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PUBLIC_CALL_REQUEST_ARRAY_LENGTHS_TEARDOWN_CALL_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_PUBLIC_CALL_REQUEST_ARRAY_LENGTHS_TEARDOWN_CALL_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_PUBLIC_CALL_REQUEST_ARRAY_LENGTHS_TEARDOWN_CALL_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_PUBLIC_CALL_REQUEST_ARRAY_LENGTHS_TEARDOWN_CALL_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PUBLIC_SETUP_CALL_REQUESTS_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PUBLIC_SETUP_CALL_REQUESTS_ROW_IDX.html new file mode 100644 index 000000000000..934ca637974a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PUBLIC_SETUP_CALL_REQUESTS_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_PUBLIC_SETUP_CALL_REQUESTS_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_PUBLIC_SETUP_CALL_REQUESTS_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_PUBLIC_SETUP_CALL_REQUESTS_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PUBLIC_TEARDOWN_CALL_REQUEST_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PUBLIC_TEARDOWN_CALL_REQUEST_ROW_IDX.html new file mode 100644 index 000000000000..ad1827898c3f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_PUBLIC_TEARDOWN_CALL_REQUEST_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_PUBLIC_TEARDOWN_CALL_REQUEST_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_PUBLIC_TEARDOWN_CALL_REQUEST_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_PUBLIC_TEARDOWN_CALL_REQUEST_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_REVERTED_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_REVERTED_ROW_IDX.html new file mode 100644 index 000000000000..4c96123f8e9e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_REVERTED_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_REVERTED_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_REVERTED_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_REVERTED_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_START_GAS_USED_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_START_GAS_USED_ROW_IDX.html new file mode 100644 index 000000000000..89ed4b244086 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_START_GAS_USED_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_START_GAS_USED_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_START_GAS_USED_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_START_GAS_USED_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_L1_TO_L2_MESSAGE_TREE_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_L1_TO_L2_MESSAGE_TREE_ROW_IDX.html new file mode 100644 index 000000000000..76f141c971ed --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_L1_TO_L2_MESSAGE_TREE_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_L1_TO_L2_MESSAGE_TREE_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_L1_TO_L2_MESSAGE_TREE_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_L1_TO_L2_MESSAGE_TREE_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_NOTE_HASH_TREE_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_NOTE_HASH_TREE_ROW_IDX.html new file mode 100644 index 000000000000..9eddc38a23af --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_NOTE_HASH_TREE_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_NOTE_HASH_TREE_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_NOTE_HASH_TREE_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_NOTE_HASH_TREE_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_NULLIFIER_TREE_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_NULLIFIER_TREE_ROW_IDX.html new file mode 100644 index 000000000000..bbc8e54875e2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_NULLIFIER_TREE_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_NULLIFIER_TREE_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_NULLIFIER_TREE_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_NULLIFIER_TREE_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_PUBLIC_DATA_TREE_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_PUBLIC_DATA_TREE_ROW_IDX.html new file mode 100644 index 000000000000..fa0a39002eff --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_PUBLIC_DATA_TREE_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_PUBLIC_DATA_TREE_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_PUBLIC_DATA_TREE_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_PUBLIC_DATA_TREE_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_ROW_IDX.html new file mode 100644 index 000000000000..d4fd890dd8c1 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_TRANSACTION_FEE_ROW_IDX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_TRANSACTION_FEE_ROW_IDX.html new file mode 100644 index 000000000000..e15d581b50b3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_PUBLIC_INPUTS_TRANSACTION_FEE_ROW_IDX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_PUBLIC_INPUTS_TRANSACTION_FEE_ROW_IDX documentation + + + + + +
+ +

Global AVM_PUBLIC_INPUTS_TRANSACTION_FEE_ROW_IDX

+
pub global AVM_PUBLIC_INPUTS_TRANSACTION_FEE_ROW_IDX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_RETRIEVED_BYTECODES_TREE_HEIGHT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_RETRIEVED_BYTECODES_TREE_HEIGHT.html new file mode 100644 index 000000000000..347367c808ab --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_RETRIEVED_BYTECODES_TREE_HEIGHT.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_RETRIEVED_BYTECODES_TREE_HEIGHT documentation + + + + + +
+ +

Global AVM_RETRIEVED_BYTECODES_TREE_HEIGHT

+
pub global AVM_RETRIEVED_BYTECODES_TREE_HEIGHT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_RETRIEVED_BYTECODES_TREE_INITIAL_ROOT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_RETRIEVED_BYTECODES_TREE_INITIAL_ROOT.html new file mode 100644 index 000000000000..885dc82032b2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_RETRIEVED_BYTECODES_TREE_INITIAL_ROOT.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_RETRIEVED_BYTECODES_TREE_INITIAL_ROOT documentation + + + + + +
+ +

Global AVM_RETRIEVED_BYTECODES_TREE_INITIAL_ROOT

+
pub global AVM_RETRIEVED_BYTECODES_TREE_INITIAL_ROOT: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_RETRIEVED_BYTECODES_TREE_INITIAL_SIZE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_RETRIEVED_BYTECODES_TREE_INITIAL_SIZE.html new file mode 100644 index 000000000000..91999b042477 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_RETRIEVED_BYTECODES_TREE_INITIAL_SIZE.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_RETRIEVED_BYTECODES_TREE_INITIAL_SIZE documentation + + + + + +
+ +

Global AVM_RETRIEVED_BYTECODES_TREE_INITIAL_SIZE

+
pub global AVM_RETRIEVED_BYTECODES_TREE_INITIAL_SIZE: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_RETURNDATACOPY_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_RETURNDATACOPY_BASE_L2_GAS.html new file mode 100644 index 000000000000..e3d641861063 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_RETURNDATACOPY_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_RETURNDATACOPY_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_RETURNDATACOPY_BASE_L2_GAS

+
pub global AVM_RETURNDATACOPY_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_RETURNDATACOPY_DYN_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_RETURNDATACOPY_DYN_L2_GAS.html new file mode 100644 index 000000000000..d39007669d6f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_RETURNDATACOPY_DYN_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_RETURNDATACOPY_DYN_L2_GAS documentation + + + + + +
+ +

Global AVM_RETURNDATACOPY_DYN_L2_GAS

+
pub global AVM_RETURNDATACOPY_DYN_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_RETURNDATASIZE_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_RETURNDATASIZE_BASE_L2_GAS.html new file mode 100644 index 000000000000..17126b4e266c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_RETURNDATASIZE_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_RETURNDATASIZE_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_RETURNDATASIZE_BASE_L2_GAS

+
pub global AVM_RETURNDATASIZE_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_RETURN_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_RETURN_BASE_L2_GAS.html new file mode 100644 index 000000000000..7032ea96c29a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_RETURN_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_RETURN_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_RETURN_BASE_L2_GAS

+
pub global AVM_RETURN_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_REVERT_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_REVERT_BASE_L2_GAS.html new file mode 100644 index 000000000000..f201f25eb5ec --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_REVERT_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_REVERT_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_REVERT_BASE_L2_GAS

+
pub global AVM_REVERT_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SENDL2TOL1MSG_BASE_DA_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SENDL2TOL1MSG_BASE_DA_GAS.html new file mode 100644 index 000000000000..84e58d878b25 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SENDL2TOL1MSG_BASE_DA_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_SENDL2TOL1MSG_BASE_DA_GAS documentation + + + + + +
+ +

Global AVM_SENDL2TOL1MSG_BASE_DA_GAS

+
pub global AVM_SENDL2TOL1MSG_BASE_DA_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SENDL2TOL1MSG_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SENDL2TOL1MSG_BASE_L2_GAS.html new file mode 100644 index 000000000000..5624625925cc --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SENDL2TOL1MSG_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_SENDL2TOL1MSG_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_SENDL2TOL1MSG_BASE_L2_GAS

+
pub global AVM_SENDL2TOL1MSG_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SET_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SET_BASE_L2_GAS.html new file mode 100644 index 000000000000..56fd46b23421 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SET_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_SET_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_SET_BASE_L2_GAS

+
pub global AVM_SET_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SHA256COMPRESSION_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SHA256COMPRESSION_BASE_L2_GAS.html new file mode 100644 index 000000000000..9d24a2f730c7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SHA256COMPRESSION_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_SHA256COMPRESSION_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_SHA256COMPRESSION_BASE_L2_GAS

+
pub global AVM_SHA256COMPRESSION_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SHL_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SHL_BASE_L2_GAS.html new file mode 100644 index 000000000000..9e154bc610f9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SHL_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_SHL_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_SHL_BASE_L2_GAS

+
pub global AVM_SHL_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SHR_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SHR_BASE_L2_GAS.html new file mode 100644 index 000000000000..458b1ce67113 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SHR_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_SHR_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_SHR_BASE_L2_GAS

+
pub global AVM_SHR_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SLOAD_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SLOAD_BASE_L2_GAS.html new file mode 100644 index 000000000000..a312c95cc93e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SLOAD_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_SLOAD_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_SLOAD_BASE_L2_GAS

+
pub global AVM_SLOAD_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SSTORE_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SSTORE_BASE_L2_GAS.html new file mode 100644 index 000000000000..80c7c9c6e642 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SSTORE_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_SSTORE_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_SSTORE_BASE_L2_GAS

+
pub global AVM_SSTORE_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SSTORE_DYN_DA_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SSTORE_DYN_DA_GAS.html new file mode 100644 index 000000000000..7ff5a182cdbd --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SSTORE_DYN_DA_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_SSTORE_DYN_DA_GAS documentation + + + + + +
+ +

Global AVM_SSTORE_DYN_DA_GAS

+
pub global AVM_SSTORE_DYN_DA_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_STATICCALL_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_STATICCALL_BASE_L2_GAS.html new file mode 100644 index 000000000000..8715c3bd8f67 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_STATICCALL_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_STATICCALL_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_STATICCALL_BASE_L2_GAS

+
pub global AVM_STATICCALL_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_ALU.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_ALU.html new file mode 100644 index 000000000000..1df4d4407c5b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_ALU.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_SUBTRACE_ID_ALU documentation + + + + + +
+ +

Global AVM_SUBTRACE_ID_ALU

+
pub global AVM_SUBTRACE_ID_ALU: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_BITWISE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_BITWISE.html new file mode 100644 index 000000000000..4548975de7f9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_BITWISE.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_SUBTRACE_ID_BITWISE documentation + + + + + +
+ +

Global AVM_SUBTRACE_ID_BITWISE

+
pub global AVM_SUBTRACE_ID_BITWISE: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_CALLDATA_COPY.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_CALLDATA_COPY.html new file mode 100644 index 000000000000..abb2abb4be5a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_CALLDATA_COPY.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_SUBTRACE_ID_CALLDATA_COPY documentation + + + + + +
+ +

Global AVM_SUBTRACE_ID_CALLDATA_COPY

+
pub global AVM_SUBTRACE_ID_CALLDATA_COPY: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_CAST.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_CAST.html new file mode 100644 index 000000000000..e797b9c53b82 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_CAST.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_SUBTRACE_ID_CAST documentation + + + + + +
+ +

Global AVM_SUBTRACE_ID_CAST

+
pub global AVM_SUBTRACE_ID_CAST: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_ECC.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_ECC.html new file mode 100644 index 000000000000..866334148509 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_ECC.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_SUBTRACE_ID_ECC documentation + + + + + +
+ +

Global AVM_SUBTRACE_ID_ECC

+
pub global AVM_SUBTRACE_ID_ECC: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_EMITUNENCRYPTEDLOG.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_EMITUNENCRYPTEDLOG.html new file mode 100644 index 000000000000..37190fc0b16a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_EMITUNENCRYPTEDLOG.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_SUBTRACE_ID_EMITUNENCRYPTEDLOG documentation + + + + + +
+ +

Global AVM_SUBTRACE_ID_EMITUNENCRYPTEDLOG

+
pub global AVM_SUBTRACE_ID_EMITUNENCRYPTEDLOG: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_EXECUTION.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_EXECUTION.html new file mode 100644 index 000000000000..d087ec7de4eb --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_EXECUTION.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_SUBTRACE_ID_EXECUTION documentation + + + + + +
+ +

Global AVM_SUBTRACE_ID_EXECUTION

+
pub global AVM_SUBTRACE_ID_EXECUTION: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_GETCONTRACTINSTANCE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_GETCONTRACTINSTANCE.html new file mode 100644 index 000000000000..d2bf9a11bf3f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_GETCONTRACTINSTANCE.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_SUBTRACE_ID_GETCONTRACTINSTANCE documentation + + + + + +
+ +

Global AVM_SUBTRACE_ID_GETCONTRACTINSTANCE

+
pub global AVM_SUBTRACE_ID_GETCONTRACTINSTANCE: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_KECCAKF1600.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_KECCAKF1600.html new file mode 100644 index 000000000000..50529a473b86 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_KECCAKF1600.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_SUBTRACE_ID_KECCAKF1600 documentation + + + + + +
+ +

Global AVM_SUBTRACE_ID_KECCAKF1600

+
pub global AVM_SUBTRACE_ID_KECCAKF1600: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_POSEIDON2_PERM.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_POSEIDON2_PERM.html new file mode 100644 index 000000000000..e82c21b0b09a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_POSEIDON2_PERM.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_SUBTRACE_ID_POSEIDON2_PERM documentation + + + + + +
+ +

Global AVM_SUBTRACE_ID_POSEIDON2_PERM

+
pub global AVM_SUBTRACE_ID_POSEIDON2_PERM: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_RETURNDATA_COPY.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_RETURNDATA_COPY.html new file mode 100644 index 000000000000..c2f5ba1c2b63 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_RETURNDATA_COPY.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_SUBTRACE_ID_RETURNDATA_COPY documentation + + + + + +
+ +

Global AVM_SUBTRACE_ID_RETURNDATA_COPY

+
pub global AVM_SUBTRACE_ID_RETURNDATA_COPY: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_SET.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_SET.html new file mode 100644 index 000000000000..28d591211097 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_SET.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_SUBTRACE_ID_SET documentation + + + + + +
+ +

Global AVM_SUBTRACE_ID_SET

+
pub global AVM_SUBTRACE_ID_SET: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_SHA256_COMPRESSION.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_SHA256_COMPRESSION.html new file mode 100644 index 000000000000..adb2dba22581 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_SHA256_COMPRESSION.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_SUBTRACE_ID_SHA256_COMPRESSION documentation + + + + + +
+ +

Global AVM_SUBTRACE_ID_SHA256_COMPRESSION

+
pub global AVM_SUBTRACE_ID_SHA256_COMPRESSION: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_TO_RADIX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_TO_RADIX.html new file mode 100644 index 000000000000..308ebd9df863 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUBTRACE_ID_TO_RADIX.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_SUBTRACE_ID_TO_RADIX documentation + + + + + +
+ +

Global AVM_SUBTRACE_ID_TO_RADIX

+
pub global AVM_SUBTRACE_ID_TO_RADIX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUB_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUB_BASE_L2_GAS.html new file mode 100644 index 000000000000..7265ecc3aa2e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUB_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_SUB_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_SUB_BASE_L2_GAS

+
pub global AVM_SUB_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUCCESSCOPY_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUCCESSCOPY_BASE_L2_GAS.html new file mode 100644 index 000000000000..514917977fdd --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_SUCCESSCOPY_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_SUCCESSCOPY_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_SUCCESSCOPY_BASE_L2_GAS

+
pub global AVM_SUCCESSCOPY_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_TORADIXBE_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_TORADIXBE_BASE_L2_GAS.html new file mode 100644 index 000000000000..19f727fdf548 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_TORADIXBE_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_TORADIXBE_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_TORADIXBE_BASE_L2_GAS

+
pub global AVM_TORADIXBE_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_TORADIXBE_DYN_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_TORADIXBE_DYN_L2_GAS.html new file mode 100644 index 000000000000..0ebc97089895 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_TORADIXBE_DYN_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_TORADIXBE_DYN_L2_GAS documentation + + + + + +
+ +

Global AVM_TORADIXBE_DYN_L2_GAS

+
pub global AVM_TORADIXBE_DYN_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_TX_PHASE_VALUE_LAST.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_TX_PHASE_VALUE_LAST.html new file mode 100644 index 000000000000..80ec11ff6a43 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_TX_PHASE_VALUE_LAST.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_TX_PHASE_VALUE_LAST documentation + + + + + +
+ +

Global AVM_TX_PHASE_VALUE_LAST

+
pub global AVM_TX_PHASE_VALUE_LAST: u8;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_TX_PHASE_VALUE_SETUP.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_TX_PHASE_VALUE_SETUP.html new file mode 100644 index 000000000000..1f7aba1e340e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_TX_PHASE_VALUE_SETUP.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_TX_PHASE_VALUE_SETUP documentation + + + + + +
+ +

Global AVM_TX_PHASE_VALUE_SETUP

+
pub global AVM_TX_PHASE_VALUE_SETUP: u8;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_TX_PHASE_VALUE_START.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_TX_PHASE_VALUE_START.html new file mode 100644 index 000000000000..038eb6828ed7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_TX_PHASE_VALUE_START.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_TX_PHASE_VALUE_START documentation + + + + + +
+ +

Global AVM_TX_PHASE_VALUE_START

+
pub global AVM_TX_PHASE_VALUE_START: u8;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED.html new file mode 100644 index 000000000000..9b3e97998e98 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED documentation + + + + + +
+ +

Global AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED

+
pub global AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_V2_VERIFICATION_KEY_LENGTH_IN_FIELDS_PADDED.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_V2_VERIFICATION_KEY_LENGTH_IN_FIELDS_PADDED.html new file mode 100644 index 000000000000..a327916968a1 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_V2_VERIFICATION_KEY_LENGTH_IN_FIELDS_PADDED.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_V2_VERIFICATION_KEY_LENGTH_IN_FIELDS_PADDED documentation + + + + + +
+ +

Global AVM_V2_VERIFICATION_KEY_LENGTH_IN_FIELDS_PADDED

+
pub global AVM_V2_VERIFICATION_KEY_LENGTH_IN_FIELDS_PADDED: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS.html new file mode 100644 index 000000000000..dd7db32ce0b2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS documentation + + + + + +
+ +

Global AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS

+
pub global AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_HEIGHT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_HEIGHT.html new file mode 100644 index 000000000000..e76b67da15b5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_HEIGHT.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_HEIGHT documentation + + + + + +
+ +

Global AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_HEIGHT

+
pub global AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_HEIGHT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_INITIAL_ROOT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_INITIAL_ROOT.html new file mode 100644 index 000000000000..12dba1391513 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_INITIAL_ROOT.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_INITIAL_ROOT documentation + + + + + +
+ +

Global AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_INITIAL_ROOT

+
pub global AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_INITIAL_ROOT: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_INITIAL_SIZE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_INITIAL_SIZE.html new file mode 100644 index 000000000000..1fe5b254bd8d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_INITIAL_SIZE.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_INITIAL_SIZE documentation + + + + + +
+ +

Global AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_INITIAL_SIZE

+
pub global AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_INITIAL_SIZE: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_XOR_BASE_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_XOR_BASE_L2_GAS.html new file mode 100644 index 000000000000..533cb811e5db --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AVM_XOR_BASE_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global AVM_XOR_BASE_L2_GAS documentation + + + + + +
+ +

Global AVM_XOR_BASE_L2_GAS

+
pub global AVM_XOR_BASE_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AZTEC_ADDRESS_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AZTEC_ADDRESS_LENGTH.html new file mode 100644 index 000000000000..042a0d703c87 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AZTEC_ADDRESS_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global AZTEC_ADDRESS_LENGTH documentation + + + + + +
+ +

Global AZTEC_ADDRESS_LENGTH

+
pub global AZTEC_ADDRESS_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AZTEC_MAX_EPOCH_DURATION.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AZTEC_MAX_EPOCH_DURATION.html new file mode 100644 index 000000000000..a9259fc1bd74 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.AZTEC_MAX_EPOCH_DURATION.html @@ -0,0 +1,583 @@ + + + + + + +Global AZTEC_MAX_EPOCH_DURATION documentation + + + + + +
+ +

Global AZTEC_MAX_EPOCH_DURATION

+
pub global AZTEC_MAX_EPOCH_DURATION: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOBS_PER_CHECKPOINT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOBS_PER_CHECKPOINT.html new file mode 100644 index 000000000000..2b382676c211 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOBS_PER_CHECKPOINT.html @@ -0,0 +1,583 @@ + + + + + + +Global BLOBS_PER_CHECKPOINT documentation + + + + + +
+ +

Global BLOBS_PER_CHECKPOINT

+
pub global BLOBS_PER_CHECKPOINT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOB_ACCUMULATOR_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOB_ACCUMULATOR_LENGTH.html new file mode 100644 index 000000000000..db125bf50f78 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOB_ACCUMULATOR_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global BLOB_ACCUMULATOR_LENGTH documentation + + + + + +
+ +

Global BLOB_ACCUMULATOR_LENGTH

+
pub global BLOB_ACCUMULATOR_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_CONSTANT_DATA_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_CONSTANT_DATA_LENGTH.html new file mode 100644 index 000000000000..cda444c15d56 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_CONSTANT_DATA_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global BLOCK_CONSTANT_DATA_LENGTH documentation + + + + + +
+ +

Global BLOCK_CONSTANT_DATA_LENGTH

+
pub global BLOCK_CONSTANT_DATA_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_END_PREFIX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_END_PREFIX.html new file mode 100644 index 000000000000..5c9908044296 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_END_PREFIX.html @@ -0,0 +1,583 @@ + + + + + + +Global BLOCK_END_PREFIX documentation + + + + + +
+ +

Global BLOCK_END_PREFIX

+
pub global BLOCK_END_PREFIX: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_HEADER_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_HEADER_LENGTH.html new file mode 100644 index 000000000000..58fe9bb76f61 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_HEADER_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global BLOCK_HEADER_LENGTH documentation + + + + + +
+ +

Global BLOCK_HEADER_LENGTH

+
pub global BLOCK_HEADER_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_HEADER_LENGTH_BYTES.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_HEADER_LENGTH_BYTES.html new file mode 100644 index 000000000000..e49f21860543 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_HEADER_LENGTH_BYTES.html @@ -0,0 +1,583 @@ + + + + + + +Global BLOCK_HEADER_LENGTH_BYTES documentation + + + + + +
+ +

Global BLOCK_HEADER_LENGTH_BYTES

+
pub global BLOCK_HEADER_LENGTH_BYTES: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_MERGE_ROLLUP_VK_INDEX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_MERGE_ROLLUP_VK_INDEX.html new file mode 100644 index 000000000000..c26f61d5b50d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_MERGE_ROLLUP_VK_INDEX.html @@ -0,0 +1,583 @@ + + + + + + +Global BLOCK_MERGE_ROLLUP_VK_INDEX documentation + + + + + +
+ +

Global BLOCK_MERGE_ROLLUP_VK_INDEX

+
pub comptime global BLOCK_MERGE_ROLLUP_VK_INDEX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_ROLLUP_PUBLIC_INPUTS_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_ROLLUP_PUBLIC_INPUTS_LENGTH.html new file mode 100644 index 000000000000..862e1094c0de --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_ROLLUP_PUBLIC_INPUTS_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global BLOCK_ROLLUP_PUBLIC_INPUTS_LENGTH documentation + + + + + +
+ +

Global BLOCK_ROLLUP_PUBLIC_INPUTS_LENGTH

+
pub global BLOCK_ROLLUP_PUBLIC_INPUTS_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_ROOT_EMPTY_TX_FIRST_ROLLUP_VK_INDEX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_ROOT_EMPTY_TX_FIRST_ROLLUP_VK_INDEX.html new file mode 100644 index 000000000000..094ebbe73c4b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_ROOT_EMPTY_TX_FIRST_ROLLUP_VK_INDEX.html @@ -0,0 +1,583 @@ + + + + + + +Global BLOCK_ROOT_EMPTY_TX_FIRST_ROLLUP_VK_INDEX documentation + + + + + +
+ +

Global BLOCK_ROOT_EMPTY_TX_FIRST_ROLLUP_VK_INDEX

+
pub comptime global BLOCK_ROOT_EMPTY_TX_FIRST_ROLLUP_VK_INDEX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_ROOT_FIRST_ROLLUP_VK_INDEX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_ROOT_FIRST_ROLLUP_VK_INDEX.html new file mode 100644 index 000000000000..1ca38926a98e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_ROOT_FIRST_ROLLUP_VK_INDEX.html @@ -0,0 +1,583 @@ + + + + + + +Global BLOCK_ROOT_FIRST_ROLLUP_VK_INDEX documentation + + + + + +
+ +

Global BLOCK_ROOT_FIRST_ROLLUP_VK_INDEX

+
pub comptime global BLOCK_ROOT_FIRST_ROLLUP_VK_INDEX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_ROOT_ROLLUP_VK_INDEX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_ROOT_ROLLUP_VK_INDEX.html new file mode 100644 index 000000000000..c787fe0a4a88 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_ROOT_ROLLUP_VK_INDEX.html @@ -0,0 +1,583 @@ + + + + + + +Global BLOCK_ROOT_ROLLUP_VK_INDEX documentation + + + + + +
+ +

Global BLOCK_ROOT_ROLLUP_VK_INDEX

+
pub comptime global BLOCK_ROOT_ROLLUP_VK_INDEX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_ROOT_SINGLE_TX_FIRST_ROLLUP_VK_INDEX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_ROOT_SINGLE_TX_FIRST_ROLLUP_VK_INDEX.html new file mode 100644 index 000000000000..8b87c25733e9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_ROOT_SINGLE_TX_FIRST_ROLLUP_VK_INDEX.html @@ -0,0 +1,583 @@ + + + + + + +Global BLOCK_ROOT_SINGLE_TX_FIRST_ROLLUP_VK_INDEX documentation + + + + + +
+ +

Global BLOCK_ROOT_SINGLE_TX_FIRST_ROLLUP_VK_INDEX

+
pub comptime global BLOCK_ROOT_SINGLE_TX_FIRST_ROLLUP_VK_INDEX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_ROOT_SINGLE_TX_ROLLUP_VK_INDEX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_ROOT_SINGLE_TX_ROLLUP_VK_INDEX.html new file mode 100644 index 000000000000..517e077f537a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLOCK_ROOT_SINGLE_TX_ROLLUP_VK_INDEX.html @@ -0,0 +1,583 @@ + + + + + + +Global BLOCK_ROOT_SINGLE_TX_ROLLUP_VK_INDEX documentation + + + + + +
+ +

Global BLOCK_ROOT_SINGLE_TX_ROLLUP_VK_INDEX

+
pub comptime global BLOCK_ROOT_SINGLE_TX_ROLLUP_VK_INDEX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLS12_FQ_LIMBS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLS12_FQ_LIMBS.html new file mode 100644 index 000000000000..5faa768bd624 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLS12_FQ_LIMBS.html @@ -0,0 +1,583 @@ + + + + + + +Global BLS12_FQ_LIMBS documentation + + + + + +
+ +

Global BLS12_FQ_LIMBS

+
pub global BLS12_FQ_LIMBS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLS12_FR_LIMBS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLS12_FR_LIMBS.html new file mode 100644 index 000000000000..b0d15439d97f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLS12_FR_LIMBS.html @@ -0,0 +1,583 @@ + + + + + + +Global BLS12_FR_LIMBS documentation + + + + + +
+ +

Global BLS12_FR_LIMBS

+
pub global BLS12_FR_LIMBS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLS12_POINT_COMPRESSED_BYTES.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLS12_POINT_COMPRESSED_BYTES.html new file mode 100644 index 000000000000..c16f07381cca --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLS12_POINT_COMPRESSED_BYTES.html @@ -0,0 +1,583 @@ + + + + + + +Global BLS12_POINT_COMPRESSED_BYTES documentation + + + + + +
+ +

Global BLS12_POINT_COMPRESSED_BYTES

+
pub global BLS12_POINT_COMPRESSED_BYTES: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLS12_POINT_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLS12_POINT_LENGTH.html new file mode 100644 index 000000000000..e4a8e7a13826 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.BLS12_POINT_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global BLS12_POINT_LENGTH documentation + + + + + +
+ +

Global BLS12_POINT_LENGTH

+
pub global BLS12_POINT_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CALL_CONTEXT_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CALL_CONTEXT_LENGTH.html new file mode 100644 index 000000000000..27459c5ef74c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CALL_CONTEXT_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global CALL_CONTEXT_LENGTH documentation + + + + + +
+ +

Global CALL_CONTEXT_LENGTH

+
pub global CALL_CONTEXT_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CANONICAL_AUTH_REGISTRY_ADDRESS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CANONICAL_AUTH_REGISTRY_ADDRESS.html new file mode 100644 index 000000000000..87ce4d2dcf15 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CANONICAL_AUTH_REGISTRY_ADDRESS.html @@ -0,0 +1,583 @@ + + + + + + +Global CANONICAL_AUTH_REGISTRY_ADDRESS documentation + + + + + +
+ +

Global CANONICAL_AUTH_REGISTRY_ADDRESS

+
pub global CANONICAL_AUTH_REGISTRY_ADDRESS: AztecAddress;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHECKPOINT_CONSTANT_DATA_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHECKPOINT_CONSTANT_DATA_LENGTH.html new file mode 100644 index 000000000000..c3d823d5eaf5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHECKPOINT_CONSTANT_DATA_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global CHECKPOINT_CONSTANT_DATA_LENGTH documentation + + + + + +
+ +

Global CHECKPOINT_CONSTANT_DATA_LENGTH

+
pub global CHECKPOINT_CONSTANT_DATA_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHECKPOINT_END_PREFIX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHECKPOINT_END_PREFIX.html new file mode 100644 index 000000000000..47a3551a56d0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHECKPOINT_END_PREFIX.html @@ -0,0 +1,583 @@ + + + + + + +Global CHECKPOINT_END_PREFIX documentation + + + + + +
+ +

Global CHECKPOINT_END_PREFIX

+
pub global CHECKPOINT_END_PREFIX: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHECKPOINT_HEADER_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHECKPOINT_HEADER_LENGTH.html new file mode 100644 index 000000000000..6e498128feda --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHECKPOINT_HEADER_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global CHECKPOINT_HEADER_LENGTH documentation + + + + + +
+ +

Global CHECKPOINT_HEADER_LENGTH

+
pub global CHECKPOINT_HEADER_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHECKPOINT_HEADER_SIZE_IN_BYTES.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHECKPOINT_HEADER_SIZE_IN_BYTES.html new file mode 100644 index 000000000000..b457953c99b2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHECKPOINT_HEADER_SIZE_IN_BYTES.html @@ -0,0 +1,583 @@ + + + + + + +Global CHECKPOINT_HEADER_SIZE_IN_BYTES documentation + + + + + +
+ +

Global CHECKPOINT_HEADER_SIZE_IN_BYTES

+
pub global CHECKPOINT_HEADER_SIZE_IN_BYTES: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHECKPOINT_MERGE_ROLLUP_VK_INDEX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHECKPOINT_MERGE_ROLLUP_VK_INDEX.html new file mode 100644 index 000000000000..8a7a51dd0564 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHECKPOINT_MERGE_ROLLUP_VK_INDEX.html @@ -0,0 +1,583 @@ + + + + + + +Global CHECKPOINT_MERGE_ROLLUP_VK_INDEX documentation + + + + + +
+ +

Global CHECKPOINT_MERGE_ROLLUP_VK_INDEX

+
pub comptime global CHECKPOINT_MERGE_ROLLUP_VK_INDEX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHECKPOINT_PADDING_ROLLUP_VK_INDEX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHECKPOINT_PADDING_ROLLUP_VK_INDEX.html new file mode 100644 index 000000000000..fd0320f7faab --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHECKPOINT_PADDING_ROLLUP_VK_INDEX.html @@ -0,0 +1,583 @@ + + + + + + +Global CHECKPOINT_PADDING_ROLLUP_VK_INDEX documentation + + + + + +
+ +

Global CHECKPOINT_PADDING_ROLLUP_VK_INDEX

+
pub comptime global CHECKPOINT_PADDING_ROLLUP_VK_INDEX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHECKPOINT_ROLLUP_PUBLIC_INPUTS_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHECKPOINT_ROLLUP_PUBLIC_INPUTS_LENGTH.html new file mode 100644 index 000000000000..979312cd1b33 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHECKPOINT_ROLLUP_PUBLIC_INPUTS_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global CHECKPOINT_ROLLUP_PUBLIC_INPUTS_LENGTH documentation + + + + + +
+ +

Global CHECKPOINT_ROLLUP_PUBLIC_INPUTS_LENGTH

+
pub global CHECKPOINT_ROLLUP_PUBLIC_INPUTS_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHECKPOINT_ROOT_ROLLUP_VK_INDEX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHECKPOINT_ROOT_ROLLUP_VK_INDEX.html new file mode 100644 index 000000000000..1c78709fb295 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHECKPOINT_ROOT_ROLLUP_VK_INDEX.html @@ -0,0 +1,583 @@ + + + + + + +Global CHECKPOINT_ROOT_ROLLUP_VK_INDEX documentation + + + + + +
+ +

Global CHECKPOINT_ROOT_ROLLUP_VK_INDEX

+
pub comptime global CHECKPOINT_ROOT_ROLLUP_VK_INDEX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHECKPOINT_ROOT_SINGLE_BLOCK_ROLLUP_VK_INDEX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHECKPOINT_ROOT_SINGLE_BLOCK_ROLLUP_VK_INDEX.html new file mode 100644 index 000000000000..caf76136bfd3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHECKPOINT_ROOT_SINGLE_BLOCK_ROLLUP_VK_INDEX.html @@ -0,0 +1,583 @@ + + + + + + +Global CHECKPOINT_ROOT_SINGLE_BLOCK_ROLLUP_VK_INDEX documentation + + + + + +
+ +

Global CHECKPOINT_ROOT_SINGLE_BLOCK_ROLLUP_VK_INDEX

+
pub comptime global CHECKPOINT_ROOT_SINGLE_BLOCK_ROLLUP_VK_INDEX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHONK_PROOF_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHONK_PROOF_LENGTH.html new file mode 100644 index 000000000000..ed91723a98a8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHONK_PROOF_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global CHONK_PROOF_LENGTH documentation + + + + + +
+ +

Global CHONK_PROOF_LENGTH

+
pub global CHONK_PROOF_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHONK_VK_LENGTH_IN_FIELDS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHONK_VK_LENGTH_IN_FIELDS.html new file mode 100644 index 000000000000..b58133ec91ec --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CHONK_VK_LENGTH_IN_FIELDS.html @@ -0,0 +1,583 @@ + + + + + + +Global CHONK_VK_LENGTH_IN_FIELDS documentation + + + + + +
+ +

Global CHONK_VK_LENGTH_IN_FIELDS

+
pub global CHONK_VK_LENGTH_IN_FIELDS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CLASS_REGISTRY_PRIVATE_FUNCTION_BROADCASTED_ADDITIONAL_FIELDS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CLASS_REGISTRY_PRIVATE_FUNCTION_BROADCASTED_ADDITIONAL_FIELDS.html new file mode 100644 index 000000000000..48d6ac062850 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CLASS_REGISTRY_PRIVATE_FUNCTION_BROADCASTED_ADDITIONAL_FIELDS.html @@ -0,0 +1,583 @@ + + + + + + +Global CLASS_REGISTRY_PRIVATE_FUNCTION_BROADCASTED_ADDITIONAL_FIELDS documentation + + + + + +
+ +

Global CLASS_REGISTRY_PRIVATE_FUNCTION_BROADCASTED_ADDITIONAL_FIELDS

+
pub global CLASS_REGISTRY_PRIVATE_FUNCTION_BROADCASTED_ADDITIONAL_FIELDS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CLASS_REGISTRY_UTILITY_FUNCTION_BROADCASTED_ADDITIONAL_FIELDS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CLASS_REGISTRY_UTILITY_FUNCTION_BROADCASTED_ADDITIONAL_FIELDS.html new file mode 100644 index 000000000000..69e35ea23886 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CLASS_REGISTRY_UTILITY_FUNCTION_BROADCASTED_ADDITIONAL_FIELDS.html @@ -0,0 +1,583 @@ + + + + + + +Global CLASS_REGISTRY_UTILITY_FUNCTION_BROADCASTED_ADDITIONAL_FIELDS documentation + + + + + +
+ +

Global CLASS_REGISTRY_UTILITY_FUNCTION_BROADCASTED_ADDITIONAL_FIELDS

+
pub global CLASS_REGISTRY_UTILITY_FUNCTION_BROADCASTED_ADDITIONAL_FIELDS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.COMBINED_CONSTANT_DATA_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.COMBINED_CONSTANT_DATA_LENGTH.html new file mode 100644 index 000000000000..94883fd86f4c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.COMBINED_CONSTANT_DATA_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global COMBINED_CONSTANT_DATA_LENGTH documentation + + + + + +
+ +

Global COMBINED_CONSTANT_DATA_LENGTH

+
pub global COMBINED_CONSTANT_DATA_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTENT_COMMITMENT_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTENT_COMMITMENT_LENGTH.html new file mode 100644 index 000000000000..2beab9618ac6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTENT_COMMITMENT_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global CONTENT_COMMITMENT_LENGTH documentation + + + + + +
+ +

Global CONTENT_COMMITMENT_LENGTH

+
pub global CONTENT_COMMITMENT_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_CLASS_LOG_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_CLASS_LOG_LENGTH.html new file mode 100644 index 000000000000..8577e65ab0d5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_CLASS_LOG_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global CONTRACT_CLASS_LOG_LENGTH documentation + + + + + +
+ +

Global CONTRACT_CLASS_LOG_LENGTH

+
pub global CONTRACT_CLASS_LOG_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_CLASS_LOG_SIZE_IN_FIELDS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_CLASS_LOG_SIZE_IN_FIELDS.html new file mode 100644 index 000000000000..3295ab1da734 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_CLASS_LOG_SIZE_IN_FIELDS.html @@ -0,0 +1,583 @@ + + + + + + +Global CONTRACT_CLASS_LOG_SIZE_IN_FIELDS documentation + + + + + +
+ +

Global CONTRACT_CLASS_LOG_SIZE_IN_FIELDS

+
pub global CONTRACT_CLASS_LOG_SIZE_IN_FIELDS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_CLASS_PUBLISHED_MAGIC_VALUE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_CLASS_PUBLISHED_MAGIC_VALUE.html new file mode 100644 index 000000000000..d45c3f90936c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_CLASS_PUBLISHED_MAGIC_VALUE.html @@ -0,0 +1,583 @@ + + + + + + +Global CONTRACT_CLASS_PUBLISHED_MAGIC_VALUE documentation + + + + + +
+ +

Global CONTRACT_CLASS_PUBLISHED_MAGIC_VALUE

+
pub global CONTRACT_CLASS_PUBLISHED_MAGIC_VALUE: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_CLASS_REGISTRY_BYTECODE_CAPSULE_SLOT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_CLASS_REGISTRY_BYTECODE_CAPSULE_SLOT.html new file mode 100644 index 000000000000..d1d8f586f27b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_CLASS_REGISTRY_BYTECODE_CAPSULE_SLOT.html @@ -0,0 +1,583 @@ + + + + + + +Global CONTRACT_CLASS_REGISTRY_BYTECODE_CAPSULE_SLOT documentation + + + + + +
+ +

Global CONTRACT_CLASS_REGISTRY_BYTECODE_CAPSULE_SLOT

+
pub global CONTRACT_CLASS_REGISTRY_BYTECODE_CAPSULE_SLOT: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_CLASS_REGISTRY_CONTRACT_ADDRESS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_CLASS_REGISTRY_CONTRACT_ADDRESS.html new file mode 100644 index 000000000000..10d59bda0393 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_CLASS_REGISTRY_CONTRACT_ADDRESS.html @@ -0,0 +1,583 @@ + + + + + + +Global CONTRACT_CLASS_REGISTRY_CONTRACT_ADDRESS documentation + + + + + +
+ +

Global CONTRACT_CLASS_REGISTRY_CONTRACT_ADDRESS

+
pub global CONTRACT_CLASS_REGISTRY_CONTRACT_ADDRESS: AztecAddress;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_CLASS_REGISTRY_PRIVATE_FUNCTION_BROADCASTED_MAGIC_VALUE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_CLASS_REGISTRY_PRIVATE_FUNCTION_BROADCASTED_MAGIC_VALUE.html new file mode 100644 index 000000000000..548fd072cda9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_CLASS_REGISTRY_PRIVATE_FUNCTION_BROADCASTED_MAGIC_VALUE.html @@ -0,0 +1,583 @@ + + + + + + +Global CONTRACT_CLASS_REGISTRY_PRIVATE_FUNCTION_BROADCASTED_MAGIC_VALUE documentation + + + + + +
+ +

Global CONTRACT_CLASS_REGISTRY_PRIVATE_FUNCTION_BROADCASTED_MAGIC_VALUE

+
pub global CONTRACT_CLASS_REGISTRY_PRIVATE_FUNCTION_BROADCASTED_MAGIC_VALUE: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_CLASS_REGISTRY_UTILITY_FUNCTION_BROADCASTED_MAGIC_VALUE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_CLASS_REGISTRY_UTILITY_FUNCTION_BROADCASTED_MAGIC_VALUE.html new file mode 100644 index 000000000000..52e845f74b9b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_CLASS_REGISTRY_UTILITY_FUNCTION_BROADCASTED_MAGIC_VALUE.html @@ -0,0 +1,583 @@ + + + + + + +Global CONTRACT_CLASS_REGISTRY_UTILITY_FUNCTION_BROADCASTED_MAGIC_VALUE documentation + + + + + +
+ +

Global CONTRACT_CLASS_REGISTRY_UTILITY_FUNCTION_BROADCASTED_MAGIC_VALUE

+
pub global CONTRACT_CLASS_REGISTRY_UTILITY_FUNCTION_BROADCASTED_MAGIC_VALUE: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_INSTANCE_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_INSTANCE_LENGTH.html new file mode 100644 index 000000000000..ff6fd8ee203b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_INSTANCE_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global CONTRACT_INSTANCE_LENGTH documentation + + + + + +
+ +

Global CONTRACT_INSTANCE_LENGTH

+
pub global CONTRACT_INSTANCE_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_INSTANCE_PUBLISHED_MAGIC_VALUE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_INSTANCE_PUBLISHED_MAGIC_VALUE.html new file mode 100644 index 000000000000..6d34908c7326 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_INSTANCE_PUBLISHED_MAGIC_VALUE.html @@ -0,0 +1,583 @@ + + + + + + +Global CONTRACT_INSTANCE_PUBLISHED_MAGIC_VALUE documentation + + + + + +
+ +

Global CONTRACT_INSTANCE_PUBLISHED_MAGIC_VALUE

+
pub global CONTRACT_INSTANCE_PUBLISHED_MAGIC_VALUE: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS.html new file mode 100644 index 000000000000..af5c7968de52 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS.html @@ -0,0 +1,583 @@ + + + + + + +Global CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS documentation + + + + + +
+ +

Global CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS

+
pub global CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS: AztecAddress;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_INSTANCE_UPDATED_MAGIC_VALUE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_INSTANCE_UPDATED_MAGIC_VALUE.html new file mode 100644 index 000000000000..08ea945b591f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_INSTANCE_UPDATED_MAGIC_VALUE.html @@ -0,0 +1,583 @@ + + + + + + +Global CONTRACT_INSTANCE_UPDATED_MAGIC_VALUE documentation + + + + + +
+ +

Global CONTRACT_INSTANCE_UPDATED_MAGIC_VALUE

+
pub global CONTRACT_INSTANCE_UPDATED_MAGIC_VALUE: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_STORAGE_READ_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_STORAGE_READ_LENGTH.html new file mode 100644 index 000000000000..d7e157db6c63 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_STORAGE_READ_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global CONTRACT_STORAGE_READ_LENGTH documentation + + + + + +
+ +

Global CONTRACT_STORAGE_READ_LENGTH

+
pub global CONTRACT_STORAGE_READ_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_STORAGE_UPDATE_REQUEST_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_STORAGE_UPDATE_REQUEST_LENGTH.html new file mode 100644 index 000000000000..687adec99208 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.CONTRACT_STORAGE_UPDATE_REQUEST_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global CONTRACT_STORAGE_UPDATE_REQUEST_LENGTH documentation + + + + + +
+ +

Global CONTRACT_STORAGE_UPDATE_REQUEST_LENGTH

+
pub global CONTRACT_STORAGE_UPDATE_REQUEST_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.COUNTED_L2_TO_L1_MESSAGE_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.COUNTED_L2_TO_L1_MESSAGE_LENGTH.html new file mode 100644 index 000000000000..9d796c94a457 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.COUNTED_L2_TO_L1_MESSAGE_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global COUNTED_L2_TO_L1_MESSAGE_LENGTH documentation + + + + + +
+ +

Global COUNTED_L2_TO_L1_MESSAGE_LENGTH

+
pub global COUNTED_L2_TO_L1_MESSAGE_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.COUNTED_LOG_HASH_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.COUNTED_LOG_HASH_LENGTH.html new file mode 100644 index 000000000000..bd5d3683cd28 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.COUNTED_LOG_HASH_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global COUNTED_LOG_HASH_LENGTH documentation + + + + + +
+ +

Global COUNTED_LOG_HASH_LENGTH

+
pub global COUNTED_LOG_HASH_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.COUNTED_PUBLIC_CALL_REQUEST_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.COUNTED_PUBLIC_CALL_REQUEST_LENGTH.html new file mode 100644 index 000000000000..8fa976089491 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.COUNTED_PUBLIC_CALL_REQUEST_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global COUNTED_PUBLIC_CALL_REQUEST_LENGTH documentation + + + + + +
+ +

Global COUNTED_PUBLIC_CALL_REQUEST_LENGTH

+
pub global COUNTED_PUBLIC_CALL_REQUEST_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DA_BYTES_PER_FIELD.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DA_BYTES_PER_FIELD.html new file mode 100644 index 000000000000..bf84c9397ead --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DA_BYTES_PER_FIELD.html @@ -0,0 +1,583 @@ + + + + + + +Global DA_BYTES_PER_FIELD documentation + + + + + +
+ +

Global DA_BYTES_PER_FIELD

+
pub global DA_BYTES_PER_FIELD: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DA_GAS_PER_BYTE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DA_GAS_PER_BYTE.html new file mode 100644 index 000000000000..94a3033e6218 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DA_GAS_PER_BYTE.html @@ -0,0 +1,583 @@ + + + + + + +Global DA_GAS_PER_BYTE documentation + + + + + +
+ +

Global DA_GAS_PER_BYTE

+
pub global DA_GAS_PER_BYTE: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_DA_GAS_LIMIT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_DA_GAS_LIMIT.html new file mode 100644 index 000000000000..8865052f239d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_DA_GAS_LIMIT.html @@ -0,0 +1,583 @@ + + + + + + +Global DEFAULT_DA_GAS_LIMIT documentation + + + + + +
+ +

Global DEFAULT_DA_GAS_LIMIT

+
pub global DEFAULT_DA_GAS_LIMIT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_IVPK_M_X.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_IVPK_M_X.html new file mode 100644 index 000000000000..3f6ee369f00c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_IVPK_M_X.html @@ -0,0 +1,583 @@ + + + + + + +Global DEFAULT_IVPK_M_X documentation + + + + + +
+ +

Global DEFAULT_IVPK_M_X

+
pub global DEFAULT_IVPK_M_X: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_IVPK_M_Y.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_IVPK_M_Y.html new file mode 100644 index 000000000000..db2c0a674fcb --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_IVPK_M_Y.html @@ -0,0 +1,583 @@ + + + + + + +Global DEFAULT_IVPK_M_Y documentation + + + + + +
+ +

Global DEFAULT_IVPK_M_Y

+
pub global DEFAULT_IVPK_M_Y: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_L2_GAS_LIMIT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_L2_GAS_LIMIT.html new file mode 100644 index 000000000000..9f478ed9c8ff --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_L2_GAS_LIMIT.html @@ -0,0 +1,583 @@ + + + + + + +Global DEFAULT_L2_GAS_LIMIT documentation + + + + + +
+ +

Global DEFAULT_L2_GAS_LIMIT

+
pub global DEFAULT_L2_GAS_LIMIT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_MAX_DEBUG_LOG_MEMORY_READS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_MAX_DEBUG_LOG_MEMORY_READS.html new file mode 100644 index 000000000000..99b92e5b57c6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_MAX_DEBUG_LOG_MEMORY_READS.html @@ -0,0 +1,583 @@ + + + + + + +Global DEFAULT_MAX_DEBUG_LOG_MEMORY_READS documentation + + + + + +
+ +

Global DEFAULT_MAX_DEBUG_LOG_MEMORY_READS

+
pub global DEFAULT_MAX_DEBUG_LOG_MEMORY_READS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_NPK_M_X.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_NPK_M_X.html new file mode 100644 index 000000000000..bfa8f81670f5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_NPK_M_X.html @@ -0,0 +1,583 @@ + + + + + + +Global DEFAULT_NPK_M_X documentation + + + + + +
+ +

Global DEFAULT_NPK_M_X

+
pub global DEFAULT_NPK_M_X: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_NPK_M_Y.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_NPK_M_Y.html new file mode 100644 index 000000000000..72dbd5edf1f9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_NPK_M_Y.html @@ -0,0 +1,583 @@ + + + + + + +Global DEFAULT_NPK_M_Y documentation + + + + + +
+ +

Global DEFAULT_NPK_M_Y

+
pub global DEFAULT_NPK_M_Y: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_OVPK_M_X.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_OVPK_M_X.html new file mode 100644 index 000000000000..27895cd4fadb --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_OVPK_M_X.html @@ -0,0 +1,583 @@ + + + + + + +Global DEFAULT_OVPK_M_X documentation + + + + + +
+ +

Global DEFAULT_OVPK_M_X

+
pub global DEFAULT_OVPK_M_X: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_OVPK_M_Y.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_OVPK_M_Y.html new file mode 100644 index 000000000000..c98d37c81d04 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_OVPK_M_Y.html @@ -0,0 +1,583 @@ + + + + + + +Global DEFAULT_OVPK_M_Y documentation + + + + + +
+ +

Global DEFAULT_OVPK_M_Y

+
pub global DEFAULT_OVPK_M_Y: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_TEARDOWN_DA_GAS_LIMIT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_TEARDOWN_DA_GAS_LIMIT.html new file mode 100644 index 000000000000..b676ffb8869e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_TEARDOWN_DA_GAS_LIMIT.html @@ -0,0 +1,583 @@ + + + + + + +Global DEFAULT_TEARDOWN_DA_GAS_LIMIT documentation + + + + + +
+ +

Global DEFAULT_TEARDOWN_DA_GAS_LIMIT

+
pub global DEFAULT_TEARDOWN_DA_GAS_LIMIT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_TEARDOWN_L2_GAS_LIMIT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_TEARDOWN_L2_GAS_LIMIT.html new file mode 100644 index 000000000000..82fb7d4eeeae --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_TEARDOWN_L2_GAS_LIMIT.html @@ -0,0 +1,583 @@ + + + + + + +Global DEFAULT_TEARDOWN_L2_GAS_LIMIT documentation + + + + + +
+ +

Global DEFAULT_TEARDOWN_L2_GAS_LIMIT

+
pub global DEFAULT_TEARDOWN_L2_GAS_LIMIT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_TPK_M_X.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_TPK_M_X.html new file mode 100644 index 000000000000..76eced3db47d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_TPK_M_X.html @@ -0,0 +1,583 @@ + + + + + + +Global DEFAULT_TPK_M_X documentation + + + + + +
+ +

Global DEFAULT_TPK_M_X

+
pub global DEFAULT_TPK_M_X: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_TPK_M_Y.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_TPK_M_Y.html new file mode 100644 index 000000000000..b7a8ffb42415 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_TPK_M_Y.html @@ -0,0 +1,583 @@ + + + + + + +Global DEFAULT_TPK_M_Y documentation + + + + + +
+ +

Global DEFAULT_TPK_M_Y

+
pub global DEFAULT_TPK_M_Y: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_UPDATE_DELAY.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_UPDATE_DELAY.html new file mode 100644 index 000000000000..83f116aec0ac --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.DEFAULT_UPDATE_DELAY.html @@ -0,0 +1,583 @@ + + + + + + +Global DEFAULT_UPDATE_DELAY documentation + + + + + +
+ +

Global DEFAULT_UPDATE_DELAY

+
pub global DEFAULT_UPDATE_DELAY: u64;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.EPOCH_CONSTANT_DATA_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.EPOCH_CONSTANT_DATA_LENGTH.html new file mode 100644 index 000000000000..3f80da17c5d8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.EPOCH_CONSTANT_DATA_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global EPOCH_CONSTANT_DATA_LENGTH documentation + + + + + +
+ +

Global EPOCH_CONSTANT_DATA_LENGTH

+
pub global EPOCH_CONSTANT_DATA_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.ETH_ADDRESS_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.ETH_ADDRESS_LENGTH.html new file mode 100644 index 000000000000..bf430dc1cda0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.ETH_ADDRESS_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global ETH_ADDRESS_LENGTH documentation + + + + + +
+ +

Global ETH_ADDRESS_LENGTH

+
pub global ETH_ADDRESS_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FEE_JUICE_ADDRESS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FEE_JUICE_ADDRESS.html new file mode 100644 index 000000000000..5555c2719e4d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FEE_JUICE_ADDRESS.html @@ -0,0 +1,583 @@ + + + + + + +Global FEE_JUICE_ADDRESS documentation + + + + + +
+ +

Global FEE_JUICE_ADDRESS

+
pub global FEE_JUICE_ADDRESS: AztecAddress;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FEE_JUICE_BALANCES_SLOT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FEE_JUICE_BALANCES_SLOT.html new file mode 100644 index 000000000000..7df347650f58 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FEE_JUICE_BALANCES_SLOT.html @@ -0,0 +1,583 @@ + + + + + + +Global FEE_JUICE_BALANCES_SLOT documentation + + + + + +
+ +

Global FEE_JUICE_BALANCES_SLOT

+
pub global FEE_JUICE_BALANCES_SLOT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FEE_RECIPIENT_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FEE_RECIPIENT_LENGTH.html new file mode 100644 index 000000000000..ef3552cfaf4f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FEE_RECIPIENT_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global FEE_RECIPIENT_LENGTH documentation + + + + + +
+ +

Global FEE_RECIPIENT_LENGTH

+
pub global FEE_RECIPIENT_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FIELDS_PER_BLOB.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FIELDS_PER_BLOB.html new file mode 100644 index 000000000000..e54eb3ec0d70 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FIELDS_PER_BLOB.html @@ -0,0 +1,583 @@ + + + + + + +Global FIELDS_PER_BLOB documentation + + + + + +
+ +

Global FIELDS_PER_BLOB

+
pub global FIELDS_PER_BLOB: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FINAL_BLOB_ACCUMULATOR_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FINAL_BLOB_ACCUMULATOR_LENGTH.html new file mode 100644 index 000000000000..7e30fc8dc4da --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FINAL_BLOB_ACCUMULATOR_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global FINAL_BLOB_ACCUMULATOR_LENGTH documentation + + + + + +
+ +

Global FINAL_BLOB_ACCUMULATOR_LENGTH

+
pub global FINAL_BLOB_ACCUMULATOR_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FINAL_BLOB_BATCHING_CHALLENGES_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FINAL_BLOB_BATCHING_CHALLENGES_LENGTH.html new file mode 100644 index 000000000000..277e013b28a7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FINAL_BLOB_BATCHING_CHALLENGES_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global FINAL_BLOB_BATCHING_CHALLENGES_LENGTH documentation + + + + + +
+ +

Global FINAL_BLOB_BATCHING_CHALLENGES_LENGTH

+
pub global FINAL_BLOB_BATCHING_CHALLENGES_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FIXED_AVM_STARTUP_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FIXED_AVM_STARTUP_L2_GAS.html new file mode 100644 index 000000000000..d6914b5cddb7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FIXED_AVM_STARTUP_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global FIXED_AVM_STARTUP_L2_GAS documentation + + + + + +
+ +

Global FIXED_AVM_STARTUP_L2_GAS

+
pub global FIXED_AVM_STARTUP_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FIXED_DA_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FIXED_DA_GAS.html new file mode 100644 index 000000000000..4ef627763d37 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FIXED_DA_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global FIXED_DA_GAS documentation + + + + + +
+ +

Global FIXED_DA_GAS

+
pub global FIXED_DA_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FIXED_L2_GAS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FIXED_L2_GAS.html new file mode 100644 index 000000000000..5f60a6d196dd --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FIXED_L2_GAS.html @@ -0,0 +1,583 @@ + + + + + + +Global FIXED_L2_GAS documentation + + + + + +
+ +

Global FIXED_L2_GAS

+
pub global FIXED_L2_GAS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FLAT_PUBLIC_LOGS_HEADER_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FLAT_PUBLIC_LOGS_HEADER_LENGTH.html new file mode 100644 index 000000000000..8cdbd9ad8cb2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FLAT_PUBLIC_LOGS_HEADER_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global FLAT_PUBLIC_LOGS_HEADER_LENGTH documentation + + + + + +
+ +

Global FLAT_PUBLIC_LOGS_HEADER_LENGTH

+
pub global FLAT_PUBLIC_LOGS_HEADER_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FLAT_PUBLIC_LOGS_PAYLOAD_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FLAT_PUBLIC_LOGS_PAYLOAD_LENGTH.html new file mode 100644 index 000000000000..c3afb495aae2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FLAT_PUBLIC_LOGS_PAYLOAD_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global FLAT_PUBLIC_LOGS_PAYLOAD_LENGTH documentation + + + + + +
+ +

Global FLAT_PUBLIC_LOGS_PAYLOAD_LENGTH

+
pub global FLAT_PUBLIC_LOGS_PAYLOAD_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FUNCTION_DATA_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FUNCTION_DATA_LENGTH.html new file mode 100644 index 000000000000..3328a824a9b3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FUNCTION_DATA_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global FUNCTION_DATA_LENGTH documentation + + + + + +
+ +

Global FUNCTION_DATA_LENGTH

+
pub global FUNCTION_DATA_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FUNCTION_LEAF_PREIMAGE_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FUNCTION_LEAF_PREIMAGE_LENGTH.html new file mode 100644 index 000000000000..9707bf0baedc --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FUNCTION_LEAF_PREIMAGE_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global FUNCTION_LEAF_PREIMAGE_LENGTH documentation + + + + + +
+ +

Global FUNCTION_LEAF_PREIMAGE_LENGTH

+
pub global FUNCTION_LEAF_PREIMAGE_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FUNCTION_SELECTOR_NUM_BYTES.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FUNCTION_SELECTOR_NUM_BYTES.html new file mode 100644 index 000000000000..ed1b37931034 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FUNCTION_SELECTOR_NUM_BYTES.html @@ -0,0 +1,583 @@ + + + + + + +Global FUNCTION_SELECTOR_NUM_BYTES documentation + + + + + +
+ +

Global FUNCTION_SELECTOR_NUM_BYTES

+
pub global FUNCTION_SELECTOR_NUM_BYTES: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FUNCTION_TREE_HEIGHT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FUNCTION_TREE_HEIGHT.html new file mode 100644 index 000000000000..0daa7c031ab2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.FUNCTION_TREE_HEIGHT.html @@ -0,0 +1,583 @@ + + + + + + +Global FUNCTION_TREE_HEIGHT documentation + + + + + +
+ +

Global FUNCTION_TREE_HEIGHT

+
pub global FUNCTION_TREE_HEIGHT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GAS_ESTIMATION_DA_GAS_LIMIT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GAS_ESTIMATION_DA_GAS_LIMIT.html new file mode 100644 index 000000000000..eafaed6abec3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GAS_ESTIMATION_DA_GAS_LIMIT.html @@ -0,0 +1,583 @@ + + + + + + +Global GAS_ESTIMATION_DA_GAS_LIMIT documentation + + + + + +
+ +

Global GAS_ESTIMATION_DA_GAS_LIMIT

+
pub global GAS_ESTIMATION_DA_GAS_LIMIT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GAS_ESTIMATION_L2_GAS_LIMIT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GAS_ESTIMATION_L2_GAS_LIMIT.html new file mode 100644 index 000000000000..ce6ec3284a57 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GAS_ESTIMATION_L2_GAS_LIMIT.html @@ -0,0 +1,583 @@ + + + + + + +Global GAS_ESTIMATION_L2_GAS_LIMIT documentation + + + + + +
+ +

Global GAS_ESTIMATION_L2_GAS_LIMIT

+
pub global GAS_ESTIMATION_L2_GAS_LIMIT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GAS_ESTIMATION_TEARDOWN_DA_GAS_LIMIT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GAS_ESTIMATION_TEARDOWN_DA_GAS_LIMIT.html new file mode 100644 index 000000000000..e51b9416fcfe --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GAS_ESTIMATION_TEARDOWN_DA_GAS_LIMIT.html @@ -0,0 +1,583 @@ + + + + + + +Global GAS_ESTIMATION_TEARDOWN_DA_GAS_LIMIT documentation + + + + + +
+ +

Global GAS_ESTIMATION_TEARDOWN_DA_GAS_LIMIT

+
pub global GAS_ESTIMATION_TEARDOWN_DA_GAS_LIMIT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GAS_ESTIMATION_TEARDOWN_L2_GAS_LIMIT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GAS_ESTIMATION_TEARDOWN_L2_GAS_LIMIT.html new file mode 100644 index 000000000000..3cef70897091 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GAS_ESTIMATION_TEARDOWN_L2_GAS_LIMIT.html @@ -0,0 +1,583 @@ + + + + + + +Global GAS_ESTIMATION_TEARDOWN_L2_GAS_LIMIT documentation + + + + + +
+ +

Global GAS_ESTIMATION_TEARDOWN_L2_GAS_LIMIT

+
pub global GAS_ESTIMATION_TEARDOWN_L2_GAS_LIMIT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GAS_FEES_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GAS_FEES_LENGTH.html new file mode 100644 index 000000000000..3bdf42fac2fe --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GAS_FEES_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global GAS_FEES_LENGTH documentation + + + + + +
+ +

Global GAS_FEES_LENGTH

+
pub global GAS_FEES_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GAS_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GAS_LENGTH.html new file mode 100644 index 000000000000..08b24cff6f47 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GAS_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global GAS_LENGTH documentation + + + + + +
+ +

Global GAS_LENGTH

+
pub global GAS_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GAS_SETTINGS_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GAS_SETTINGS_LENGTH.html new file mode 100644 index 000000000000..187eed0a5b8e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GAS_SETTINGS_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global GAS_SETTINGS_LENGTH documentation + + + + + +
+ +

Global GAS_SETTINGS_LENGTH

+
pub global GAS_SETTINGS_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__AUTHWIT_INNER.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__AUTHWIT_INNER.html new file mode 100644 index 000000000000..1388da45469b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__AUTHWIT_INNER.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__AUTHWIT_INNER documentation + + + + + +
+ +

Global GENERATOR_INDEX__AUTHWIT_INNER

+
pub global GENERATOR_INDEX__AUTHWIT_INNER: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__AUTHWIT_NULLIFIER.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__AUTHWIT_NULLIFIER.html new file mode 100644 index 000000000000..07e7e7fcb1ad --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__AUTHWIT_NULLIFIER.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__AUTHWIT_NULLIFIER documentation + + + + + +
+ +

Global GENERATOR_INDEX__AUTHWIT_NULLIFIER

+
pub global GENERATOR_INDEX__AUTHWIT_NULLIFIER: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__AUTHWIT_OUTER.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__AUTHWIT_OUTER.html new file mode 100644 index 000000000000..612b9f6f4cec --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__AUTHWIT_OUTER.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__AUTHWIT_OUTER documentation + + + + + +
+ +

Global GENERATOR_INDEX__AUTHWIT_OUTER

+
pub global GENERATOR_INDEX__AUTHWIT_OUTER: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__BLOCK_HASH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__BLOCK_HASH.html new file mode 100644 index 000000000000..7b72bb7d22f5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__BLOCK_HASH.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__BLOCK_HASH documentation + + + + + +
+ +

Global GENERATOR_INDEX__BLOCK_HASH

+
pub global GENERATOR_INDEX__BLOCK_HASH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__CALL_CONTEXT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__CALL_CONTEXT.html new file mode 100644 index 000000000000..624a23fa627c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__CALL_CONTEXT.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__CALL_CONTEXT documentation + + + + + +
+ +

Global GENERATOR_INDEX__CALL_CONTEXT

+
pub global GENERATOR_INDEX__CALL_CONTEXT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__CALL_STACK_ITEM.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__CALL_STACK_ITEM.html new file mode 100644 index 000000000000..08352ea481a9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__CALL_STACK_ITEM.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__CALL_STACK_ITEM documentation + + + + + +
+ +

Global GENERATOR_INDEX__CALL_STACK_ITEM

+
pub global GENERATOR_INDEX__CALL_STACK_ITEM: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__CALL_STACK_ITEM_2.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__CALL_STACK_ITEM_2.html new file mode 100644 index 000000000000..0334d685c673 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__CALL_STACK_ITEM_2.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__CALL_STACK_ITEM_2 documentation + + + + + +
+ +

Global GENERATOR_INDEX__CALL_STACK_ITEM_2

+
pub global GENERATOR_INDEX__CALL_STACK_ITEM_2: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__COMBINED_PAYLOAD.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__COMBINED_PAYLOAD.html new file mode 100644 index 000000000000..53d9bb116381 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__COMBINED_PAYLOAD.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__COMBINED_PAYLOAD documentation + + + + + +
+ +

Global GENERATOR_INDEX__COMBINED_PAYLOAD

+
pub global GENERATOR_INDEX__COMBINED_PAYLOAD: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__CONSTRUCTOR.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__CONSTRUCTOR.html new file mode 100644 index 000000000000..912b9b8e9a1e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__CONSTRUCTOR.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__CONSTRUCTOR documentation + + + + + +
+ +

Global GENERATOR_INDEX__CONSTRUCTOR

+
pub global GENERATOR_INDEX__CONSTRUCTOR: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__CONSTRUCTOR_ARGS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__CONSTRUCTOR_ARGS.html new file mode 100644 index 000000000000..bfe1617d3426 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__CONSTRUCTOR_ARGS.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__CONSTRUCTOR_ARGS documentation + + + + + +
+ +

Global GENERATOR_INDEX__CONSTRUCTOR_ARGS

+
pub global GENERATOR_INDEX__CONSTRUCTOR_ARGS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__CONTRACT_ADDRESS_V1.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__CONTRACT_ADDRESS_V1.html new file mode 100644 index 000000000000..9aa2e76bbca8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__CONTRACT_ADDRESS_V1.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__CONTRACT_ADDRESS_V1 documentation + + + + + +
+ +

Global GENERATOR_INDEX__CONTRACT_ADDRESS_V1

+
pub global GENERATOR_INDEX__CONTRACT_ADDRESS_V1: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__CONTRACT_DEPLOYMENT_DATA.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__CONTRACT_DEPLOYMENT_DATA.html new file mode 100644 index 000000000000..d9d7cc1044c5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__CONTRACT_DEPLOYMENT_DATA.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__CONTRACT_DEPLOYMENT_DATA documentation + + + + + +
+ +

Global GENERATOR_INDEX__CONTRACT_DEPLOYMENT_DATA

+
pub global GENERATOR_INDEX__CONTRACT_DEPLOYMENT_DATA: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__CONTRACT_LEAF.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__CONTRACT_LEAF.html new file mode 100644 index 000000000000..b567fd851b27 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__CONTRACT_LEAF.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__CONTRACT_LEAF documentation + + + + + +
+ +

Global GENERATOR_INDEX__CONTRACT_LEAF

+
pub global GENERATOR_INDEX__CONTRACT_LEAF: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__EVENT_COMMITMENT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__EVENT_COMMITMENT.html new file mode 100644 index 000000000000..17982f6a38cc --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__EVENT_COMMITMENT.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__EVENT_COMMITMENT documentation + + + + + +
+ +

Global GENERATOR_INDEX__EVENT_COMMITMENT

+
pub global GENERATOR_INDEX__EVENT_COMMITMENT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__FEE_PAYLOAD.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__FEE_PAYLOAD.html new file mode 100644 index 000000000000..973cbffa50b1 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__FEE_PAYLOAD.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__FEE_PAYLOAD documentation + + + + + +
+ +

Global GENERATOR_INDEX__FEE_PAYLOAD

+
pub global GENERATOR_INDEX__FEE_PAYLOAD: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__FUNCTION_ARGS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__FUNCTION_ARGS.html new file mode 100644 index 000000000000..7c303e97b803 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__FUNCTION_ARGS.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__FUNCTION_ARGS documentation + + + + + +
+ +

Global GENERATOR_INDEX__FUNCTION_ARGS

+
pub global GENERATOR_INDEX__FUNCTION_ARGS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__FUNCTION_DATA.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__FUNCTION_DATA.html new file mode 100644 index 000000000000..8ad6c9e78172 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__FUNCTION_DATA.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__FUNCTION_DATA documentation + + + + + +
+ +

Global GENERATOR_INDEX__FUNCTION_DATA

+
pub global GENERATOR_INDEX__FUNCTION_DATA: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__FUNCTION_LEAF.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__FUNCTION_LEAF.html new file mode 100644 index 000000000000..857ecf31aec3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__FUNCTION_LEAF.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__FUNCTION_LEAF documentation + + + + + +
+ +

Global GENERATOR_INDEX__FUNCTION_LEAF

+
pub global GENERATOR_INDEX__FUNCTION_LEAF: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__GLOBAL_VARIABLES.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__GLOBAL_VARIABLES.html new file mode 100644 index 000000000000..bbff917dfbd4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__GLOBAL_VARIABLES.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__GLOBAL_VARIABLES documentation + + + + + +
+ +

Global GENERATOR_INDEX__GLOBAL_VARIABLES

+
pub global GENERATOR_INDEX__GLOBAL_VARIABLES: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__INITIALIZATION_NULLIFIER.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__INITIALIZATION_NULLIFIER.html new file mode 100644 index 000000000000..184ee8e6deea --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__INITIALIZATION_NULLIFIER.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__INITIALIZATION_NULLIFIER documentation + + + + + +
+ +

Global GENERATOR_INDEX__INITIALIZATION_NULLIFIER

+
pub global GENERATOR_INDEX__INITIALIZATION_NULLIFIER: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__IVSK_M.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__IVSK_M.html new file mode 100644 index 000000000000..a2536241e544 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__IVSK_M.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__IVSK_M documentation + + + + + +
+ +

Global GENERATOR_INDEX__IVSK_M

+
pub global GENERATOR_INDEX__IVSK_M: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__L2_TO_L1_MSG.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__L2_TO_L1_MSG.html new file mode 100644 index 000000000000..0f3c8a3f3f74 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__L2_TO_L1_MSG.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__L2_TO_L1_MSG documentation + + + + + +
+ +

Global GENERATOR_INDEX__L2_TO_L1_MSG

+
pub global GENERATOR_INDEX__L2_TO_L1_MSG: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__MESSAGE_NULLIFIER.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__MESSAGE_NULLIFIER.html new file mode 100644 index 000000000000..d10c032140a8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__MESSAGE_NULLIFIER.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__MESSAGE_NULLIFIER documentation + + + + + +
+ +

Global GENERATOR_INDEX__MESSAGE_NULLIFIER

+
pub global GENERATOR_INDEX__MESSAGE_NULLIFIER: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__NOTE_HASH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__NOTE_HASH.html new file mode 100644 index 000000000000..49e7afed3010 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__NOTE_HASH.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__NOTE_HASH documentation + + + + + +
+ +

Global GENERATOR_INDEX__NOTE_HASH

+
pub global GENERATOR_INDEX__NOTE_HASH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__NOTE_HASH_NONCE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__NOTE_HASH_NONCE.html new file mode 100644 index 000000000000..8f402da81a1f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__NOTE_HASH_NONCE.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__NOTE_HASH_NONCE documentation + + + + + +
+ +

Global GENERATOR_INDEX__NOTE_HASH_NONCE

+
pub global GENERATOR_INDEX__NOTE_HASH_NONCE: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__NOTE_NULLIFIER.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__NOTE_NULLIFIER.html new file mode 100644 index 000000000000..72a077885a61 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__NOTE_NULLIFIER.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__NOTE_NULLIFIER documentation + + + + + +
+ +

Global GENERATOR_INDEX__NOTE_NULLIFIER

+
pub global GENERATOR_INDEX__NOTE_NULLIFIER: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__NSK_M.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__NSK_M.html new file mode 100644 index 000000000000..54c4e64ba446 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__NSK_M.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__NSK_M documentation + + + + + +
+ +

Global GENERATOR_INDEX__NSK_M

+
pub global GENERATOR_INDEX__NSK_M: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__OUTER_NULLIFIER.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__OUTER_NULLIFIER.html new file mode 100644 index 000000000000..2702430634f6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__OUTER_NULLIFIER.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__OUTER_NULLIFIER documentation + + + + + +
+ +

Global GENERATOR_INDEX__OUTER_NULLIFIER

+
pub global GENERATOR_INDEX__OUTER_NULLIFIER: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__OVSK_M.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__OVSK_M.html new file mode 100644 index 000000000000..11f51c6b8510 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__OVSK_M.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__OVSK_M documentation + + + + + +
+ +

Global GENERATOR_INDEX__OVSK_M

+
pub global GENERATOR_INDEX__OVSK_M: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PARTIAL_ADDRESS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PARTIAL_ADDRESS.html new file mode 100644 index 000000000000..9d102a8b213a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PARTIAL_ADDRESS.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__PARTIAL_ADDRESS documentation + + + + + +
+ +

Global GENERATOR_INDEX__PARTIAL_ADDRESS

+
pub global GENERATOR_INDEX__PARTIAL_ADDRESS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PARTIAL_NOTE_VALIDITY_COMMITMENT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PARTIAL_NOTE_VALIDITY_COMMITMENT.html new file mode 100644 index 000000000000..07a559f85dc6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PARTIAL_NOTE_VALIDITY_COMMITMENT.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__PARTIAL_NOTE_VALIDITY_COMMITMENT documentation + + + + + +
+ +

Global GENERATOR_INDEX__PARTIAL_NOTE_VALIDITY_COMMITMENT

+
pub global GENERATOR_INDEX__PARTIAL_NOTE_VALIDITY_COMMITMENT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PRIVATE_TX_HASH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PRIVATE_TX_HASH.html new file mode 100644 index 000000000000..84c1b9567165 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PRIVATE_TX_HASH.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__PRIVATE_TX_HASH documentation + + + + + +
+ +

Global GENERATOR_INDEX__PRIVATE_TX_HASH

+
pub global GENERATOR_INDEX__PRIVATE_TX_HASH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PROTOCOL_CONTRACTS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PROTOCOL_CONTRACTS.html new file mode 100644 index 000000000000..7977d4e2b997 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PROTOCOL_CONTRACTS.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__PROTOCOL_CONTRACTS documentation + + + + + +
+ +

Global GENERATOR_INDEX__PROTOCOL_CONTRACTS

+
pub global GENERATOR_INDEX__PROTOCOL_CONTRACTS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PUBLIC_BYTECODE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PUBLIC_BYTECODE.html new file mode 100644 index 000000000000..a7988771ba7d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PUBLIC_BYTECODE.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__PUBLIC_BYTECODE documentation + + + + + +
+ +

Global GENERATOR_INDEX__PUBLIC_BYTECODE

+
pub global GENERATOR_INDEX__PUBLIC_BYTECODE: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PUBLIC_CALLDATA.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PUBLIC_CALLDATA.html new file mode 100644 index 000000000000..68a822f49286 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PUBLIC_CALLDATA.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__PUBLIC_CALLDATA documentation + + + + + +
+ +

Global GENERATOR_INDEX__PUBLIC_CALLDATA

+
pub global GENERATOR_INDEX__PUBLIC_CALLDATA: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PUBLIC_DATA_LEAF.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PUBLIC_DATA_LEAF.html new file mode 100644 index 000000000000..72d97bff99d4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PUBLIC_DATA_LEAF.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__PUBLIC_DATA_LEAF documentation + + + + + +
+ +

Global GENERATOR_INDEX__PUBLIC_DATA_LEAF

+
pub global GENERATOR_INDEX__PUBLIC_DATA_LEAF: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PUBLIC_DATA_READ.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PUBLIC_DATA_READ.html new file mode 100644 index 000000000000..45f607929680 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PUBLIC_DATA_READ.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__PUBLIC_DATA_READ documentation + + + + + +
+ +

Global GENERATOR_INDEX__PUBLIC_DATA_READ

+
pub global GENERATOR_INDEX__PUBLIC_DATA_READ: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PUBLIC_DATA_UPDATE_REQUEST.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PUBLIC_DATA_UPDATE_REQUEST.html new file mode 100644 index 000000000000..88ff58719abc --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PUBLIC_DATA_UPDATE_REQUEST.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__PUBLIC_DATA_UPDATE_REQUEST documentation + + + + + +
+ +

Global GENERATOR_INDEX__PUBLIC_DATA_UPDATE_REQUEST

+
pub global GENERATOR_INDEX__PUBLIC_DATA_UPDATE_REQUEST: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PUBLIC_KEYS_HASH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PUBLIC_KEYS_HASH.html new file mode 100644 index 000000000000..fd773fe2abd8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PUBLIC_KEYS_HASH.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__PUBLIC_KEYS_HASH documentation + + + + + +
+ +

Global GENERATOR_INDEX__PUBLIC_KEYS_HASH

+
pub global GENERATOR_INDEX__PUBLIC_KEYS_HASH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PUBLIC_LEAF_INDEX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PUBLIC_LEAF_INDEX.html new file mode 100644 index 000000000000..3c2cfeb5e4a5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PUBLIC_LEAF_INDEX.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__PUBLIC_LEAF_INDEX documentation + + + + + +
+ +

Global GENERATOR_INDEX__PUBLIC_LEAF_INDEX

+
pub global GENERATOR_INDEX__PUBLIC_LEAF_INDEX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PUBLIC_TX_HASH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PUBLIC_TX_HASH.html new file mode 100644 index 000000000000..f83fd9068985 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__PUBLIC_TX_HASH.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__PUBLIC_TX_HASH documentation + + + + + +
+ +

Global GENERATOR_INDEX__PUBLIC_TX_HASH

+
pub global GENERATOR_INDEX__PUBLIC_TX_HASH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__SECRET_HASH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__SECRET_HASH.html new file mode 100644 index 000000000000..e9dde4ff9d47 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__SECRET_HASH.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__SECRET_HASH documentation + + + + + +
+ +

Global GENERATOR_INDEX__SECRET_HASH

+
pub global GENERATOR_INDEX__SECRET_HASH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__SIDE_EFFECT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__SIDE_EFFECT.html new file mode 100644 index 000000000000..d78497996262 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__SIDE_EFFECT.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__SIDE_EFFECT documentation + + + + + +
+ +

Global GENERATOR_INDEX__SIDE_EFFECT

+
pub global GENERATOR_INDEX__SIDE_EFFECT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__SIGNATURE_PAYLOAD.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__SIGNATURE_PAYLOAD.html new file mode 100644 index 000000000000..b508ab6724d3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__SIGNATURE_PAYLOAD.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__SIGNATURE_PAYLOAD documentation + + + + + +
+ +

Global GENERATOR_INDEX__SIGNATURE_PAYLOAD

+
pub global GENERATOR_INDEX__SIGNATURE_PAYLOAD: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__SIGNED_TX_REQUEST.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__SIGNED_TX_REQUEST.html new file mode 100644 index 000000000000..8df73836da45 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__SIGNED_TX_REQUEST.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__SIGNED_TX_REQUEST documentation + + + + + +
+ +

Global GENERATOR_INDEX__SIGNED_TX_REQUEST

+
pub global GENERATOR_INDEX__SIGNED_TX_REQUEST: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__SILOED_NOTE_HASH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__SILOED_NOTE_HASH.html new file mode 100644 index 000000000000..87a9d7256f62 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__SILOED_NOTE_HASH.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__SILOED_NOTE_HASH documentation + + + + + +
+ +

Global GENERATOR_INDEX__SILOED_NOTE_HASH

+
pub global GENERATOR_INDEX__SILOED_NOTE_HASH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__SYMMETRIC_KEY.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__SYMMETRIC_KEY.html new file mode 100644 index 000000000000..4d0cb17ac9c7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__SYMMETRIC_KEY.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__SYMMETRIC_KEY documentation + + + + + +
+ +

Global GENERATOR_INDEX__SYMMETRIC_KEY

+
pub global GENERATOR_INDEX__SYMMETRIC_KEY: u8;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__SYMMETRIC_KEY_2.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__SYMMETRIC_KEY_2.html new file mode 100644 index 000000000000..95f6f9ef6bdc --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__SYMMETRIC_KEY_2.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__SYMMETRIC_KEY_2 documentation + + + + + +
+ +

Global GENERATOR_INDEX__SYMMETRIC_KEY_2

+
pub global GENERATOR_INDEX__SYMMETRIC_KEY_2: u8;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__TSK_M.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__TSK_M.html new file mode 100644 index 000000000000..759445701679 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__TSK_M.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__TSK_M documentation + + + + + +
+ +

Global GENERATOR_INDEX__TSK_M

+
pub global GENERATOR_INDEX__TSK_M: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__TX_CONTEXT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__TX_CONTEXT.html new file mode 100644 index 000000000000..1f14b512d220 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__TX_CONTEXT.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__TX_CONTEXT documentation + + + + + +
+ +

Global GENERATOR_INDEX__TX_CONTEXT

+
pub global GENERATOR_INDEX__TX_CONTEXT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__TX_NULLIFIER.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__TX_NULLIFIER.html new file mode 100644 index 000000000000..0e45d72ffba9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__TX_NULLIFIER.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__TX_NULLIFIER documentation + + + + + +
+ +

Global GENERATOR_INDEX__TX_NULLIFIER

+
pub global GENERATOR_INDEX__TX_NULLIFIER: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__TX_REQUEST.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__TX_REQUEST.html new file mode 100644 index 000000000000..bf164030945d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__TX_REQUEST.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__TX_REQUEST documentation + + + + + +
+ +

Global GENERATOR_INDEX__TX_REQUEST

+
pub global GENERATOR_INDEX__TX_REQUEST: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__UNIQUE_NOTE_HASH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__UNIQUE_NOTE_HASH.html new file mode 100644 index 000000000000..d0e4d67df0e7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__UNIQUE_NOTE_HASH.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__UNIQUE_NOTE_HASH documentation + + + + + +
+ +

Global GENERATOR_INDEX__UNIQUE_NOTE_HASH

+
pub global GENERATOR_INDEX__UNIQUE_NOTE_HASH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__VK.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__VK.html new file mode 100644 index 000000000000..e3fc307ab33b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENERATOR_INDEX__VK.html @@ -0,0 +1,583 @@ + + + + + + +Global GENERATOR_INDEX__VK documentation + + + + + +
+ +

Global GENERATOR_INDEX__VK

+
pub global GENERATOR_INDEX__VK: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENESIS_ARCHIVE_ROOT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENESIS_ARCHIVE_ROOT.html new file mode 100644 index 000000000000..b1e77eb9476f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENESIS_ARCHIVE_ROOT.html @@ -0,0 +1,583 @@ + + + + + + +Global GENESIS_ARCHIVE_ROOT documentation + + + + + +
+ +

Global GENESIS_ARCHIVE_ROOT

+
pub global GENESIS_ARCHIVE_ROOT: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENESIS_BLOCK_HEADER_HASH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENESIS_BLOCK_HEADER_HASH.html new file mode 100644 index 000000000000..69461da61d04 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GENESIS_BLOCK_HEADER_HASH.html @@ -0,0 +1,583 @@ + + + + + + +Global GENESIS_BLOCK_HEADER_HASH documentation + + + + + +
+ +

Global GENESIS_BLOCK_HEADER_HASH

+
pub global GENESIS_BLOCK_HEADER_HASH: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_INDEX_CONTRACT_CLASS_LOG_HASH_OFFSET.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_INDEX_CONTRACT_CLASS_LOG_HASH_OFFSET.html new file mode 100644 index 000000000000..f77313e96303 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_INDEX_CONTRACT_CLASS_LOG_HASH_OFFSET.html @@ -0,0 +1,583 @@ + + + + + + +Global GLOBAL_INDEX_CONTRACT_CLASS_LOG_HASH_OFFSET documentation + + + + + +
+ +

Global GLOBAL_INDEX_CONTRACT_CLASS_LOG_HASH_OFFSET

+
pub global GLOBAL_INDEX_CONTRACT_CLASS_LOG_HASH_OFFSET: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_INDEX_CONTRACT_MIN_REVERTIBLE_SIDE_EFFECT_COUNTER_OFFSET.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_INDEX_CONTRACT_MIN_REVERTIBLE_SIDE_EFFECT_COUNTER_OFFSET.html new file mode 100644 index 000000000000..f6857853cf35 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_INDEX_CONTRACT_MIN_REVERTIBLE_SIDE_EFFECT_COUNTER_OFFSET.html @@ -0,0 +1,583 @@ + + + + + + +Global GLOBAL_INDEX_CONTRACT_MIN_REVERTIBLE_SIDE_EFFECT_COUNTER_OFFSET documentation + + + + + +
+ +

Global GLOBAL_INDEX_CONTRACT_MIN_REVERTIBLE_SIDE_EFFECT_COUNTER_OFFSET

+
pub global GLOBAL_INDEX_CONTRACT_MIN_REVERTIBLE_SIDE_EFFECT_COUNTER_OFFSET: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_INDEX_L2_TO_L1_MSG_OFFSET.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_INDEX_L2_TO_L1_MSG_OFFSET.html new file mode 100644 index 000000000000..12453bb27d97 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_INDEX_L2_TO_L1_MSG_OFFSET.html @@ -0,0 +1,583 @@ + + + + + + +Global GLOBAL_INDEX_L2_TO_L1_MSG_OFFSET documentation + + + + + +
+ +

Global GLOBAL_INDEX_L2_TO_L1_MSG_OFFSET

+
pub global GLOBAL_INDEX_L2_TO_L1_MSG_OFFSET: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_INDEX_NOTE_HASH_OFFSET.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_INDEX_NOTE_HASH_OFFSET.html new file mode 100644 index 000000000000..176c28609e02 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_INDEX_NOTE_HASH_OFFSET.html @@ -0,0 +1,583 @@ + + + + + + +Global GLOBAL_INDEX_NOTE_HASH_OFFSET documentation + + + + + +
+ +

Global GLOBAL_INDEX_NOTE_HASH_OFFSET

+
pub global GLOBAL_INDEX_NOTE_HASH_OFFSET: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_INDEX_NOTE_HASH_READ_REQUEST_OFFSET.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_INDEX_NOTE_HASH_READ_REQUEST_OFFSET.html new file mode 100644 index 000000000000..a4bdbd3de8a0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_INDEX_NOTE_HASH_READ_REQUEST_OFFSET.html @@ -0,0 +1,583 @@ + + + + + + +Global GLOBAL_INDEX_NOTE_HASH_READ_REQUEST_OFFSET documentation + + + + + +
+ +

Global GLOBAL_INDEX_NOTE_HASH_READ_REQUEST_OFFSET

+
pub global GLOBAL_INDEX_NOTE_HASH_READ_REQUEST_OFFSET: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_INDEX_NULLIFIER_OFFSET.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_INDEX_NULLIFIER_OFFSET.html new file mode 100644 index 000000000000..f04460ed1459 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_INDEX_NULLIFIER_OFFSET.html @@ -0,0 +1,583 @@ + + + + + + +Global GLOBAL_INDEX_NULLIFIER_OFFSET documentation + + + + + +
+ +

Global GLOBAL_INDEX_NULLIFIER_OFFSET

+
pub global GLOBAL_INDEX_NULLIFIER_OFFSET: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_INDEX_NULLIFIER_READ_REQUEST_OFFSET.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_INDEX_NULLIFIER_READ_REQUEST_OFFSET.html new file mode 100644 index 000000000000..b589b756e321 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_INDEX_NULLIFIER_READ_REQUEST_OFFSET.html @@ -0,0 +1,583 @@ + + + + + + +Global GLOBAL_INDEX_NULLIFIER_READ_REQUEST_OFFSET documentation + + + + + +
+ +

Global GLOBAL_INDEX_NULLIFIER_READ_REQUEST_OFFSET

+
pub global GLOBAL_INDEX_NULLIFIER_READ_REQUEST_OFFSET: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_INDEX_PRIVATE_CALL_REQUEST_OFFSET.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_INDEX_PRIVATE_CALL_REQUEST_OFFSET.html new file mode 100644 index 000000000000..e23bc99ea364 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_INDEX_PRIVATE_CALL_REQUEST_OFFSET.html @@ -0,0 +1,583 @@ + + + + + + +Global GLOBAL_INDEX_PRIVATE_CALL_REQUEST_OFFSET documentation + + + + + +
+ +

Global GLOBAL_INDEX_PRIVATE_CALL_REQUEST_OFFSET

+
pub global GLOBAL_INDEX_PRIVATE_CALL_REQUEST_OFFSET: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_INDEX_PRIVATE_LOG_OFFSET.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_INDEX_PRIVATE_LOG_OFFSET.html new file mode 100644 index 000000000000..7e30d8927650 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_INDEX_PRIVATE_LOG_OFFSET.html @@ -0,0 +1,583 @@ + + + + + + +Global GLOBAL_INDEX_PRIVATE_LOG_OFFSET documentation + + + + + +
+ +

Global GLOBAL_INDEX_PRIVATE_LOG_OFFSET

+
pub global GLOBAL_INDEX_PRIVATE_LOG_OFFSET: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_INDEX_PUBLIC_CALL_REQUEST_OFFSET.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_INDEX_PUBLIC_CALL_REQUEST_OFFSET.html new file mode 100644 index 000000000000..2a1733e0b0c7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_INDEX_PUBLIC_CALL_REQUEST_OFFSET.html @@ -0,0 +1,583 @@ + + + + + + +Global GLOBAL_INDEX_PUBLIC_CALL_REQUEST_OFFSET documentation + + + + + +
+ +

Global GLOBAL_INDEX_PUBLIC_CALL_REQUEST_OFFSET

+
pub global GLOBAL_INDEX_PUBLIC_CALL_REQUEST_OFFSET: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_VARIABLES_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_VARIABLES_LENGTH.html new file mode 100644 index 000000000000..81295b736590 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GLOBAL_VARIABLES_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global GLOBAL_VARIABLES_LENGTH documentation + + + + + +
+ +

Global GLOBAL_VARIABLES_LENGTH

+
pub global GLOBAL_VARIABLES_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GRUMPKIN_ONE_X.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GRUMPKIN_ONE_X.html new file mode 100644 index 000000000000..b96d72002bac --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GRUMPKIN_ONE_X.html @@ -0,0 +1,583 @@ + + + + + + +Global GRUMPKIN_ONE_X documentation + + + + + +
+ +

Global GRUMPKIN_ONE_X

+
pub global GRUMPKIN_ONE_X: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GRUMPKIN_ONE_Y.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GRUMPKIN_ONE_Y.html new file mode 100644 index 000000000000..45c2195e32d2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.GRUMPKIN_ONE_Y.html @@ -0,0 +1,583 @@ + + + + + + +Global GRUMPKIN_ONE_Y documentation + + + + + +
+ +

Global GRUMPKIN_ONE_Y

+
pub global GRUMPKIN_ONE_Y: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.HIDING_KERNEL_IO_PUBLIC_INPUTS_SIZE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.HIDING_KERNEL_IO_PUBLIC_INPUTS_SIZE.html new file mode 100644 index 000000000000..073ca055d41f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.HIDING_KERNEL_IO_PUBLIC_INPUTS_SIZE.html @@ -0,0 +1,583 @@ + + + + + + +Global HIDING_KERNEL_IO_PUBLIC_INPUTS_SIZE documentation + + + + + +
+ +

Global HIDING_KERNEL_IO_PUBLIC_INPUTS_SIZE

+
pub global HIDING_KERNEL_IO_PUBLIC_INPUTS_SIZE: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.HIDING_KERNEL_TO_PUBLIC_VK_INDEX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.HIDING_KERNEL_TO_PUBLIC_VK_INDEX.html new file mode 100644 index 000000000000..90f76517fbb6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.HIDING_KERNEL_TO_PUBLIC_VK_INDEX.html @@ -0,0 +1,583 @@ + + + + + + +Global HIDING_KERNEL_TO_PUBLIC_VK_INDEX documentation + + + + + +
+ +

Global HIDING_KERNEL_TO_PUBLIC_VK_INDEX

+
pub comptime global HIDING_KERNEL_TO_PUBLIC_VK_INDEX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.HIDING_KERNEL_TO_ROLLUP_VK_INDEX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.HIDING_KERNEL_TO_ROLLUP_VK_INDEX.html new file mode 100644 index 000000000000..24c84cdf97f3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.HIDING_KERNEL_TO_ROLLUP_VK_INDEX.html @@ -0,0 +1,583 @@ + + + + + + +Global HIDING_KERNEL_TO_ROLLUP_VK_INDEX documentation + + + + + +
+ +

Global HIDING_KERNEL_TO_ROLLUP_VK_INDEX

+
pub comptime global HIDING_KERNEL_TO_ROLLUP_VK_INDEX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.INITIAL_CHECKPOINT_NUMBER.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.INITIAL_CHECKPOINT_NUMBER.html new file mode 100644 index 000000000000..20070fe9c653 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.INITIAL_CHECKPOINT_NUMBER.html @@ -0,0 +1,583 @@ + + + + + + +Global INITIAL_CHECKPOINT_NUMBER documentation + + + + + +
+ +

Global INITIAL_CHECKPOINT_NUMBER

+
pub global INITIAL_CHECKPOINT_NUMBER: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.INITIAL_L2_BLOCK_NUM.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.INITIAL_L2_BLOCK_NUM.html new file mode 100644 index 000000000000..7f3e302c4be8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.INITIAL_L2_BLOCK_NUM.html @@ -0,0 +1,583 @@ + + + + + + +Global INITIAL_L2_BLOCK_NUM documentation + + + + + +
+ +

Global INITIAL_L2_BLOCK_NUM

+
pub global INITIAL_L2_BLOCK_NUM: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.IPA_CLAIM_SIZE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.IPA_CLAIM_SIZE.html new file mode 100644 index 000000000000..ee74d1e4c4ed --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.IPA_CLAIM_SIZE.html @@ -0,0 +1,583 @@ + + + + + + +Global IPA_CLAIM_SIZE documentation + + + + + +
+ +

Global IPA_CLAIM_SIZE

+
pub global IPA_CLAIM_SIZE: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.IPA_PROOF_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.IPA_PROOF_LENGTH.html new file mode 100644 index 000000000000..7983a16b27a4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.IPA_PROOF_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global IPA_PROOF_LENGTH documentation + + + + + +
+ +

Global IPA_PROOF_LENGTH

+
pub global IPA_PROOF_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH.html new file mode 100644 index 000000000000..5facb2e206cf --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH documentation + + + + + +
+ +

Global KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH

+
pub global KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.KEY_VALIDATION_REQUEST_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.KEY_VALIDATION_REQUEST_LENGTH.html new file mode 100644 index 000000000000..6f31776dca43 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.KEY_VALIDATION_REQUEST_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global KEY_VALIDATION_REQUEST_LENGTH documentation + + + + + +
+ +

Global KEY_VALIDATION_REQUEST_LENGTH

+
pub global KEY_VALIDATION_REQUEST_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L1_TO_L2_MESSAGE_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L1_TO_L2_MESSAGE_LENGTH.html new file mode 100644 index 000000000000..5e434f74343c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L1_TO_L2_MESSAGE_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global L1_TO_L2_MESSAGE_LENGTH documentation + + + + + +
+ +

Global L1_TO_L2_MESSAGE_LENGTH

+
pub global L1_TO_L2_MESSAGE_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L1_TO_L2_MESSAGE_TREE_ID.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L1_TO_L2_MESSAGE_TREE_ID.html new file mode 100644 index 000000000000..bfdbb816c8de --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L1_TO_L2_MESSAGE_TREE_ID.html @@ -0,0 +1,583 @@ + + + + + + +Global L1_TO_L2_MESSAGE_TREE_ID documentation + + + + + +
+ +

Global L1_TO_L2_MESSAGE_TREE_ID

+
pub global L1_TO_L2_MESSAGE_TREE_ID: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L1_TO_L2_MSG_SUBTREE_HEIGHT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L1_TO_L2_MSG_SUBTREE_HEIGHT.html new file mode 100644 index 000000000000..9590ed18dd54 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L1_TO_L2_MSG_SUBTREE_HEIGHT.html @@ -0,0 +1,583 @@ + + + + + + +Global L1_TO_L2_MSG_SUBTREE_HEIGHT documentation + + + + + +
+ +

Global L1_TO_L2_MSG_SUBTREE_HEIGHT

+
pub global L1_TO_L2_MSG_SUBTREE_HEIGHT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH.html new file mode 100644 index 000000000000..0aae79be6f61 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH documentation + + + + + +
+ +

Global L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH

+
pub global L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L1_TO_L2_MSG_TREE_HEIGHT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L1_TO_L2_MSG_TREE_HEIGHT.html new file mode 100644 index 000000000000..cf4053a62d0d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L1_TO_L2_MSG_TREE_HEIGHT.html @@ -0,0 +1,583 @@ + + + + + + +Global L1_TO_L2_MSG_TREE_HEIGHT documentation + + + + + +
+ +

Global L1_TO_L2_MSG_TREE_HEIGHT

+
pub global L1_TO_L2_MSG_TREE_HEIGHT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L1_TO_L2_MSG_TREE_LEAF_COUNT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L1_TO_L2_MSG_TREE_LEAF_COUNT.html new file mode 100644 index 000000000000..603ac42d74c3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L1_TO_L2_MSG_TREE_LEAF_COUNT.html @@ -0,0 +1,583 @@ + + + + + + +Global L1_TO_L2_MSG_TREE_LEAF_COUNT documentation + + + + + +
+ +

Global L1_TO_L2_MSG_TREE_LEAF_COUNT

+
pub global L1_TO_L2_MSG_TREE_LEAF_COUNT: u64;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L2_GAS_DISTRIBUTED_STORAGE_PREMIUM.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L2_GAS_DISTRIBUTED_STORAGE_PREMIUM.html new file mode 100644 index 000000000000..ff5467399bb6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L2_GAS_DISTRIBUTED_STORAGE_PREMIUM.html @@ -0,0 +1,583 @@ + + + + + + +Global L2_GAS_DISTRIBUTED_STORAGE_PREMIUM documentation + + + + + +
+ +

Global L2_GAS_DISTRIBUTED_STORAGE_PREMIUM

+
pub global L2_GAS_DISTRIBUTED_STORAGE_PREMIUM: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L2_GAS_PER_CONTRACT_CLASS_LOG.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L2_GAS_PER_CONTRACT_CLASS_LOG.html new file mode 100644 index 000000000000..46e4ac2013b7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L2_GAS_PER_CONTRACT_CLASS_LOG.html @@ -0,0 +1,583 @@ + + + + + + +Global L2_GAS_PER_CONTRACT_CLASS_LOG documentation + + + + + +
+ +

Global L2_GAS_PER_CONTRACT_CLASS_LOG

+
pub global L2_GAS_PER_CONTRACT_CLASS_LOG: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L2_GAS_PER_L2_TO_L1_MSG.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L2_GAS_PER_L2_TO_L1_MSG.html new file mode 100644 index 000000000000..5a77dc8d9347 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L2_GAS_PER_L2_TO_L1_MSG.html @@ -0,0 +1,583 @@ + + + + + + +Global L2_GAS_PER_L2_TO_L1_MSG documentation + + + + + +
+ +

Global L2_GAS_PER_L2_TO_L1_MSG

+
pub global L2_GAS_PER_L2_TO_L1_MSG: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L2_GAS_PER_NOTE_HASH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L2_GAS_PER_NOTE_HASH.html new file mode 100644 index 000000000000..506206d1eeb4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L2_GAS_PER_NOTE_HASH.html @@ -0,0 +1,583 @@ + + + + + + +Global L2_GAS_PER_NOTE_HASH documentation + + + + + +
+ +

Global L2_GAS_PER_NOTE_HASH

+
pub global L2_GAS_PER_NOTE_HASH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L2_GAS_PER_NULLIFIER.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L2_GAS_PER_NULLIFIER.html new file mode 100644 index 000000000000..764dc22e84c2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L2_GAS_PER_NULLIFIER.html @@ -0,0 +1,583 @@ + + + + + + +Global L2_GAS_PER_NULLIFIER documentation + + + + + +
+ +

Global L2_GAS_PER_NULLIFIER

+
pub global L2_GAS_PER_NULLIFIER: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L2_GAS_PER_PRIVATE_LOG.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L2_GAS_PER_PRIVATE_LOG.html new file mode 100644 index 000000000000..c08dcd96d44f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L2_GAS_PER_PRIVATE_LOG.html @@ -0,0 +1,583 @@ + + + + + + +Global L2_GAS_PER_PRIVATE_LOG documentation + + + + + +
+ +

Global L2_GAS_PER_PRIVATE_LOG

+
pub global L2_GAS_PER_PRIVATE_LOG: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L2_TO_L1_MESSAGE_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L2_TO_L1_MESSAGE_LENGTH.html new file mode 100644 index 000000000000..460a42c8c05f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.L2_TO_L1_MESSAGE_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global L2_TO_L1_MESSAGE_LENGTH documentation + + + + + +
+ +

Global L2_TO_L1_MESSAGE_LENGTH

+
pub global L2_TO_L1_MESSAGE_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.LOG_HASH_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.LOG_HASH_LENGTH.html new file mode 100644 index 000000000000..5449fbd19e4e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.LOG_HASH_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global LOG_HASH_LENGTH documentation + + + + + +
+ +

Global LOG_HASH_LENGTH

+
pub global LOG_HASH_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_CONTRACT_CLASS_LOGS_PER_CALL.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_CONTRACT_CLASS_LOGS_PER_CALL.html new file mode 100644 index 000000000000..3c54980a4279 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_CONTRACT_CLASS_LOGS_PER_CALL.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_CONTRACT_CLASS_LOGS_PER_CALL documentation + + + + + +
+ +

Global MAX_CONTRACT_CLASS_LOGS_PER_CALL

+
pub global MAX_CONTRACT_CLASS_LOGS_PER_CALL: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_CONTRACT_CLASS_LOGS_PER_TX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_CONTRACT_CLASS_LOGS_PER_TX.html new file mode 100644 index 000000000000..d057185d3754 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_CONTRACT_CLASS_LOGS_PER_TX.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_CONTRACT_CLASS_LOGS_PER_TX documentation + + + + + +
+ +

Global MAX_CONTRACT_CLASS_LOGS_PER_TX

+
pub global MAX_CONTRACT_CLASS_LOGS_PER_TX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_ENQUEUED_CALLS_PER_CALL.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_ENQUEUED_CALLS_PER_CALL.html new file mode 100644 index 000000000000..3770d4f6fef0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_ENQUEUED_CALLS_PER_CALL.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_ENQUEUED_CALLS_PER_CALL documentation + + + + + +
+ +

Global MAX_ENQUEUED_CALLS_PER_CALL

+
pub global MAX_ENQUEUED_CALLS_PER_CALL: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_ENQUEUED_CALLS_PER_TX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_ENQUEUED_CALLS_PER_TX.html new file mode 100644 index 000000000000..b61b558dc9af --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_ENQUEUED_CALLS_PER_TX.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_ENQUEUED_CALLS_PER_TX documentation + + + + + +
+ +

Global MAX_ENQUEUED_CALLS_PER_TX

+
pub global MAX_ENQUEUED_CALLS_PER_TX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_FIELD_VALUE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_FIELD_VALUE.html new file mode 100644 index 000000000000..eaf9dda05f2c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_FIELD_VALUE.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_FIELD_VALUE documentation + + + + + +
+ +

Global MAX_FIELD_VALUE

+
pub global MAX_FIELD_VALUE: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_FR_CALLDATA_TO_ALL_ENQUEUED_CALLS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_FR_CALLDATA_TO_ALL_ENQUEUED_CALLS.html new file mode 100644 index 000000000000..121c124e2830 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_FR_CALLDATA_TO_ALL_ENQUEUED_CALLS.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_FR_CALLDATA_TO_ALL_ENQUEUED_CALLS documentation + + + + + +
+ +

Global MAX_FR_CALLDATA_TO_ALL_ENQUEUED_CALLS

+
pub global MAX_FR_CALLDATA_TO_ALL_ENQUEUED_CALLS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_INCLUDE_BY_TIMESTAMP_DURATION.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_INCLUDE_BY_TIMESTAMP_DURATION.html new file mode 100644 index 000000000000..64d5bacb6d57 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_INCLUDE_BY_TIMESTAMP_DURATION.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_INCLUDE_BY_TIMESTAMP_DURATION documentation + + + + + +
+ +

Global MAX_INCLUDE_BY_TIMESTAMP_DURATION

+
pub global MAX_INCLUDE_BY_TIMESTAMP_DURATION: u64;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_KEY_VALIDATION_REQUESTS_PER_CALL.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_KEY_VALIDATION_REQUESTS_PER_CALL.html new file mode 100644 index 000000000000..8300554dfb05 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_KEY_VALIDATION_REQUESTS_PER_CALL.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_KEY_VALIDATION_REQUESTS_PER_CALL documentation + + + + + +
+ +

Global MAX_KEY_VALIDATION_REQUESTS_PER_CALL

+
pub global MAX_KEY_VALIDATION_REQUESTS_PER_CALL: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_KEY_VALIDATION_REQUESTS_PER_TX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_KEY_VALIDATION_REQUESTS_PER_TX.html new file mode 100644 index 000000000000..6bdb9913c15c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_KEY_VALIDATION_REQUESTS_PER_TX.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_KEY_VALIDATION_REQUESTS_PER_TX documentation + + + + + +
+ +

Global MAX_KEY_VALIDATION_REQUESTS_PER_TX

+
pub global MAX_KEY_VALIDATION_REQUESTS_PER_TX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_L2_TO_L1_MSGS_PER_CALL.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_L2_TO_L1_MSGS_PER_CALL.html new file mode 100644 index 000000000000..ae9c9dc04155 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_L2_TO_L1_MSGS_PER_CALL.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_L2_TO_L1_MSGS_PER_CALL documentation + + + + + +
+ +

Global MAX_L2_TO_L1_MSGS_PER_CALL

+
pub global MAX_L2_TO_L1_MSGS_PER_CALL: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_L2_TO_L1_MSGS_PER_TX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_L2_TO_L1_MSGS_PER_TX.html new file mode 100644 index 000000000000..14ddbfcec8db --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_L2_TO_L1_MSGS_PER_TX.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_L2_TO_L1_MSGS_PER_TX documentation + + + + + +
+ +

Global MAX_L2_TO_L1_MSGS_PER_TX

+
pub global MAX_L2_TO_L1_MSGS_PER_TX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_L2_TO_L1_MSG_SUBTREES_PER_TX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_L2_TO_L1_MSG_SUBTREES_PER_TX.html new file mode 100644 index 000000000000..6f667ac19258 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_L2_TO_L1_MSG_SUBTREES_PER_TX.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_L2_TO_L1_MSG_SUBTREES_PER_TX documentation + + + + + +
+ +

Global MAX_L2_TO_L1_MSG_SUBTREES_PER_TX

+
pub global MAX_L2_TO_L1_MSG_SUBTREES_PER_TX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_NOTE_HASHES_PER_CALL.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_NOTE_HASHES_PER_CALL.html new file mode 100644 index 000000000000..0b83c7b7ab63 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_NOTE_HASHES_PER_CALL.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_NOTE_HASHES_PER_CALL documentation + + + + + +
+ +

Global MAX_NOTE_HASHES_PER_CALL

+
pub global MAX_NOTE_HASHES_PER_CALL: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_NOTE_HASHES_PER_TX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_NOTE_HASHES_PER_TX.html new file mode 100644 index 000000000000..e85189d4c7b9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_NOTE_HASHES_PER_TX.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_NOTE_HASHES_PER_TX documentation + + + + + +
+ +

Global MAX_NOTE_HASHES_PER_TX

+
pub global MAX_NOTE_HASHES_PER_TX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_NOTE_HASH_READ_REQUESTS_PER_CALL.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_NOTE_HASH_READ_REQUESTS_PER_CALL.html new file mode 100644 index 000000000000..f28309fd4d42 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_NOTE_HASH_READ_REQUESTS_PER_CALL.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_NOTE_HASH_READ_REQUESTS_PER_CALL documentation + + + + + +
+ +

Global MAX_NOTE_HASH_READ_REQUESTS_PER_CALL

+
pub global MAX_NOTE_HASH_READ_REQUESTS_PER_CALL: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_NOTE_HASH_READ_REQUESTS_PER_TX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_NOTE_HASH_READ_REQUESTS_PER_TX.html new file mode 100644 index 000000000000..d47319f02f64 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_NOTE_HASH_READ_REQUESTS_PER_TX.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_NOTE_HASH_READ_REQUESTS_PER_TX documentation + + + + + +
+ +

Global MAX_NOTE_HASH_READ_REQUESTS_PER_TX

+
pub global MAX_NOTE_HASH_READ_REQUESTS_PER_TX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_NULLIFIERS_PER_CALL.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_NULLIFIERS_PER_CALL.html new file mode 100644 index 000000000000..e83f6ca261da --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_NULLIFIERS_PER_CALL.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_NULLIFIERS_PER_CALL documentation + + + + + +
+ +

Global MAX_NULLIFIERS_PER_CALL

+
pub global MAX_NULLIFIERS_PER_CALL: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_NULLIFIERS_PER_TX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_NULLIFIERS_PER_TX.html new file mode 100644 index 000000000000..0ee3dabaf3d3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_NULLIFIERS_PER_TX.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_NULLIFIERS_PER_TX documentation + + + + + +
+ +

Global MAX_NULLIFIERS_PER_TX

+
pub global MAX_NULLIFIERS_PER_TX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_NULLIFIER_READ_REQUESTS_PER_CALL.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_NULLIFIER_READ_REQUESTS_PER_CALL.html new file mode 100644 index 000000000000..9bb7442c0919 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_NULLIFIER_READ_REQUESTS_PER_CALL.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_NULLIFIER_READ_REQUESTS_PER_CALL documentation + + + + + +
+ +

Global MAX_NULLIFIER_READ_REQUESTS_PER_CALL

+
pub global MAX_NULLIFIER_READ_REQUESTS_PER_CALL: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_NULLIFIER_READ_REQUESTS_PER_TX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_NULLIFIER_READ_REQUESTS_PER_TX.html new file mode 100644 index 000000000000..26ddffe545e7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_NULLIFIER_READ_REQUESTS_PER_TX.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_NULLIFIER_READ_REQUESTS_PER_TX documentation + + + + + +
+ +

Global MAX_NULLIFIER_READ_REQUESTS_PER_TX

+
pub global MAX_NULLIFIER_READ_REQUESTS_PER_TX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS.html new file mode 100644 index 000000000000..ee3cca403b05 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS documentation + + + + + +
+ +

Global MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS

+
pub global MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PACKED_BYTECODE_SIZE_PER_UTILITY_FUNCTION_IN_FIELDS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PACKED_BYTECODE_SIZE_PER_UTILITY_FUNCTION_IN_FIELDS.html new file mode 100644 index 000000000000..384408b9a145 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PACKED_BYTECODE_SIZE_PER_UTILITY_FUNCTION_IN_FIELDS.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_PACKED_BYTECODE_SIZE_PER_UTILITY_FUNCTION_IN_FIELDS documentation + + + + + +
+ +

Global MAX_PACKED_BYTECODE_SIZE_PER_UTILITY_FUNCTION_IN_FIELDS

+
pub global MAX_PACKED_BYTECODE_SIZE_PER_UTILITY_FUNCTION_IN_FIELDS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS.html new file mode 100644 index 000000000000..dbb6efb5b189 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS documentation + + + + + +
+ +

Global MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS

+
pub global MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL.html new file mode 100644 index 000000000000..dca01d2191b5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL documentation + + + + + +
+ +

Global MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL

+
pub global MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX.html new file mode 100644 index 000000000000..7b3de9b55989 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX documentation + + + + + +
+ +

Global MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX

+
pub global MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PRIVATE_LOGS_PER_CALL.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PRIVATE_LOGS_PER_CALL.html new file mode 100644 index 000000000000..306dc4075a54 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PRIVATE_LOGS_PER_CALL.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_PRIVATE_LOGS_PER_CALL documentation + + + + + +
+ +

Global MAX_PRIVATE_LOGS_PER_CALL

+
pub global MAX_PRIVATE_LOGS_PER_CALL: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PRIVATE_LOGS_PER_TX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PRIVATE_LOGS_PER_TX.html new file mode 100644 index 000000000000..46ccd7aa1424 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PRIVATE_LOGS_PER_TX.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_PRIVATE_LOGS_PER_TX documentation + + + + + +
+ +

Global MAX_PRIVATE_LOGS_PER_TX

+
pub global MAX_PRIVATE_LOGS_PER_TX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT.html new file mode 100644 index 000000000000..24f1affc755b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT documentation + + + + + +
+ +

Global MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT

+
pub global MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PROTOCOL_CONTRACTS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PROTOCOL_CONTRACTS.html new file mode 100644 index 000000000000..3bb8c81c7980 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PROTOCOL_CONTRACTS.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_PROTOCOL_CONTRACTS documentation + + + + + +
+ +

Global MAX_PROTOCOL_CONTRACTS

+
pub global MAX_PROTOCOL_CONTRACTS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PUBLIC_BYTECODE_SIZE_IN_BYTES.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PUBLIC_BYTECODE_SIZE_IN_BYTES.html new file mode 100644 index 000000000000..c12716c486e4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PUBLIC_BYTECODE_SIZE_IN_BYTES.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_PUBLIC_BYTECODE_SIZE_IN_BYTES documentation + + + + + +
+ +

Global MAX_PUBLIC_BYTECODE_SIZE_IN_BYTES

+
pub global MAX_PUBLIC_BYTECODE_SIZE_IN_BYTES: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PUBLIC_CALLS_TO_UNIQUE_CONTRACT_CLASS_IDS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PUBLIC_CALLS_TO_UNIQUE_CONTRACT_CLASS_IDS.html new file mode 100644 index 000000000000..00a390aff3c9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PUBLIC_CALLS_TO_UNIQUE_CONTRACT_CLASS_IDS.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_PUBLIC_CALLS_TO_UNIQUE_CONTRACT_CLASS_IDS documentation + + + + + +
+ +

Global MAX_PUBLIC_CALLS_TO_UNIQUE_CONTRACT_CLASS_IDS

+
pub global MAX_PUBLIC_CALLS_TO_UNIQUE_CONTRACT_CLASS_IDS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PUBLIC_DATA_READS_PER_TX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PUBLIC_DATA_READS_PER_TX.html new file mode 100644 index 000000000000..330ef08c4730 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PUBLIC_DATA_READS_PER_TX.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_PUBLIC_DATA_READS_PER_TX documentation + + + + + +
+ +

Global MAX_PUBLIC_DATA_READS_PER_TX

+
pub global MAX_PUBLIC_DATA_READS_PER_TX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX.html new file mode 100644 index 000000000000..8e0e61780ecb --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX documentation + + + + + +
+ +

Global MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX

+
pub global MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PUBLIC_LOG_SIZE_IN_FIELDS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PUBLIC_LOG_SIZE_IN_FIELDS.html new file mode 100644 index 000000000000..6bf668fca116 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_PUBLIC_LOG_SIZE_IN_FIELDS.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_PUBLIC_LOG_SIZE_IN_FIELDS documentation + + + + + +
+ +

Global MAX_PUBLIC_LOG_SIZE_IN_FIELDS

+
pub global MAX_PUBLIC_LOG_SIZE_IN_FIELDS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX.html new file mode 100644 index 000000000000..30f3cdd0aa5f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX documentation + + + + + +
+ +

Global MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX

+
pub global MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_U32_VALUE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_U32_VALUE.html new file mode 100644 index 000000000000..0904f52599d6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_U32_VALUE.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_U32_VALUE documentation + + + + + +
+ +

Global MAX_U32_VALUE

+
pub global MAX_U32_VALUE: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_U64_VALUE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_U64_VALUE.html new file mode 100644 index 000000000000..6992e4638cce --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MAX_U64_VALUE.html @@ -0,0 +1,583 @@ + + + + + + +Global MAX_U64_VALUE documentation + + + + + +
+ +

Global MAX_U64_VALUE

+
pub global MAX_U64_VALUE: u64;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MEGA_VK_LENGTH_IN_FIELDS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MEGA_VK_LENGTH_IN_FIELDS.html new file mode 100644 index 000000000000..fd106df88849 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MEGA_VK_LENGTH_IN_FIELDS.html @@ -0,0 +1,583 @@ + + + + + + +Global MEGA_VK_LENGTH_IN_FIELDS documentation + + + + + +
+ +

Global MEGA_VK_LENGTH_IN_FIELDS

+
pub global MEGA_VK_LENGTH_IN_FIELDS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MEM_TAG_FF.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MEM_TAG_FF.html new file mode 100644 index 000000000000..7b1223874a06 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MEM_TAG_FF.html @@ -0,0 +1,583 @@ + + + + + + +Global MEM_TAG_FF documentation + + + + + +
+ +

Global MEM_TAG_FF

+
pub global MEM_TAG_FF: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MEM_TAG_U1.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MEM_TAG_U1.html new file mode 100644 index 000000000000..61bf8d5b3e06 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MEM_TAG_U1.html @@ -0,0 +1,583 @@ + + + + + + +Global MEM_TAG_U1 documentation + + + + + +
+ +

Global MEM_TAG_U1

+
pub global MEM_TAG_U1: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MEM_TAG_U128.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MEM_TAG_U128.html new file mode 100644 index 000000000000..0a430634b426 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MEM_TAG_U128.html @@ -0,0 +1,583 @@ + + + + + + +Global MEM_TAG_U128 documentation + + + + + +
+ +

Global MEM_TAG_U128

+
pub global MEM_TAG_U128: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MEM_TAG_U16.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MEM_TAG_U16.html new file mode 100644 index 000000000000..003889254583 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MEM_TAG_U16.html @@ -0,0 +1,583 @@ + + + + + + +Global MEM_TAG_U16 documentation + + + + + +
+ +

Global MEM_TAG_U16

+
pub global MEM_TAG_U16: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MEM_TAG_U32.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MEM_TAG_U32.html new file mode 100644 index 000000000000..a984951fa54d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MEM_TAG_U32.html @@ -0,0 +1,583 @@ + + + + + + +Global MEM_TAG_U32 documentation + + + + + +
+ +

Global MEM_TAG_U32

+
pub global MEM_TAG_U32: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MEM_TAG_U64.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MEM_TAG_U64.html new file mode 100644 index 000000000000..c66f3bd7de4d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MEM_TAG_U64.html @@ -0,0 +1,583 @@ + + + + + + +Global MEM_TAG_U64 documentation + + + + + +
+ +

Global MEM_TAG_U64

+
pub global MEM_TAG_U64: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MEM_TAG_U8.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MEM_TAG_U8.html new file mode 100644 index 000000000000..3e9afc605b5a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MEM_TAG_U8.html @@ -0,0 +1,583 @@ + + + + + + +Global MEM_TAG_U8 documentation + + + + + +
+ +

Global MEM_TAG_U8

+
pub global MEM_TAG_U8: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MINIMUM_UPDATE_DELAY.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MINIMUM_UPDATE_DELAY.html new file mode 100644 index 000000000000..4e912cb52935 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MINIMUM_UPDATE_DELAY.html @@ -0,0 +1,583 @@ + + + + + + +Global MINIMUM_UPDATE_DELAY documentation + + + + + +
+ +

Global MINIMUM_UPDATE_DELAY

+
pub global MINIMUM_UPDATE_DELAY: u64;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MULTI_CALL_ENTRYPOINT_ADDRESS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MULTI_CALL_ENTRYPOINT_ADDRESS.html new file mode 100644 index 000000000000..e36faac30d7e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.MULTI_CALL_ENTRYPOINT_ADDRESS.html @@ -0,0 +1,583 @@ + + + + + + +Global MULTI_CALL_ENTRYPOINT_ADDRESS documentation + + + + + +
+ +

Global MULTI_CALL_ENTRYPOINT_ADDRESS

+
pub global MULTI_CALL_ENTRYPOINT_ADDRESS: AztecAddress;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NESTED_RECURSIVE_PROOF_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NESTED_RECURSIVE_PROOF_LENGTH.html new file mode 100644 index 000000000000..9fb305b3ec78 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NESTED_RECURSIVE_PROOF_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global NESTED_RECURSIVE_PROOF_LENGTH documentation + + + + + +
+ +

Global NESTED_RECURSIVE_PROOF_LENGTH

+
pub global NESTED_RECURSIVE_PROOF_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH.html new file mode 100644 index 000000000000..077d97724f72 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH documentation + + + + + +
+ +

Global NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH

+
pub global NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NOTE_HASH_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NOTE_HASH_LENGTH.html new file mode 100644 index 000000000000..8977a074b4c1 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NOTE_HASH_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global NOTE_HASH_LENGTH documentation + + + + + +
+ +

Global NOTE_HASH_LENGTH

+
pub global NOTE_HASH_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NOTE_HASH_SUBTREE_HEIGHT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NOTE_HASH_SUBTREE_HEIGHT.html new file mode 100644 index 000000000000..76269b422d42 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NOTE_HASH_SUBTREE_HEIGHT.html @@ -0,0 +1,583 @@ + + + + + + +Global NOTE_HASH_SUBTREE_HEIGHT documentation + + + + + +
+ +

Global NOTE_HASH_SUBTREE_HEIGHT

+
pub global NOTE_HASH_SUBTREE_HEIGHT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NOTE_HASH_SUBTREE_ROOT_SIBLING_PATH_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NOTE_HASH_SUBTREE_ROOT_SIBLING_PATH_LENGTH.html new file mode 100644 index 000000000000..61da45b52d73 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NOTE_HASH_SUBTREE_ROOT_SIBLING_PATH_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global NOTE_HASH_SUBTREE_ROOT_SIBLING_PATH_LENGTH documentation + + + + + +
+ +

Global NOTE_HASH_SUBTREE_ROOT_SIBLING_PATH_LENGTH

+
pub global NOTE_HASH_SUBTREE_ROOT_SIBLING_PATH_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NOTE_HASH_TREE_HEIGHT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NOTE_HASH_TREE_HEIGHT.html new file mode 100644 index 000000000000..e9a7ce7adba0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NOTE_HASH_TREE_HEIGHT.html @@ -0,0 +1,583 @@ + + + + + + +Global NOTE_HASH_TREE_HEIGHT documentation + + + + + +
+ +

Global NOTE_HASH_TREE_HEIGHT

+
pub global NOTE_HASH_TREE_HEIGHT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NOTE_HASH_TREE_ID.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NOTE_HASH_TREE_ID.html new file mode 100644 index 000000000000..5a57446f39cc --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NOTE_HASH_TREE_ID.html @@ -0,0 +1,583 @@ + + + + + + +Global NOTE_HASH_TREE_ID documentation + + + + + +
+ +

Global NOTE_HASH_TREE_ID

+
pub global NOTE_HASH_TREE_ID: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NOTE_HASH_TREE_LEAF_COUNT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NOTE_HASH_TREE_LEAF_COUNT.html new file mode 100644 index 000000000000..c7019fd156be --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NOTE_HASH_TREE_LEAF_COUNT.html @@ -0,0 +1,583 @@ + + + + + + +Global NOTE_HASH_TREE_LEAF_COUNT documentation + + + + + +
+ +

Global NOTE_HASH_TREE_LEAF_COUNT

+
pub global NOTE_HASH_TREE_LEAF_COUNT: u64;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NULLIFIER_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NULLIFIER_LENGTH.html new file mode 100644 index 000000000000..0ca23ae10268 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NULLIFIER_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global NULLIFIER_LENGTH documentation + + + + + +
+ +

Global NULLIFIER_LENGTH

+
pub global NULLIFIER_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NULLIFIER_SUBTREE_HEIGHT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NULLIFIER_SUBTREE_HEIGHT.html new file mode 100644 index 000000000000..925e408b6755 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NULLIFIER_SUBTREE_HEIGHT.html @@ -0,0 +1,583 @@ + + + + + + +Global NULLIFIER_SUBTREE_HEIGHT documentation + + + + + +
+ +

Global NULLIFIER_SUBTREE_HEIGHT

+
pub global NULLIFIER_SUBTREE_HEIGHT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NULLIFIER_SUBTREE_ROOT_SIBLING_PATH_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NULLIFIER_SUBTREE_ROOT_SIBLING_PATH_LENGTH.html new file mode 100644 index 000000000000..4a36073c57bc --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NULLIFIER_SUBTREE_ROOT_SIBLING_PATH_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global NULLIFIER_SUBTREE_ROOT_SIBLING_PATH_LENGTH documentation + + + + + +
+ +

Global NULLIFIER_SUBTREE_ROOT_SIBLING_PATH_LENGTH

+
pub global NULLIFIER_SUBTREE_ROOT_SIBLING_PATH_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NULLIFIER_TREE_HEIGHT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NULLIFIER_TREE_HEIGHT.html new file mode 100644 index 000000000000..081642bb204d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NULLIFIER_TREE_HEIGHT.html @@ -0,0 +1,583 @@ + + + + + + +Global NULLIFIER_TREE_HEIGHT documentation + + + + + +
+ +

Global NULLIFIER_TREE_HEIGHT

+
pub global NULLIFIER_TREE_HEIGHT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NULLIFIER_TREE_ID.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NULLIFIER_TREE_ID.html new file mode 100644 index 000000000000..e3e07bb700a3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NULLIFIER_TREE_ID.html @@ -0,0 +1,583 @@ + + + + + + +Global NULLIFIER_TREE_ID documentation + + + + + +
+ +

Global NULLIFIER_TREE_ID

+
pub global NULLIFIER_TREE_ID: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NULL_MSG_SENDER_CONTRACT_ADDRESS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NULL_MSG_SENDER_CONTRACT_ADDRESS.html new file mode 100644 index 000000000000..53437b1f9b64 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NULL_MSG_SENDER_CONTRACT_ADDRESS.html @@ -0,0 +1,583 @@ + + + + + + +Global NULL_MSG_SENDER_CONTRACT_ADDRESS documentation + + + + + +
+ +

Global NULL_MSG_SENDER_CONTRACT_ADDRESS

+
pub global NULL_MSG_SENDER_CONTRACT_ADDRESS: AztecAddress;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP.html new file mode 100644 index 000000000000..fab7648360e2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP.html @@ -0,0 +1,583 @@ + + + + + + +Global NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP documentation + + + + + +
+ +

Global NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP

+
pub global NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NUM_AVM_ACCUMULATED_DATA_ARRAYS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NUM_AVM_ACCUMULATED_DATA_ARRAYS.html new file mode 100644 index 000000000000..62d65917e776 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NUM_AVM_ACCUMULATED_DATA_ARRAYS.html @@ -0,0 +1,583 @@ + + + + + + +Global NUM_AVM_ACCUMULATED_DATA_ARRAYS documentation + + + + + +
+ +

Global NUM_AVM_ACCUMULATED_DATA_ARRAYS

+
pub global NUM_AVM_ACCUMULATED_DATA_ARRAYS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NUM_BASE_PARITY_PER_ROOT_PARITY.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NUM_BASE_PARITY_PER_ROOT_PARITY.html new file mode 100644 index 000000000000..1fa3a065f6ab --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NUM_BASE_PARITY_PER_ROOT_PARITY.html @@ -0,0 +1,583 @@ + + + + + + +Global NUM_BASE_PARITY_PER_ROOT_PARITY documentation + + + + + +
+ +

Global NUM_BASE_PARITY_PER_ROOT_PARITY

+
pub global NUM_BASE_PARITY_PER_ROOT_PARITY: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NUM_MSGS_PER_BASE_PARITY.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NUM_MSGS_PER_BASE_PARITY.html new file mode 100644 index 000000000000..2a683b3fbeb5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NUM_MSGS_PER_BASE_PARITY.html @@ -0,0 +1,583 @@ + + + + + + +Global NUM_MSGS_PER_BASE_PARITY documentation + + + + + +
+ +

Global NUM_MSGS_PER_BASE_PARITY

+
pub global NUM_MSGS_PER_BASE_PARITY: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NUM_PRIVATE_TO_AVM_ACCUMULATED_DATA_ARRAYS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NUM_PRIVATE_TO_AVM_ACCUMULATED_DATA_ARRAYS.html new file mode 100644 index 000000000000..3751cf75ad63 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NUM_PRIVATE_TO_AVM_ACCUMULATED_DATA_ARRAYS.html @@ -0,0 +1,583 @@ + + + + + + +Global NUM_PRIVATE_TO_AVM_ACCUMULATED_DATA_ARRAYS documentation + + + + + +
+ +

Global NUM_PRIVATE_TO_AVM_ACCUMULATED_DATA_ARRAYS

+
pub global NUM_PRIVATE_TO_AVM_ACCUMULATED_DATA_ARRAYS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NUM_PUBLIC_CALL_REQUEST_ARRAYS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NUM_PUBLIC_CALL_REQUEST_ARRAYS.html new file mode 100644 index 000000000000..7ee5ceb9ec3d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.NUM_PUBLIC_CALL_REQUEST_ARRAYS.html @@ -0,0 +1,583 @@ + + + + + + +Global NUM_PUBLIC_CALL_REQUEST_ARRAYS documentation + + + + + +
+ +

Global NUM_PUBLIC_CALL_REQUEST_ARRAYS

+
pub global NUM_PUBLIC_CALL_REQUEST_ARRAYS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PAIRING_POINTS_SIZE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PAIRING_POINTS_SIZE.html new file mode 100644 index 000000000000..885ffd54c36b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PAIRING_POINTS_SIZE.html @@ -0,0 +1,583 @@ + + + + + + +Global PAIRING_POINTS_SIZE documentation + + + + + +
+ +

Global PAIRING_POINTS_SIZE

+
pub global PAIRING_POINTS_SIZE: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PARITY_BASE_VK_INDEX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PARITY_BASE_VK_INDEX.html new file mode 100644 index 000000000000..cf231c3275f4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PARITY_BASE_VK_INDEX.html @@ -0,0 +1,583 @@ + + + + + + +Global PARITY_BASE_VK_INDEX documentation + + + + + +
+ +

Global PARITY_BASE_VK_INDEX

+
pub comptime global PARITY_BASE_VK_INDEX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PARITY_ROOT_VK_INDEX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PARITY_ROOT_VK_INDEX.html new file mode 100644 index 000000000000..15e24258699e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PARITY_ROOT_VK_INDEX.html @@ -0,0 +1,583 @@ + + + + + + +Global PARITY_ROOT_VK_INDEX documentation + + + + + +
+ +

Global PARITY_ROOT_VK_INDEX

+
pub comptime global PARITY_ROOT_VK_INDEX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PARTIAL_STATE_REFERENCE_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PARTIAL_STATE_REFERENCE_LENGTH.html new file mode 100644 index 000000000000..4de031255bbe --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PARTIAL_STATE_REFERENCE_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global PARTIAL_STATE_REFERENCE_LENGTH documentation + + + + + +
+ +

Global PARTIAL_STATE_REFERENCE_LENGTH

+
pub global PARTIAL_STATE_REFERENCE_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_ACCUMULATED_DATA_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_ACCUMULATED_DATA_LENGTH.html new file mode 100644 index 000000000000..69e047e1aa2b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_ACCUMULATED_DATA_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global PRIVATE_ACCUMULATED_DATA_LENGTH documentation + + + + + +
+ +

Global PRIVATE_ACCUMULATED_DATA_LENGTH

+
pub global PRIVATE_ACCUMULATED_DATA_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_CALL_REQUEST_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_CALL_REQUEST_LENGTH.html new file mode 100644 index 000000000000..4bc94e1932df --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_CALL_REQUEST_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global PRIVATE_CALL_REQUEST_LENGTH documentation + + + + + +
+ +

Global PRIVATE_CALL_REQUEST_LENGTH

+
pub global PRIVATE_CALL_REQUEST_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH.html new file mode 100644 index 000000000000..b9bc21b19bb5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH documentation + + + + + +
+ +

Global PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH

+
pub global PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_CONTEXT_INPUTS_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_CONTEXT_INPUTS_LENGTH.html new file mode 100644 index 000000000000..5ea9541374ca --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_CONTEXT_INPUTS_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global PRIVATE_CONTEXT_INPUTS_LENGTH documentation + + + + + +
+ +

Global PRIVATE_CONTEXT_INPUTS_LENGTH

+
pub global PRIVATE_CONTEXT_INPUTS_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH.html new file mode 100644 index 000000000000..d3eb042e9fb2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global PRIVATE_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH documentation + + + + + +
+ +

Global PRIVATE_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH

+
pub global PRIVATE_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_KERNEL_INIT_INDEX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_KERNEL_INIT_INDEX.html new file mode 100644 index 000000000000..faef66204d0c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_KERNEL_INIT_INDEX.html @@ -0,0 +1,583 @@ + + + + + + +Global PRIVATE_KERNEL_INIT_INDEX documentation + + + + + +
+ +

Global PRIVATE_KERNEL_INIT_INDEX

+
pub comptime global PRIVATE_KERNEL_INIT_INDEX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_KERNEL_INNER_INDEX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_KERNEL_INNER_INDEX.html new file mode 100644 index 000000000000..2dacc0702141 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_KERNEL_INNER_INDEX.html @@ -0,0 +1,583 @@ + + + + + + +Global PRIVATE_KERNEL_INNER_INDEX documentation + + + + + +
+ +

Global PRIVATE_KERNEL_INNER_INDEX

+
pub comptime global PRIVATE_KERNEL_INNER_INDEX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_KERNEL_RESET_INDEX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_KERNEL_RESET_INDEX.html new file mode 100644 index 000000000000..eaac7dd85db6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_KERNEL_RESET_INDEX.html @@ -0,0 +1,583 @@ + + + + + + +Global PRIVATE_KERNEL_RESET_INDEX documentation + + + + + +
+ +

Global PRIVATE_KERNEL_RESET_INDEX

+
pub comptime global PRIVATE_KERNEL_RESET_INDEX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_KERNEL_TAIL_INDEX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_KERNEL_TAIL_INDEX.html new file mode 100644 index 000000000000..405ef013736d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_KERNEL_TAIL_INDEX.html @@ -0,0 +1,583 @@ + + + + + + +Global PRIVATE_KERNEL_TAIL_INDEX documentation + + + + + +
+ +

Global PRIVATE_KERNEL_TAIL_INDEX

+
pub comptime global PRIVATE_KERNEL_TAIL_INDEX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_KERNEL_TAIL_TO_PUBLIC_INDEX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_KERNEL_TAIL_TO_PUBLIC_INDEX.html new file mode 100644 index 000000000000..5f66c3511cc4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_KERNEL_TAIL_TO_PUBLIC_INDEX.html @@ -0,0 +1,583 @@ + + + + + + +Global PRIVATE_KERNEL_TAIL_TO_PUBLIC_INDEX documentation + + + + + +
+ +

Global PRIVATE_KERNEL_TAIL_TO_PUBLIC_INDEX

+
pub comptime global PRIVATE_KERNEL_TAIL_TO_PUBLIC_INDEX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_LOG_CIPHERTEXT_LEN.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_LOG_CIPHERTEXT_LEN.html new file mode 100644 index 000000000000..c677d3d3ce3d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_LOG_CIPHERTEXT_LEN.html @@ -0,0 +1,588 @@ + + + + + + +Global PRIVATE_LOG_CIPHERTEXT_LEN documentation + + + + + +
+ +

Global PRIVATE_LOG_CIPHERTEXT_LEN

+
pub global PRIVATE_LOG_CIPHERTEXT_LEN: u32;
+ +
+

A private log's ciphertext is all fields except the first one, which is called 'tag'. We call this 'ciphertext' +because, unlike public logs, it is expected that private logs are encrypted (though this is not +mandatory).

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_LOG_DATA_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_LOG_DATA_LENGTH.html new file mode 100644 index 000000000000..1e47f151fd47 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_LOG_DATA_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global PRIVATE_LOG_DATA_LENGTH documentation + + + + + +
+ +

Global PRIVATE_LOG_DATA_LENGTH

+
pub global PRIVATE_LOG_DATA_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_LOG_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_LOG_LENGTH.html new file mode 100644 index 000000000000..375be2ab1b74 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_LOG_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global PRIVATE_LOG_LENGTH documentation + + + + + +
+ +

Global PRIVATE_LOG_LENGTH

+
pub global PRIVATE_LOG_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_LOG_SIZE_IN_FIELDS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_LOG_SIZE_IN_FIELDS.html new file mode 100644 index 000000000000..05e3b32348ef --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_LOG_SIZE_IN_FIELDS.html @@ -0,0 +1,583 @@ + + + + + + +Global PRIVATE_LOG_SIZE_IN_FIELDS documentation + + + + + +
+ +

Global PRIVATE_LOG_SIZE_IN_FIELDS

+
pub global PRIVATE_LOG_SIZE_IN_FIELDS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_TO_AVM_ACCUMULATED_DATA_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_TO_AVM_ACCUMULATED_DATA_LENGTH.html new file mode 100644 index 000000000000..d2fc33f76f2a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_TO_AVM_ACCUMULATED_DATA_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global PRIVATE_TO_AVM_ACCUMULATED_DATA_LENGTH documentation + + + + + +
+ +

Global PRIVATE_TO_AVM_ACCUMULATED_DATA_LENGTH

+
pub global PRIVATE_TO_AVM_ACCUMULATED_DATA_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_TO_PUBLIC_ACCUMULATED_DATA_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_TO_PUBLIC_ACCUMULATED_DATA_LENGTH.html new file mode 100644 index 000000000000..3ff8d138e275 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_TO_PUBLIC_ACCUMULATED_DATA_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global PRIVATE_TO_PUBLIC_ACCUMULATED_DATA_LENGTH documentation + + + + + +
+ +

Global PRIVATE_TO_PUBLIC_ACCUMULATED_DATA_LENGTH

+
pub global PRIVATE_TO_PUBLIC_ACCUMULATED_DATA_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_TO_PUBLIC_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_TO_PUBLIC_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH.html new file mode 100644 index 000000000000..44363813a095 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_TO_PUBLIC_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global PRIVATE_TO_PUBLIC_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH documentation + + + + + +
+ +

Global PRIVATE_TO_PUBLIC_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH

+
pub global PRIVATE_TO_PUBLIC_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_TO_ROLLUP_ACCUMULATED_DATA_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_TO_ROLLUP_ACCUMULATED_DATA_LENGTH.html new file mode 100644 index 000000000000..3ecda84de5c5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_TO_ROLLUP_ACCUMULATED_DATA_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global PRIVATE_TO_ROLLUP_ACCUMULATED_DATA_LENGTH documentation + + + + + +
+ +

Global PRIVATE_TO_ROLLUP_ACCUMULATED_DATA_LENGTH

+
pub global PRIVATE_TO_ROLLUP_ACCUMULATED_DATA_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_TO_ROLLUP_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_TO_ROLLUP_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH.html new file mode 100644 index 000000000000..f619f4cd08f7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_TO_ROLLUP_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global PRIVATE_TO_ROLLUP_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH documentation + + + + + +
+ +

Global PRIVATE_TO_ROLLUP_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH

+
pub global PRIVATE_TO_ROLLUP_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_TX_BASE_ROLLUP_VK_INDEX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_TX_BASE_ROLLUP_VK_INDEX.html new file mode 100644 index 000000000000..b495bee124f4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_TX_BASE_ROLLUP_VK_INDEX.html @@ -0,0 +1,583 @@ + + + + + + +Global PRIVATE_TX_BASE_ROLLUP_VK_INDEX documentation + + + + + +
+ +

Global PRIVATE_TX_BASE_ROLLUP_VK_INDEX

+
pub comptime global PRIVATE_TX_BASE_ROLLUP_VK_INDEX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_VALIDATION_REQUESTS_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_VALIDATION_REQUESTS_LENGTH.html new file mode 100644 index 000000000000..163dec7730d9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PRIVATE_VALIDATION_REQUESTS_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global PRIVATE_VALIDATION_REQUESTS_LENGTH documentation + + + + + +
+ +

Global PRIVATE_VALIDATION_REQUESTS_LENGTH

+
pub global PRIVATE_VALIDATION_REQUESTS_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PROOF_TYPE_AVM.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PROOF_TYPE_AVM.html new file mode 100644 index 000000000000..9d86d729aa11 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PROOF_TYPE_AVM.html @@ -0,0 +1,583 @@ + + + + + + +Global PROOF_TYPE_AVM documentation + + + + + +
+ +

Global PROOF_TYPE_AVM

+
pub global PROOF_TYPE_AVM: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PROOF_TYPE_CHONK.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PROOF_TYPE_CHONK.html new file mode 100644 index 000000000000..02b742c08d69 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PROOF_TYPE_CHONK.html @@ -0,0 +1,583 @@ + + + + + + +Global PROOF_TYPE_CHONK documentation + + + + + +
+ +

Global PROOF_TYPE_CHONK

+
pub global PROOF_TYPE_CHONK: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PROOF_TYPE_HN.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PROOF_TYPE_HN.html new file mode 100644 index 000000000000..4916f9f89881 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PROOF_TYPE_HN.html @@ -0,0 +1,583 @@ + + + + + + +Global PROOF_TYPE_HN documentation + + + + + +
+ +

Global PROOF_TYPE_HN

+
pub global PROOF_TYPE_HN: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PROOF_TYPE_HN_FINAL.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PROOF_TYPE_HN_FINAL.html new file mode 100644 index 000000000000..5c86d3c51bec --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PROOF_TYPE_HN_FINAL.html @@ -0,0 +1,583 @@ + + + + + + +Global PROOF_TYPE_HN_FINAL documentation + + + + + +
+ +

Global PROOF_TYPE_HN_FINAL

+
pub global PROOF_TYPE_HN_FINAL: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PROOF_TYPE_HN_TAIL.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PROOF_TYPE_HN_TAIL.html new file mode 100644 index 000000000000..0c2eab3d3585 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PROOF_TYPE_HN_TAIL.html @@ -0,0 +1,583 @@ + + + + + + +Global PROOF_TYPE_HN_TAIL documentation + + + + + +
+ +

Global PROOF_TYPE_HN_TAIL

+
pub global PROOF_TYPE_HN_TAIL: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PROOF_TYPE_HONK.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PROOF_TYPE_HONK.html new file mode 100644 index 000000000000..5f1e05670a78 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PROOF_TYPE_HONK.html @@ -0,0 +1,583 @@ + + + + + + +Global PROOF_TYPE_HONK documentation + + + + + +
+ +

Global PROOF_TYPE_HONK

+
pub global PROOF_TYPE_HONK: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PROOF_TYPE_OINK.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PROOF_TYPE_OINK.html new file mode 100644 index 000000000000..17cabe107b0a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PROOF_TYPE_OINK.html @@ -0,0 +1,583 @@ + + + + + + +Global PROOF_TYPE_OINK documentation + + + + + +
+ +

Global PROOF_TYPE_OINK

+
pub global PROOF_TYPE_OINK: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PROOF_TYPE_ROLLUP_HONK.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PROOF_TYPE_ROLLUP_HONK.html new file mode 100644 index 000000000000..a0f00fe8a313 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PROOF_TYPE_ROLLUP_HONK.html @@ -0,0 +1,583 @@ + + + + + + +Global PROOF_TYPE_ROLLUP_HONK documentation + + + + + +
+ +

Global PROOF_TYPE_ROLLUP_HONK

+
pub global PROOF_TYPE_ROLLUP_HONK: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PROOF_TYPE_ROOT_ROLLUP_HONK.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PROOF_TYPE_ROOT_ROLLUP_HONK.html new file mode 100644 index 000000000000..21eeafd35e94 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PROOF_TYPE_ROOT_ROLLUP_HONK.html @@ -0,0 +1,583 @@ + + + + + + +Global PROOF_TYPE_ROOT_ROLLUP_HONK documentation + + + + + +
+ +

Global PROOF_TYPE_ROOT_ROLLUP_HONK

+
pub global PROOF_TYPE_ROOT_ROLLUP_HONK: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PROTOCOL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PROTOCOL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX.html new file mode 100644 index 000000000000..dddae0fdc2ef --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PROTOCOL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX.html @@ -0,0 +1,583 @@ + + + + + + +Global PROTOCOL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX documentation + + + + + +
+ +

Global PROTOCOL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX

+
pub global PROTOCOL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_CALL_REQUEST_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_CALL_REQUEST_LENGTH.html new file mode 100644 index 000000000000..dd954be0133b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_CALL_REQUEST_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global PUBLIC_CALL_REQUEST_LENGTH documentation + + + + + +
+ +

Global PUBLIC_CALL_REQUEST_LENGTH

+
pub global PUBLIC_CALL_REQUEST_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_CALL_STACK_ITEM_COMPRESSED_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_CALL_STACK_ITEM_COMPRESSED_LENGTH.html new file mode 100644 index 000000000000..5cbf34d28d5e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_CALL_STACK_ITEM_COMPRESSED_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global PUBLIC_CALL_STACK_ITEM_COMPRESSED_LENGTH documentation + + + + + +
+ +

Global PUBLIC_CALL_STACK_ITEM_COMPRESSED_LENGTH

+
pub global PUBLIC_CALL_STACK_ITEM_COMPRESSED_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_CHONK_VERIFIER_VK_INDEX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_CHONK_VERIFIER_VK_INDEX.html new file mode 100644 index 000000000000..c49e13a1f5d4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_CHONK_VERIFIER_VK_INDEX.html @@ -0,0 +1,583 @@ + + + + + + +Global PUBLIC_CHONK_VERIFIER_VK_INDEX documentation + + + + + +
+ +

Global PUBLIC_CHONK_VERIFIER_VK_INDEX

+
pub comptime global PUBLIC_CHONK_VERIFIER_VK_INDEX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_DATA_READ_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_DATA_READ_LENGTH.html new file mode 100644 index 000000000000..865b3cd814b8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_DATA_READ_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global PUBLIC_DATA_READ_LENGTH documentation + + + + + +
+ +

Global PUBLIC_DATA_READ_LENGTH

+
pub global PUBLIC_DATA_READ_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_DATA_SUBTREE_HEIGHT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_DATA_SUBTREE_HEIGHT.html new file mode 100644 index 000000000000..23debb92c192 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_DATA_SUBTREE_HEIGHT.html @@ -0,0 +1,583 @@ + + + + + + +Global PUBLIC_DATA_SUBTREE_HEIGHT documentation + + + + + +
+ +

Global PUBLIC_DATA_SUBTREE_HEIGHT

+
pub global PUBLIC_DATA_SUBTREE_HEIGHT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_DATA_TREE_HEIGHT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_DATA_TREE_HEIGHT.html new file mode 100644 index 000000000000..95bb44a2dfc6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_DATA_TREE_HEIGHT.html @@ -0,0 +1,583 @@ + + + + + + +Global PUBLIC_DATA_TREE_HEIGHT documentation + + + + + +
+ +

Global PUBLIC_DATA_TREE_HEIGHT

+
pub global PUBLIC_DATA_TREE_HEIGHT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_DATA_TREE_ID.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_DATA_TREE_ID.html new file mode 100644 index 000000000000..27182eaee900 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_DATA_TREE_ID.html @@ -0,0 +1,583 @@ + + + + + + +Global PUBLIC_DATA_TREE_ID documentation + + + + + +
+ +

Global PUBLIC_DATA_TREE_ID

+
pub global PUBLIC_DATA_TREE_ID: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_DATA_WRITE_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_DATA_WRITE_LENGTH.html new file mode 100644 index 000000000000..56ac4b41bb52 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_DATA_WRITE_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global PUBLIC_DATA_WRITE_LENGTH documentation + + + + + +
+ +

Global PUBLIC_DATA_WRITE_LENGTH

+
pub global PUBLIC_DATA_WRITE_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_INNER_CALL_REQUEST_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_INNER_CALL_REQUEST_LENGTH.html new file mode 100644 index 000000000000..63b345058c7d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_INNER_CALL_REQUEST_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global PUBLIC_INNER_CALL_REQUEST_LENGTH documentation + + + + + +
+ +

Global PUBLIC_INNER_CALL_REQUEST_LENGTH

+
pub global PUBLIC_INNER_CALL_REQUEST_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_LOGS_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_LOGS_LENGTH.html new file mode 100644 index 000000000000..49c3bf432be8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_LOGS_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global PUBLIC_LOGS_LENGTH documentation + + + + + +
+ +

Global PUBLIC_LOGS_LENGTH

+
pub global PUBLIC_LOGS_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_LOG_HEADER_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_LOG_HEADER_LENGTH.html new file mode 100644 index 000000000000..40a3f481bc02 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_LOG_HEADER_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global PUBLIC_LOG_HEADER_LENGTH documentation + + + + + +
+ +

Global PUBLIC_LOG_HEADER_LENGTH

+
pub global PUBLIC_LOG_HEADER_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_TX_BASE_ROLLUP_VK_INDEX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_TX_BASE_ROLLUP_VK_INDEX.html new file mode 100644 index 000000000000..8f7def599aeb --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.PUBLIC_TX_BASE_ROLLUP_VK_INDEX.html @@ -0,0 +1,583 @@ + + + + + + +Global PUBLIC_TX_BASE_ROLLUP_VK_INDEX documentation + + + + + +
+ +

Global PUBLIC_TX_BASE_ROLLUP_VK_INDEX

+
pub comptime global PUBLIC_TX_BASE_ROLLUP_VK_INDEX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.RECURSIVE_PROOF_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.RECURSIVE_PROOF_LENGTH.html new file mode 100644 index 000000000000..3ffa44e99a59 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.RECURSIVE_PROOF_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global RECURSIVE_PROOF_LENGTH documentation + + + + + +
+ +

Global RECURSIVE_PROOF_LENGTH

+
pub global RECURSIVE_PROOF_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.RECURSIVE_ROLLUP_HONK_PROOF_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.RECURSIVE_ROLLUP_HONK_PROOF_LENGTH.html new file mode 100644 index 000000000000..d2d8deb524dc --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.RECURSIVE_ROLLUP_HONK_PROOF_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global RECURSIVE_ROLLUP_HONK_PROOF_LENGTH documentation + + + + + +
+ +

Global RECURSIVE_ROLLUP_HONK_PROOF_LENGTH

+
pub global RECURSIVE_ROLLUP_HONK_PROOF_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.ROOT_ROLLUP_PUBLIC_INPUTS_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.ROOT_ROLLUP_PUBLIC_INPUTS_LENGTH.html new file mode 100644 index 000000000000..93833914611e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.ROOT_ROLLUP_PUBLIC_INPUTS_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global ROOT_ROLLUP_PUBLIC_INPUTS_LENGTH documentation + + + + + +
+ +

Global ROOT_ROLLUP_PUBLIC_INPUTS_LENGTH

+
pub global ROOT_ROLLUP_PUBLIC_INPUTS_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.ROOT_ROLLUP_VK_INDEX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.ROOT_ROLLUP_VK_INDEX.html new file mode 100644 index 000000000000..e2229cedebb6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.ROOT_ROLLUP_VK_INDEX.html @@ -0,0 +1,583 @@ + + + + + + +Global ROOT_ROLLUP_VK_INDEX documentation + + + + + +
+ +

Global ROOT_ROLLUP_VK_INDEX

+
pub comptime global ROOT_ROLLUP_VK_INDEX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.ROUTER_ADDRESS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.ROUTER_ADDRESS.html new file mode 100644 index 000000000000..a545a612e2cb --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.ROUTER_ADDRESS.html @@ -0,0 +1,583 @@ + + + + + + +Global ROUTER_ADDRESS documentation + + + + + +
+ +

Global ROUTER_ADDRESS

+
pub global ROUTER_ADDRESS: AztecAddress;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SCOPED_COUNTED_L2_TO_L1_MESSAGE_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SCOPED_COUNTED_L2_TO_L1_MESSAGE_LENGTH.html new file mode 100644 index 000000000000..fd4e03b65066 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SCOPED_COUNTED_L2_TO_L1_MESSAGE_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global SCOPED_COUNTED_L2_TO_L1_MESSAGE_LENGTH documentation + + + + + +
+ +

Global SCOPED_COUNTED_L2_TO_L1_MESSAGE_LENGTH

+
pub global SCOPED_COUNTED_L2_TO_L1_MESSAGE_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SCOPED_COUNTED_LOG_HASH_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SCOPED_COUNTED_LOG_HASH_LENGTH.html new file mode 100644 index 000000000000..3f5c91c6953c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SCOPED_COUNTED_LOG_HASH_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global SCOPED_COUNTED_LOG_HASH_LENGTH documentation + + + + + +
+ +

Global SCOPED_COUNTED_LOG_HASH_LENGTH

+
pub global SCOPED_COUNTED_LOG_HASH_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SCOPED_KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SCOPED_KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH.html new file mode 100644 index 000000000000..9937d32cb61a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SCOPED_KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global SCOPED_KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH documentation + + + + + +
+ +

Global SCOPED_KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH

+
pub global SCOPED_KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SCOPED_L2_TO_L1_MESSAGE_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SCOPED_L2_TO_L1_MESSAGE_LENGTH.html new file mode 100644 index 000000000000..1369cb0ea4c6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SCOPED_L2_TO_L1_MESSAGE_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global SCOPED_L2_TO_L1_MESSAGE_LENGTH documentation + + + + + +
+ +

Global SCOPED_L2_TO_L1_MESSAGE_LENGTH

+
pub global SCOPED_L2_TO_L1_MESSAGE_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SCOPED_LOG_HASH_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SCOPED_LOG_HASH_LENGTH.html new file mode 100644 index 000000000000..0d3fc8a07eb7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SCOPED_LOG_HASH_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global SCOPED_LOG_HASH_LENGTH documentation + + + + + +
+ +

Global SCOPED_LOG_HASH_LENGTH

+
pub global SCOPED_LOG_HASH_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SCOPED_NOTE_HASH_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SCOPED_NOTE_HASH_LENGTH.html new file mode 100644 index 000000000000..734e3ca07e23 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SCOPED_NOTE_HASH_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global SCOPED_NOTE_HASH_LENGTH documentation + + + + + +
+ +

Global SCOPED_NOTE_HASH_LENGTH

+
pub global SCOPED_NOTE_HASH_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SCOPED_NULLIFIER_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SCOPED_NULLIFIER_LENGTH.html new file mode 100644 index 000000000000..25f605e87806 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SCOPED_NULLIFIER_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global SCOPED_NULLIFIER_LENGTH documentation + + + + + +
+ +

Global SCOPED_NULLIFIER_LENGTH

+
pub global SCOPED_NULLIFIER_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SCOPED_PRIVATE_LOG_DATA_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SCOPED_PRIVATE_LOG_DATA_LENGTH.html new file mode 100644 index 000000000000..0f5e1a54bad9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SCOPED_PRIVATE_LOG_DATA_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global SCOPED_PRIVATE_LOG_DATA_LENGTH documentation + + + + + +
+ +

Global SCOPED_PRIVATE_LOG_DATA_LENGTH

+
pub global SCOPED_PRIVATE_LOG_DATA_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SCOPED_READ_REQUEST_LEN.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SCOPED_READ_REQUEST_LEN.html new file mode 100644 index 000000000000..2b1a9fed5fc6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SCOPED_READ_REQUEST_LEN.html @@ -0,0 +1,583 @@ + + + + + + +Global SCOPED_READ_REQUEST_LEN documentation + + + + + +
+ +

Global SCOPED_READ_REQUEST_LEN

+
pub global SCOPED_READ_REQUEST_LEN: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SIDE_EFFECT_MASKING_ADDRESS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SIDE_EFFECT_MASKING_ADDRESS.html new file mode 100644 index 000000000000..684408f3b039 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SIDE_EFFECT_MASKING_ADDRESS.html @@ -0,0 +1,583 @@ + + + + + + +Global SIDE_EFFECT_MASKING_ADDRESS documentation + + + + + +
+ +

Global SIDE_EFFECT_MASKING_ADDRESS

+
pub global SIDE_EFFECT_MASKING_ADDRESS: AztecAddress;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SPONGE_BLOB_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SPONGE_BLOB_LENGTH.html new file mode 100644 index 000000000000..50232fc813ec --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.SPONGE_BLOB_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global SPONGE_BLOB_LENGTH documentation + + + + + +
+ +

Global SPONGE_BLOB_LENGTH

+
pub global SPONGE_BLOB_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.STATE_REFERENCE_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.STATE_REFERENCE_LENGTH.html new file mode 100644 index 000000000000..5b59e99ace9a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.STATE_REFERENCE_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global STATE_REFERENCE_LENGTH documentation + + + + + +
+ +

Global STATE_REFERENCE_LENGTH

+
pub global STATE_REFERENCE_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TIMESTAMP_OF_CHANGE_BIT_SIZE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TIMESTAMP_OF_CHANGE_BIT_SIZE.html new file mode 100644 index 000000000000..202d25d3995f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TIMESTAMP_OF_CHANGE_BIT_SIZE.html @@ -0,0 +1,583 @@ + + + + + + +Global TIMESTAMP_OF_CHANGE_BIT_SIZE documentation + + + + + +
+ +

Global TIMESTAMP_OF_CHANGE_BIT_SIZE

+
pub global TIMESTAMP_OF_CHANGE_BIT_SIZE: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TOTAL_COUNTED_SIDE_EFFECTS_PER_CALL.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TOTAL_COUNTED_SIDE_EFFECTS_PER_CALL.html new file mode 100644 index 000000000000..a31a6f20001f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TOTAL_COUNTED_SIDE_EFFECTS_PER_CALL.html @@ -0,0 +1,583 @@ + + + + + + +Global TOTAL_COUNTED_SIDE_EFFECTS_PER_CALL documentation + + + + + +
+ +

Global TOTAL_COUNTED_SIDE_EFFECTS_PER_CALL

+
pub global TOTAL_COUNTED_SIDE_EFFECTS_PER_CALL: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TOTAL_FEES_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TOTAL_FEES_LENGTH.html new file mode 100644 index 000000000000..e8a28e7943c2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TOTAL_FEES_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global TOTAL_FEES_LENGTH documentation + + + + + +
+ +

Global TOTAL_FEES_LENGTH

+
pub global TOTAL_FEES_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TOTAL_MANA_USED_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TOTAL_MANA_USED_LENGTH.html new file mode 100644 index 000000000000..a523d003b29d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TOTAL_MANA_USED_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global TOTAL_MANA_USED_LENGTH documentation + + + + + +
+ +

Global TOTAL_MANA_USED_LENGTH

+
pub global TOTAL_MANA_USED_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TREE_LEAF_READ_REQUEST_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TREE_LEAF_READ_REQUEST_LENGTH.html new file mode 100644 index 000000000000..1c03ea920df9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TREE_LEAF_READ_REQUEST_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global TREE_LEAF_READ_REQUEST_LENGTH documentation + + + + + +
+ +

Global TREE_LEAF_READ_REQUEST_LENGTH

+
pub global TREE_LEAF_READ_REQUEST_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TREE_SNAPSHOTS_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TREE_SNAPSHOTS_LENGTH.html new file mode 100644 index 000000000000..860369775310 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TREE_SNAPSHOTS_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global TREE_SNAPSHOTS_LENGTH documentation + + + + + +
+ +

Global TREE_SNAPSHOTS_LENGTH

+
pub global TREE_SNAPSHOTS_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TWO_POW_64.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TWO_POW_64.html new file mode 100644 index 000000000000..202c47378cc6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TWO_POW_64.html @@ -0,0 +1,583 @@ + + + + + + +Global TWO_POW_64 documentation + + + + + +
+ +

Global TWO_POW_64

+
pub global TWO_POW_64: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TX_CONSTANT_DATA_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TX_CONSTANT_DATA_LENGTH.html new file mode 100644 index 000000000000..78c096d0a1f9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TX_CONSTANT_DATA_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global TX_CONSTANT_DATA_LENGTH documentation + + + + + +
+ +

Global TX_CONSTANT_DATA_LENGTH

+
pub global TX_CONSTANT_DATA_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TX_CONTEXT_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TX_CONTEXT_LENGTH.html new file mode 100644 index 000000000000..d2d09194f511 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TX_CONTEXT_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global TX_CONTEXT_LENGTH documentation + + + + + +
+ +

Global TX_CONTEXT_LENGTH

+
pub global TX_CONTEXT_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TX_MERGE_ROLLUP_VK_INDEX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TX_MERGE_ROLLUP_VK_INDEX.html new file mode 100644 index 000000000000..c92e1353211d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TX_MERGE_ROLLUP_VK_INDEX.html @@ -0,0 +1,583 @@ + + + + + + +Global TX_MERGE_ROLLUP_VK_INDEX documentation + + + + + +
+ +

Global TX_MERGE_ROLLUP_VK_INDEX

+
pub comptime global TX_MERGE_ROLLUP_VK_INDEX: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TX_REQUEST_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TX_REQUEST_LENGTH.html new file mode 100644 index 000000000000..016af82cafcb --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TX_REQUEST_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global TX_REQUEST_LENGTH documentation + + + + + +
+ +

Global TX_REQUEST_LENGTH

+
pub global TX_REQUEST_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TX_ROLLUP_PUBLIC_INPUTS_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TX_ROLLUP_PUBLIC_INPUTS_LENGTH.html new file mode 100644 index 000000000000..0202c71c1146 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TX_ROLLUP_PUBLIC_INPUTS_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global TX_ROLLUP_PUBLIC_INPUTS_LENGTH documentation + + + + + +
+ +

Global TX_ROLLUP_PUBLIC_INPUTS_LENGTH

+
pub global TX_ROLLUP_PUBLIC_INPUTS_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TX_START_PREFIX.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TX_START_PREFIX.html new file mode 100644 index 000000000000..897aebb99372 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.TX_START_PREFIX.html @@ -0,0 +1,583 @@ + + + + + + +Global TX_START_PREFIX documentation + + + + + +
+ +

Global TX_START_PREFIX

+
pub global TX_START_PREFIX: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.ULTRA_KECCAK_PROOF_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.ULTRA_KECCAK_PROOF_LENGTH.html new file mode 100644 index 000000000000..3ae91aac4712 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.ULTRA_KECCAK_PROOF_LENGTH.html @@ -0,0 +1,583 @@ + + + + + + +Global ULTRA_KECCAK_PROOF_LENGTH documentation + + + + + +
+ +

Global ULTRA_KECCAK_PROOF_LENGTH

+
pub global ULTRA_KECCAK_PROOF_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.ULTRA_VK_LENGTH_IN_FIELDS.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.ULTRA_VK_LENGTH_IN_FIELDS.html new file mode 100644 index 000000000000..ce7c90c9ba04 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.ULTRA_VK_LENGTH_IN_FIELDS.html @@ -0,0 +1,583 @@ + + + + + + +Global ULTRA_VK_LENGTH_IN_FIELDS documentation + + + + + +
+ +

Global ULTRA_VK_LENGTH_IN_FIELDS

+
pub global ULTRA_VK_LENGTH_IN_FIELDS: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.UPDATED_CLASS_IDS_SLOT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.UPDATED_CLASS_IDS_SLOT.html new file mode 100644 index 000000000000..f546884105fa --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.UPDATED_CLASS_IDS_SLOT.html @@ -0,0 +1,583 @@ + + + + + + +Global UPDATED_CLASS_IDS_SLOT documentation + + + + + +
+ +

Global UPDATED_CLASS_IDS_SLOT

+
pub global UPDATED_CLASS_IDS_SLOT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.UPDATES_DELAYED_PUBLIC_MUTABLE_METADATA_BIT_SIZE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.UPDATES_DELAYED_PUBLIC_MUTABLE_METADATA_BIT_SIZE.html new file mode 100644 index 000000000000..f048a1cc2ac4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.UPDATES_DELAYED_PUBLIC_MUTABLE_METADATA_BIT_SIZE.html @@ -0,0 +1,583 @@ + + + + + + +Global UPDATES_DELAYED_PUBLIC_MUTABLE_METADATA_BIT_SIZE documentation + + + + + +
+ +

Global UPDATES_DELAYED_PUBLIC_MUTABLE_METADATA_BIT_SIZE

+
pub global UPDATES_DELAYED_PUBLIC_MUTABLE_METADATA_BIT_SIZE: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.UPDATES_DELAYED_PUBLIC_MUTABLE_SDC_DELAY_BIT_SIZE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.UPDATES_DELAYED_PUBLIC_MUTABLE_SDC_DELAY_BIT_SIZE.html new file mode 100644 index 000000000000..8c9885051737 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.UPDATES_DELAYED_PUBLIC_MUTABLE_SDC_DELAY_BIT_SIZE.html @@ -0,0 +1,583 @@ + + + + + + +Global UPDATES_DELAYED_PUBLIC_MUTABLE_SDC_DELAY_BIT_SIZE documentation + + + + + +
+ +

Global UPDATES_DELAYED_PUBLIC_MUTABLE_SDC_DELAY_BIT_SIZE

+
pub global UPDATES_DELAYED_PUBLIC_MUTABLE_SDC_DELAY_BIT_SIZE: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.UPDATES_DELAYED_PUBLIC_MUTABLE_SDC_IS_SOME_BIT_SIZE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.UPDATES_DELAYED_PUBLIC_MUTABLE_SDC_IS_SOME_BIT_SIZE.html new file mode 100644 index 000000000000..f33882f3e204 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.UPDATES_DELAYED_PUBLIC_MUTABLE_SDC_IS_SOME_BIT_SIZE.html @@ -0,0 +1,583 @@ + + + + + + +Global UPDATES_DELAYED_PUBLIC_MUTABLE_SDC_IS_SOME_BIT_SIZE documentation + + + + + +
+ +

Global UPDATES_DELAYED_PUBLIC_MUTABLE_SDC_IS_SOME_BIT_SIZE

+
pub global UPDATES_DELAYED_PUBLIC_MUTABLE_SDC_IS_SOME_BIT_SIZE: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.UPDATES_DELAYED_PUBLIC_MUTABLE_SDC_OPTION_DELAY_BIT_SIZE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.UPDATES_DELAYED_PUBLIC_MUTABLE_SDC_OPTION_DELAY_BIT_SIZE.html new file mode 100644 index 000000000000..e49c6882a92a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.UPDATES_DELAYED_PUBLIC_MUTABLE_SDC_OPTION_DELAY_BIT_SIZE.html @@ -0,0 +1,583 @@ + + + + + + +Global UPDATES_DELAYED_PUBLIC_MUTABLE_SDC_OPTION_DELAY_BIT_SIZE documentation + + + + + +
+ +

Global UPDATES_DELAYED_PUBLIC_MUTABLE_SDC_OPTION_DELAY_BIT_SIZE

+
pub global UPDATES_DELAYED_PUBLIC_MUTABLE_SDC_OPTION_DELAY_BIT_SIZE: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.UPDATES_DELAYED_PUBLIC_MUTABLE_VALUES_LEN.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.UPDATES_DELAYED_PUBLIC_MUTABLE_VALUES_LEN.html new file mode 100644 index 000000000000..4d8928bec47d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.UPDATES_DELAYED_PUBLIC_MUTABLE_VALUES_LEN.html @@ -0,0 +1,583 @@ + + + + + + +Global UPDATES_DELAYED_PUBLIC_MUTABLE_VALUES_LEN documentation + + + + + +
+ +

Global UPDATES_DELAYED_PUBLIC_MUTABLE_VALUES_LEN

+
pub global UPDATES_DELAYED_PUBLIC_MUTABLE_VALUES_LEN: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.UPDATES_VALUE_SIZE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.UPDATES_VALUE_SIZE.html new file mode 100644 index 000000000000..1dac79eb5fd9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.UPDATES_VALUE_SIZE.html @@ -0,0 +1,583 @@ + + + + + + +Global UPDATES_VALUE_SIZE documentation + + + + + +
+ +

Global UPDATES_VALUE_SIZE

+
pub global UPDATES_VALUE_SIZE: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.VK_TREE_HEIGHT.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.VK_TREE_HEIGHT.html new file mode 100644 index 000000000000..741c41dfd0be --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/global.VK_TREE_HEIGHT.html @@ -0,0 +1,583 @@ + + + + + + +Global VK_TREE_HEIGHT documentation + + + + + +
+ +

Global VK_TREE_HEIGHT

+
pub global VK_TREE_HEIGHT: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/index.html new file mode 100644 index 000000000000..8bcbf996017f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/constants/index.html @@ -0,0 +1,621 @@ + + + + + + +Module constants documentation + + + + + +
+ +

Module constants

+

Globals

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/content_commitment/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/content_commitment/index.html new file mode 100644 index 000000000000..6afe2677bad3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/content_commitment/index.html @@ -0,0 +1,64 @@ + + + + + + +Module content_commitment documentation + + + + + +
+
aztec-nr - protocol_types::content_commitment
+

Module content_commitment

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/content_commitment/struct.ContentCommitment.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/content_commitment/struct.ContentCommitment.html new file mode 100644 index 000000000000..04e1c2826999 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/content_commitment/struct.ContentCommitment.html @@ -0,0 +1,76 @@ + + + + + + +Struct ContentCommitment documentation + + + + + +
+ +

Struct ContentCommitment

+
pub struct ContentCommitment {
+    pub blobs_hash: Field,
+    pub in_hash: Field,
+    pub out_hash: Field,
+}
+
+

Fields

+
blobs_hash: Field
+
in_hash: Field
+
out_hash: Field
+

Trait implementations

+

impl Deserialize for ContentCommitment

+ +
pub fn deserialize(serialized: [Field; 3]) -> Self + +

impl Empty for ContentCommitment

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for ContentCommitment

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for ContentCommitment

+ +
pub fn serialize(self) -> [Field; 3] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/contract_class_id/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/contract_class_id/index.html new file mode 100644 index 000000000000..1b99ac8f478f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/contract_class_id/index.html @@ -0,0 +1,64 @@ + + + + + + +Module contract_class_id documentation + + + + + +
+
aztec-nr - protocol_types::contract_class_id
+

Module contract_class_id

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/contract_class_id/struct.ContractClassId.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/contract_class_id/struct.ContractClassId.html new file mode 100644 index 000000000000..cbba95b8dc1d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/contract_class_id/struct.ContractClassId.html @@ -0,0 +1,103 @@ + + + + + + +Struct ContractClassId documentation + + + + + +
+ +

Struct ContractClassId

+
pub struct ContractClassId {
+    pub inner: Field,
+}
+
+

Fields

+
inner: Field
+

Implementations

+

impl ContractClassId

+ +
pub fn compute( + artifact_hash: Field, + private_functions_root: Field, + public_bytecode_commitment: Field, +) -> Self + +pub fn assert_is_zero(self) + +

Trait implementations

+

impl Deserialize for ContractClassId

+ +
pub fn deserialize(serialized: [Field; 1]) -> Self + +

impl Empty for ContractClassId

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for ContractClassId

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl FromField for ContractClassId

+ +
pub fn from_field(value: Field) -> Self + +

impl Packable for ContractClassId

+ +
pub fn pack(self) -> [Field; 1] + +pub fn unpack(packed: [Field; 1]) -> Self + +

impl Serialize for ContractClassId

+ +
pub fn serialize(self) -> [Field; 1] + +

impl ToField for ContractClassId

+ +
pub fn to_field(self) -> Field + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/contract_instance/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/contract_instance/index.html new file mode 100644 index 000000000000..4be45b26818a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/contract_instance/index.html @@ -0,0 +1,64 @@ + + + + + + +Module contract_instance documentation + + + + + +
+
aztec-nr - protocol_types::contract_instance
+

Module contract_instance

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/contract_instance/struct.ContractInstance.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/contract_instance/struct.ContractInstance.html new file mode 100644 index 000000000000..f95a7a2ee6a9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/contract_instance/struct.ContractInstance.html @@ -0,0 +1,87 @@ + + + + + + +Struct ContractInstance documentation + + + + + +
+ +

Struct ContractInstance

+
pub struct ContractInstance {
+    pub salt: Field,
+    pub deployer: AztecAddress,
+    pub contract_class_id: ContractClassId,
+    pub initialization_hash: Field,
+    pub public_keys: PublicKeys,
+}
+
+

Fields

+
salt: Field
+
deployer: AztecAddress
+
contract_class_id: ContractClassId
+
initialization_hash: Field
+
public_keys: PublicKeys
+

Implementations

+

impl ContractInstance

+ +
pub fn to_address(self) -> AztecAddress + +

Trait implementations

+

impl Deserialize for ContractInstance

+ +
pub fn deserialize(serialized: [Field; 16]) -> Self + +

impl Eq for ContractInstance

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Hash for ContractInstance

+ +
pub fn hash(self) -> Field + +

impl Serialize for ContractInstance

+ +
pub fn serialize(self) -> [Field; 16] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/data/hash/fn.compute_public_data_leaf_slot.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/data/hash/fn.compute_public_data_leaf_slot.html new file mode 100644 index 000000000000..188dfb207e8c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/data/hash/fn.compute_public_data_leaf_slot.html @@ -0,0 +1,36 @@ + + + + + + +Function compute_public_data_leaf_slot documentation + + + + + +
+ +

Function compute_public_data_leaf_slot

+
pub fn compute_public_data_leaf_slot(
+    contract_address: AztecAddress,
+    storage_slot: Field,
+) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/data/hash/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/data/hash/index.html new file mode 100644 index 000000000000..c0c6062c6180 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/data/hash/index.html @@ -0,0 +1,41 @@ + + + + + + +Module hash documentation + + + + + +
+ +

Module hash

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/data/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/data/index.html new file mode 100644 index 000000000000..9b18c7da70ee --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/data/index.html @@ -0,0 +1,71 @@ + + + + + + +Module data documentation + + + + + +
+ +

Module data

+

Re-exports

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/data/public_data_tree_leaf/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/data/public_data_tree_leaf/index.html new file mode 100644 index 000000000000..3ac762c230e8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/data/public_data_tree_leaf/index.html @@ -0,0 +1,41 @@ + + + + + + +Module public_data_tree_leaf documentation + + + + + +
+
aztec-nr - protocol_types::data::public_data_tree_leaf
+

Module public_data_tree_leaf

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/data/public_data_tree_leaf/struct.PublicDataTreeLeaf.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/data/public_data_tree_leaf/struct.PublicDataTreeLeaf.html new file mode 100644 index 000000000000..d8247c74d2b2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/data/public_data_tree_leaf/struct.PublicDataTreeLeaf.html @@ -0,0 +1,77 @@ + + + + + + +Struct PublicDataTreeLeaf documentation + + + + + +
+ +

Struct PublicDataTreeLeaf

+
pub struct PublicDataTreeLeaf {
+    pub slot: Field,
+    pub value: Field,
+}
+
+

Fields

+
slot: Field
+
value: Field
+

Implementations

+

impl PublicDataTreeLeaf

+ +
pub fn is_empty(self) -> bool + +

Trait implementations

+

impl Empty for PublicDataTreeLeaf

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for PublicDataTreeLeaf

+ +
pub fn eq(self, other: Self) -> bool + +

impl IndexedTreeLeafValue for PublicDataTreeLeaf

+ +
pub fn get_key(self) -> Field + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/data/public_data_tree_leaf_preimage/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/data/public_data_tree_leaf_preimage/index.html new file mode 100644 index 000000000000..837672adc75e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/data/public_data_tree_leaf_preimage/index.html @@ -0,0 +1,41 @@ + + + + + + +Module public_data_tree_leaf_preimage documentation + + + + + +
+
aztec-nr - protocol_types::data::public_data_tree_leaf_preimage
+

Module public_data_tree_leaf_preimage

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/data/public_data_tree_leaf_preimage/struct.PublicDataTreeLeafPreimage.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/data/public_data_tree_leaf_preimage/struct.PublicDataTreeLeafPreimage.html new file mode 100644 index 000000000000..a31c9c6f62e5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/data/public_data_tree_leaf_preimage/struct.PublicDataTreeLeafPreimage.html @@ -0,0 +1,113 @@ + + + + + + +Struct PublicDataTreeLeafPreimage documentation + + + + + +
+ +

Struct PublicDataTreeLeafPreimage

+
pub struct PublicDataTreeLeafPreimage {
+    pub slot: Field,
+    pub value: Field,
+    pub next_slot: Field,
+    pub next_index: Field,
+}
+
+

Fields

+
slot: Field
+
value: Field
+
next_slot: Field
+
next_index: Field
+

Implementations

+

impl PublicDataTreeLeafPreimage

+ +
pub fn is_empty(self) -> bool + +

Trait implementations

+

impl Deserialize for PublicDataTreeLeafPreimage

+ +
pub fn deserialize(serialized: [Field; 4]) -> Self + +

impl Empty for PublicDataTreeLeafPreimage

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for PublicDataTreeLeafPreimage

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Hash for PublicDataTreeLeafPreimage

+ +
pub fn hash(self) -> Field + +

impl IndexedTreeLeafPreimage<PublicDataTreeLeaf> for PublicDataTreeLeafPreimage

+ +
pub fn get_next_key(self) -> Field + +pub fn points_to_infinity(self) -> bool + +pub fn update_pointers(self, next_slot: Field, next_index: Field) -> Self + +pub fn update_value(self, write: PublicDataTreeLeaf) -> Self + +pub fn build_insertion_leaf(write: PublicDataTreeLeaf, low_leaf: Self) -> Self + +

impl LeafPreimage for PublicDataTreeLeafPreimage

+ +
pub fn get_key(self) -> Field + +pub fn as_leaf(self) -> Field + +

impl Serialize for PublicDataTreeLeafPreimage

+ +
pub fn serialize(self) -> [Field; 4] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug/fn.no_op.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug/fn.no_op.html new file mode 100644 index 000000000000..617fbf023bff --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug/fn.no_op.html @@ -0,0 +1,33 @@ + + + + + + +Function no_op documentation + + + + + +
+ +

Function no_op

+
pub fn no_op<T>(value: T)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug/index.html new file mode 100644 index 000000000000..2d48e42127bb --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug/index.html @@ -0,0 +1,64 @@ + + + + + + +Module debug documentation + + + + + +
+ +

Module debug

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/fn.debug_log.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/fn.debug_log.html new file mode 100644 index 000000000000..bedae1a52ca9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/fn.debug_log.html @@ -0,0 +1,52 @@ + + + + + + +Function debug_log documentation + + + + + +
+ +

Function debug_log

+
pub fn debug_log<let N: u32>(msg: str<N>)
+ +
+

Utility function to console.log data in the acir simulator. +Example: +debug_log("blah blah this is a debug string");

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/fn.debug_log_format.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/fn.debug_log_format.html new file mode 100644 index 000000000000..366868171e9e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/fn.debug_log_format.html @@ -0,0 +1,54 @@ + + + + + + +Function debug_log_format documentation + + + + + +
+ +

Function debug_log_format

+
pub fn debug_log_format<let M: u32, let N: u32>(msg: str<M>, args: [Field; N])
+ +
+

Utility function to console.log data in the acir simulator. This variant receives a format string in which the +${k} tokens will be replaced with the k-eth value in the args array. +Examples: +debug_log_format("get_2(slot:{0}) =>\n\t0:{1}\n\t1:{2}", [storage_slot, note0_hash, note1_hash]); +debug_log_format("whole array: {}", [e1, e2, e3, e4]);

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/fn.debug_log_format_slice.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/fn.debug_log_format_slice.html new file mode 100644 index 000000000000..b2a8090fd8f1 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/fn.debug_log_format_slice.html @@ -0,0 +1,58 @@ + + + + + + +Function debug_log_format_slice documentation + + + + + +
+ +

Function debug_log_format_slice

+
pub fn debug_log_format_slice<let M: u32>(
+    log_level: u8,
+    msg: str<M>,
+    args: [Field],
+)
+ +
+

Utility function to console.log data in the acir simulator. This variant receives a format string in which the +${k} tokens will be replaced with the k-eth value in the args slice. +Examples: +debug_log_format("get_2(slot:{0}) =>\n\t0:{1}\n\t1:{2}", [storage_slot, note0_hash, note1_hash]); +debug_log_format("whole slice: {}", [e1, e2, e3, e4]);

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/fn.debug_log_format_with_level.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/fn.debug_log_format_with_level.html new file mode 100644 index 000000000000..9b577baa3052 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/fn.debug_log_format_with_level.html @@ -0,0 +1,55 @@ + + + + + + +Function debug_log_format_with_level documentation + + + + + +
+ +

Function debug_log_format_with_level

+
pub fn debug_log_format_with_level<let M: u32, let N: u32>(
+    log_level: u8,
+    msg: str<M>,
+    args: [Field; N],
+)
+ +
+

Same as debug_log_format, but allows to customize the log level. +Consider changing just to 'log_format'

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/fn.debug_log_with_level.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/fn.debug_log_with_level.html new file mode 100644 index 000000000000..2af303baf508 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/fn.debug_log_with_level.html @@ -0,0 +1,51 @@ + + + + + + +Function debug_log_with_level documentation + + + + + +
+ +

Function debug_log_with_level

+
pub fn debug_log_with_level<let N: u32>(log_level: u8, msg: str<N>)
+ +
+

Same as debug_log, but allows to customize the log level. +Consider changing just to 'log'

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/global.DEBUG_LOG_LEVEL.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/global.DEBUG_LOG_LEVEL.html new file mode 100644 index 000000000000..3fd3a31f04b2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/global.DEBUG_LOG_LEVEL.html @@ -0,0 +1,47 @@ + + + + + + +Global DEBUG_LOG_LEVEL documentation + + + + + +
+ +

Global DEBUG_LOG_LEVEL

+
pub global DEBUG_LOG_LEVEL: u8;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/global.ERROR_LOG_LEVEL.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/global.ERROR_LOG_LEVEL.html new file mode 100644 index 000000000000..42c7976d8554 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/global.ERROR_LOG_LEVEL.html @@ -0,0 +1,47 @@ + + + + + + +Global ERROR_LOG_LEVEL documentation + + + + + +
+ +

Global ERROR_LOG_LEVEL

+
pub global ERROR_LOG_LEVEL: u8;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/global.FATAL_LOG_LEVEL.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/global.FATAL_LOG_LEVEL.html new file mode 100644 index 000000000000..1d3b4cbd4e23 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/global.FATAL_LOG_LEVEL.html @@ -0,0 +1,47 @@ + + + + + + +Global FATAL_LOG_LEVEL documentation + + + + + +
+ +

Global FATAL_LOG_LEVEL

+
pub global FATAL_LOG_LEVEL: u8;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/global.INFO_LOG_LEVEL.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/global.INFO_LOG_LEVEL.html new file mode 100644 index 000000000000..dbd269aeb749 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/global.INFO_LOG_LEVEL.html @@ -0,0 +1,47 @@ + + + + + + +Global INFO_LOG_LEVEL documentation + + + + + +
+ +

Global INFO_LOG_LEVEL

+
pub global INFO_LOG_LEVEL: u8;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/global.SILENT_LOG_LEVEL.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/global.SILENT_LOG_LEVEL.html new file mode 100644 index 000000000000..79cb19b91da9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/global.SILENT_LOG_LEVEL.html @@ -0,0 +1,47 @@ + + + + + + +Global SILENT_LOG_LEVEL documentation + + + + + +
+ +

Global SILENT_LOG_LEVEL

+
pub global SILENT_LOG_LEVEL: u8;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/global.TRACE_LOG_LEVEL.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/global.TRACE_LOG_LEVEL.html new file mode 100644 index 000000000000..9eb83d98a370 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/global.TRACE_LOG_LEVEL.html @@ -0,0 +1,47 @@ + + + + + + +Global TRACE_LOG_LEVEL documentation + + + + + +
+ +

Global TRACE_LOG_LEVEL

+
pub global TRACE_LOG_LEVEL: u8;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/global.VERBOSE_LOG_LEVEL.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/global.VERBOSE_LOG_LEVEL.html new file mode 100644 index 000000000000..a9db313f785f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/global.VERBOSE_LOG_LEVEL.html @@ -0,0 +1,47 @@ + + + + + + +Global VERBOSE_LOG_LEVEL documentation + + + + + +
+ +

Global VERBOSE_LOG_LEVEL

+
pub global VERBOSE_LOG_LEVEL: u8;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/global.WARN_LOG_LEVEL.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/global.WARN_LOG_LEVEL.html new file mode 100644 index 000000000000..41ce8f070f06 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/global.WARN_LOG_LEVEL.html @@ -0,0 +1,47 @@ + + + + + + +Global WARN_LOG_LEVEL documentation + + + + + +
+ +

Global WARN_LOG_LEVEL

+
pub global WARN_LOG_LEVEL: u8;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/index.html new file mode 100644 index 000000000000..8fb8498deffe --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/debug_log/index.html @@ -0,0 +1,91 @@ + + + + + + +Module debug_log documentation + + + + + +
+ +

Module debug_log

+

Functions

    +
  • Utility function to console.log data in the acir simulator. +Example: +debug_log("blah blah this is a debug string");
  • +
  • Utility function to console.log data in the acir simulator. This variant receives a format string in which the +${k} tokens will be replaced with the k-eth value in the args array. +Examples: +debug_log_format("get_2(slot:{0}) =>\n\t0:{1}\n\t1:{2}", [storage_slot, note0_hash, note1_hash]); +debug_log_format("whole array: {}", [e1, e2, e3, e4]);
  • +
  • Utility function to console.log data in the acir simulator. This variant receives a format string in which the +${k} tokens will be replaced with the k-eth value in the args slice. +Examples: +debug_log_format("get_2(slot:{0}) =>\n\t0:{1}\n\t1:{2}", [storage_slot, note0_hash, note1_hash]); +debug_log_format("whole slice: {}", [e1, e2, e3, e4]);
  • +
  • Same as debug_log_format, but allows to customize the log level. +Consider changing just to 'log_format'
  • +
  • Same as debug_log, but allows to customize the log level. +Consider changing just to 'log'
  • +
+

Globals

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/delayed_public_mutable_values/fn.unpack_delay_change.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/delayed_public_mutable_values/fn.unpack_delay_change.html new file mode 100644 index 000000000000..4433c8c31bd9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/delayed_public_mutable_values/fn.unpack_delay_change.html @@ -0,0 +1,39 @@ + + + + + + +Function unpack_delay_change documentation + + + + + +
+ +

Function unpack_delay_change

+
pub fn unpack_delay_change<let INITIAL_DELAY: u64>(
+    packed: Field,
+) -> ScheduledDelayChange<INITIAL_DELAY>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/delayed_public_mutable_values/fn.unpack_value_change.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/delayed_public_mutable_values/fn.unpack_value_change.html new file mode 100644 index 000000000000..735bd5f77b47 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/delayed_public_mutable_values/fn.unpack_value_change.html @@ -0,0 +1,41 @@ + + + + + + +Function unpack_value_change documentation + + + + + +
+ +

Function unpack_value_change

+
pub fn unpack_value_change<T, let M: u32>(
+    packed: [Field; M * 2 + 1],
+) -> ScheduledValueChange<T>
+
where + T: Packable<N = M>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/delayed_public_mutable_values/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/delayed_public_mutable_values/index.html new file mode 100644 index 000000000000..980308258001 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/delayed_public_mutable_values/index.html @@ -0,0 +1,51 @@ + + + + + + +Module delayed_public_mutable_values documentation + + + + + +
+
aztec-nr - protocol_types::delayed_public_mutable::delayed_public_mutable_values
+

Module delayed_public_mutable_values

+

Structs

    +
  • DelayedPublicMutableValues is just a wrapper around ScheduledValueChange and ScheduledDelayChange that then allows us +to wrap both of these values in WithHash. WithHash allows for efficient read of values in private.
  • +
+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/delayed_public_mutable_values/struct.DelayedPublicMutableValues.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/delayed_public_mutable_values/struct.DelayedPublicMutableValues.html new file mode 100644 index 000000000000..0d60ac034c19 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/delayed_public_mutable_values/struct.DelayedPublicMutableValues.html @@ -0,0 +1,98 @@ + + + + + + +Struct DelayedPublicMutableValues documentation + + + + + +
+ +

Struct DelayedPublicMutableValues

+
pub struct DelayedPublicMutableValues<T, let INITIAL_DELAY: u64> {
+    pub svc: ScheduledValueChange<T>,
+    pub sdc: ScheduledDelayChange<INITIAL_DELAY>,
+}
+
+
+

DelayedPublicMutableValues is just a wrapper around ScheduledValueChange and ScheduledDelayChange that then allows us +to wrap both of these values in WithHash. WithHash allows for efficient read of values in private.

+

Note that the WithHash optimization does not work in public (due to there being no unconstrained). But we also want +to be able to read the values efficiently in public and we want to be able to read each value separately. Reading +the values separately is tricky because ScheduledValueChange and ScheduledDelayChange are packed together (sdc and +svc.timestamp_of_change are stored in the same slot). For that reason we expose unpack_value_change and +unpack_delay_change functions that can be used to extract the values from the packed representation. This +is "hacky" but there is no way around it.

+
+

Fields

+ +
sdc: ScheduledDelayChange<INITIAL_DELAY>
+

Implementations

+

impl<let INITIAL_DELAY: u64, T> DelayedPublicMutableValues<T, INITIAL_DELAY>

+ +
pub fn new( + svc: ScheduledValueChange<T>, + sdc: ScheduledDelayChange<INITIAL_DELAY>, +) -> Self + +

Trait implementations

+

impl<let INITIAL_DELAY: u64, T> Eq for DelayedPublicMutableValues<T, INITIAL_DELAY> +
where + T: Eq

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl<let INITIAL_DELAY: u64, T> Hash for DelayedPublicMutableValues<T, INITIAL_DELAY> +
where + T: Packable

+ +
pub fn hash(self) -> Field + +

impl<let INITIAL_DELAY: u64, T> Packable for DelayedPublicMutableValues<T, INITIAL_DELAY> +
where + T: Packable

+ +
pub fn pack(self) -> [Field; <T as Packable>::N * 2 + 1] + +pub fn unpack(fields: [Field; <T as Packable>::N * 2 + 1]) -> Self + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/fn.compute_delayed_public_mutable_time_horizon.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/fn.compute_delayed_public_mutable_time_horizon.html new file mode 100644 index 000000000000..961cf25ca43d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/fn.compute_delayed_public_mutable_time_horizon.html @@ -0,0 +1,46 @@ + + + + + + +Function compute_delayed_public_mutable_time_horizon documentation + + + + + +
+ +

Function compute_delayed_public_mutable_time_horizon

+
pub fn compute_delayed_public_mutable_time_horizon<T, let INITIAL_DELAY: u64>(
+    delayed_public_mutable_values: DelayedPublicMutableValues<T, INITIAL_DELAY>,
+    anchor_timestamp: u64,
+) -> u64
+
where + T: ToField, + T: Eq, + T: FromField
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/index.html new file mode 100644 index 000000000000..e291d3203a08 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/index.html @@ -0,0 +1,77 @@ + + + + + + +Module delayed_public_mutable documentation + + + + + +
+
aztec-nr - protocol_types::delayed_public_mutable
+

Module delayed_public_mutable

+

Re-exports

+

Modules

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/scheduled_delay_change/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/scheduled_delay_change/index.html new file mode 100644 index 000000000000..92b7b2d617c3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/scheduled_delay_change/index.html @@ -0,0 +1,45 @@ + + + + + + +Module scheduled_delay_change documentation + + + + + +
+ +

Module scheduled_delay_change

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/scheduled_delay_change/struct.ScheduledDelayChange.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/scheduled_delay_change/struct.ScheduledDelayChange.html new file mode 100644 index 000000000000..3ea72c832bcd --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/scheduled_delay_change/struct.ScheduledDelayChange.html @@ -0,0 +1,105 @@ + + + + + + +Struct ScheduledDelayChange documentation + + + + + +
+ +

Struct ScheduledDelayChange

+
pub struct ScheduledDelayChange<let INITIAL_DELAY: u64>
+{ /* private fields */ }
+
+

Implementations

+

impl<let INITIAL_DELAY: u64> ScheduledDelayChange<INITIAL_DELAY>

+ +
pub fn new(pre: Option<u64>, post: Option<u64>, timestamp_of_change: u64) -> Self + +pub fn get_current(self, current_timestamp: u64) -> u64 + +
+

Returns the current value of the delay stored in the data structure. +This function only returns a meaningful value when called in public with the current timestamp - for +historical private reads use get_effective_minimum_delay_at instead.

+
+
pub fn get_scheduled(self) -> (u64, u64) + +
+

Returns the scheduled change, i.e. the post-change delay and the timestamp at which it will become the current +delay. Note that this timestamp may be in the past if the change has already taken place. +Additionally, further changes might be later scheduled, potentially canceling the one returned by this function.

+
+
pub fn schedule_change(&mut self, new: u64, current_timestamp: u64) + +
+

Mutates the delay change by scheduling a change at the current timestamp. This function is only meaningful +when called in public with the current timestamp. +The timestamp at which the new delay will become effective is determined automatically:

+
    +
  • when increasing the delay, the change is effective immediately
  • +
  • when reducing the delay, the change will take effect after a delay equal to the difference between old and +new delay. For example, if reducing from 3 days to 1 day, the reduction will be scheduled to happen after 2 +days.
  • +
+
+
pub fn get_effective_minimum_delay_at(self, historical_timestamp: u64) -> u64 + +
+

Returns the minimum delay before a value might mutate due to a scheduled change, from the perspective of some +historical timestamp. It only returns a meaningful value when called in private with historical timestamps. +This function can be used alongside ScheduledValueChange.get_time_horizon to properly constrain +the include_by_timestamp transaction property when reading delayed mutable state. +This value typically equals the current delay at the timestamp following the historical one (the earliest one in +which a value change could be scheduled), but it also considers scenarios in which a delay reduction is +scheduled to happen in the near future, resulting in a way to schedule a change with an overall delay lower than +the current one.

+
+

Trait implementations

+

impl<let INITIAL_DELAY: u64> Empty for ScheduledDelayChange<INITIAL_DELAY>

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl<let INITIAL_DELAY: u64> Eq for ScheduledDelayChange<INITIAL_DELAY>

+ +
pub fn eq(self, other: Self) -> bool + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/scheduled_value_change/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/scheduled_value_change/index.html new file mode 100644 index 000000000000..28c021968165 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/scheduled_value_change/index.html @@ -0,0 +1,45 @@ + + + + + + +Module scheduled_value_change documentation + + + + + +
+ +

Module scheduled_value_change

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/scheduled_value_change/struct.ScheduledValueChange.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/scheduled_value_change/struct.ScheduledValueChange.html new file mode 100644 index 000000000000..2316bd7bd1ba --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/scheduled_value_change/struct.ScheduledValueChange.html @@ -0,0 +1,116 @@ + + + + + + +Struct ScheduledValueChange documentation + + + + + +
+ +

Struct ScheduledValueChange

+
pub struct ScheduledValueChange<T>
+{ /* private fields */ }
+
+

Implementations

+

impl<T> ScheduledValueChange<T>

+ +
pub fn new(pre: T, post: T, timestamp_of_change: u64) -> Self + +pub fn get_current_at(self, timestamp: u64) -> T + +
+

Returns the value stored in the data structure at a given timestamp. This function can be called both in public +(where timestamp is simply the current timestamp, i.e. the timestamp at which the current transaction will be +included) and in private (where timestamp is the anchor block's timestamp). Reading in private is only safe +if the transaction's include_by_timestamp property is set to a value lower or equal to the time horizon (see +get_time_horizon()).

+
+
pub fn get_scheduled(self) -> (T, u64) + +
+

Returns the scheduled change, i.e. the post-change value and the timestamp at which it will become the current +value. Note that this timestamp may be in the past if the change has already taken place. +Additionally, further changes might be later scheduled, potentially canceling the one returned by this function.

+
+
pub fn get_previous(self) -> (T, u64) + +pub fn get_time_horizon(self, anchor_timestamp: u64, minimum_delay: u64) -> u64 + +
+

Returns the largest timestamp at which the value returned by get_current_at is known to remain the current +value. This value is only meaningful in private where the proof is constructed against an anchor block, since +due to its asynchronous nature private execution cannot know about any later scheduled changes. +The caller of this function must know how quickly the value can change due to a scheduled change in the form of +minimum_delay. If the delay itself is immutable, then this is just its duration. If the delay is mutable +however, then this value is the 'effective minimum delay' (obtained by calling +ScheduledDelayChange.get_effective_minimum_delay_at), which equals the minimum time in seconds that needs to +elapse from the next block's timestamp until the value changes, regardless of further delay changes. +The value returned by get_current_at in private when called with a anchor block's timestamp is only safe to use +if the transaction's include_by_timestamp property is set to a value lower or equal to the time horizon +computed using the same anchor timestamp.

+
+
pub fn schedule_change( + &mut self, + new_value: T, + current_timestamp: u64, + minimum_delay: u64, + timestamp_of_change: u64, +) + +
+

Mutates the value by scheduling a change at the current timestamp. This function is only meaningful when +called in public with the current timestamp.

+
+

Trait implementations

+

impl<T> Empty for ScheduledValueChange<T> +
where + T: Empty

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl<T> Eq for ScheduledValueChange<T> +
where + T: Eq

+ +
pub fn eq(self, other: Self) -> bool + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/with_hash/fn.compute_with_hash_hash_storage_slot.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/with_hash/fn.compute_with_hash_hash_storage_slot.html new file mode 100644 index 000000000000..1225a25ec3ff --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/with_hash/fn.compute_with_hash_hash_storage_slot.html @@ -0,0 +1,36 @@ + + + + + + +Function compute_with_hash_hash_storage_slot documentation + + + + + +
+ +

Function compute_with_hash_hash_storage_slot

+
pub fn compute_with_hash_hash_storage_slot<T>(with_hash_storage_slot: Field) -> Field
+
where + T: Packable
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/with_hash/fn.validate_with_hash_hints.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/with_hash/fn.validate_with_hash_hints.html new file mode 100644 index 000000000000..185f48edbf1d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/with_hash/fn.validate_with_hash_hints.html @@ -0,0 +1,44 @@ + + + + + + +Function validate_with_hash_hints documentation + + + + + +
+ +

Function validate_with_hash_hints

+
pub fn validate_with_hash_hints<T>(
+    historical_header: BlockHeader,
+    with_hash_storage_slot: Field,
+    contract_address: AztecAddress,
+    with_hash_value_hint: T,
+    witness: MembershipWitness<40>,
+    leaf_preimage: PublicDataTreeLeafPreimage,
+)
+
where + T: Packable, + T: Eq
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/with_hash/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/with_hash/index.html new file mode 100644 index 000000000000..ab9821a396de --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/delayed_public_mutable/with_hash/index.html @@ -0,0 +1,46 @@ + + + + + + +Module with_hash documentation + + + + + +
+ +

Module with_hash

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.accumulate_sha256.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.accumulate_sha256.html new file mode 100644 index 000000000000..04422842cbb8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.accumulate_sha256.html @@ -0,0 +1,63 @@ + + + + + + +Function accumulate_sha256 documentation + + + + + +
+ +

Function accumulate_sha256

+
pub fn accumulate_sha256(v0: Field, v1: Field) -> Field
+ +
+

Computes sha256 hash of 2 input fields.

+

@returns A truncated field (i.e., the first byte is always 0).

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.compute_app_secret_key.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.compute_app_secret_key.html new file mode 100644 index 000000000000..629db9f89ace --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.compute_app_secret_key.html @@ -0,0 +1,63 @@ + + + + + + +Function compute_app_secret_key documentation + + + + + +
+ +

Function compute_app_secret_key

+
pub fn compute_app_secret_key(
+    master_secret_key: EmbeddedCurveScalar,
+    app_address: AztecAddress,
+    app_secret_generator: Field,
+) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.compute_contract_class_log_hash.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.compute_contract_class_log_hash.html new file mode 100644 index 000000000000..950e727f406d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.compute_contract_class_log_hash.html @@ -0,0 +1,59 @@ + + + + + + +Function compute_contract_class_log_hash documentation + + + + + +
+ +

Function compute_contract_class_log_hash

+
pub fn compute_contract_class_log_hash(log: [Field; 3023]) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.compute_l2_to_l1_hash.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.compute_l2_to_l1_hash.html new file mode 100644 index 000000000000..ee02e2288cea --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.compute_l2_to_l1_hash.html @@ -0,0 +1,65 @@ + + + + + + +Function compute_l2_to_l1_hash documentation + + + + + +
+ +

Function compute_l2_to_l1_hash

+
pub fn compute_l2_to_l1_hash(
+    contract_address: AztecAddress,
+    recipient: EthAddress,
+    content: Field,
+    rollup_version_id: Field,
+    chain_id: Field,
+) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.compute_nonce_and_unique_note_hash.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.compute_nonce_and_unique_note_hash.html new file mode 100644 index 000000000000..ec2e6d3e0d90 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.compute_nonce_and_unique_note_hash.html @@ -0,0 +1,63 @@ + + + + + + +Function compute_nonce_and_unique_note_hash documentation + + + + + +
+ +

Function compute_nonce_and_unique_note_hash

+
pub fn compute_nonce_and_unique_note_hash(
+    siloed_note_hash: Field,
+    first_nullifier: Field,
+    note_index_in_tx: u32,
+) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.compute_note_hash_nonce.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.compute_note_hash_nonce.html new file mode 100644 index 000000000000..80a1c3ca7a3a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.compute_note_hash_nonce.html @@ -0,0 +1,62 @@ + + + + + + +Function compute_note_hash_nonce documentation + + + + + +
+ +

Function compute_note_hash_nonce

+
pub fn compute_note_hash_nonce(
+    first_nullifier_in_tx: Field,
+    note_index_in_tx: u32,
+) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.compute_siloed_note_hash.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.compute_siloed_note_hash.html new file mode 100644 index 000000000000..8d6004fd6ae5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.compute_siloed_note_hash.html @@ -0,0 +1,59 @@ + + + + + + +Function compute_siloed_note_hash documentation + + + + + +
+ +

Function compute_siloed_note_hash

+
pub fn compute_siloed_note_hash(app: AztecAddress, note_hash: Field) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.compute_siloed_nullifier.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.compute_siloed_nullifier.html new file mode 100644 index 000000000000..67fa010e9df6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.compute_siloed_nullifier.html @@ -0,0 +1,59 @@ + + + + + + +Function compute_siloed_nullifier documentation + + + + + +
+ +

Function compute_siloed_nullifier

+
pub fn compute_siloed_nullifier(app: AztecAddress, nullifier: Field) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.compute_siloed_private_log_field.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.compute_siloed_private_log_field.html new file mode 100644 index 000000000000..763ef480a2b8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.compute_siloed_private_log_field.html @@ -0,0 +1,62 @@ + + + + + + +Function compute_siloed_private_log_field documentation + + + + + +
+ +

Function compute_siloed_private_log_field

+
pub fn compute_siloed_private_log_field(
+    contract_address: AztecAddress,
+    field: Field,
+) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.compute_unique_note_hash.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.compute_unique_note_hash.html new file mode 100644 index 000000000000..33e678a83235 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.compute_unique_note_hash.html @@ -0,0 +1,59 @@ + + + + + + +Function compute_unique_note_hash documentation + + + + + +
+ +

Function compute_unique_note_hash

+
pub fn compute_unique_note_hash(note_nonce: Field, siloed_note_hash: Field) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.compute_unique_siloed_note_hash.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.compute_unique_siloed_note_hash.html new file mode 100644 index 000000000000..982afea0143c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.compute_unique_siloed_note_hash.html @@ -0,0 +1,66 @@ + + + + + + +Function compute_unique_siloed_note_hash documentation + + + + + +
+ +

Function compute_unique_siloed_note_hash

+
pub fn compute_unique_siloed_note_hash(
+    siloed_note_hash: Field,
+    first_nullifier: Field,
+    note_index_in_tx: u32,
+) -> Field
+ +
+

Computes unique note hashes from siloed note hashes

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.create_protocol_nullifier.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.create_protocol_nullifier.html new file mode 100644 index 000000000000..0a6e632a82e4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.create_protocol_nullifier.html @@ -0,0 +1,59 @@ + + + + + + +Function create_protocol_nullifier documentation + + + + + +
+ +

Function create_protocol_nullifier

+
pub fn create_protocol_nullifier(tx_request: TxRequest) -> Scoped<Counted<Nullifier>>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.merkle_hash.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.merkle_hash.html new file mode 100644 index 000000000000..ec3b6ed27e8d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.merkle_hash.html @@ -0,0 +1,59 @@ + + + + + + +Function merkle_hash documentation + + + + + +
+ +

Function merkle_hash

+
pub fn merkle_hash(left: Field, right: Field) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.pedersen_hash.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.pedersen_hash.html new file mode 100644 index 000000000000..3f0dfb3a4350 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.pedersen_hash.html @@ -0,0 +1,59 @@ + + + + + + +Function pedersen_hash documentation + + + + + +
+ +

Function pedersen_hash

+
pub fn pedersen_hash<let N: u32>(inputs: [Field; N], hash_index: u32) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.poseidon2_absorb_in_chunks_existing_sponge.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.poseidon2_absorb_in_chunks_existing_sponge.html new file mode 100644 index 000000000000..ea92489f33aa --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.poseidon2_absorb_in_chunks_existing_sponge.html @@ -0,0 +1,63 @@ + + + + + + +Function poseidon2_absorb_in_chunks_existing_sponge documentation + + + + + +
+ +

Function poseidon2_absorb_in_chunks_existing_sponge

+
pub fn poseidon2_absorb_in_chunks_existing_sponge<let NUM_ITEMS: u32>(
+    sponge: Poseidon2Sponge,
+    input: [Field; NUM_ITEMS],
+    in_len: u32,
+) -> Poseidon2Sponge
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.poseidon2_cheaper_variable_hash.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.poseidon2_cheaper_variable_hash.html new file mode 100644 index 000000000000..500892c83653 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.poseidon2_cheaper_variable_hash.html @@ -0,0 +1,62 @@ + + + + + + +Function poseidon2_cheaper_variable_hash documentation + + + + + +
+ +

Function poseidon2_cheaper_variable_hash

+
pub fn poseidon2_cheaper_variable_hash<let N: u32>(
+    input: [Field; N],
+    in_len: u32,
+) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.poseidon2_hash.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.poseidon2_hash.html new file mode 100644 index 000000000000..724d2d28f508 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.poseidon2_hash.html @@ -0,0 +1,59 @@ + + + + + + +Function poseidon2_hash documentation + + + + + +
+ +

Function poseidon2_hash

+
pub fn poseidon2_hash<let N: u32>(inputs: [Field; N]) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.poseidon2_hash_bytes.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.poseidon2_hash_bytes.html new file mode 100644 index 000000000000..1bef201e3466 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.poseidon2_hash_bytes.html @@ -0,0 +1,59 @@ + + + + + + +Function poseidon2_hash_bytes documentation + + + + + +
+ +

Function poseidon2_hash_bytes

+
pub fn poseidon2_hash_bytes<let N: u32>(inputs: [u8; N]) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.poseidon2_hash_subarray.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.poseidon2_hash_subarray.html new file mode 100644 index 000000000000..f0ce04e10116 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.poseidon2_hash_subarray.html @@ -0,0 +1,64 @@ + + + + + + +Function poseidon2_hash_subarray documentation + + + + + +
+ +

Function poseidon2_hash_subarray

+
pub fn poseidon2_hash_subarray<let N: u32>(input: [Field; N], in_len: u32) -> Field
+ +
+

Computes a Poseidon2 hash over a dynamic-length subarray of the given input. +Only the first in_len fields of input are absorbed; any remaining fields are ignored. +The caller is responsible for ensuring that the input is padded with zeros if required.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.poseidon2_hash_with_separator.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.poseidon2_hash_with_separator.html new file mode 100644 index 000000000000..9e623fcd932c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.poseidon2_hash_with_separator.html @@ -0,0 +1,64 @@ + + + + + + +Function poseidon2_hash_with_separator documentation + + + + + +
+ +

Function poseidon2_hash_with_separator

+
pub fn poseidon2_hash_with_separator<let N: u32, T>(
+    inputs: [Field; N],
+    separator: T,
+) -> Field
+
where + T: ToField
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.poseidon2_hash_with_separator_bounded_vec.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.poseidon2_hash_with_separator_bounded_vec.html new file mode 100644 index 000000000000..aa41f6a30a8c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.poseidon2_hash_with_separator_bounded_vec.html @@ -0,0 +1,64 @@ + + + + + + +Function poseidon2_hash_with_separator_bounded_vec documentation + + + + + +
+ +

Function poseidon2_hash_with_separator_bounded_vec

+
pub unconstrained fn poseidon2_hash_with_separator_bounded_vec<let N: u32, T>(
+    inputs: BoundedVec<Field, N>,
+    separator: T,
+) -> Field
+
where + T: ToField
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.private_functions_root_from_siblings.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.private_functions_root_from_siblings.html new file mode 100644 index 000000000000..77bdac6a1ecd --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.private_functions_root_from_siblings.html @@ -0,0 +1,64 @@ + + + + + + +Function private_functions_root_from_siblings documentation + + + + + +
+ +

Function private_functions_root_from_siblings

+
pub fn private_functions_root_from_siblings(
+    selector: FunctionSelector,
+    vk_hash: Field,
+    function_leaf_index: Field,
+    function_leaf_sibling_path: [Field; 7],
+) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.sha256_to_field.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.sha256_to_field.html new file mode 100644 index 000000000000..b0d47abaf4f6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.sha256_to_field.html @@ -0,0 +1,59 @@ + + + + + + +Function sha256_to_field documentation + + + + + +
+ +

Function sha256_to_field

+
pub fn sha256_to_field<let N: u32>(bytes_to_hash: [u8; N]) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.silo_l2_to_l1_message.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.silo_l2_to_l1_message.html new file mode 100644 index 000000000000..5bc4aad3e5a9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.silo_l2_to_l1_message.html @@ -0,0 +1,63 @@ + + + + + + +Function silo_l2_to_l1_message documentation + + + + + +
+ +

Function silo_l2_to_l1_message

+
pub fn silo_l2_to_l1_message(
+    msg: Scoped<L2ToL1Message>,
+    rollup_version_id: Field,
+    chain_id: Field,
+) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.silo_note_hash.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.silo_note_hash.html new file mode 100644 index 000000000000..48028f71eb87 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.silo_note_hash.html @@ -0,0 +1,63 @@ + + + + + + +Function silo_note_hash documentation + + + + + +
+ +

Function silo_note_hash

+
pub fn silo_note_hash(note_hash: Scoped<Counted<NoteHash>>) -> Field
+ +
+

Siloing in the context of Aztec refers to the process of hashing a note hash with a contract address (this way +the note hash is scoped to a specific contract). This is used to prevent intermingling of notes between contracts.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.silo_nullifier.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.silo_nullifier.html new file mode 100644 index 000000000000..1c1921ee732c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.silo_nullifier.html @@ -0,0 +1,59 @@ + + + + + + +Function silo_nullifier documentation + + + + + +
+ +

Function silo_nullifier

+
pub fn silo_nullifier(nullifier: Scoped<Counted<Nullifier>>) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.silo_private_log.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.silo_private_log.html new file mode 100644 index 000000000000..50b99ad8ab38 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/fn.silo_private_log.html @@ -0,0 +1,59 @@ + + + + + + +Function silo_private_log documentation + + + + + +
+ +

Function silo_private_log

+
pub fn silo_private_log(private_log: Scoped<Counted<PrivateLogData>>) -> PrivateLog
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/index.html new file mode 100644 index 000000000000..b226e923c1ef --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/hash/index.html @@ -0,0 +1,93 @@ + + + + + + +Module hash documentation + + + + + +
+ +

Module hash

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/index.html new file mode 100644 index 000000000000..8d592a226115 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/index.html @@ -0,0 +1,73 @@ + + + + + + +Crate protocol_types documentation + + + + + +
+
aztec-nr - protocol_types
+

Crate protocol_types

+

Re-exports

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/append_only_tree/fn.append_leaf_to_snapshot.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/append_only_tree/fn.append_leaf_to_snapshot.html new file mode 100644 index 000000000000..61338f458cae --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/append_only_tree/fn.append_leaf_to_snapshot.html @@ -0,0 +1,38 @@ + + + + + + +Function append_leaf_to_snapshot documentation + + + + + +
+ +

Function append_leaf_to_snapshot

+
pub fn append_leaf_to_snapshot<let TreeHeight: u32>(
+    snapshot: AppendOnlyTreeSnapshot,
+    sibling_path: [Field; TreeHeight],
+    leaf_to_append: Field,
+) -> AppendOnlyTreeSnapshot
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/append_only_tree/fn.insert_subtree_root_to_snapshot.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/append_only_tree/fn.insert_subtree_root_to_snapshot.html new file mode 100644 index 000000000000..55873b5cf9d2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/append_only_tree/fn.insert_subtree_root_to_snapshot.html @@ -0,0 +1,38 @@ + + + + + + +Function insert_subtree_root_to_snapshot documentation + + + + + +
+ +

Function insert_subtree_root_to_snapshot

+
pub fn insert_subtree_root_to_snapshot<let TreeHeight: u32, let SubtreeHeight: u32>(
+    snapshot: AppendOnlyTreeSnapshot,
+    sibling_path: [Field; TreeHeight - SubtreeHeight],
+    subtree_root_to_insert: Field,
+) -> AppendOnlyTreeSnapshot
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/append_only_tree/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/append_only_tree/index.html new file mode 100644 index 000000000000..c01a25ba4331 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/append_only_tree/index.html @@ -0,0 +1,46 @@ + + + + + + +Module append_only_tree documentation + + + + + +
+
aztec-nr - protocol_types::merkle_tree::append_only_tree
+

Module append_only_tree

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/index.html new file mode 100644 index 000000000000..d146ad0c0114 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/index.html @@ -0,0 +1,85 @@ + + + + + + +Module merkle_tree documentation + + + + + +
+
aztec-nr - protocol_types::merkle_tree
+

Module merkle_tree

+

Re-exports

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/indexed_tree/fn.assert_check_valid_low_leaf.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/indexed_tree/fn.assert_check_valid_low_leaf.html new file mode 100644 index 000000000000..70e9f9f72847 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/indexed_tree/fn.assert_check_valid_low_leaf.html @@ -0,0 +1,39 @@ + + + + + + +Function assert_check_valid_low_leaf documentation + + + + + +
+ +

Function assert_check_valid_low_leaf

+
pub fn assert_check_valid_low_leaf<LeafPreimage, Value>(
+    key: Field,
+    low_leaf_preimage: LeafPreimage,
+)
+
where + LeafPreimage: IndexedTreeLeafPreimage<Value>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/indexed_tree/fn.batch_insert_no_update.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/indexed_tree/fn.batch_insert_no_update.html new file mode 100644 index 000000000000..cb7a71230cd3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/indexed_tree/fn.batch_insert_no_update.html @@ -0,0 +1,49 @@ + + + + + + +Function batch_insert_no_update documentation + + + + + +
+ +

Function batch_insert_no_update

+
pub fn batch_insert_no_update<Value, Leaf, let TreeHeight: u32, let SubtreeWidth: u32, let SubtreeHeight: u32>(
+    start_snapshot: AppendOnlyTreeSnapshot,
+    values_to_insert: [Value; SubtreeWidth],
+    sorted_values: [Value; SubtreeWidth],
+    sorted_values_indexes: [u32; SubtreeWidth],
+    low_leaf_preimages: [Leaf; SubtreeWidth],
+    low_leaf_membership_witnesses: [MembershipWitness<TreeHeight>; SubtreeWidth],
+    new_subtree_sibling_path: [Field; TreeHeight - SubtreeHeight],
+) -> AppendOnlyTreeSnapshot
+
where + Value: IndexedTreeLeafValue, + Leaf: IndexedTreeLeafPreimage<Value>
+ +
+

Batch insert values into the indexed tree by creating a subtree of the values and inserting the subtree root. +This function does not allow updating the values of existing leaves.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/indexed_tree/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/indexed_tree/index.html new file mode 100644 index 000000000000..db0261463af9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/indexed_tree/index.html @@ -0,0 +1,47 @@ + + + + + + +Module indexed_tree documentation + + + + + +
+ +

Module indexed_tree

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/leaf_preimage/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/leaf_preimage/index.html new file mode 100644 index 000000000000..03f06b0604d4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/leaf_preimage/index.html @@ -0,0 +1,47 @@ + + + + + + +Module leaf_preimage documentation + + + + + +
+ +

Module leaf_preimage

+

Traits

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/leaf_preimage/trait.IndexedTreeLeafPreimage.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/leaf_preimage/trait.IndexedTreeLeafPreimage.html new file mode 100644 index 000000000000..1fb26a2e8165 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/leaf_preimage/trait.IndexedTreeLeafPreimage.html @@ -0,0 +1,78 @@ + + + + + + +Trait IndexedTreeLeafPreimage documentation + + + + + +
+ +

Trait IndexedTreeLeafPreimage

+
pub trait IndexedTreeLeafPreimage<Value>:
+    Empty
+    + LeafPreimage
+{
+    // Required methods
+    pub fn get_next_key(self) -> Field;
+    pub fn points_to_infinity(self) -> bool;
+    pub fn update_pointers(self, next_key: Field, next_index: Field) -> Self;
+    pub fn update_value(self, value: Value) -> Self;
+    pub fn build_insertion_leaf(value: Value, low_leaf: Self) -> Self;
+}
+ +

Required methods

+
pub fn get_next_key(self) -> Field + +pub fn points_to_infinity(self) -> bool + +pub fn update_pointers(self, next_key: Field, next_index: Field) -> Self + +pub fn update_value(self, value: Value) -> Self + +pub fn build_insertion_leaf(value: Value, low_leaf: Self) -> Self + +

Implementors

+

impl IndexedTreeLeafPreimage<Field> for NullifierLeafPreimage

+ +

impl IndexedTreeLeafPreimage<PublicDataTreeLeaf> for PublicDataTreeLeafPreimage

+ +

impl IndexedTreeLeafPreimage<Field> for TestLeafPreimage

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/leaf_preimage/trait.IndexedTreeLeafValue.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/leaf_preimage/trait.IndexedTreeLeafValue.html new file mode 100644 index 000000000000..9803f9d3392e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/leaf_preimage/trait.IndexedTreeLeafValue.html @@ -0,0 +1,56 @@ + + + + + + +Trait IndexedTreeLeafValue documentation + + + + + +
+ +

Trait IndexedTreeLeafValue

+
pub trait IndexedTreeLeafValue: Empty {
+    // Required methods
+    pub fn get_key(self) -> Field;
+}
+ +

Required methods

+
pub fn get_key(self) -> Field + +

Implementors

+

impl IndexedTreeLeafValue for Field

+ +

impl IndexedTreeLeafValue for PublicDataTreeLeaf

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/leaf_preimage/trait.LeafPreimage.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/leaf_preimage/trait.LeafPreimage.html new file mode 100644 index 000000000000..f380f13fde56 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/leaf_preimage/trait.LeafPreimage.html @@ -0,0 +1,66 @@ + + + + + + +Trait LeafPreimage documentation + + + + + +
+ +

Trait LeafPreimage

+
pub trait LeafPreimage {
+    // Required methods
+    pub fn get_key(self) -> Field;
+    pub fn as_leaf(self) -> Field;
+}
+ +

Required methods

+
pub fn get_key(self) -> Field + +pub fn as_leaf(self) -> Field + +

Implementors

+

impl LeafPreimage for NoteHashLeafPreimage

+ +

impl LeafPreimage for NullifierLeafPreimage

+ +

impl LeafPreimage for PublicDataTreeLeafPreimage

+ +

impl LeafPreimage for TestLeafPreimage

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/membership/fn.assert_check_membership.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/membership/fn.assert_check_membership.html new file mode 100644 index 000000000000..b5fcd50863f6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/membership/fn.assert_check_membership.html @@ -0,0 +1,44 @@ + + + + + + +Function assert_check_membership documentation + + + + + +
+ +

Function assert_check_membership

+
pub fn assert_check_membership<let TREE_HEIGHT: u32>(
+    leaf: Field,
+    index: Field,
+    sibling_path: [Field; TREE_HEIGHT],
+    root: Field,
+)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/membership/fn.assert_check_non_membership.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/membership/fn.assert_check_non_membership.html new file mode 100644 index 000000000000..f207738fbd5a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/membership/fn.assert_check_non_membership.html @@ -0,0 +1,46 @@ + + + + + + +Function assert_check_non_membership documentation + + + + + +
+ +

Function assert_check_non_membership

+
pub fn assert_check_non_membership<let TREE_HEIGHT: u32, LEAF_PREIMAGE, VALUE>(
+    key: Field,
+    low_leaf_preimage: LEAF_PREIMAGE,
+    low_leaf_membership_witness: MembershipWitness<TREE_HEIGHT>,
+    tree_root: Field,
+)
+
where + LEAF_PREIMAGE: IndexedTreeLeafPreimage<VALUE>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/membership/fn.check_membership.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/membership/fn.check_membership.html new file mode 100644 index 000000000000..527d13e827f3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/membership/fn.check_membership.html @@ -0,0 +1,44 @@ + + + + + + +Function check_membership documentation + + + + + +
+ +

Function check_membership

+
pub fn check_membership<let N: u32>(
+    leaf: Field,
+    index: Field,
+    sibling_path: [Field; N],
+    root: Field,
+) -> bool
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/membership/fn.conditionally_assert_check_membership.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/membership/fn.conditionally_assert_check_membership.html new file mode 100644 index 000000000000..2a7e06b9f770 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/membership/fn.conditionally_assert_check_membership.html @@ -0,0 +1,47 @@ + + + + + + +Function conditionally_assert_check_membership documentation + + + + + +
+ +

Function conditionally_assert_check_membership

+
pub fn conditionally_assert_check_membership<let TREE_HEIGHT: u32, LEAF_PREIMAGE, VALUE>(
+    key: Field,
+    exists: bool,
+    leaf_preimage: LEAF_PREIMAGE,
+    membership_witness: MembershipWitness<TREE_HEIGHT>,
+    tree_root: Field,
+)
+
where + LEAF_PREIMAGE: IndexedTreeLeafPreimage<VALUE>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/membership/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/membership/index.html new file mode 100644 index 000000000000..5e4b985244b4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/membership/index.html @@ -0,0 +1,52 @@ + + + + + + +Module membership documentation + + + + + +
+ +

Module membership

+

Structs

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/membership/struct.MembershipWitness.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/membership/struct.MembershipWitness.html new file mode 100644 index 000000000000..7bf31283d15a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/membership/struct.MembershipWitness.html @@ -0,0 +1,69 @@ + + + + + + +Struct MembershipWitness documentation + + + + + +
+ +

Struct MembershipWitness

+
pub struct MembershipWitness<let N: u32> {
+    pub leaf_index: Field,
+    pub sibling_path: [Field; N],
+}
+
+

Fields

+
leaf_index: Field
+
sibling_path: [Field; N]
+

Trait implementations

+

impl<let N: u32> Empty for MembershipWitness<N>

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl<let N: u32> Eq for MembershipWitness<N>

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/merkle_tree/fn.sibling_index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/merkle_tree/fn.sibling_index.html new file mode 100644 index 000000000000..898acbd7c833 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/merkle_tree/fn.sibling_index.html @@ -0,0 +1,36 @@ + + + + + + +Function sibling_index documentation + + + + + +
+ +

Function sibling_index

+
pub fn sibling_index(index: u32) -> u32
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/merkle_tree/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/merkle_tree/index.html new file mode 100644 index 000000000000..04e64a67f19e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/merkle_tree/index.html @@ -0,0 +1,49 @@ + + + + + + +Module merkle_tree documentation + + + + + +
+ +

Module merkle_tree

+

Structs

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/merkle_tree/struct.MerkleTree.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/merkle_tree/struct.MerkleTree.html new file mode 100644 index 000000000000..60dfcc459ddc --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/merkle_tree/struct.MerkleTree.html @@ -0,0 +1,94 @@ + + + + + + +Struct MerkleTree documentation + + + + + +
+ +

Struct MerkleTree

+
pub struct MerkleTree<let N: u32> {
+    pub leaves: [Field; N],
+    pub nodes: [Field; N - 1],
+}
+
+

Fields

+
leaves: [Field; N]
+
nodes: [Field; N - 1]
+

Implementations

+

impl<let NumLeaves: u32> MerkleTree<NumLeaves>

+ +
pub fn update_leaf<let TreeHeight: u32>(&mut self, index: u32, value: Field) + +

impl<let N: u32> MerkleTree<N>

+ +
pub fn new(leaves: [Field; N]) -> Self + +pub fn new_sha(leaves: [Field; N]) -> Self + +pub fn get_root(self) -> Field + +pub fn get_sibling_path<let K: u32>(self, leaf_index: u32) -> [Field; K] + +

impl MerkleTree<128>

+ +
pub fn update_vk_hash(&mut self, vk_index: u32, vk_hash: Field) + +

Trait implementations

+

impl<let N: u32> Empty for MerkleTree<N>

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl<let N: u32> Eq for MerkleTree<N>

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/root/fn.calculate_empty_tree_root.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/root/fn.calculate_empty_tree_root.html new file mode 100644 index 000000000000..550aeeed54cb --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/root/fn.calculate_empty_tree_root.html @@ -0,0 +1,38 @@ + + + + + + +Function calculate_empty_tree_root documentation + + + + + +
+ +

Function calculate_empty_tree_root

+
pub fn calculate_empty_tree_root(depth: u32) -> Field
+ +
+

These values are precomputed and we run tests to ensure that they are correct.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/root/fn.calculate_tree_root.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/root/fn.calculate_tree_root.html new file mode 100644 index 000000000000..aa69d2d9408d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/root/fn.calculate_tree_root.html @@ -0,0 +1,35 @@ + + + + + + +Function calculate_tree_root documentation + + + + + +
+ +

Function calculate_tree_root

+
pub fn calculate_tree_root<let N: u32>(leaves: [Field; N]) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/root/fn.root_from_sibling_path.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/root/fn.root_from_sibling_path.html new file mode 100644 index 000000000000..fd36482aa33c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/root/fn.root_from_sibling_path.html @@ -0,0 +1,39 @@ + + + + + + +Function root_from_sibling_path documentation + + + + + +
+ +

Function root_from_sibling_path

+
pub fn root_from_sibling_path<let N: u32>(
+    leaf: Field,
+    leaf_index: Field,
+    sibling_path: [Field; N],
+) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/root/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/root/index.html new file mode 100644 index 000000000000..985cc2bd9853 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/root/index.html @@ -0,0 +1,47 @@ + + + + + + +Module root documentation + + + + + +
+ +

Module root

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/unbalanced_merkle_tree/fn.compute_unbalanced_merkle_root.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/unbalanced_merkle_tree/fn.compute_unbalanced_merkle_root.html new file mode 100644 index 000000000000..10e4d4f7b654 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/unbalanced_merkle_tree/fn.compute_unbalanced_merkle_root.html @@ -0,0 +1,56 @@ + + + + + + +Function compute_unbalanced_merkle_root documentation + + + + + +
+ +

Function compute_unbalanced_merkle_root

+
pub fn compute_unbalanced_merkle_root<let N: u32, let MAX_SUBTREES: u32>(
+    leaves: [Field; N],
+    num_non_empty_leaves: u32,
+    hasher: fn(Field, Field) -> Field,
+) -> Field
+ +
+

Computes the Merkle root of an unbalanced tree.

+

Unlike a balanced Merkle tree, which requires the number of leaves to be a power of two, an unbalanced tree can have +any number of leaves.

+

The tree is constructed by iteratively extracting the smallest power-of-two-sized subtrees from right to left. +For each such subtree, it computes the subtree root and then combines all subtree roots (again from right to left) +into a single root using the provided hash function.

+

Note: We need the final tree to be as shallow as possible, to minimize the size of the sibling path required to +prove membership of a leaf. Therefor, the computation proceeds from right to left - smaller subtrees must always be +combined before being merged with a larger sibling on their left.

+

For example, consider an unbalanced tree made of three subtrees of sizes 2, 4, and 8. If we combine the size-2 and +size-4 subtrees first (producing a subtree of depth 3), and then merge it with the size-8 subtree (also depth 3), +the resulting tree has a maximum depth of 4.

+

But if we instead combine the size-4 and size-8 subtrees first (depth 4), and then merge with the size-2 subtree, +the final tree has a depth of 5.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/unbalanced_merkle_tree/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/unbalanced_merkle_tree/index.html new file mode 100644 index 000000000000..0143c04a59e2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/unbalanced_merkle_tree/index.html @@ -0,0 +1,49 @@ + + + + + + +Module unbalanced_merkle_tree documentation + + + + + +
+
aztec-nr - protocol_types::merkle_tree::unbalanced_merkle_tree
+

Module unbalanced_merkle_tree

+

Structs

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/unbalanced_merkle_tree/struct.UnbalancedMerkleTree.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/unbalanced_merkle_tree/struct.UnbalancedMerkleTree.html new file mode 100644 index 000000000000..c4bd166ad57c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/unbalanced_merkle_tree/struct.UnbalancedMerkleTree.html @@ -0,0 +1,60 @@ + + + + + + +Struct UnbalancedMerkleTree documentation + + + + + +
+ +

Struct UnbalancedMerkleTree

+
pub struct UnbalancedMerkleTree {
+    pub root: Field,
+}
+
+

Fields

+
root: Field
+

Implementations

+

impl UnbalancedMerkleTree

+ +
pub fn new_sha<let N: u32, let MAX_SUBTREES: u32>( + leaves: [Field; N], + num_non_empty_leaves: u32, +) -> Self + +pub fn get_root(self) -> Field + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/unbalanced_merkle_tree/tests/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/unbalanced_merkle_tree/tests/index.html new file mode 100644 index 000000000000..fed8658069c7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/merkle_tree/unbalanced_merkle_tree/tests/index.html @@ -0,0 +1,35 @@ + + + + + + +Module tests documentation + + + + + +
+ +

Module tests

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/messaging/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/messaging/index.html new file mode 100644 index 000000000000..2d0984e2b87f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/messaging/index.html @@ -0,0 +1,64 @@ + + + + + + +Module messaging documentation + + + + + +
+ +

Module messaging

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/messaging/l2_to_l1_message/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/messaging/l2_to_l1_message/index.html new file mode 100644 index 000000000000..f46fa3877a38 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/messaging/l2_to_l1_message/index.html @@ -0,0 +1,39 @@ + + + + + + +Module l2_to_l1_message documentation + + + + + +
+
aztec-nr - protocol_types::messaging::l2_to_l1_message
+

Module l2_to_l1_message

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/messaging/l2_to_l1_message/struct.L2ToL1Message.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/messaging/l2_to_l1_message/struct.L2ToL1Message.html new file mode 100644 index 000000000000..405e5ed5ea6a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/messaging/l2_to_l1_message/struct.L2ToL1Message.html @@ -0,0 +1,85 @@ + + + + + + +Struct L2ToL1Message documentation + + + + + +
+ +

Struct L2ToL1Message

+
pub struct L2ToL1Message {
+    pub recipient: EthAddress,
+    pub content: Field,
+}
+
+

Fields

+
recipient: EthAddress
+
content: Field
+

Implementations

+

impl L2ToL1Message

+ +
pub fn count(self, counter: u32) -> Counted<Self> + +pub fn scope(self, contract_address: AztecAddress) -> Scoped<Self> + +

Trait implementations

+

impl Deserialize for L2ToL1Message

+ +
pub fn deserialize(serialized: [Field; 2]) -> Self + +

impl Empty for L2ToL1Message

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for L2ToL1Message

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for L2ToL1Message

+ +
pub fn serialize(self) -> [Field; 2] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/meta/fn.derive_packable.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/meta/fn.derive_packable.html new file mode 100644 index 000000000000..e0694f760784 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/meta/fn.derive_packable.html @@ -0,0 +1,96 @@ + + + + + + +Function derive_packable documentation + + + + + +
+ +

Function derive_packable

+
pub comptime fn derive_packable(s: TypeDefinition) -> Quoted
+ +
+

Generates a Packable trait implementation for a given struct s.

+

Arguments

+
    +
  • s - The struct type definition to generate the implementation for
  • +
+

Returns

+

A Quoted block containing the generated trait implementation

+

Requirements

+

Each struct member type must implement the Packable trait (it gets used in the generated code).

+

Example

+

For a struct like:

+
struct MyStruct {
+    x: AztecAddress,
+    y: Field,
+}
+

This generates:

+
impl Packable for MyStruct {
+    let N: u32 = 2;
+
+    fn pack(self) -> [Field; 2] {
+        let mut result: [Field; 2] = [0_Field; 2];
+        let mut offset: u32 = 0_u32;
+        let packed_member: [Field; 1] = self.x.pack();
+        let packed_member_len: u32 = <Field as Packable>::N;
+        for i in 0_u32..packed_member_len {
+            {
+                result[i + offset] = packed_member[i];
+            }
+        }
+        offset = offset + packed_member_len;
+        let packed_member: [Field; 1] = self.y.pack();
+        let packed_member_len: u32 = <Field as Packable>::N;
+        for i in 0_u32..packed_member_len {
+            {
+                result[i + offset] = packed_member[i];
+            }
+        }
+        offset = offset + packed_member_len;
+        result
+    }
+
+    fn unpack(packed: [Field; 2]) -> Self {
+        let mut offset: u32 = 0_u32;
+        let mut member_fields: [Field; 1] = [0_Field; 1];
+        for i in 0_u32..<AztecAddress as Packable>::N {
+            member_fields[i] = packed[i + offset];
+        }
+        let x: AztecAddress = <AztecAddress as Packable>::unpack(member_fields);
+        offset = offset + <AztecAddress as Packable>::N;
+        let mut member_fields: [Field; 1] = [0_Field; 1];
+        for i in 0_u32..<Field as Packable>::N {
+            member_fields[i] = packed[i + offset];
+        }
+        let y: Field = <Field as Packable>::unpack(member_fields);
+        offset = offset + <Field as Packable>::N;
+        Self { x: x, y: y }
+    }
+}
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/meta/fn.derive_serialize.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/meta/fn.derive_serialize.html new file mode 100644 index 000000000000..73af9e1f0d52 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/meta/fn.derive_serialize.html @@ -0,0 +1,77 @@ + + + + + + +Function derive_serialize documentation + + + + + +
+ +

Function derive_serialize

+
pub comptime fn derive_serialize(s: TypeDefinition) -> Quoted
+ +
+

Generates a Serialize trait implementation for a struct type.

+

Parameters

+
    +
  • s: The struct type definition to generate the implementation for
  • +
+

Returns

+

A quoted code block containing the trait implementation

+

Example

+

For a struct defined as:

+
struct Log<N> {
+    fields: [Field; N],
+    length: u32
+}
+

This function generates code equivalent to:

+
impl<let N: u32> Serialize for Log<N> {
+    let N: u32 = <[Field; N] as Serialize>::N + <u32 as Serialize>::N;
+
+    #[inline_always]
+    fn serialize(self) -> [Field; Self::N] {
+        let mut serialized_params = [0; _];
+        let mut offset = 0;
+
+        let serialized_member = Serialize::serialize(self.fields);
+        let serialized_member_len = <[Field; N] as Serialize>::N;
+        for i in 0..serialized_member_len {
+            serialized_params[i + offset] = serialized_member[i];
+        }
+        offset += serialized_member_len;
+
+        let serialized_member = Serialize::serialize(self.length);
+        let serialized_member_len = <u32 as Serialize>::N;
+        for i in 0..serialized_member_len {
+            serialized_params[i + offset] = serialized_member[i];
+        }
+        offset += serialized_member_len;
+
+        serialized_params
+    }
+}
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/meta/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/meta/index.html new file mode 100644 index 000000000000..ca6cacb24717 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/meta/index.html @@ -0,0 +1,69 @@ + + + + + + +Module meta documentation + + + + + +
+ +

Module meta

+

Modules

+

Functions

    +
  • Generates a Packable trait implementation for a given struct s.
  • +
  • Generates a Serialize trait implementation for a struct type.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/meta/utils/fn.derive_serialization_quotes.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/meta/utils/fn.derive_serialization_quotes.html new file mode 100644 index 000000000000..6ebc62581d01 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/meta/utils/fn.derive_serialization_quotes.html @@ -0,0 +1,53 @@ + + + + + + +Function derive_serialization_quotes documentation + + + + + +
+ +

Function derive_serialization_quotes

+
pub comptime fn derive_serialization_quotes(
+    params: [(Quoted, Type)],
+    use_self_prefix: bool,
+) -> (Quoted, Quoted, Quoted)
+ +
+

Generates serialization code for a list of parameters and the total length of the serialized array

+

Parameters

+
    +
  • params: A list of (name, type) tuples to serialize
  • +
  • use_self_prefix: If true, parameters are accessed as self.$param_name (for struct members). +If false, parameters are accessed directly as $param_name (for function parameters).
  • +
+

Returns

+

A tuple containing:

+
    +
  • Quoted code that serializes the parameters into an array named serialized_params
  • +
  • Quoted code that evaluates to the total length of the serialized array
  • +
  • Quoted code containing the name of the serialized array
  • +
+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/meta/utils/fn.get_params_len_quote.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/meta/utils/fn.get_params_len_quote.html new file mode 100644 index 000000000000..d4c23cea6899 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/meta/utils/fn.get_params_len_quote.html @@ -0,0 +1,48 @@ + + + + + + +Function get_params_len_quote documentation + + + + + +
+ +

Function get_params_len_quote

+
pub comptime fn get_params_len_quote(params: [(Quoted, Type)]) -> Quoted
+ +
+

Generates a quoted expression that computes the total serialized length of function parameters.

+

Parameters

+
    +
  • params - An array of tuples where each tuple contains a quoted parameter name and its Type. The type needs +to implement the Serialize trait.
  • +
+

Returns

+

A quoted expression that evaluates to:

+
    +
  • 0 if there are no parameters
  • +
  • (<type1 as Serialize>::N + <type2 as Serialize>::N + ...) for one or more parameters
  • +
+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/meta/utils/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/meta/utils/index.html new file mode 100644 index 000000000000..080569cb05fe --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/meta/utils/index.html @@ -0,0 +1,44 @@ + + + + + + +Module utils documentation + + + + + +
+ +

Module utils

+

Functions

    +
  • Generates serialization code for a list of parameters and the total length of the serialized array
  • +
  • Generates a quoted expression that computes the total serialized length of function parameters.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/point/global.POINT_LENGTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/point/global.POINT_LENGTH.html new file mode 100644 index 000000000000..7317c7ffb363 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/point/global.POINT_LENGTH.html @@ -0,0 +1,33 @@ + + + + + + +Global POINT_LENGTH documentation + + + + + +
+ +

Global POINT_LENGTH

+
pub global POINT_LENGTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/point/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/point/index.html new file mode 100644 index 000000000000..76c6554a41b7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/point/index.html @@ -0,0 +1,68 @@ + + + + + + +Module point documentation + + + + + +
+ +

Module point

+

Re-exports

+

Globals

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/poseidon2/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/poseidon2/index.html new file mode 100644 index 000000000000..e38053b4bc26 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/poseidon2/index.html @@ -0,0 +1,64 @@ + + + + + + +Module poseidon2 documentation + + + + + +
+ +

Module poseidon2

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/poseidon2/struct.Poseidon2Sponge.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/poseidon2/struct.Poseidon2Sponge.html new file mode 100644 index 000000000000..5bce9ecf92a4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/poseidon2/struct.Poseidon2Sponge.html @@ -0,0 +1,85 @@ + + + + + + +Struct Poseidon2Sponge documentation + + + + + +
+ +

Struct Poseidon2Sponge

+
pub struct Poseidon2Sponge {
+    pub cache: [Field; 3],
+    pub state: [Field; 4],
+    pub cache_size: u32,
+    pub squeeze_mode: bool,
+}
+
+

Fields

+
cache: [Field; 3]
+
state: [Field; 4]
+
cache_size: u32
+
squeeze_mode: bool
+

Implementations

+

impl Poseidon2Sponge

+ +
pub fn hash<let N: u32>(input: [Field; N], message_size: u32) -> Field + +pub fn absorb(&mut self, input: Field) + +pub fn squeeze(&mut self) -> Field + +

Trait implementations

+

impl Deserialize for Poseidon2Sponge

+ +
pub fn deserialize(serialized: [Field; 9]) -> Self + +

impl Eq for Poseidon2Sponge

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for Poseidon2Sponge

+ +
pub fn serialize(self) -> [Field; 9] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/index.html new file mode 100644 index 000000000000..5f3da4f0adc4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/index.html @@ -0,0 +1,67 @@ + + + + + + +Module proof documentation + + + + + +
+ +

Module proof

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/proof_data/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/proof_data/index.html new file mode 100644 index 000000000000..52ba148ab67f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/proof_data/index.html @@ -0,0 +1,50 @@ + + + + + + +Module proof_data documentation + + + + + +
+ +

Module proof_data

+

Structs

+

Type aliases

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/proof_data/struct.ProofData.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/proof_data/struct.ProofData.html new file mode 100644 index 000000000000..60fc6394994e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/proof_data/struct.ProofData.html @@ -0,0 +1,96 @@ + + + + + + +Struct ProofData documentation + + + + + +
+ +

Struct ProofData

+
pub struct ProofData<T, let ProofLen: u32, let VkLen: u32> {
+    pub public_inputs: T,
+    pub proof: [Field; ProofLen],
+    pub vk_data: VkData<VkLen>,
+}
+
+

Fields

+
public_inputs: T
+
proof: [Field; ProofLen]
+
vk_data: VkData<VkLen>
+

Implementations

+

impl<let ProofLen: u32, T, let VkLen: u32> ProofData<T, ProofLen, VkLen>

+ +
pub fn verify(self, proof_type: u32) +
where + T: Serialize
+ +
+

Verifies the proof against the verification key and public inputs. +The vk hash is also checked in the backend to match the key.

+
+

impl<T> ProofData<T, 457, 115>

+ +
pub fn verify_proof(self) +
where + T: Serialize
+ +

impl<T> ProofData<T, 1963, 127>

+ +
pub fn verify_proof(self) +
where + T: Serialize
+ +

impl<T> ProofData<T, 531, 115>

+ +
pub fn verify_proof(self) +
where + T: Serialize
+ +pub fn verify_proof_in_root(self) +
where + T: Serialize
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/proof_data/struct.ProofDataForFixedVk.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/proof_data/struct.ProofDataForFixedVk.html new file mode 100644 index 000000000000..5d32a1462e08 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/proof_data/struct.ProofDataForFixedVk.html @@ -0,0 +1,63 @@ + + + + + + +Struct ProofDataForFixedVk documentation + + + + + +
+ +

Struct ProofDataForFixedVk

+
pub struct ProofDataForFixedVk<T, let ProofLen: u32> {
+    pub public_inputs: T,
+    pub proof: [Field; ProofLen],
+}
+
+

Fields

+
public_inputs: T
+
proof: [Field; ProofLen]
+

Implementations

+

impl<T> ProofDataForFixedVk<T, 20000>

+ +
pub fn verify_proof_with_columns<let N: u32>(self) +
where + T: SerializeToColumns<N>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/proof_data/type.AvmV2ProofData.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/proof_data/type.AvmV2ProofData.html new file mode 100644 index 000000000000..1d89f7b09929 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/proof_data/type.AvmV2ProofData.html @@ -0,0 +1,40 @@ + + + + + + +Type alias AvmV2ProofData documentation + + + + + +
+ +

Type alias AvmV2ProofData

+
pub type AvmV2ProofData<T> = ProofDataForFixedVk<T, 20000>;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/proof_data/type.ChonkProofData.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/proof_data/type.ChonkProofData.html new file mode 100644 index 000000000000..d01b6da2cb14 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/proof_data/type.ChonkProofData.html @@ -0,0 +1,40 @@ + + + + + + +Type alias ChonkProofData documentation + + + + + +
+ +

Type alias ChonkProofData

+
pub type ChonkProofData<T> = ProofData<T, 1963, 127>;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/proof_data/type.RollupHonkProofData.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/proof_data/type.RollupHonkProofData.html new file mode 100644 index 000000000000..9c8efe921a56 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/proof_data/type.RollupHonkProofData.html @@ -0,0 +1,43 @@ + + + + + + +Type alias RollupHonkProofData documentation + + + + + +
+ +

Type alias RollupHonkProofData

+
pub type RollupHonkProofData<T> = ProofData<T, 531, 115>;
+ +
+

Using this type for both RECURSIVE_ROLLUP_HONK_PROOF_LENGTH and NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/proof_data/type.UltraHonkProofData.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/proof_data/type.UltraHonkProofData.html new file mode 100644 index 000000000000..ca614cf1dce4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/proof_data/type.UltraHonkProofData.html @@ -0,0 +1,43 @@ + + + + + + +Type alias UltraHonkProofData documentation + + + + + +
+ +

Type alias UltraHonkProofData

+
pub type UltraHonkProofData<T> = ProofData<T, 457, 115>;
+ +
+

Using this type for both RECURSIVE_PROOF_LENGTH and NESTED_RECURSIVE_PROOF_LENGTH.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/traits/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/traits/index.html new file mode 100644 index 000000000000..fa254321e520 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/traits/index.html @@ -0,0 +1,42 @@ + + + + + + +Module traits documentation + + + + + +
+ +

Module traits

+

Traits

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/traits/trait.SerializeToColumns.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/traits/trait.SerializeToColumns.html new file mode 100644 index 000000000000..36e97fed41ec --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/traits/trait.SerializeToColumns.html @@ -0,0 +1,51 @@ + + + + + + +Trait SerializeToColumns documentation + + + + + +
+ +

Trait SerializeToColumns

+
pub trait SerializeToColumns<let N: u32> {
+    // Required methods
+    pub fn serialize_to_columns(self) -> [Field; N];
+}
+ +

Required methods

+
pub fn serialize_to_columns(self) -> [Field; N] + +

Implementors

+

impl SerializeToColumns<18740> for AvmCircuitPublicInputs

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/verification_key/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/verification_key/index.html new file mode 100644 index 000000000000..afa543391535 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/verification_key/index.html @@ -0,0 +1,50 @@ + + + + + + +Module verification_key documentation + + + + + +
+
aztec-nr - protocol_types::proof::verification_key
+

Module verification_key

+

Structs

+

Type aliases

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/verification_key/struct.VerificationKey.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/verification_key/struct.VerificationKey.html new file mode 100644 index 000000000000..b92d0ef4ced9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/verification_key/struct.VerificationKey.html @@ -0,0 +1,70 @@ + + + + + + +Struct VerificationKey documentation + + + + + +
+ +

Struct VerificationKey

+
pub struct VerificationKey<let N: u32> {
+    pub key: [Field; N],
+    pub hash: Field,
+}
+
+

Fields

+
key: [Field; N]
+
hash: Field
+

Trait implementations

+

impl<let M: u32> Empty for VerificationKey<M>

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl<let N: u32> Eq for VerificationKey<N>

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/verification_key/type.AvmVerificationKey.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/verification_key/type.AvmVerificationKey.html new file mode 100644 index 000000000000..b1d5aeb1d5d4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/verification_key/type.AvmVerificationKey.html @@ -0,0 +1,40 @@ + + + + + + +Type alias AvmVerificationKey documentation + + + + + +
+ +

Type alias AvmVerificationKey

+
pub type AvmVerificationKey = VerificationKey<86>;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/verification_key/type.ChonkVerificationKey.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/verification_key/type.ChonkVerificationKey.html new file mode 100644 index 000000000000..f9ad3c13a99b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/verification_key/type.ChonkVerificationKey.html @@ -0,0 +1,40 @@ + + + + + + +Type alias ChonkVerificationKey documentation + + + + + +
+ +

Type alias ChonkVerificationKey

+
pub type ChonkVerificationKey = VerificationKey<127>;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/verification_key/type.HonkVerificationKey.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/verification_key/type.HonkVerificationKey.html new file mode 100644 index 000000000000..3f500cba9f9c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/verification_key/type.HonkVerificationKey.html @@ -0,0 +1,40 @@ + + + + + + +Type alias HonkVerificationKey documentation + + + + + +
+ +

Type alias HonkVerificationKey

+
pub type HonkVerificationKey = VerificationKey<115>;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/verification_key/type.MegaVerificationKey.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/verification_key/type.MegaVerificationKey.html new file mode 100644 index 000000000000..89b450212a04 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/verification_key/type.MegaVerificationKey.html @@ -0,0 +1,40 @@ + + + + + + +Type alias MegaVerificationKey documentation + + + + + +
+ +

Type alias MegaVerificationKey

+
pub type MegaVerificationKey = VerificationKey<127>;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/verification_key/type.RollupHonkVerificationKey.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/verification_key/type.RollupHonkVerificationKey.html new file mode 100644 index 000000000000..9d73c3b9b42b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/verification_key/type.RollupHonkVerificationKey.html @@ -0,0 +1,40 @@ + + + + + + +Type alias RollupHonkVerificationKey documentation + + + + + +
+ +

Type alias RollupHonkVerificationKey

+
pub type RollupHonkVerificationKey = VerificationKey<115>;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/vk_data/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/vk_data/index.html new file mode 100644 index 000000000000..7288ec51706d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/vk_data/index.html @@ -0,0 +1,42 @@ + + + + + + +Module vk_data documentation + + + + + +
+ +

Module vk_data

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/vk_data/struct.VkData.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/vk_data/struct.VkData.html new file mode 100644 index 000000000000..9522c2095f34 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/proof/vk_data/struct.VkData.html @@ -0,0 +1,82 @@ + + + + + + +Struct VkData documentation + + + + + +
+ +

Struct VkData

+
pub struct VkData<let VK_LENGTH: u32> {
+    pub vk: VerificationKey<VK_LENGTH>,
+    pub leaf_index: u32,
+    pub sibling_path: [Field; 7],
+}
+
+

Fields

+
vk: VerificationKey<VK_LENGTH>
+
leaf_index: u32
+
sibling_path: [Field; 7]
+

Implementations

+

impl<let VK_LENGTH: u32> VkData<VK_LENGTH>

+ +
pub fn validate_allowed_in_vk_tree<let N: u32>( + self, + vk_tree_root: Field, + allowed_indices: [u32; N], +) + +pub fn validate_in_vk_tree(self, vk_tree_root: Field) + +

Trait implementations

+

impl<let VK_LENGTH: u32> Empty for VkData<VK_LENGTH>

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl<let VK_LENGTH: u32> Eq for VkData<VK_LENGTH>

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/public_keys/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/public_keys/index.html new file mode 100644 index 000000000000..7e145718851e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/public_keys/index.html @@ -0,0 +1,73 @@ + + + + + + +Module public_keys documentation + + + + + +
+
aztec-nr - protocol_types::public_keys
+

Module public_keys

+

Structs

+

Traits

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/public_keys/struct.AddressPoint.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/public_keys/struct.AddressPoint.html new file mode 100644 index 000000000000..ed17cb4ada23 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/public_keys/struct.AddressPoint.html @@ -0,0 +1,59 @@ + + + + + + +Struct AddressPoint documentation + + + + + +
+ +

Struct AddressPoint

+
pub struct AddressPoint {
+    pub inner: EmbeddedCurvePoint,
+}
+
+

Fields

+ +

Trait implementations

+

impl ToPoint for AddressPoint

+ +
pub fn to_point(self) -> EmbeddedCurvePoint + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/public_keys/struct.IvpkM.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/public_keys/struct.IvpkM.html new file mode 100644 index 000000000000..6b88fac2d2ca --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/public_keys/struct.IvpkM.html @@ -0,0 +1,74 @@ + + + + + + +Struct IvpkM documentation + + + + + +
+ +

Struct IvpkM

+
pub struct IvpkM {
+    pub inner: EmbeddedCurvePoint,
+}
+
+

Fields

+ +

Trait implementations

+

impl Deserialize for IvpkM

+ +
pub fn deserialize(serialized: [Field; 3]) -> Self + +

impl Eq for IvpkM

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for IvpkM

+ +
pub fn serialize(self) -> [Field; 3] + +

impl ToPoint for IvpkM

+ +
pub fn to_point(self) -> EmbeddedCurvePoint + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/public_keys/struct.NpkM.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/public_keys/struct.NpkM.html new file mode 100644 index 000000000000..8c092673fa63 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/public_keys/struct.NpkM.html @@ -0,0 +1,79 @@ + + + + + + +Struct NpkM documentation + + + + + +
+ +

Struct NpkM

+
pub struct NpkM {
+    pub inner: EmbeddedCurvePoint,
+}
+
+

Fields

+ +

Trait implementations

+

impl Deserialize for NpkM

+ +
pub fn deserialize(serialized: [Field; 3]) -> Self + +

impl Eq for NpkM

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Hash for NpkM

+ +
pub fn hash(self) -> Field + +

impl Serialize for NpkM

+ +
pub fn serialize(self) -> [Field; 3] + +

impl ToPoint for NpkM

+ +
pub fn to_point(self) -> EmbeddedCurvePoint + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/public_keys/struct.OvpkM.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/public_keys/struct.OvpkM.html new file mode 100644 index 000000000000..7c40ceb2d307 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/public_keys/struct.OvpkM.html @@ -0,0 +1,79 @@ + + + + + + +Struct OvpkM documentation + + + + + +
+ +

Struct OvpkM

+
pub struct OvpkM {
+    pub inner: EmbeddedCurvePoint,
+}
+
+

Fields

+ +

Trait implementations

+

impl Deserialize for OvpkM

+ +
pub fn deserialize(serialized: [Field; 3]) -> Self + +

impl Eq for OvpkM

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Hash for OvpkM

+ +
pub fn hash(self) -> Field + +

impl Serialize for OvpkM

+ +
pub fn serialize(self) -> [Field; 3] + +

impl ToPoint for OvpkM

+ +
pub fn to_point(self) -> EmbeddedCurvePoint + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/public_keys/struct.PublicKeys.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/public_keys/struct.PublicKeys.html new file mode 100644 index 000000000000..dd30ba2d2cf6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/public_keys/struct.PublicKeys.html @@ -0,0 +1,92 @@ + + + + + + +Struct PublicKeys documentation + + + + + +
+ +

Struct PublicKeys

+
pub struct PublicKeys {
+    pub npk_m: NpkM,
+    pub ivpk_m: IvpkM,
+    pub ovpk_m: OvpkM,
+    pub tpk_m: TpkM,
+}
+
+

Fields

+
npk_m: NpkM
+
ivpk_m: IvpkM
+
ovpk_m: OvpkM
+
tpk_m: TpkM
+

Implementations

+

impl PublicKeys

+ +
pub fn hash(self) -> PublicKeysHash + +

Trait implementations

+

impl Default for PublicKeys

+ +
pub fn default() -> Self + +

impl Deserialize for PublicKeys

+ +
pub fn deserialize(serialized: [Field; 12]) -> Self + +

impl Eq for PublicKeys

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for PublicKeys

+ +
pub fn serialize(self) -> [Field; 12] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/public_keys/struct.TpkM.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/public_keys/struct.TpkM.html new file mode 100644 index 000000000000..f42f4d722c07 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/public_keys/struct.TpkM.html @@ -0,0 +1,74 @@ + + + + + + +Struct TpkM documentation + + + + + +
+ +

Struct TpkM

+
pub struct TpkM {
+    pub inner: EmbeddedCurvePoint,
+}
+
+

Fields

+ +

Trait implementations

+

impl Deserialize for TpkM

+ +
pub fn deserialize(serialized: [Field; 3]) -> Self + +

impl Eq for TpkM

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Serialize for TpkM

+ +
pub fn serialize(self) -> [Field; 3] + +

impl ToPoint for TpkM

+ +
pub fn to_point(self) -> EmbeddedCurvePoint + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/public_keys/trait.ToPoint.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/public_keys/trait.ToPoint.html new file mode 100644 index 000000000000..e551d2899d49 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/public_keys/trait.ToPoint.html @@ -0,0 +1,71 @@ + + + + + + +Trait ToPoint documentation + + + + + +
+ +

Trait ToPoint

+
pub trait ToPoint {
+    // Required methods
+    pub fn to_point(self) -> EmbeddedCurvePoint;
+}
+ +

Required methods

+
pub fn to_point(self) -> EmbeddedCurvePoint + +

Implementors

+

impl ToPoint for AddressPoint

+ +

impl ToPoint for IvpkM

+ +

impl ToPoint for NpkM

+ +

impl ToPoint for OvpkM

+ +

impl ToPoint for TpkM

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/scalar/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/scalar/index.html new file mode 100644 index 000000000000..e7b5758b1d23 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/scalar/index.html @@ -0,0 +1,64 @@ + + + + + + +Module scalar documentation + + + + + +
+ +

Module scalar

+

Re-exports

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/side_effect/counted/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/side_effect/counted/index.html new file mode 100644 index 000000000000..a5e85ce208e6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/side_effect/counted/index.html @@ -0,0 +1,44 @@ + + + + + + +Module counted documentation + + + + + +
+ +

Module counted

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/side_effect/counted/struct.Counted.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/side_effect/counted/struct.Counted.html new file mode 100644 index 000000000000..bdae95151752 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/side_effect/counted/struct.Counted.html @@ -0,0 +1,125 @@ + + + + + + +Struct Counted documentation + + + + + +
+ +

Struct Counted

+
pub struct Counted<T> {
+    pub inner: T,
+    pub counter: u32,
+}
+
+

Fields

+
inner: T
+
counter: u32
+

Implementations

+

impl Counted<L2ToL1Message>

+ +
pub fn scope(self, contract_address: AztecAddress) -> Scoped<Self> + +

impl Counted<PublicCallRequest>

+ +

impl<T> Counted<T>

+ +
pub fn scope(self, contract_address: AztecAddress) -> Scoped<Self> + +

impl<T> Counted<T>

+ +
pub fn new(inner: T, counter: u32) -> Self + +

Trait implementations

+

impl<T> Deserialize for Counted<T> +
where + T: Deserialize

+ +
pub fn deserialize(fields: [Field; <T as Deserialize>::N + 1]) -> Self + +

impl<T> Empty for Counted<T> +
where + T: Empty

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl<T> Eq for Counted<T> +
where + T: Eq

+ +
pub fn eq(self, other: Self) -> bool + +

impl<T> Ordered for Counted<T>

+ +
pub fn counter(self) -> u32 + +

impl<T> Ordered for Scoped<Counted<T>>

+ +
pub fn counter(self) -> u32 + +

impl Readable for Scoped<Counted<NoteHash>>

+ +
pub fn assert_match_read_request(self, read_request: Scoped<Counted<Field>>) + +

impl Readable for Scoped<Counted<Nullifier>>

+ +
pub fn assert_match_read_request(self, read_request: Scoped<Counted<Field>>) + +

impl<T> Serialize for Counted<T> +
where + T: Serialize

+ +
pub fn serialize(self) -> [Field; <T as Serialize>::N + 1] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/side_effect/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/side_effect/index.html new file mode 100644 index 000000000000..2ace47d4be1f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/side_effect/index.html @@ -0,0 +1,75 @@ + + + + + + +Module side_effect documentation + + + + + +
+
aztec-nr - protocol_types::side_effect
+

Module side_effect

+

Re-exports

    +
  • pub use protocol_types::side_effect::counted::Counted;
  • +
  • pub use protocol_types::side_effect::scoped::Scoped;
  • +
+

Modules

+

Traits

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/side_effect/scoped/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/side_effect/scoped/index.html new file mode 100644 index 000000000000..2d7933235209 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/side_effect/scoped/index.html @@ -0,0 +1,44 @@ + + + + + + +Module scoped documentation + + + + + +
+ +

Module scoped

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/side_effect/scoped/struct.Scoped.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/side_effect/scoped/struct.Scoped.html new file mode 100644 index 000000000000..482f7f7f65f0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/side_effect/scoped/struct.Scoped.html @@ -0,0 +1,135 @@ + + + + + + +Struct Scoped documentation + + + + + +
+ +

Struct Scoped

+
pub struct Scoped<T> {
+    pub inner: T,
+    pub contract_address: AztecAddress,
+}
+
+

Fields

+
inner: T
+
contract_address: AztecAddress
+

Implementations

+

impl Scoped<Counted<Field>>

+ +
pub fn expose_to_public(self) -> Field + +

impl Scoped<Counted<L2ToL1Message>>

+ +

impl Scoped<Counted<PrivateLogData>>

+ +
pub fn expose_to_public(self) -> PrivateLog + +

impl Scoped<Counted<LogHash>>

+ +
pub fn expose_to_public(self) -> Scoped<LogHash> + +

impl Scoped<Counted<Nullifier>>

+ +
pub fn expose_to_public(self) -> Field + +

impl<T> Scoped<Counted<T>>

+ +
pub fn innermost(self) -> T + +

impl<T> Scoped<T>

+ +
pub fn new(inner: T, contract_address: AztecAddress) -> Self + +

Trait implementations

+

impl<T> Deserialize for Scoped<T> +
where + T: Deserialize

+ +
pub fn deserialize(fields: [Field; <T as Deserialize>::N + 1]) -> Self + +

impl<T> Empty for Scoped<T> +
where + T: Empty

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl<T> Eq for Scoped<T> +
where + T: Eq

+ +
pub fn eq(self, other: Self) -> bool + +

impl<T> Ordered for Scoped<Counted<T>>

+ +
pub fn counter(self) -> u32 + +

impl Readable for Scoped<Counted<NoteHash>>

+ +
pub fn assert_match_read_request(self, read_request: Scoped<Counted<Field>>) + +

impl Readable for Scoped<Counted<Nullifier>>

+ +
pub fn assert_match_read_request(self, read_request: Scoped<Counted<Field>>) + +

impl<T> Serialize for Scoped<T> +
where + T: Serialize

+ +
pub fn serialize(self) -> [Field; <T as Serialize>::N + 1] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/side_effect/trait.Ordered.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/side_effect/trait.Ordered.html new file mode 100644 index 000000000000..e36efc7eda6c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/side_effect/trait.Ordered.html @@ -0,0 +1,65 @@ + + + + + + +Trait Ordered documentation + + + + + +
+ +

Trait Ordered

+
pub trait Ordered {
+    // Required methods
+    pub fn counter(self) -> u32;
+}
+ +

Required methods

+
pub fn counter(self) -> u32 + +

Implementors

+

impl<T> Ordered for Counted<T>

+ +

impl Ordered for PrivateCallRequest

+ +

impl<T> Ordered for Scoped<Counted<T>>

+ +

impl Ordered for TestValue

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/side_effect/trait.Readable.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/side_effect/trait.Readable.html new file mode 100644 index 000000000000..3cab99242a4a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/side_effect/trait.Readable.html @@ -0,0 +1,65 @@ + + + + + + +Trait Readable documentation + + + + + +
+ +

Trait Readable

+
pub trait Readable {
+    // Required methods
+    pub fn assert_match_read_request(self, read_request: Scoped<Counted<Field>>);
+}
+ +

Required methods

+
pub fn assert_match_read_request(self, read_request: Scoped<Counted<Field>>) + +

Implementors

+

impl Readable for NoteHashLeafPreimage

+ +

impl Readable for NullifierLeafPreimage

+ +

impl Readable for Scoped<Counted<NoteHash>>

+ +

impl Readable for Scoped<Counted<Nullifier>>

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/storage/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/storage/index.html new file mode 100644 index 000000000000..9a2c6c95f7c8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/storage/index.html @@ -0,0 +1,64 @@ + + + + + + +Module storage documentation + + + + + +
+ +

Module storage

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/storage/map/fn.derive_storage_slot_in_map.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/storage/map/fn.derive_storage_slot_in_map.html new file mode 100644 index 000000000000..a5cbec58205f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/storage/map/fn.derive_storage_slot_in_map.html @@ -0,0 +1,35 @@ + + + + + + +Function derive_storage_slot_in_map documentation + + + + + +
+ +

Function derive_storage_slot_in_map

+
pub fn derive_storage_slot_in_map<K>(storage_slot: Field, key: K) -> Field
+
where + K: ToField
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/storage/map/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/storage/map/index.html new file mode 100644 index 000000000000..d0b5460796ae --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/storage/map/index.html @@ -0,0 +1,39 @@ + + + + + + +Module map documentation + + + + + +
+ +

Module map

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixture_builder/fn.claimed_length_array_from_bounded_vec.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixture_builder/fn.claimed_length_array_from_bounded_vec.html new file mode 100644 index 000000000000..e1b03143205f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixture_builder/fn.claimed_length_array_from_bounded_vec.html @@ -0,0 +1,43 @@ + + + + + + +Function claimed_length_array_from_bounded_vec documentation + + + + + +
+ +

Function claimed_length_array_from_bounded_vec

+
pub fn claimed_length_array_from_bounded_vec<T, let N: u32>(
+    vec: BoundedVec<T, N>,
+) -> ClaimedLengthArray<T, N>
+ +
+

For testing only. Not safe. +Not part of the ClaimedLengthArray methods, because we don't want it +to be accidentally called in production code.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixture_builder/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixture_builder/index.html new file mode 100644 index 000000000000..d15667acbac9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixture_builder/index.html @@ -0,0 +1,49 @@ + + + + + + +Module fixture_builder documentation + + + + + +
+
aztec-nr - protocol_types::tests::fixture_builder
+

Module fixture_builder

+

Structs

+

Functions

    +
  • For testing only. Not safe. +Not part of the ClaimedLengthArray methods, because we don't want it +to be accidentally called in production code.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixture_builder/struct.FixtureBuilder.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixture_builder/struct.FixtureBuilder.html new file mode 100644 index 000000000000..af48dbc9cf79 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixture_builder/struct.FixtureBuilder.html @@ -0,0 +1,545 @@ + + + + + + +Struct FixtureBuilder documentation + + + + + +
+ +

Struct FixtureBuilder

+
pub struct FixtureBuilder {
+    pub contract_address: AztecAddress,
+    pub msg_sender: AztecAddress,
+    pub is_static_call: bool,
+    pub is_private_only: bool,
+    pub claimed_first_nullifier: Field,
+    pub claimed_revertible_counter: u32,
+    pub include_by_timestamp: u64,
+    pub is_fee_payer: bool,
+    pub fee_payer: AztecAddress,
+    pub public_teardown_call_request: PublicCallRequest,
+    pub transaction_fee: Field,
+    pub effective_gas_fees: GasFees,
+    pub anchor_block_header: BlockHeader,
+    pub tx_context: TxContext,
+    pub global_variables: GlobalVariables,
+    pub note_hashes: BoundedVec<Scoped<Counted<NoteHash>>, 64>,
+    pub nullifiers: BoundedVec<Scoped<Counted<Nullifier>>, 64>,
+    pub l2_to_l1_msgs: BoundedVec<Scoped<Counted<L2ToL1Message>>, 8>,
+    pub private_logs: BoundedVec<Scoped<Counted<PrivateLogData>>, 64>,
+    pub public_logs: PublicLogs,
+    pub contract_class_logs_hashes: BoundedVec<Scoped<Counted<LogHash>>, 1>,
+    pub contract_class_log_fields: BoundedVec<[Field; 3023], 1>,
+    pub public_data_writes: BoundedVec<PublicDataWrite, 64>,
+    pub private_call_requests: BoundedVec<PrivateCallRequest, 16>,
+    pub public_call_requests: BoundedVec<Counted<PublicCallRequest>, 32>,
+    pub gas_used: Gas,
+    pub start_gas_used: Gas,
+    pub end_gas_used: Gas,
+    pub revert_code: u8,
+    pub reverted: bool,
+    pub note_hash_read_requests: BoundedVec<Scoped<Counted<Field>>, 64>,
+    pub nullifier_read_requests: BoundedVec<Scoped<Counted<Field>>, 64>,
+    pub scoped_key_validation_requests_and_generators: BoundedVec<Scoped<KeyValidationRequestAndGenerator>, 64>,
+    pub function_data: FunctionData,
+    pub args_hash: Field,
+    pub calldata_hash: Field,
+    pub returns_hash: Field,
+    pub salted_initialization_hash: SaltedInitializationHash,
+    pub public_keys: PublicKeys,
+    pub contract_class_artifact_hash: Field,
+    pub contract_class_public_bytecode_commitment: Field,
+    pub function_leaf_membership_witness: MembershipWitness<7>,
+    pub bytecode_hash: Field,
+    pub prover_id: Field,
+    pub vk: MegaVerificationKey,
+    pub vk_index: u32,
+    pub vk_path: [Field; 7],
+    pub vk_tree_root: Field,
+    pub protocol_contracts: ProtocolContracts,
+    pub updated_class_id_witness: MembershipWitness<40>,
+    pub updated_class_id_leaf: PublicDataTreeLeafPreimage,
+    pub updated_class_id_value_change: ScheduledValueChange<ContractClassId>,
+    pub updated_class_id_delay_change: ScheduledDelayChange<86400>,
+    pub start_tree_snapshots: TreeSnapshots,
+    pub end_tree_snapshots: TreeSnapshots,
+    pub min_revertible_side_effect_counter: u32,
+    pub counter_start: u32,
+    pub counter: u32,
+    pub expected_non_revertible_side_effect_counter: u32,
+    pub expected_revertible_side_effect_counter: u32,
+    pub start_state: PartialStateReference,
+    pub value_offset: Field,
+}
+
+

Fields

+
contract_address: AztecAddress
+
msg_sender: AztecAddress
+
is_static_call: bool
+
is_private_only: bool
+
claimed_first_nullifier: Field
+
claimed_revertible_counter: u32
+
include_by_timestamp: u64
+
is_fee_payer: bool
+
fee_payer: AztecAddress
+
public_teardown_call_request: PublicCallRequest
+
transaction_fee: Field
+
effective_gas_fees: GasFees
+
anchor_block_header: BlockHeader
+
tx_context: TxContext
+
global_variables: GlobalVariables
+
note_hashes: BoundedVec<Scoped<Counted<NoteHash>>, 64>
+
nullifiers: BoundedVec<Scoped<Counted<Nullifier>>, 64>
+
l2_to_l1_msgs: BoundedVec<Scoped<Counted<L2ToL1Message>>, 8>
+
+
public_logs: PublicLogs
+
contract_class_logs_hashes: BoundedVec<Scoped<Counted<LogHash>>, 1>
+
contract_class_log_fields: BoundedVec<[Field; 3023], 1>
+
public_data_writes: BoundedVec<PublicDataWrite, 64>
+
private_call_requests: BoundedVec<PrivateCallRequest, 16>
+
public_call_requests: BoundedVec<Counted<PublicCallRequest>, 32>
+
gas_used: Gas
+
start_gas_used: Gas
+
end_gas_used: Gas
+
revert_code: u8
+
reverted: bool
+
note_hash_read_requests: BoundedVec<Scoped<Counted<Field>>, 64>
+
nullifier_read_requests: BoundedVec<Scoped<Counted<Field>>, 64>
+
scoped_key_validation_requests_and_generators: BoundedVec<Scoped<KeyValidationRequestAndGenerator>, 64>
+
function_data: FunctionData
+
args_hash: Field
+
calldata_hash: Field
+
returns_hash: Field
+
salted_initialization_hash: SaltedInitializationHash
+
public_keys: PublicKeys
+
contract_class_artifact_hash: Field
+
contract_class_public_bytecode_commitment: Field
+
function_leaf_membership_witness: MembershipWitness<7>
+
bytecode_hash: Field
+
prover_id: Field
+
+
vk_index: u32
+
vk_path: [Field; 7]
+
vk_tree_root: Field
+
protocol_contracts: ProtocolContracts
+
updated_class_id_witness: MembershipWitness<40>
+
updated_class_id_leaf: PublicDataTreeLeafPreimage
+
updated_class_id_value_change: ScheduledValueChange<ContractClassId>
+
updated_class_id_delay_change: ScheduledDelayChange<86400>
+
start_tree_snapshots: TreeSnapshots
+
end_tree_snapshots: TreeSnapshots
+
min_revertible_side_effect_counter: u32
+
counter_start: u32
+
counter: u32
+
expected_non_revertible_side_effect_counter: u32
+
expected_revertible_side_effect_counter: u32
+
+
value_offset: Field
+

Implementations

+

impl FixtureBuilder

+ +
pub fn new() -> Self + +pub fn new_from_counter(counter_start: u32) -> Self + +pub fn as_parent_contract(&mut self) -> Self + +pub fn in_vk_tree(&mut self, vk_index: u32) -> Self + +pub fn use_protocol_contract(&mut self, contract_index: u32) -> Self + +pub fn use_contract(&mut self, contract_data: ContractData) -> Self + +pub fn use_function(&mut self, function_data: ContractFunction, vk: [Field; 127]) -> Self + +pub fn is_static_call(&mut self) -> Self + +pub fn is_first_call(&mut self) -> Self + +pub fn to_tx_constant_data(self) -> TxConstantData + +pub fn to_private_tx_constant_data(self) -> PrivateTxConstantData + +pub fn build_tx_request(self) -> TxRequest + +pub fn build_call_context(self) -> CallContext + +pub fn build_private_call_request(self) -> PrivateCallRequest + +pub fn to_private_circuit_public_inputs(self) -> PrivateCircuitPublicInputs + +pub fn to_private_verification_key_hints(self) -> PrivateVerificationKeyHints + +pub fn compute_update_tree_and_hints(&mut self) + +pub fn set_anchor_block_header_from_call_data(&mut self, private_call: PrivateCallData) + +pub fn to_private_call_data(self) -> PrivateCallData + +pub fn to_private_accumulated_data(self) -> PrivateAccumulatedData + +pub fn to_public_call_request(self) -> PublicCallRequest + +pub fn to_private_to_public_accumulated_data( + self, + revertible: bool, +) -> PrivateToPublicAccumulatedData + +pub fn to_private_to_rollup_accumulated_data(self) -> PrivateToRollupAccumulatedData + +pub fn to_private_validation_requests(self) -> PrivateValidationRequests + +pub fn to_private_kernel_circuit_public_inputs(self) -> PrivateKernelCircuitPublicInputs + +pub fn to_private_kernel_data(self) -> PrivateKernelData + +pub fn to_private_to_public_kernel_circuit_public_inputs( + self, +) -> PrivateToPublicKernelCircuitPublicInputs + +pub fn to_private_to_rollup_kernel_circuit_public_inputs( + self, +) -> PrivateToRollupKernelCircuitPublicInputs + +pub fn to_avm_accumulated_data(self) -> AvmAccumulatedData + +pub fn to_private_to_avm_accumulated_data( + self, + revertible: bool, +) -> PrivateToAvmAccumulatedData + +pub fn to_avm_circuit_public_inputs(self) -> AvmCircuitPublicInputs + +pub fn add_new_note_hash(&mut self, value: NoteHash) + +pub fn add_siloed_note_hash(&mut self, value: NoteHash) + +pub fn add_siloed_unique_note_hash(&mut self, value: Field) + +pub fn append_note_hashes(&mut self, num_note_hashes: u32) + +pub fn append_siloed_note_hashes(&mut self, num_note_hashes: u32) + +pub fn append_siloed_unique_note_hashes(&mut self, num_note_hashes: u32) + +pub fn append_note_hashes_with_logs(&mut self, num_note_hashes: u32) + +pub fn append_padded_note_hashes(&mut self, num_note_hashes: u32) + +pub fn set_protocol_nullifier(&mut self) + +pub fn add_nullifier(&mut self, value: Field) + +pub fn add_nullifier_for_note_hash(&mut self, value: Field, note_hash: Field) + +pub fn add_siloed_nullifier(&mut self, value: Field) + +pub fn add_siloed_nullifier_for_note_hash(&mut self, value: Field, note_hash: Field) + +pub fn append_nullifiers(&mut self, num_extra_nullifier: u32) + +pub fn append_siloed_nullifiers(&mut self, num_extra_nullifier: u32) + +pub fn append_padded_nullifiers(&mut self, num_nullifiers: u32) + +pub fn add_l2_to_l1_message(&mut self, content: Field, recipient: EthAddress) + +pub fn append_l2_to_l1_msgs(&mut self, num: u32) + +pub fn add_settled_note_hash_read_request(&mut self, value: Field) -> u32 + +pub fn add_read_request_for_pending_note_hash(&mut self, note_hash_index: u32) -> u32 + +pub fn append_note_hash_read_requests(&mut self, num_reads: u32) + +pub fn add_nullifier_read_request(&mut self, value: Field) -> u32 + +pub fn add_read_request_for_pending_nullifier(&mut self, nullifier_index: u32) -> u32 + +pub fn append_nullifier_read_requests(&mut self, num_reads: u32) + +pub fn add_request_for_key_validation( + &mut self, + pk_m: EmbeddedCurvePoint, + sk_app: Field, + sk_app_generator: Field, +) + +pub fn append_key_validation_requests(&mut self, num_requests: u32) + +pub fn add_private_log( + &mut self, + fields: [Field; 18], + length: u32, + note_hash_counter: u32, +) + +pub fn append_private_logs_for_note(&mut self, num_logs: u32, note_hash_counter: u32) + +pub fn append_private_logs(&mut self, num_logs: u32) + +pub fn append_private_logs_with_length<let LogFieldsLen: u32>(&mut self, num_logs: u32) + +pub fn append_private_logs_with_lengths<let NumLogs: u32>( + &mut self, + lengths: [u32; NumLogs], +) + +pub fn add_siloed_private_log( + &mut self, + fields: [Field; 18], + length: u32, + note_hash_counter: u32, +) + +pub fn append_siloed_private_logs_for_note( + &mut self, + num_logs: u32, + note_hash_counter: u32, +) + +pub fn append_siloed_private_logs(&mut self, num_logs: u32) + +pub fn append_siloed_private_logs_with_lengths<let NumLogs: u32>( + &mut self, + lengths: [u32; NumLogs], +) + +pub fn append_siloed_private_logs_with_length<let LogFieldsLen: u32>( + &mut self, + num_logs: u32, +) + +pub fn append_padded_private_logs(&mut self, num_logs: u32) + +pub fn add_public_logs(&mut self, length: u32) + +pub fn add_contract_class_log_hash(&mut self, hash: Field, length: u32) + +pub fn append_contract_class_logs(&mut self, num_logs: u32) + +pub fn append_contract_class_logs_with_length<let LogFieldsLen: u32>( + &mut self, + num_logs: u32, +) + +pub fn append_contract_class_logs_with_lengths<let NumLogs: u32>( + &mut self, + lengths: [u32; NumLogs], +) + +pub fn add_private_call_request_for_private_call( + &mut self, + private_call: PrivateCallData, +) + +pub fn add_private_call_request(&mut self) + +pub fn append_private_call_requests(&mut self, num: u32) + +pub fn add_public_call_request(&mut self, request: PublicCallRequest) + +pub fn append_public_call_requests(&mut self, num: u32) + +pub fn add_public_data_write(&mut self, leaf_slot: Field, value: Field) + +pub fn append_public_data_writes(&mut self, num: u32) + +pub fn set_fee_payer(&mut self, fee_payer: AztecAddress) + +pub fn make_fee_payer(&mut self) -> AztecAddress + +pub fn set_gas_used(&mut self, da_gas: u32, l2_gas: u32) + +pub fn set_public_teardown_call_request(&mut self) + +pub fn end_setup(&mut self) + +

Trait implementations

+

impl Eq for FixtureBuilder

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/contract_functions/fn.get_protocol_contract_function.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/contract_functions/fn.get_protocol_contract_function.html new file mode 100644 index 000000000000..f2561b917787 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/contract_functions/fn.get_protocol_contract_function.html @@ -0,0 +1,40 @@ + + + + + + +Function get_protocol_contract_function documentation + + + + + +
+ +

Function get_protocol_contract_function

+
pub fn get_protocol_contract_function(contract_index: u32) -> ContractFunction
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/contract_functions/global.default_private_function.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/contract_functions/global.default_private_function.html new file mode 100644 index 000000000000..1a33d3e3a054 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/contract_functions/global.default_private_function.html @@ -0,0 +1,40 @@ + + + + + + +Global default_private_function documentation + + + + + +
+ +

Global default_private_function

+
pub global default_private_function: ContractFunction;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/contract_functions/global.default_vk.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/contract_functions/global.default_vk.html new file mode 100644 index 000000000000..c96ff7244d5e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/contract_functions/global.default_vk.html @@ -0,0 +1,40 @@ + + + + + + +Global default_vk documentation + + + + + +
+ +

Global default_vk

+
pub global default_vk: [Field; 127];
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/contract_functions/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/contract_functions/index.html new file mode 100644 index 000000000000..1d8292adf6bf --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/contract_functions/index.html @@ -0,0 +1,59 @@ + + + + + + +Module contract_functions documentation + + + + + +
+
aztec-nr - protocol_types::tests::fixtures::contract_functions
+

Module contract_functions

+

Structs

+

Functions

+

Globals

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/contract_functions/struct.ContractFunction.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/contract_functions/struct.ContractFunction.html new file mode 100644 index 000000000000..5978a77b123e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/contract_functions/struct.ContractFunction.html @@ -0,0 +1,55 @@ + + + + + + +Struct ContractFunction documentation + + + + + +
+ +

Struct ContractFunction

+
pub struct ContractFunction {
+    pub data: FunctionData,
+    pub vk_hash: Field,
+    pub membership_witness: MembershipWitness<7>,
+}
+
+

Fields

+ +
vk_hash: Field
+
membership_witness: MembershipWitness<7>
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/contracts/fn.get_protocol_contract.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/contracts/fn.get_protocol_contract.html new file mode 100644 index 000000000000..6ec220bdf8fa --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/contracts/fn.get_protocol_contract.html @@ -0,0 +1,40 @@ + + + + + + +Function get_protocol_contract documentation + + + + + +
+ +

Function get_protocol_contract

+
pub fn get_protocol_contract(index: u32) -> ContractData
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/contracts/global.default_contract.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/contracts/global.default_contract.html new file mode 100644 index 000000000000..163cfd037eab --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/contracts/global.default_contract.html @@ -0,0 +1,40 @@ + + + + + + +Global default_contract documentation + + + + + +
+ +

Global default_contract

+
pub global default_contract: ContractData;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/contracts/global.parent_contract.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/contracts/global.parent_contract.html new file mode 100644 index 000000000000..566f56a9ce4d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/contracts/global.parent_contract.html @@ -0,0 +1,40 @@ + + + + + + +Global parent_contract documentation + + + + + +
+ +

Global parent_contract

+
pub global parent_contract: ContractData;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/contracts/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/contracts/index.html new file mode 100644 index 000000000000..8a6735f7e80c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/contracts/index.html @@ -0,0 +1,59 @@ + + + + + + +Module contracts documentation + + + + + +
+ +

Module contracts

+

Structs

+

Functions

+

Globals

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/contracts/struct.ContractData.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/contracts/struct.ContractData.html new file mode 100644 index 000000000000..8a8ececace19 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/contracts/struct.ContractData.html @@ -0,0 +1,76 @@ + + + + + + +Struct ContractData documentation + + + + + +
+ +

Struct ContractData

+
pub struct ContractData {
+    pub address: AztecAddress,
+    pub artifact_hash: Field,
+    pub contract_address_salt: Field,
+    pub contract_class_id: ContractClassId,
+    pub private_functions_root: Field,
+    pub public_bytecode_commitment: Field,
+    pub public_keys: PublicKeys,
+    pub salted_initialization_hash: SaltedInitializationHash,
+    pub partial_address: PartialAddress,
+    pub deployer: AztecAddress,
+}
+
+

Fields

+
address: AztecAddress
+
artifact_hash: Field
+
contract_address_salt: Field
+
contract_class_id: ContractClassId
+
private_functions_root: Field
+
public_bytecode_commitment: Field
+
public_keys: PublicKeys
+
salted_initialization_hash: SaltedInitializationHash
+
partial_address: PartialAddress
+
deployer: AztecAddress
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/global.CHAIN_ID.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/global.CHAIN_ID.html new file mode 100644 index 000000000000..1c645c1ece8b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/global.CHAIN_ID.html @@ -0,0 +1,44 @@ + + + + + + +Global CHAIN_ID documentation + + + + + +
+ +

Global CHAIN_ID

+
pub global CHAIN_ID: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/global.GENESIS_TIMESTAMP.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/global.GENESIS_TIMESTAMP.html new file mode 100644 index 000000000000..6f704dbe2a49 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/global.GENESIS_TIMESTAMP.html @@ -0,0 +1,44 @@ + + + + + + +Global GENESIS_TIMESTAMP documentation + + + + + +
+ +

Global GENESIS_TIMESTAMP

+
pub global GENESIS_TIMESTAMP: u64;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/global.MSG_SENDER.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/global.MSG_SENDER.html new file mode 100644 index 000000000000..80df2d57cae9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/global.MSG_SENDER.html @@ -0,0 +1,44 @@ + + + + + + +Global MSG_SENDER documentation + + + + + +
+ +

Global MSG_SENDER

+
pub global MSG_SENDER: AztecAddress;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/global.VERSION.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/global.VERSION.html new file mode 100644 index 000000000000..8bff86a45510 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/global.VERSION.html @@ -0,0 +1,44 @@ + + + + + + +Global VERSION documentation + + + + + +
+ +

Global VERSION

+
pub global VERSION: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/index.html new file mode 100644 index 000000000000..e096765c81b3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/index.html @@ -0,0 +1,55 @@ + + + + + + +Module fixtures documentation + + + + + +
+ +

Module fixtures

+

Modules

+

Globals

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/proof_data/fn.make_proof.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/proof_data/fn.make_proof.html new file mode 100644 index 000000000000..76463a4e9069 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/proof_data/fn.make_proof.html @@ -0,0 +1,35 @@ + + + + + + +Function make_proof documentation + + + + + +
+ +

Function make_proof

+
pub fn make_proof<let ProofLen: u32>(seed: u32) -> [Field; ProofLen]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/proof_data/fn.make_proof_data.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/proof_data/fn.make_proof_data.html new file mode 100644 index 000000000000..ab2a7469a60e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/proof_data/fn.make_proof_data.html @@ -0,0 +1,38 @@ + + + + + + +Function make_proof_data documentation + + + + + +
+ +

Function make_proof_data

+
pub fn make_proof_data<T, let ProofLen: u32, let VkLen: u32>(
+    public_inputs: T,
+    vk_index: u32,
+) -> ProofData<T, ProofLen, VkLen>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/proof_data/fn.make_proof_data_for_fixed_vk.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/proof_data/fn.make_proof_data_for_fixed_vk.html new file mode 100644 index 000000000000..216f3897ed83 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/proof_data/fn.make_proof_data_for_fixed_vk.html @@ -0,0 +1,38 @@ + + + + + + +Function make_proof_data_for_fixed_vk documentation + + + + + +
+ +

Function make_proof_data_for_fixed_vk

+
pub fn make_proof_data_for_fixed_vk<T, let ProofLen: u32>(
+    public_inputs: T,
+    seed: u32,
+) -> ProofDataForFixedVk<T, ProofLen>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/proof_data/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/proof_data/index.html new file mode 100644 index 000000000000..dba2546ad604 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/proof_data/index.html @@ -0,0 +1,52 @@ + + + + + + +Module proof_data documentation + + + + + +
+ +

Module proof_data

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/protocol_contracts/fn.get_protocol_contracts.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/protocol_contracts/fn.get_protocol_contracts.html new file mode 100644 index 000000000000..f9c3ff90d8cc --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/protocol_contracts/fn.get_protocol_contracts.html @@ -0,0 +1,33 @@ + + + + + + +Function get_protocol_contracts documentation + + + + + +
+ +

Function get_protocol_contracts

+
pub fn get_protocol_contracts() -> ProtocolContracts
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/protocol_contracts/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/protocol_contracts/index.html new file mode 100644 index 000000000000..35c804f0e005 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/protocol_contracts/index.html @@ -0,0 +1,50 @@ + + + + + + +Module protocol_contracts documentation + + + + + +
+
aztec-nr - protocol_types::tests::fixtures::protocol_contracts
+

Module protocol_contracts

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/public_data_tree/fn.empty_public_data_tree.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/public_data_tree/fn.empty_public_data_tree.html new file mode 100644 index 000000000000..94bffefa7550 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/public_data_tree/fn.empty_public_data_tree.html @@ -0,0 +1,35 @@ + + + + + + +Function empty_public_data_tree documentation + + + + + +
+ +

Function empty_public_data_tree

+
pub fn empty_public_data_tree<let SubtreeWidth: u32, let SubtreeHeight: u32>(
+    prefill_count: u32,
+) -> SingleSubtreeMerkleTree<SubtreeWidth, SubtreeHeight, 40>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/public_data_tree/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/public_data_tree/index.html new file mode 100644 index 000000000000..b779a44ce540 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/public_data_tree/index.html @@ -0,0 +1,50 @@ + + + + + + +Module public_data_tree documentation + + + + + +
+
aztec-nr - protocol_types::tests::fixtures::public_data_tree
+

Module public_data_tree

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/vk_tree/fn.generate_fake_chonk_vk_for_index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/vk_tree/fn.generate_fake_chonk_vk_for_index.html new file mode 100644 index 000000000000..9fe16fd195dc --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/vk_tree/fn.generate_fake_chonk_vk_for_index.html @@ -0,0 +1,42 @@ + + + + + + +Function generate_fake_chonk_vk_for_index documentation + + + + + +
+ +

Function generate_fake_chonk_vk_for_index

+
pub fn generate_fake_chonk_vk_for_index(index: u32) -> VerificationKey<127>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/vk_tree/fn.generate_fake_honk_vk_for_index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/vk_tree/fn.generate_fake_honk_vk_for_index.html new file mode 100644 index 000000000000..4dfa807ebf5e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/vk_tree/fn.generate_fake_honk_vk_for_index.html @@ -0,0 +1,42 @@ + + + + + + +Function generate_fake_honk_vk_for_index documentation + + + + + +
+ +

Function generate_fake_honk_vk_for_index

+
pub fn generate_fake_honk_vk_for_index(index: u32) -> VerificationKey<115>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/vk_tree/fn.generate_fake_rollup_honk_vk_for_index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/vk_tree/fn.generate_fake_rollup_honk_vk_for_index.html new file mode 100644 index 000000000000..60b02926f622 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/vk_tree/fn.generate_fake_rollup_honk_vk_for_index.html @@ -0,0 +1,42 @@ + + + + + + +Function generate_fake_rollup_honk_vk_for_index documentation + + + + + +
+ +

Function generate_fake_rollup_honk_vk_for_index

+
pub fn generate_fake_rollup_honk_vk_for_index(index: u32) -> VerificationKey<115>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/vk_tree/fn.generate_fake_vk_for_index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/vk_tree/fn.generate_fake_vk_for_index.html new file mode 100644 index 000000000000..d4a163561174 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/vk_tree/fn.generate_fake_vk_for_index.html @@ -0,0 +1,42 @@ + + + + + + +Function generate_fake_vk_for_index documentation + + + + + +
+ +

Function generate_fake_vk_for_index

+
pub fn generate_fake_vk_for_index<let N: u32>(vk_index: u32) -> VerificationKey<N>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/vk_tree/fn.get_vk_data.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/vk_tree/fn.get_vk_data.html new file mode 100644 index 000000000000..531b423c098d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/vk_tree/fn.get_vk_data.html @@ -0,0 +1,42 @@ + + + + + + +Function get_vk_data documentation + + + + + +
+ +

Function get_vk_data

+
pub fn get_vk_data<let VkLen: u32>(vk_index: u32) -> VkData<VkLen>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/vk_tree/global.VK_MERKLE_TREE.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/vk_tree/global.VK_MERKLE_TREE.html new file mode 100644 index 000000000000..f510fd2f1752 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/vk_tree/global.VK_MERKLE_TREE.html @@ -0,0 +1,42 @@ + + + + + + +Global VK_MERKLE_TREE documentation + + + + + +
+ +

Global VK_MERKLE_TREE

+
pub global VK_MERKLE_TREE: MerkleTree<128>;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/vk_tree/global.VK_TREE_WIDTH.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/vk_tree/global.VK_TREE_WIDTH.html new file mode 100644 index 000000000000..d89e302d8d31 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/vk_tree/global.VK_TREE_WIDTH.html @@ -0,0 +1,42 @@ + + + + + + +Global VK_TREE_WIDTH documentation + + + + + +
+ +

Global VK_TREE_WIDTH

+
pub global VK_TREE_WIDTH: u32;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/vk_tree/global.vk_tree_root.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/vk_tree/global.vk_tree_root.html new file mode 100644 index 000000000000..9c479c349bda --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/vk_tree/global.vk_tree_root.html @@ -0,0 +1,42 @@ + + + + + + +Global vk_tree_root documentation + + + + + +
+ +

Global vk_tree_root

+
pub global vk_tree_root: Field;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/vk_tree/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/vk_tree/index.html new file mode 100644 index 000000000000..bbc83a9cfa3c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/fixtures/vk_tree/index.html @@ -0,0 +1,60 @@ + + + + + + +Module vk_tree documentation + + + + + +
+ +

Module vk_tree

+

Functions

+

Globals

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/index.html new file mode 100644 index 000000000000..b1bfe3d7a825 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/index.html @@ -0,0 +1,72 @@ + + + + + + +Module tests documentation + + + + + +
+ +

Module tests

+

Re-exports

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/merkle_tree_utils/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/merkle_tree_utils/index.html new file mode 100644 index 000000000000..db538fd32924 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/merkle_tree_utils/index.html @@ -0,0 +1,43 @@ + + + + + + +Module merkle_tree_utils documentation + + + + + +
+
aztec-nr - protocol_types::tests::merkle_tree_utils
+

Module merkle_tree_utils

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/merkle_tree_utils/struct.SingleSubtreeMerkleTree.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/merkle_tree_utils/struct.SingleSubtreeMerkleTree.html new file mode 100644 index 000000000000..8583406a2ec9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/merkle_tree_utils/struct.SingleSubtreeMerkleTree.html @@ -0,0 +1,72 @@ + + + + + + +Struct SingleSubtreeMerkleTree documentation + + + + + +
+ +

Struct SingleSubtreeMerkleTree

+
pub struct SingleSubtreeMerkleTree<let SubtreeWidth: u32, let SubtreeHeight: u32, let TreeHeight: u32>
+{ /* private fields */ }
+
+

Implementations

+

impl<let SubtreeHeight: u32, let SubtreeWidth: u32, let TreeHeight: u32> SingleSubtreeMerkleTree<SubtreeWidth, SubtreeHeight, TreeHeight>

+ +
pub fn new(subtree_leaves: [Field; SubtreeWidth]) -> Self + +pub fn new_at_index( + subtree_leaves: [Field; SubtreeWidth], + first_leaf_index: Field, +) -> Self + +pub fn new_tree_roots_at_index<let InsertedValueTreeHeight: u32>( + subtree_leaves: [Field; SubtreeWidth], + first_leaf_index: Field, +) -> Self + +
+

The values to be inserted to the subtree are tree roots themselves. The zero hashes will take into account the +extra layers (InsertedValueTreeHeight) of the inserted values.

+
+
pub fn get_sibling_path(self, leaf_index: Field) -> [Field; TreeHeight] + +pub fn update_leaf(&mut self, leaf_index: Field, value: Field) + +pub fn get_root(self) -> Field + +pub fn get_next_available_index(self) -> Field + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/types/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/types/index.html new file mode 100644 index 000000000000..bc67e4ec2772 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/types/index.html @@ -0,0 +1,44 @@ + + + + + + +Module types documentation + + + + + +
+ +

Module types

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/types/struct.TestLeafPreimage.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/types/struct.TestLeafPreimage.html new file mode 100644 index 000000000000..ed1dc359cb73 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/types/struct.TestLeafPreimage.html @@ -0,0 +1,84 @@ + + + + + + +Struct TestLeafPreimage documentation + + + + + +
+ +

Struct TestLeafPreimage

+
pub struct TestLeafPreimage {
+    pub value: Field,
+    pub next_value: Field,
+}
+
+

Fields

+
value: Field
+
next_value: Field
+

Trait implementations

+

impl Empty for TestLeafPreimage

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for TestLeafPreimage

+ +
pub fn eq(self, other: Self) -> bool + +

impl IndexedTreeLeafPreimage<Field> for TestLeafPreimage

+ +
pub fn get_next_key(self) -> Field + +pub fn points_to_infinity(self) -> bool + +pub fn update_pointers(self, next_value: Field, _next_index: Field) -> Self + +pub fn update_value(self, value: Field) -> Self + +pub fn build_insertion_leaf(value: Field, low_leaf: Self) -> Self + +

impl LeafPreimage for TestLeafPreimage

+ +
pub fn get_key(self) -> Field + +pub fn as_leaf(self) -> Field + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/types/struct.TestValue.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/types/struct.TestValue.html new file mode 100644 index 000000000000..6149d5e5da76 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/types/struct.TestValue.html @@ -0,0 +1,79 @@ + + + + + + +Struct TestValue documentation + + + + + +
+ +

Struct TestValue

+
pub struct TestValue {
+    pub value: Field,
+    pub counter: u32,
+}
+
+

Fields

+
value: Field
+
counter: u32
+

Trait implementations

+

impl Deserialize for TestValue

+ +
pub fn deserialize(serialized: [Field; 2]) -> Self + +

impl Empty for TestValue

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl Eq for TestValue

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl Ordered for TestValue

+ +
pub fn counter(self) -> u32 + +

impl Serialize for TestValue

+ +
pub fn serialize(self) -> [Field; 2] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/utils/fn.assert_array_eq.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/utils/fn.assert_array_eq.html new file mode 100644 index 000000000000..2927c46a444b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/utils/fn.assert_array_eq.html @@ -0,0 +1,39 @@ + + + + + + +Function assert_array_eq documentation + + + + + +
+ +

Function assert_array_eq

+
pub fn assert_array_eq<T, let N: u32, let M: u32>(array: [T; N], expected: [T; M])
+
where + T: Empty
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/utils/fn.make_fixture.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/utils/fn.make_fixture.html new file mode 100644 index 000000000000..27e68b2aea83 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/utils/fn.make_fixture.html @@ -0,0 +1,39 @@ + + + + + + +Function make_fixture documentation + + + + + +
+ +

Function make_fixture

+
pub fn make_fixture<T>(seed: Field) -> T
+
where + T: Deserialize
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/utils/fn.pad_end.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/utils/fn.pad_end.html new file mode 100644 index 000000000000..efb9dcd8a8a1 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/utils/fn.pad_end.html @@ -0,0 +1,39 @@ + + + + + + +Function pad_end documentation + + + + + +
+ +

Function pad_end

+
pub fn pad_end<T, let N: u32, let M: u32>(items: [T; N]) -> [T; M]
+
where + T: Empty
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/utils/fn.pad_end_with.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/utils/fn.pad_end_with.html new file mode 100644 index 000000000000..a6d67f40fe5e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/utils/fn.pad_end_with.html @@ -0,0 +1,37 @@ + + + + + + +Function pad_end_with documentation + + + + + +
+ +

Function pad_end_with

+
pub fn pad_end_with<T, let N: u32, let M: u32>(items: [T; N], padded_item: T) -> [T; M]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/utils/fn.swap_items.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/utils/fn.swap_items.html new file mode 100644 index 000000000000..7bef0a1b244e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/utils/fn.swap_items.html @@ -0,0 +1,41 @@ + + + + + + +Function swap_items documentation + + + + + +
+ +

Function swap_items

+
pub fn swap_items<T, let N: u32>(
+    vec: &mut BoundedVec<T, N>,
+    from_index: u32,
+    to_index: u32,
+)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/utils/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/utils/index.html new file mode 100644 index 000000000000..2d96ba2fc427 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tests/utils/index.html @@ -0,0 +1,47 @@ + + + + + + +Module utils documentation + + + + + +
+ +

Module utils

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/traits/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/traits/index.html new file mode 100644 index 000000000000..93eaa3052488 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/traits/index.html @@ -0,0 +1,70 @@ + + + + + + +Module traits documentation + + + + + +
+ +

Module traits

+

Traits

    +
  • Trait for deserializing Noir types from arrays of Fields.
  • +
  • +
  • +
  • +
  • Trait for efficiently packing and unpacking Noir types into and from arrays of Fields.
  • +
  • Trait for serializing Noir types into arrays of Fields.
  • +
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/traits/trait.Deserialize.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/traits/trait.Deserialize.html new file mode 100644 index 000000000000..f1f22cfb0b2b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/traits/trait.Deserialize.html @@ -0,0 +1,442 @@ + + + + + + +Trait Deserialize documentation + + + + + +
+ +

Trait Deserialize

+
pub trait Deserialize {
+    let N: u32;
+
+    // Required methods
+    pub fn deserialize(fields: [Field; N]) -> Self;
+}
+ +
+

Trait for deserializing Noir types from arrays of Fields.

+

An implementation of the Deserialize trait has to follow Noir's intrinsic serialization (each member of a struct +converted directly into one or more Fields without any packing or compression). This trait is typically used when +deserializing return values from function calls in Noir. Since the same function could be called from TypeScript +(TS), in which case the TS deserialization would get used, we need to have a match between the 2.

+

Associated Constants

+
    +
  • N - The length of the input Field array, known at compile time
  • +
+

Example

+
impl<let M: u32> Deserialize for str<M> {
+    let N: u32 = M;
+
+    #[inline_always]
+    fn deserialize(fields: [Field; Self::N]) -> Self {
+        str::<Self::N>::from(fields.map(|value| value as u8))
+    }
+}
+

Required methods

+
pub fn deserialize(fields: [Field; N]) -> Self + +

Implementors

+

impl Deserialize for ()

+ +

impl<T0, T1> Deserialize for (T0, T1) +
where + T0: Deserialize, + T1: Deserialize

+ +

impl<T0, T1, T2> Deserialize for (T0, T1, T2) +
where + T0: Deserialize, + T1: Deserialize, + T2: Deserialize

+ +

impl<T0, T1, T2, T3> Deserialize for (T0, T1, T2, T3) +
where + T0: Deserialize, + T1: Deserialize, + T2: Deserialize, + T3: Deserialize

+ +

impl<T0, T1, T2, T3, T4> Deserialize for (T0, T1, T2, T3, T4) +
where + T0: Deserialize, + T1: Deserialize, + T2: Deserialize, + T3: Deserialize, + T4: Deserialize

+ +

impl<T0, T1, T2, T3, T4, T5> Deserialize for (T0, T1, T2, T3, T4, T5) +
where + T0: Deserialize, + T1: Deserialize, + T2: Deserialize, + T3: Deserialize, + T4: Deserialize, + T5: Deserialize

+ +

impl<T1> Deserialize for (T1,) +
where + T1: Deserialize

+ +

impl Deserialize for AddressNote

+ +

impl Deserialize for AppendOnlyTreeSnapshot

+ +

impl Deserialize for AuthorizationSelector

+ +

impl Deserialize for AvmAccumulatedData

+ +

impl Deserialize for AvmAccumulatedDataArrayLengths

+ +

impl Deserialize for AvmCircuitPublicInputs

+ +

impl Deserialize for AztecAddress

+ +

impl Deserialize for BlockConstantData

+ +

impl Deserialize for BlockHeader

+ +

impl<let M: u32, T> Deserialize for BoundedVec<T, M> +
where + T: Deserialize

+ +

impl Deserialize for CallContext

+ +

impl Deserialize for CheckpointConstantData

+ +

impl Deserialize for CheckpointHeader

+ +

impl<let N: u32, T> Deserialize for ClaimedLengthArray<T, N> +
where + T: Deserialize

+ +

impl<let M: u32, let N: u32> Deserialize for CompressedString<N, M>

+ +

impl Deserialize for ContentCommitment

+ +

impl Deserialize for ContractClassId

+ +

impl Deserialize for ContractInstance

+ +

impl<T> Deserialize for Counted<T> +
where + T: Deserialize

+ +

impl Deserialize for EmbeddedCurvePoint

+ +

impl Deserialize for Empty

+ +

impl Deserialize for EpochConstantData

+ +

impl Deserialize for EthAddress

+ +

impl Deserialize for EventSelector

+ +

impl Deserialize for Fancier

+ +

impl Deserialize for FeeRecipient

+ +

impl Deserialize for Field

+ +

impl Deserialize for FieldCompressedString

+ +

impl Deserialize for FieldNote

+ +

impl Deserialize for FunctionData

+ +

impl Deserialize for FunctionSelector

+ +

impl Deserialize for Gas

+ +

impl Deserialize for GasFees

+ +

impl Deserialize for GasSettings

+ +

impl Deserialize for GlobalVariables

+ +

impl Deserialize for HasArray

+ +

impl<let N: u32, T> Deserialize for HasArrayWithGenerics<T, N> +
where + T: Deserialize

+ +

impl Deserialize for IvpkM

+ +

impl Deserialize for KeyValidationRequest

+ +

impl Deserialize for KeyValidationRequestAndGenerator

+ +

impl Deserialize for L2ToL1Message

+ +

impl<let N: u32> Deserialize for Log<N>

+ +

impl Deserialize for LogHash

+ +

impl<let M: u32, let N: u32> Deserialize for MembershipWitness<N, M>

+ +

impl Deserialize for MessageContext

+ +

impl Deserialize for MockStruct

+ +

impl Deserialize for NoteMetadata

+ +

impl Deserialize for NpkM

+ +

impl Deserialize for Nullifier

+ +

impl Deserialize for NullifierLeafPreimage

+ +

impl Deserialize for NullifierMembershipWitness

+ +

impl<T> Deserialize for Option<T> +
where + T: Deserialize

+ +

impl Deserialize for OvpkM

+ +

impl Deserialize for PartialAddress

+ +

impl Deserialize for PartialStateReference

+ +

impl Deserialize for PartialUintNote

+ +

impl Deserialize for Poseidon2Sponge

+ +

impl Deserialize for PrivateCallRequest

+ +

impl Deserialize for PrivateCircuitPublicInputs

+ +

impl Deserialize for PrivateLogData

+ +

impl Deserialize for PrivateToAvmAccumulatedData

+ +

impl Deserialize for PrivateToAvmAccumulatedDataArrayLengths

+ +

impl Deserialize for PrivateToPublicAccumulatedData

+ +

impl Deserialize for PrivateToPublicKernelCircuitPublicInputs

+ +

impl Deserialize for PrivateToRollupAccumulatedData

+ +

impl Deserialize for PrivateToRollupKernelCircuitPublicInputs

+ +

impl Deserialize for ProtocolContracts

+ +

impl Deserialize for PublicCallRequest

+ +

impl Deserialize for PublicCallRequestArrayLengths

+ +

impl Deserialize for PublicDataTreeLeafPreimage

+ +

impl Deserialize for PublicDataWitness

+ +

impl Deserialize for PublicDataWrite

+ +

impl Deserialize for PublicKeys

+ +

impl Deserialize for PublicKeysHash

+ +

impl Deserialize for PublicLogs

+ +

impl<Note> Deserialize for RetrievedNote<Note> +
where + Note: Deserialize

+ +

impl<T> Deserialize for Scoped<T> +
where + T: Deserialize

+ +

impl Deserialize for Smol

+ +

impl Deserialize for SpongeBlob

+ +

impl Deserialize for StateReference

+ +

impl Deserialize for TestAccount

+ +

impl Deserialize for TestValue

+ +

impl Deserialize for TpkM

+ +

impl Deserialize for TreeSnapshots

+ +

impl Deserialize for TxConstantData

+ +

impl Deserialize for TxContext

+ +

impl Deserialize for TxRequest

+ +

impl Deserialize for UintNote

+ +

impl<let M: u32, T> Deserialize for [T; M] +
where + T: Deserialize

+ +

impl Deserialize for bool

+ +

impl Deserialize for i16

+ +

impl Deserialize for i32

+ +

impl Deserialize for i64

+ +

impl Deserialize for i8

+ +

impl<let M: u32> Deserialize for str<M>

+ +

impl Deserialize for u1

+ +

impl Deserialize for u128

+ +

impl Deserialize for u16

+ +

impl Deserialize for u32

+ +

impl Deserialize for u64

+ +

impl Deserialize for u8

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/traits/trait.Empty.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/traits/trait.Empty.html new file mode 100644 index 000000000000..a936f081d8c5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/traits/trait.Empty.html @@ -0,0 +1,358 @@ + + + + + + +Trait Empty documentation + + + + + +
+ +

Trait Empty

+
pub trait Empty: Eq {
+    // Required methods
+    pub fn empty() -> Self;
+
+    // Provided methods
+    pub fn is_empty(self) -> bool { ... }
+    pub fn assert_empty<let S: u32>(self, msg: str<S>) { ... }
+}
+ +

Required methods

+
pub fn empty() -> Self + +

Provided methods

+
pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

Implementors

+

impl<A, B> Empty for (A, B) +
where + A: Empty, + B: Empty

+ +

impl Empty for AppendOnlyTreeSnapshot

+ +

impl Empty for AuthorizationSelector

+ +

impl Empty for AvmAccumulatedData

+ +

impl Empty for AvmAccumulatedDataArrayLengths

+ +

impl Empty for AvmCircuitPublicInputs

+ +

impl Empty for AztecAddress

+ +

impl Empty for BlockConstantData

+ +

impl Empty for BlockHeader

+ +

impl Empty for CallContext

+ +

impl Empty for CheckpointConstantData

+ +

impl Empty for CheckpointHeader

+ +

impl<let N: u32, T> Empty for ClaimedLengthArray<T, N> +
where + T: Empty

+ +

impl Empty for ContentCommitment

+ +

impl Empty for ContractClassId

+ +

impl Empty for ContractClassLog

+ +

impl<T> Empty for Counted<T> +
where + T: Empty

+ +

impl Empty for EmbeddedCurvePoint

+ +

impl Empty for EmbeddedCurveScalar

+ +

impl Empty for EpochConstantData

+ +

impl Empty for EthAddress

+ +

impl Empty for EventSelector

+ +

impl Empty for FeeRecipient

+ +

impl Empty for Field

+ +

impl Empty for FunctionData

+ +

impl Empty for FunctionSelector

+ +

impl Empty for Gas

+ +

impl Empty for GasFees

+ +

impl Empty for GasSettings

+ +

impl Empty for GlobalVariables

+ +

impl Empty for KeyValidationRequest

+ +

impl Empty for KeyValidationRequestAndGenerator

+ +

impl Empty for L2ToL1Message

+ +

impl<let N: u32> Empty for Log<N>

+ +

impl Empty for LogHash

+ +

impl<let N: u32> Empty for MembershipWitness<N>

+ +

impl<let N: u32> Empty for MerkleTree<N>

+ +

impl Empty for MockStruct

+ +

impl Empty for NoteHashLeafPreimage

+ +

impl Empty for Nullifier

+ +

impl Empty for NullifierLeafPreimage

+ +

impl<T> Empty for Option<T> +
where + T: Eq

+ +

impl Empty for PartialAddress

+ +

impl Empty for PartialStateReference

+ +

impl Empty for PrivateAccumulatedData

+ +

impl Empty for PrivateCallRequest

+ +

impl Empty for PrivateCircuitPublicInputs

+ +

impl Empty for PrivateContext

+ +

impl Empty for PrivateContextInputs

+ +

impl Empty for PrivateKernelCircuitPublicInputs

+ +

impl Empty for PrivateLogData

+ +

impl Empty for PrivateToAvmAccumulatedData

+ +

impl Empty for PrivateToAvmAccumulatedDataArrayLengths

+ +

impl Empty for PrivateToPublicAccumulatedData

+ +

impl Empty for PrivateToPublicKernelCircuitPublicInputs

+ +

impl Empty for PrivateToRollupAccumulatedData

+ +

impl Empty for PrivateToRollupKernelCircuitPublicInputs

+ +

impl Empty for PrivateTxConstantData

+ +

impl Empty for PrivateValidationRequests

+ +

impl Empty for ProtocolContracts

+ +

impl Empty for PublicCallRequest

+ +

impl Empty for PublicCallRequestArrayLengths

+ +

impl Empty for PublicContext

+ +

impl Empty for PublicDataTreeLeaf

+ +

impl Empty for PublicDataTreeLeafPreimage

+ +

impl Empty for PublicDataWrite

+ +

impl Empty for PublicKeysHash

+ +

impl Empty for PublicLogs

+ +

impl<let INITIAL_DELAY: u64> Empty for ScheduledDelayChange<INITIAL_DELAY>

+ +

impl<T> Empty for ScheduledValueChange<T> +
where + T: Empty

+ +

impl<T> Empty for Scoped<T> +
where + T: Empty

+ +

impl Empty for SpongeBlob

+ +

impl Empty for StateReference

+ +

impl Empty for TestLeafPreimage

+ +

impl Empty for TestValue

+ +

impl Empty for TreeSnapshots

+ +

impl Empty for TxConstantData

+ +

impl Empty for TxContext

+ +

impl Empty for TxEffect

+ +

impl Empty for TxRequest

+ +

impl<let M: u32> Empty for VerificationKey<M>

+ +

impl<let VK_LENGTH: u32> Empty for VkData<VK_LENGTH>

+ +

impl<let N: u32, T> Empty for [T; N] +
where + T: Empty

+ +

impl<T> Empty for [T] +
where + T: Empty

+ +

impl Empty for bool

+ +

impl Empty for u1

+ +

impl Empty for u128

+ +

impl Empty for u16

+ +

impl Empty for u32

+ +

impl Empty for u64

+ +

impl Empty for u8

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/traits/trait.FromField.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/traits/trait.FromField.html new file mode 100644 index 000000000000..12f693d8984c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/traits/trait.FromField.html @@ -0,0 +1,96 @@ + + + + + + +Trait FromField documentation + + + + + +
+ +

Trait FromField

+
pub trait FromField {
+    // Required methods
+    pub fn from_field(value: Field) -> Self;
+}
+ +

Required methods

+
pub fn from_field(value: Field) -> Self + +

Implementors

+

impl FromField for AuthorizationSelector

+ +

impl FromField for AztecAddress

+ +

impl FromField for ContractClassId

+ +

impl FromField for EventSelector

+ +

impl FromField for Field

+ +

impl FromField for FunctionSelector

+ +

impl FromField for PartialUintNote

+ +

impl FromField for bool

+ +

impl FromField for u1

+ +

impl FromField for u128

+ +

impl FromField for u16

+ +

impl FromField for u32

+ +

impl FromField for u64

+ +

impl FromField for u8

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/traits/trait.Hash.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/traits/trait.Hash.html new file mode 100644 index 000000000000..ec082b0e1ab3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/traits/trait.Hash.html @@ -0,0 +1,98 @@ + + + + + + +Trait Hash documentation + + + + + +
+ +

Trait Hash

+
pub trait Hash {
+    // Required methods
+    pub fn hash(self) -> Field;
+}
+ +

Required methods

+
pub fn hash(self) -> Field + +

Implementors

+

impl Hash for AppPayload

+ +

impl Hash for BlockHeader

+ +

impl Hash for CheckpointHeader

+ +

impl Hash for ContractClassFunctionLeafPreimage

+ +

impl Hash for ContractInstance

+ +

impl<let INITIAL_DELAY: u64, T> Hash for DelayedPublicMutableValues<T, INITIAL_DELAY> +
where + T: Packable

+ +

impl Hash for EmbeddedCurvePoint

+ +

impl Hash for NpkM

+ +

impl Hash for NullifierLeafPreimage

+ +

impl Hash for OvpkM

+ +

impl Hash for PrivateToPublicKernelCircuitPublicInputs

+ +

impl Hash for PrivateToRollupKernelCircuitPublicInputs

+ +

impl Hash for PublicDataTreeLeafPreimage

+ +

impl Hash for TxRequest

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/traits/trait.Packable.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/traits/trait.Packable.html new file mode 100644 index 000000000000..f21108ec5865 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/traits/trait.Packable.html @@ -0,0 +1,179 @@ + + + + + + +Trait Packable documentation + + + + + +
+ +

Trait Packable

+
pub trait Packable {
+    let N: u32;
+
+    // Required methods
+    pub fn pack(self) -> [Field; N];
+    pub fn unpack(fields: [Field; N]) -> Self;
+}
+ +
+

Trait for efficiently packing and unpacking Noir types into and from arrays of Fields.

+

The Packable trait allows types to be serialized and deserialized with a focus on minimizing the size of +the resulting Field array. This trait is used when storage efficiency is critical (e.g. when storing data +in the contract's public storage).

+

Associated Constants

+
    +
  • N - The length of the Field array, known at compile time
  • +
+
+

Required methods

+
pub fn pack(self) -> [Field; N] + +
+

Packs the current value into a compact array of Field elements.

+
+
pub fn unpack(fields: [Field; N]) -> Self + +
+

Unpacks a compact array of Field elements into the original value.

+
+

Implementors

+

impl Packable for AddressNote

+ +

impl Packable for AztecAddress

+ +

impl<let M: u32, let N: u32> Packable for CompressedString<N, M>

+ +

impl Packable for ContractClassId

+ +

impl<let INITIAL_DELAY: u64, T> Packable for DelayedPublicMutableValues<T, INITIAL_DELAY> +
where + T: Packable

+ +

impl Packable for EmbeddedCurvePoint

+ +

impl Packable for Empty

+ +

impl Packable for EthAddress

+ +

impl Packable for Field

+ +

impl Packable for FieldCompressedString

+ +

impl Packable for FieldNote

+ +

impl<let N: u32, T> Packable for HasArrayWithGenerics<T, N> +
where + T: Packable

+ +

impl Packable for MockStruct

+ +

impl Packable for MockStruct

+ +

impl Packable for NoteMetadata

+ +

impl Packable for PartialUintNote

+ +

impl<Note> Packable for RetrievedNote<Note> +
where + Note: Packable

+ +

impl Packable for Smol

+ +

impl Packable for UintNote

+ +

impl<let M: u32, T> Packable for WithHash<T, M> +
where + T: Packable<N = M>

+ +

impl<let M: u32, T> Packable for [T; M] +
where + T: Packable

+ +

impl Packable for bool

+ +

impl Packable for i16

+ +

impl Packable for i32

+ +

impl Packable for i64

+ +

impl Packable for i8

+ +

impl Packable for u128

+ +

impl Packable for u16

+ +

impl Packable for u32

+ +

impl Packable for u64

+ +

impl Packable for u8

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/traits/trait.Serialize.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/traits/trait.Serialize.html new file mode 100644 index 000000000000..1cb21b88c199 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/traits/trait.Serialize.html @@ -0,0 +1,455 @@ + + + + + + +Trait Serialize documentation + + + + + +
+ +

Trait Serialize

+
pub trait Serialize {
+    let N: u32;
+
+    // Required methods
+    pub fn serialize(self) -> [Field; N];
+}
+ +
+

Trait for serializing Noir types into arrays of Fields.

+

An implementation of the Serialize trait has to follow Noir's intrinsic serialization (each member of a struct +converted directly into one or more Fields without any packing or compression). This trait (and Deserialize) are +typically used to communicate between Noir and TypeScript (via oracles and function arguments).

+

On Following Noir's Intrinsic Serialization

+

When calling a Noir function from TypeScript (TS), first the function arguments are serialized into an array +of fields. This array is then included in the initial witness. Noir's intrinsic serialization is then used +to deserialize the arguments from the witness. When the same Noir function is called from Noir this Serialize trait +is used instead of the serialization in TS. For this reason we need to have a match between TS serialization, +Noir's intrinsic serialization and the implementation of this trait. If there is a mismatch, the function calls +fail with an arguments hash mismatch error message.

+

Associated Constants

+
    +
  • N - The length of the output Field array, known at compile time
  • +
+

Example

+
impl<let N: u32> Serialize for str<N> {
+    let N: u32 = N;
+
+    fn serialize(self) -> [Field; Self::N] {
+        let bytes = self.as_bytes();
+        let mut fields = [0; Self::N];
+        for i in 0..bytes.len() {
+            fields[i] = bytes[i] as Field;  // Each byte gets its own Field
+        }
+        fields
+    }
+}
+

Required methods

+
pub fn serialize(self) -> [Field; N] + +

Implementors

+

impl<T0, T1> Serialize for (T0, T1) +
where + T0: Serialize, + T1: Serialize

+ +

impl<T0, T1, T2> Serialize for (T0, T1, T2) +
where + T0: Serialize, + T1: Serialize, + T2: Serialize

+ +

impl<T0, T1, T2, T3> Serialize for (T0, T1, T2, T3) +
where + T0: Serialize, + T1: Serialize, + T2: Serialize, + T3: Serialize

+ +

impl<T0, T1, T2, T3, T4> Serialize for (T0, T1, T2, T3, T4) +
where + T0: Serialize, + T1: Serialize, + T2: Serialize, + T3: Serialize, + T4: Serialize

+ +

impl<T0, T1, T2, T3, T4, T5> Serialize for (T0, T1, T2, T3, T4, T5) +
where + T0: Serialize, + T1: Serialize, + T2: Serialize, + T3: Serialize, + T4: Serialize, + T5: Serialize

+ +

impl<T1> Serialize for (T1,) +
where + T1: Serialize

+ +

impl Serialize for AddressNote

+ +

impl Serialize for AppPayload

+ +

impl Serialize for AppendOnlyTreeSnapshot

+ +

impl Serialize for AuthorizationSelector

+ +

impl Serialize for AvmAccumulatedData

+ +

impl Serialize for AvmAccumulatedDataArrayLengths

+ +

impl Serialize for AvmCircuitPublicInputs

+ +

impl Serialize for AztecAddress

+ +

impl Serialize for BlockConstantData

+ +

impl Serialize for BlockHeader

+ +

impl<let M: u32, T> Serialize for BoundedVec<T, M> +
where + T: Serialize

+ +

impl Serialize for CallContext

+ +

impl Serialize for CheckpointConstantData

+ +

impl Serialize for CheckpointHeader

+ +

impl<let N: u32, T> Serialize for ClaimedLengthArray<T, N> +
where + T: Serialize

+ +

impl<let M: u32, let N: u32> Serialize for CompressedString<N, M>

+ +

impl Serialize for ContentCommitment

+ +

impl Serialize for ContractClassId

+ +

impl Serialize for ContractInstance

+ +

impl<T> Serialize for Counted<T> +
where + T: Serialize

+ +

impl Serialize for EmbeddedCurvePoint

+ +

impl Serialize for EmbeddedCurveScalar

+ +

impl Serialize for Empty

+ +

impl Serialize for EpochConstantData

+ +

impl Serialize for EthAddress

+ +

impl Serialize for EventSelector

+ +

impl Serialize for Fancier

+ +

impl Serialize for FeeRecipient

+ +

impl Serialize for Field

+ +

impl Serialize for FieldCompressedString

+ +

impl Serialize for FieldNote

+ +

impl Serialize for FunctionCall

+ +

impl Serialize for FunctionData

+ +

impl Serialize for FunctionSelector

+ +

impl Serialize for Gas

+ +

impl Serialize for GasFees

+ +

impl Serialize for GasSettings

+ +

impl Serialize for GlobalVariables

+ +

impl Serialize for HasArray

+ +

impl<let N: u32, T> Serialize for HasArrayWithGenerics<T, N> +
where + T: Serialize

+ +

impl Serialize for IvpkM

+ +

impl Serialize for KeyValidationRequest

+ +

impl Serialize for KeyValidationRequestAndGenerator

+ +

impl Serialize for L2ToL1Message

+ +

impl<let N: u32> Serialize for Log<N>

+ +

impl Serialize for LogHash

+ +

impl<let M: u32, let N: u32> Serialize for MembershipWitness<N, M>

+ +

impl Serialize for MockStruct

+ +

impl Serialize for NoteMetadata

+ +

impl Serialize for NpkM

+ +

impl Serialize for Nullifier

+ +

impl Serialize for NullifierLeafPreimage

+ +

impl Serialize for NullifierMembershipWitness

+ +

impl<T> Serialize for Option<T> +
where + T: Serialize

+ +

impl Serialize for OvpkM

+ +

impl Serialize for PartialAddress

+ +

impl Serialize for PartialStateReference

+ +

impl Serialize for PartialUintNote

+ +

impl Serialize for Poseidon2Sponge

+ +

impl Serialize for PrivateCallRequest

+ +

impl Serialize for PrivateCircuitPublicInputs

+ +

impl Serialize for PrivateLogData

+ +

impl Serialize for PrivateToAvmAccumulatedData

+ +

impl Serialize for PrivateToAvmAccumulatedDataArrayLengths

+ +

impl Serialize for PrivateToPublicAccumulatedData

+ +

impl Serialize for PrivateToPublicKernelCircuitPublicInputs

+ +

impl Serialize for PrivateToRollupAccumulatedData

+ +

impl Serialize for PrivateToRollupKernelCircuitPublicInputs

+ +

impl Serialize for ProtocolContracts

+ +

impl Serialize for PublicCallRequest

+ +

impl Serialize for PublicCallRequestArrayLengths

+ +

impl Serialize for PublicDataTreeLeafPreimage

+ +

impl Serialize for PublicDataWitness

+ +

impl Serialize for PublicDataWrite

+ +

impl Serialize for PublicKeys

+ +

impl Serialize for PublicKeysHash

+ +

impl Serialize for PublicLogs

+ +

impl<Note> Serialize for RetrievedNote<Note> +
where + Note: Serialize

+ +

impl<T> Serialize for Scoped<T> +
where + T: Serialize

+ +

impl Serialize for Smol

+ +

impl Serialize for SpongeBlob

+ +

impl Serialize for StateReference

+ +

impl Serialize for TestAccount

+ +

impl Serialize for TestValue

+ +

impl Serialize for TpkM

+ +

impl Serialize for TreeSnapshots

+ +

impl Serialize for TxConstantData

+ +

impl Serialize for TxContext

+ +

impl Serialize for TxRequest

+ +

impl Serialize for UintNote

+ +

impl<let M: u32, T> Serialize for [T; M] +
where + T: Serialize

+ +

impl Serialize for bool

+ +

impl Serialize for i16

+ +

impl Serialize for i32

+ +

impl Serialize for i64

+ +

impl Serialize for i8

+ +

impl<let M: u32> Serialize for str<M>

+ +

impl Serialize for u1

+ +

impl Serialize for u128

+ +

impl Serialize for u16

+ +

impl Serialize for u32

+ +

impl Serialize for u64

+ +

impl Serialize for u8

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/traits/trait.ToField.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/traits/trait.ToField.html new file mode 100644 index 000000000000..b08d05057922 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/traits/trait.ToField.html @@ -0,0 +1,111 @@ + + + + + + +Trait ToField documentation + + + + + +
+ +

Trait ToField

+
pub trait ToField {
+    // Required methods
+    pub fn to_field(self) -> Field;
+}
+ +

Required methods

+
pub fn to_field(self) -> Field + +

Implementors

+

impl ToField for AuthorizationSelector

+ +

impl ToField for AztecAddress

+ +

impl ToField for ContractClassId

+ +

impl ToField for EthAddress

+ +

impl ToField for EventSelector

+ +

impl ToField for Field

+ +

impl ToField for FunctionSelector

+ +

impl ToField for PartialAddress

+ +

impl ToField for PartialUintNote

+ +

impl ToField for PublicKeysHash

+ +

impl ToField for SaltedInitializationHash

+ +

impl ToField for bool

+ +

impl<let N: u32> ToField for str<N>

+ +

impl ToField for u1

+ +

impl ToField for u128

+ +

impl ToField for u16

+ +

impl ToField for u32

+ +

impl ToField for u64

+ +

impl ToField for u8

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/tuple_serialization/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tuple_serialization/index.html new file mode 100644 index 000000000000..045d9e01aebd --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/tuple_serialization/index.html @@ -0,0 +1,57 @@ + + + + + + +Module tuple_serialization documentation + + + + + +
+
aztec-nr - protocol_types::tuple_serialization
+

Module tuple_serialization

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/type_packing/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/type_packing/index.html new file mode 100644 index 000000000000..92f83c840939 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/type_packing/index.html @@ -0,0 +1,57 @@ + + + + + + +Module type_packing documentation + + + + + +
+
aztec-nr - protocol_types::type_packing
+

Module type_packing

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/type_serialization/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/type_serialization/index.html new file mode 100644 index 000000000000..117d6409bfb5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/type_serialization/index.html @@ -0,0 +1,57 @@ + + + + + + +Module type_serialization documentation + + + + + +
+
aztec-nr - protocol_types::type_serialization
+

Module type_serialization

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.array_length.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.array_length.html new file mode 100644 index 000000000000..f67196fce282 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.array_length.html @@ -0,0 +1,62 @@ + + + + + + +Function array_length documentation + + + + + +
+ +

Function array_length

+
pub fn array_length<T, let N: u32>(array: [T; N]) -> u32
+
where + T: Empty
+ +
+

Deprecated.

+

Helper function to count the number of non-empty elements in a validated array. +Important: Only use it for validated arrays where validate_array(array) returns true, +which ensures that:

+
    +
  1. All elements before the first empty element are non-empty
  2. +
  3. All elements after and including the first empty element are empty
  4. +
  5. The array forms a contiguous sequence of non-empty elements followed by empty elements
  6. +
+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.array_length_until.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.array_length_until.html new file mode 100644 index 000000000000..e341792a11bc --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.array_length_until.html @@ -0,0 +1,52 @@ + + + + + + +Function array_length_until documentation + + + + + +
+ +

Function array_length_until

+
pub fn array_length_until<T, let N: u32, Env>(
+    array: [T; N],
+    predicate: fn[Env](T) -> bool,
+) -> u32
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.array_merge.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.array_merge.html new file mode 100644 index 000000000000..290a60dc79e7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.array_merge.html @@ -0,0 +1,55 @@ + + + + + + +Function array_merge documentation + + + + + +
+ +

Function array_merge

+
pub fn array_merge<T, let N: u32>(array1: [T; N], array2: [T; N]) -> [T; N]
+
where + T: Empty
+ +
+

This function assumes that array1 and array2 contain no more than N non-empty elements between them, +if this is not the case then elements from the end of array2 will be dropped.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.array_padded_with.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.array_padded_with.html new file mode 100644 index 000000000000..d21486b89726 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.array_padded_with.html @@ -0,0 +1,55 @@ + + + + + + +Function array_padded_with documentation + + + + + +
+ +

Function array_padded_with

+
pub fn array_padded_with<T, let N: u32>(
+    array: [T; N],
+    from_index: u32,
+    padded_with: T,
+) -> bool
+
where + T: Eq
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.assert_trailing_zeros.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.assert_trailing_zeros.html new file mode 100644 index 000000000000..222d6f42233e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.assert_trailing_zeros.html @@ -0,0 +1,52 @@ + + + + + + +Function assert_trailing_zeros documentation + + + + + +
+ +

Function assert_trailing_zeros

+
pub fn assert_trailing_zeros<let N: u32>(input: [Field; N], in_len: u32)
+ +
+

Asserts that all fields in input after the first in_len fields are zero.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.check_permutation.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.check_permutation.html new file mode 100644 index 000000000000..96c46350ad36 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.check_permutation.html @@ -0,0 +1,55 @@ + + + + + + +Function check_permutation documentation + + + + + +
+ +

Function check_permutation

+
pub fn check_permutation<T, let N: u32>(
+    original_array: [T; N],
+    permuted_array: [T; N],
+    original_indexes: [u32; N],
+)
+
where + T: Eq
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.find_first_index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.find_first_index.html new file mode 100644 index 000000000000..ec8315bdc894 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.find_first_index.html @@ -0,0 +1,56 @@ + + + + + + +Function find_first_index documentation + + + + + +
+ +

Function find_first_index

+
pub unconstrained fn find_first_index<T, let N: u32, Env>(
+    array: [T; N],
+    find: fn[Env](T) -> bool,
+) -> u32
+ +
+

Helper function to find the index of the first element in an array that satisfies a given predicate. +If the element is not found, the function returns the length of the array N

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.find_index_hint.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.find_index_hint.html new file mode 100644 index 000000000000..85b16185fda3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.find_index_hint.html @@ -0,0 +1,52 @@ + + + + + + +Function find_index_hint documentation + + + + + +
+ +

Function find_index_hint

+
pub unconstrained fn find_index_hint<T, let N: u32, Env>(
+    array: [T; N],
+    find: fn[Env](T) -> bool,
+) -> Option<u32>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.find_index_hint_in_reverse.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.find_index_hint_in_reverse.html new file mode 100644 index 000000000000..d596f06c29fc --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.find_index_hint_in_reverse.html @@ -0,0 +1,52 @@ + + + + + + +Function find_index_hint_in_reverse documentation + + + + + +
+ +

Function find_index_hint_in_reverse

+
pub unconstrained fn find_index_hint_in_reverse<T, let N: u32, Env>(
+    array: [T; N],
+    find: fn[Env](T) -> bool,
+) -> Option<u32>
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.find_last_index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.find_last_index.html new file mode 100644 index 000000000000..38779b14103a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.find_last_index.html @@ -0,0 +1,56 @@ + + + + + + +Function find_last_index documentation + + + + + +
+ +

Function find_last_index

+
pub unconstrained fn find_last_index<T, let N: u32, Env>(
+    array: [T; N],
+    find: fn[Env](T) -> bool,
+) -> u32
+ +
+

Helper function to find the index of the last element in an array that satisfies a given predicate. +If the element is not found, the function returns the length of the array N

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.get_sorted_tuples.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.get_sorted_tuples.html new file mode 100644 index 000000000000..42ef69bf3aba --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.get_sorted_tuples.html @@ -0,0 +1,54 @@ + + + + + + +Function get_sorted_tuples documentation + + + + + +
+ +

Function get_sorted_tuples

+
pub unconstrained fn get_sorted_tuples<T, let N: u32, Env>(
+    array: [T; N],
+    ordering: fn[Env](T, T) -> bool,
+) -> [SortedTuple<T>; N]
+
where + T: Eq
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.subarray.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.subarray.html new file mode 100644 index 000000000000..1bc610886f6c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.subarray.html @@ -0,0 +1,54 @@ + + + + + + +Function subarray documentation + + + + + +
+ +

Function subarray

+
pub fn subarray<T, let N: u32, let M: u32>(array: [T; N], offset: u32) -> [T; M]
+
where + T: Empty
+ +
+

Helper fn to create a subarray from a given array.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.trimmed_array_length_hint.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.trimmed_array_length_hint.html new file mode 100644 index 000000000000..625c5aeb0cd6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/fn.trimmed_array_length_hint.html @@ -0,0 +1,51 @@ + + + + + + +Function trimmed_array_length_hint documentation + + + + + +
+ +

Function trimmed_array_length_hint

+
pub unconstrained fn trimmed_array_length_hint<T, let N: u32>(array: [T; N]) -> u32
+
where + T: Empty
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/index.html new file mode 100644 index 000000000000..159b88448679 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/index.html @@ -0,0 +1,70 @@ + + + + + + +Module arrays documentation + + + + + +
+ +

Module arrays

+

Structs

    +
  • ClaimedLengthArray - An array interpreted by Kernel circuits. +Its length is merely a claim that must eventually be validated. +Validation must include:

    +
      +
    • Asserting all items to the LHS of the length are nonempty (dense).
    • +
    • Asserting all items to the RHS of the length are empty.
    • +
  • +
  • +
+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/struct.ClaimedLengthArray.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/struct.ClaimedLengthArray.html new file mode 100644 index 000000000000..653560792694 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/struct.ClaimedLengthArray.html @@ -0,0 +1,154 @@ + + + + + + +Struct ClaimedLengthArray documentation + + + + + +
+ +

Struct ClaimedLengthArray

+
pub struct ClaimedLengthArray<T, let N: u32> {
+    pub array: [T; N],
+    pub length: u32,
+}
+
+
+

ClaimedLengthArray - An array interpreted by Kernel circuits. +Its length is merely a claim that must eventually be validated. +Validation must include:

+
    +
  • Asserting all items to the LHS of the length are nonempty (dense).
  • +
  • Asserting all items to the RHS of the length are empty.
  • +
+
+

Fields

+
array: [T; N]
+
length: u32
+

Implementations

+

impl<let N: u32, T> ClaimedLengthArray<T, N>

+ +
pub fn assert_dense_trimmed(self) +
where + T: Empty
+ +pub fn assert_empty<let S: u32>(self, msg: str<S>) +
where + T: Empty
+ +pub fn assert_length_within_bounds<let S: u32>(self, msg: str<S>) +
where + T: Empty
+ +pub fn push(&mut self, item: T) +
where + T: Empty
+ +pub fn pop(&mut self) -> T +
where + T: Empty
+ +pub fn for_each<Env>(self, f: fn[Env](T)) +
where + T: Empty
+ +pub fn for_each_i<Env>(self, f: fn[Env](T, u32)) +
where + T: Empty
+ +pub fn from_bounded_vec(vec: BoundedVec<T, N>) -> Self +
where + T: Empty
+ +

Trait implementations

+

impl<let N: u32, T> Deserialize for ClaimedLengthArray<T, N> +
where + T: Deserialize

+ +
pub fn deserialize( + serialized: [Field; N * <(resolved type) as Deserialize>::N + 1], +) -> Self + +

impl<let N: u32, T> Empty for ClaimedLengthArray<T, N> +
where + T: Empty

+ +
pub fn empty() -> Self + +pub fn is_empty(self) -> bool + +pub fn assert_empty<let S: u32>(self, msg: str<S>) + +

impl<let N: u32, T> Eq for ClaimedLengthArray<T, N> +
where + T: Eq

+ +
pub fn eq(self, other: Self) -> bool + +

impl<let N: u32, T> Serialize for ClaimedLengthArray<T, N> +
where + T: Serialize

+ +
pub fn serialize(self) -> [Field; N * <(resolved type) as Serialize>::N + 1] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/struct.SortedTuple.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/struct.SortedTuple.html new file mode 100644 index 000000000000..c152d9856b6b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/arrays/struct.SortedTuple.html @@ -0,0 +1,72 @@ + + + + + + +Struct SortedTuple documentation + + + + + +
+ +

Struct SortedTuple

+
pub struct SortedTuple<T> {
+    pub elem: T,
+    pub original_index: u32,
+}
+
+

Fields

+
elem: T
+
original_index: u32
+

Trait implementations

+

impl<T> Eq for SortedTuple<T> +
where + T: Eq

+ +
pub fn eq(self, other: Self) -> bool + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/field/fn.field_from_bytes.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/field/fn.field_from_bytes.html new file mode 100644 index 000000000000..a81d8eb75dc4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/field/fn.field_from_bytes.html @@ -0,0 +1,39 @@ + + + + + + +Function field_from_bytes documentation + + + + + +
+ +

Function field_from_bytes

+
pub fn field_from_bytes<let N: u32>(bytes: [u8; N], big_endian: bool) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/field/fn.field_from_bytes_32_trunc.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/field/fn.field_from_bytes_32_trunc.html new file mode 100644 index 000000000000..9695fdb2f43d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/field/fn.field_from_bytes_32_trunc.html @@ -0,0 +1,39 @@ + + + + + + +Function field_from_bytes_32_trunc documentation + + + + + +
+ +

Function field_from_bytes_32_trunc

+
pub fn field_from_bytes_32_trunc(bytes32: [u8; 32]) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/field/fn.full_field_greater_than.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/field/fn.full_field_greater_than.html new file mode 100644 index 000000000000..e7f18add1706 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/field/fn.full_field_greater_than.html @@ -0,0 +1,39 @@ + + + + + + +Function full_field_greater_than documentation + + + + + +
+ +

Function full_field_greater_than

+
pub fn full_field_greater_than(lhs: Field, rhs: Field) -> bool
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/field/fn.full_field_less_than.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/field/fn.full_field_less_than.html new file mode 100644 index 000000000000..974c5d953fbd --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/field/fn.full_field_less_than.html @@ -0,0 +1,39 @@ + + + + + + +Function full_field_less_than documentation + + + + + +
+ +

Function full_field_less_than

+
pub fn full_field_less_than(lhs: Field, rhs: Field) -> bool
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/field/fn.min.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/field/fn.min.html new file mode 100644 index 000000000000..e429605339c3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/field/fn.min.html @@ -0,0 +1,39 @@ + + + + + + +Function min documentation + + + + + +
+ +

Function min

+
pub fn min(f1: Field, f2: Field) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/field/fn.pow.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/field/fn.pow.html new file mode 100644 index 000000000000..ec796ec606ee --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/field/fn.pow.html @@ -0,0 +1,39 @@ + + + + + + +Function pow documentation + + + + + +
+ +

Function pow

+
pub fn pow(x: Field, y: Field) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/field/fn.sqrt.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/field/fn.sqrt.html new file mode 100644 index 000000000000..6f5f9993f701 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/field/fn.sqrt.html @@ -0,0 +1,42 @@ + + + + + + +Function sqrt documentation + + + + + +
+ +

Function sqrt

+
pub fn sqrt(x: Field) -> Option<Field>
+ +
+

Returns Option::some(sqrt) if there is a square root, and Option::none() if there isn't.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/field/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/field/index.html new file mode 100644 index 000000000000..8e58c4b03579 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/field/index.html @@ -0,0 +1,50 @@ + + + + + + +Module field documentation + + + + + +
+ +

Module field

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/for_loop/fn.for_i_in_.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/for_loop/fn.for_i_in_.html new file mode 100644 index 000000000000..1c1eff080ed7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/for_loop/fn.for_i_in_.html @@ -0,0 +1,61 @@ + + + + + + +Function for_i_in_ documentation + + + + + +
+ +

Function for_i_in_

+
pub fn for_i_in_<Env1, Env2, Env3>(
+    min: u32,
+    max: u32,
+    MIN: u32,
+    MAX: u32,
+    f_before_min: fn[Env1](u32),
+    f_within: fn[Env2](u32),
+    f_after_max: fn[Env3](u32),
+    assert_min_lte_max: bool,
+    assert_max_lte_MAX: bool,
+)
+ +
+

Iterates through i, +where:

+
    +
  • min <= i < max
  • +
  • min and max are only known at runtime
  • +
  • MIN and MAX are known at compile-time, and dictate the static loop bounds.
  • +
+

Lambda functions of the form |i| { my_array[i].assert_empty() } can be specified.

+

If the dev knows what they're doing, they can choose to set the following to false: +assert_min_lte_max, assert_max_lte_MAX, as a very small constraint optimisation.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/for_loop/fn.for_i_in_0_.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/for_loop/fn.for_i_in_0_.html new file mode 100644 index 000000000000..b6745246f0be --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/for_loop/fn.for_i_in_0_.html @@ -0,0 +1,57 @@ + + + + + + +Function for_i_in_0_ documentation + + + + + +
+ +

Function for_i_in_0_

+
pub fn for_i_in_0_<Env1, Env2>(
+    max: u32,
+    MAX: u32,
+    f_within: fn[Env1](u32),
+    f_after_max: fn[Env2](u32),
+    assert_max_lte_MAX: bool,
+)
+ +
+

Iterates through i, +where:

+
    +
  • 0 <= i < max
  • +
  • max is only known at runtime
  • +
  • MAX is known at compile-time, e.g. the fixed length of an array.
  • +
+

Lambda functions of the form |i| { my_array[i].assert_empty() } can be specified.

+

If the dev knows what they're doing, they can choose to set the following to false: +assert_min_lte_max, assert_max_lte_MAX, as a very small constraint optimisation.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/for_loop/fn.for_i_only_in_.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/for_loop/fn.for_i_only_in_.html new file mode 100644 index 000000000000..cd51cfae513a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/for_loop/fn.for_i_only_in_.html @@ -0,0 +1,47 @@ + + + + + + +Function for_i_only_in_ documentation + + + + + +
+ +

Function for_i_only_in_

+
pub fn for_i_only_in_<Env>(
+    min: u32,
+    max: u32,
+    MIN: u32,
+    MAX: u32,
+    f_within: fn[Env](u32),
+    assert_min_lte_max: bool,
+    assert_max_lte_MAX: bool,
+)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/for_loop/fn.for_i_only_in_0_.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/for_loop/fn.for_i_only_in_0_.html new file mode 100644 index 000000000000..da771d81e396 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/for_loop/fn.for_i_only_in_0_.html @@ -0,0 +1,44 @@ + + + + + + +Function for_i_only_in_0_ documentation + + + + + +
+ +

Function for_i_only_in_0_

+
pub fn for_i_only_in_0_<Env>(
+    max: u32,
+    MAX: u32,
+    f_within: fn[Env](u32),
+    assert_max_lte_MAX: bool,
+)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/for_loop/global.for_loop_no_op.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/for_loop/global.for_loop_no_op.html new file mode 100644 index 000000000000..5c7a2f297d70 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/for_loop/global.for_loop_no_op.html @@ -0,0 +1,39 @@ + + + + + + +Global for_loop_no_op documentation + + + + + +
+ +

Global for_loop_no_op

+
pub global for_loop_no_op: fn(u32);
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/for_loop/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/for_loop/index.html new file mode 100644 index 000000000000..7b26fcc2108f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/for_loop/index.html @@ -0,0 +1,63 @@ + + + + + + +Module for_loop documentation + + + + + +
+ +

Module for_loop

+

Functions

    +
  • Iterates through i, +where:

    +
      +
    • min <= i < max
    • +
    • min and max are only known at runtime
    • +
    • MIN and MAX are known at compile-time, and dictate the static loop bounds.
    • +
  • +
  • Iterates through i, +where:

    +
      +
    • 0 <= i < max
    • +
    • max is only known at runtime
    • +
    • MAX is known at compile-time, e.g. the fixed length of an array.
    • +
  • +
  • +
  • +
+

Globals

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/index.html new file mode 100644 index 000000000000..ebe696f580d5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/index.html @@ -0,0 +1,69 @@ + + + + + + +Module utils documentation + + + + + +
+ +

Module utils

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/math/fn.is_power_of_2.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/math/fn.is_power_of_2.html new file mode 100644 index 000000000000..d5997fab6f32 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/math/fn.is_power_of_2.html @@ -0,0 +1,33 @@ + + + + + + +Function is_power_of_2 documentation + + + + + +
+ +

Function is_power_of_2

+
pub fn is_power_of_2(n: u16) -> bool
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/math/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/math/index.html new file mode 100644 index 000000000000..fb427c5735be --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/math/index.html @@ -0,0 +1,44 @@ + + + + + + +Module math documentation + + + + + +
+ +

Module math

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/reader/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/reader/index.html new file mode 100644 index 000000000000..94ceec65f1f6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/reader/index.html @@ -0,0 +1,44 @@ + + + + + + +Module reader documentation + + + + + +
+ +

Module reader

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/reader/struct.Reader.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/reader/struct.Reader.html new file mode 100644 index 000000000000..0e79398b64f5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/reader/struct.Reader.html @@ -0,0 +1,72 @@ + + + + + + +Struct Reader documentation + + + + + +
+ +

Struct Reader

+
pub struct Reader<let N: u32>
+{ /* private fields */ }
+
+

Implementations

+

impl<let N: u32> Reader<N>

+ +
pub fn new(data: [Field; N]) -> Self + +pub fn read(&mut self) -> Field + +pub fn read_u32(&mut self) -> u32 + +pub fn read_u64(&mut self) -> u64 + +pub fn read_bool(&mut self) -> bool + +pub fn read_array<let K: u32>(&mut self) -> [Field; K] + +pub fn read_struct<T, let K: u32>(&mut self, deserialise: fn([Field; K]) -> T) -> T + +pub fn read_struct_array<T, let K: u32, let C: u32>( + &mut self, + deserialise: fn([Field; K]) -> T, + result: [T; C], +) -> [T; C] + +pub fn finish(self) + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/uint256/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/uint256/index.html new file mode 100644 index 000000000000..46504d622a38 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/uint256/index.html @@ -0,0 +1,44 @@ + + + + + + +Module uint256 documentation + + + + + +
+ +

Module uint256

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/uint256/struct.U256.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/uint256/struct.U256.html new file mode 100644 index 000000000000..5cb60daf2dbb --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/utils/uint256/struct.U256.html @@ -0,0 +1,47 @@ + + + + + + +Struct U256 documentation + + + + + +
+ +

Struct U256

+
pub struct U256
+{ /* private fields */ }
+
+

Implementations

+

impl U256

+ +
pub fn from_bytes32(bytes: [u8; 32]) -> Self + +pub fn to_u128_limbs(self) -> [Field; 2] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/validate/fn.should_validate_output.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/validate/fn.should_validate_output.html new file mode 100644 index 000000000000..81a393fd5fcd --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/validate/fn.should_validate_output.html @@ -0,0 +1,33 @@ + + + + + + +Function should_validate_output documentation + + + + + +
+ +

Function should_validate_output

+
pub fn should_validate_output() -> bool
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/protocol_types/validate/index.html b/docs/static/aztec-nr-api/v3.0.2/protocol_types/validate/index.html new file mode 100644 index 000000000000..aad0ad07d57d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/protocol_types/validate/index.html @@ -0,0 +1,64 @@ + + + + + + +Module validate documentation + + + + + +
+ +

Module validate

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/sha256/fn.digest.html b/docs/static/aztec-nr-api/v3.0.2/sha256/fn.digest.html new file mode 100644 index 000000000000..3045a94770aa --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/sha256/fn.digest.html @@ -0,0 +1,38 @@ + + + + + + +Function digest documentation + + + + + +
+ +

Function digest

+
pub fn digest<let N: u32>(msg: [u8; N]) -> HASH
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/sha256/fn.partial_sha224_var_end.html b/docs/static/aztec-nr-api/v3.0.2/sha256/fn.partial_sha224_var_end.html new file mode 100644 index 000000000000..0ec96bd0ef1d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/sha256/fn.partial_sha224_var_end.html @@ -0,0 +1,53 @@ + + + + + + +Function partial_sha224_var_end documentation + + + + + +
+ +

Function partial_sha224_var_end

+
pub fn partial_sha224_var_end<let N: u32>(
+    h: [u32; 8],
+    msg: [u8; N],
+    message_size: u32,
+    real_message_size: u32,
+) -> HASH_SHA224
+ +
+

Given some state of a partially computed sha256/sha224 hash and remaining preimage, complete the hash +@notice used for traditional partial hashing

+

@param N - the maximum length of the message to hash +@param h - the intermediate hash state +@param msg - the remaining preimage to hash +@param message_size - the size of the current chunk +@param real_message_size - the total size of the original preimage +@return finalized sha24 hash

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/sha256/fn.partial_sha256_var_end.html b/docs/static/aztec-nr-api/v3.0.2/sha256/fn.partial_sha256_var_end.html new file mode 100644 index 000000000000..b7588eb2c0a9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/sha256/fn.partial_sha256_var_end.html @@ -0,0 +1,53 @@ + + + + + + +Function partial_sha256_var_end documentation + + + + + +
+ +

Function partial_sha256_var_end

+
pub fn partial_sha256_var_end<let N: u32>(
+    h: [u32; 8],
+    msg: [u8; N],
+    message_size: u32,
+    real_message_size: u32,
+) -> [u8; 32]
+ +
+

Given some state of a partially computed sha256 hash and remaining preimage, complete the hash +@notice used for traditional partial hashing

+

@param N - the maximum length of the message to hash +@param h - the intermediate hash state +@param msg - the remaining preimage to hash +@param message_size - the size of the current chunk +@param real_message_size - the total size of the original preimage +@return finalized sha256 hash

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/sha256/fn.partial_sha256_var_interstitial.html b/docs/static/aztec-nr-api/v3.0.2/sha256/fn.partial_sha256_var_interstitial.html new file mode 100644 index 000000000000..06450678aa0e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/sha256/fn.partial_sha256_var_interstitial.html @@ -0,0 +1,51 @@ + + + + + + +Function partial_sha256_var_interstitial documentation + + + + + +
+ +

Function partial_sha256_var_interstitial

+
pub fn partial_sha256_var_interstitial<let N: u32>(
+    h: [u32; 8],
+    msg: [u8; N],
+    message_size: u32,
+) -> [u32; 8]
+ +
+

Given some state of a partially computed sha256 hash and part of the preimage, continue hashing +@notice used for complex/ recursive offloading of post-partial hashing

+

@param N - the maximum length of the message to hash +@param h - the intermediate hash state +@param msg - the preimage to hash +@param message_size - the actual length of the preimage to hash +@return the intermediate hash state after compressing in msg to h

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/sha256/fn.sha224_var.html b/docs/static/aztec-nr-api/v3.0.2/sha256/fn.sha224_var.html new file mode 100644 index 000000000000..504543096944 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/sha256/fn.sha224_var.html @@ -0,0 +1,38 @@ + + + + + + +Function sha224_var documentation + + + + + +
+ +

Function sha224_var

+
pub fn sha224_var<let N: u32>(msg: [u8; N], message_size: u32) -> HASH_SHA224
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/sha256/fn.sha256_var.html b/docs/static/aztec-nr-api/v3.0.2/sha256/fn.sha256_var.html new file mode 100644 index 000000000000..085effdcbf82 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/sha256/fn.sha256_var.html @@ -0,0 +1,38 @@ + + + + + + +Function sha256_var documentation + + + + + +
+ +

Function sha256_var

+
pub fn sha256_var<let N: u32>(msg: [u8; N], message_size: u32) -> HASH
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/sha256/index.html b/docs/static/aztec-nr-api/v3.0.2/sha256/index.html new file mode 100644 index 000000000000..feac516d4c11 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/sha256/index.html @@ -0,0 +1,51 @@ + + + + + + +Crate sha256 documentation + + + + + +
+
aztec-nr - sha256
+

Crate sha256

+

Functions

    +
  • +
  • Given some state of a partially computed sha256/sha224 hash and remaining preimage, complete the hash +@notice used for traditional partial hashing
  • +
  • Given some state of a partially computed sha256 hash and remaining preimage, complete the hash +@notice used for traditional partial hashing
  • +
  • Given some state of a partially computed sha256 hash and part of the preimage, continue hashing +@notice used for complex/ recursive offloading of post-partial hashing
  • +
  • +
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/aes128/fn.aes128_encrypt.html b/docs/static/aztec-nr-api/v3.0.2/std/aes128/fn.aes128_encrypt.html new file mode 100644 index 000000000000..c996ab009513 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/aes128/fn.aes128_encrypt.html @@ -0,0 +1,37 @@ + + + + + + +Function aes128_encrypt documentation + + + + + +
+ +

Function aes128_encrypt

+
pub fn aes128_encrypt<let N: u32>(
+    input: [u8; N],
+    iv: [u8; 16],
+    key: [u8; 16],
+) -> [u8; N + 16 - N % 16]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/aes128/index.html b/docs/static/aztec-nr-api/v3.0.2/std/aes128/index.html new file mode 100644 index 000000000000..5d493461d78c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/aes128/index.html @@ -0,0 +1,100 @@ + + + + + + +Module aes128 documentation + + + + + +
+
aztec-nr - std::aes128
+

Module aes128

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/append/index.html b/docs/static/aztec-nr-api/v3.0.2/std/append/index.html new file mode 100644 index 000000000000..c54979a72f9a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/append/index.html @@ -0,0 +1,100 @@ + + + + + + +Module append documentation + + + + + +
+
aztec-nr - std::append
+

Module append

+

Traits

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/append/trait.Append.html b/docs/static/aztec-nr-api/v3.0.2/std/append/trait.Append.html new file mode 100644 index 000000000000..911866abd68d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/append/trait.Append.html @@ -0,0 +1,61 @@ + + + + + + +Trait Append documentation + + + + + +
+ +

Trait Append

+
pub trait Append {
+    // Required methods
+    pub fn empty() -> Self;
+    pub fn append(self, other: Self) -> Self;
+}
+ +

Required methods

+
pub fn empty() -> Self + +pub fn append(self, other: Self) -> Self + +

Implementors

+

impl Append for CtString

+ +

impl Append for Quoted

+ +

impl<T> Append for [T]

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/array/index.html b/docs/static/aztec-nr-api/v3.0.2/std/array/index.html new file mode 100644 index 000000000000..baf0b5208219 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/array/index.html @@ -0,0 +1,93 @@ + + + + + + +Module array documentation + + + + + +
+
aztec-nr - std::array
+

Module array

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/cmp/fn.max.html b/docs/static/aztec-nr-api/v3.0.2/std/cmp/fn.max.html new file mode 100644 index 000000000000..7817701558b4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/cmp/fn.max.html @@ -0,0 +1,43 @@ + + + + + + +Function max documentation + + + + + +
+ +

Function max

+
pub fn max<T>(v1: T, v2: T) -> T
+
where + T: Ord
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/cmp/fn.min.html b/docs/static/aztec-nr-api/v3.0.2/std/cmp/fn.min.html new file mode 100644 index 000000000000..d0bee6bfacd6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/cmp/fn.min.html @@ -0,0 +1,43 @@ + + + + + + +Function min documentation + + + + + +
+ +

Function min

+
pub fn min<T>(v1: T, v2: T) -> T
+
where + T: Ord
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/cmp/index.html b/docs/static/aztec-nr-api/v3.0.2/std/cmp/index.html new file mode 100644 index 000000000000..5710563edf91 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/cmp/index.html @@ -0,0 +1,110 @@ + + + + + + +Module cmp documentation + + + + + +
+
aztec-nr - std::cmp
+

Module cmp

+

Structs

+

Traits

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/cmp/struct.Ordering.html b/docs/static/aztec-nr-api/v3.0.2/std/cmp/struct.Ordering.html new file mode 100644 index 000000000000..a4ba31bf9e3a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/cmp/struct.Ordering.html @@ -0,0 +1,67 @@ + + + + + + +Struct Ordering documentation + + + + + +
+ +

Struct Ordering

+
pub struct Ordering
+{ /* private fields */ }
+
+

Implementations

+

impl Ordering

+ +
pub fn less() -> Self + +pub fn equal() -> Self + +pub fn greater() -> Self + +

Trait implementations

+

impl Eq for Ordering

+ +
pub fn eq(self, other: Self) -> bool + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/cmp/trait.Eq.html b/docs/static/aztec-nr-api/v3.0.2/std/cmp/trait.Eq.html new file mode 100644 index 000000000000..53a2ae6077fe --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/cmp/trait.Eq.html @@ -0,0 +1,520 @@ + + + + + + +Trait Eq documentation + + + + + +
+ +

Trait Eq

+
pub trait Eq {
+    // Required methods
+    pub fn eq(self, other: Self) -> bool;
+}
+ +

Required methods

+
pub fn eq(self, other: Self) -> bool + +

Implementors

+

impl Eq for ()

+ +

impl<A, B> Eq for (A, B) +
where + A: Eq, + B: Eq

+ +

impl<A, B, C> Eq for (A, B, C) +
where + A: Eq, + B: Eq, + C: Eq

+ +

impl<A, B, C, D> Eq for (A, B, C, D) +
where + A: Eq, + B: Eq, + C: Eq, + D: Eq

+ +

impl<A, B, C, D, E> Eq for (A, B, C, D, E) +
where + A: Eq, + B: Eq, + C: Eq, + D: Eq, + E: Eq

+ +

impl Eq for AddressNote

+ +

impl Eq for AppendOnlyTreeSnapshot

+ +

impl Eq for AuthorizationSelector

+ +

impl Eq for AvmAccumulatedData

+ +

impl Eq for AvmAccumulatedDataArrayLengths

+ +

impl Eq for AvmCircuitPublicInputs

+ +

impl Eq for AztecAddress

+ +

impl Eq for BinaryOp

+ +

impl Eq for BlockConstantData

+ +

impl Eq for BlockHeader

+ +

impl<let MaxLen: u32, T> Eq for BoundedVec<T, MaxLen> +
where + T: Eq

+ +

impl Eq for CallContext

+ +

impl Eq for CheckpointConstantData

+ +

impl Eq for CheckpointHeader

+ +

impl<let N: u32, T> Eq for ClaimedLengthArray<T, N> +
where + T: Eq

+ +

impl Eq for CompoundStruct

+ +

impl<let M: u32, let N: u32> Eq for CompressedString<N, M>

+ +

impl Eq for ContentCommitment

+ +

impl Eq for ContractClassId

+ +

impl Eq for ContractClassLog

+ +

impl Eq for ContractInstance

+ +

impl<T> Eq for Counted<T> +
where + T: Eq

+ +

impl Eq for CtString

+ +

impl<let INITIAL_DELAY: u64, T> Eq for DelayedPublicMutableValues<T, INITIAL_DELAY> +
where + T: Eq

+ +

impl Eq for EmbeddedCurvePoint

+ +

impl Eq for EmbeddedCurveScalar

+ +

impl Eq for EpochConstantData

+ +

impl Eq for EthAddress

+ +

impl Eq for EventSelector

+ +

impl Eq for FeeRecipient

+ +

impl Eq for Field

+ +

impl Eq for FieldCompressedString

+ +

impl Eq for FieldNote

+ +

impl Eq for FixtureBuilder

+ +

impl Eq for FunctionData

+ +

impl Eq for FunctionDefinition

+ +

impl Eq for FunctionSelector

+ +

impl Eq for Gas

+ +

impl Eq for GasFees

+ +

impl Eq for GasSettings

+ +

impl Eq for GlobalVariables

+ +

impl<B, K, let N: u32, V> Eq for HashMap<K, V, N, B> +
where + K: Eq, + K: Hash, + V: Eq, + B: BuildHasher

+ +

impl Eq for IvpkM

+ +

impl Eq for KeyValidationRequest

+ +

impl Eq for KeyValidationRequestAndGenerator

+ +

impl Eq for L2ToL1Message

+ +

impl<let N: u32> Eq for Log<N>

+ +

impl Eq for LogHash

+ +

impl<let M: u32, let N: u32> Eq for MembershipWitness<N, M>

+ +

impl<let N: u32> Eq for MembershipWitness<N>

+ +

impl<let N: u32> Eq for MerkleTree<N>

+ +

impl Eq for MessageContext

+ +

impl Eq for MockStruct

+ +

impl Eq for Module

+ +

impl Eq for NoteHashLeafPreimage

+ +

impl Eq for NoteMetadata

+ +

impl Eq for NpkM

+ +

impl Eq for Nullifier

+ +

impl Eq for NullifierLeafPreimage

+ +

impl Eq for NullifierMembershipWitness

+ +

impl<T> Eq for Option<T> +
where + T: Eq

+ +

impl Eq for Ordering

+ +

impl Eq for OvpkM

+ +

impl Eq for PartialAddress

+ +

impl Eq for PartialStateReference

+ +

impl Eq for PartialUintNote

+ +

impl Eq for Poseidon2Sponge

+ +

impl Eq for PrivateAccumulatedData

+ +

impl Eq for PrivateCallRequest

+ +

impl Eq for PrivateCircuitPublicInputs

+ +

impl Eq for PrivateContext

+ +

impl Eq for PrivateContextInputs

+ +

impl Eq for PrivateKernelCircuitPublicInputs

+ +

impl Eq for PrivateLogData

+ +

impl Eq for PrivateToAvmAccumulatedData

+ +

impl Eq for PrivateToAvmAccumulatedDataArrayLengths

+ +

impl Eq for PrivateToPublicAccumulatedData

+ +

impl Eq for PrivateToPublicKernelCircuitPublicInputs

+ +

impl Eq for PrivateToRollupAccumulatedData

+ +

impl Eq for PrivateToRollupKernelCircuitPublicInputs

+ +

impl Eq for PrivateTxConstantData

+ +

impl Eq for PrivateValidationRequests

+ +

impl Eq for ProtocolContracts

+ +

impl Eq for PublicCallRequest

+ +

impl Eq for PublicCallRequestArrayLengths

+ +

impl Eq for PublicContext

+ +

impl Eq for PublicDataTreeLeaf

+ +

impl Eq for PublicDataTreeLeafPreimage

+ +

impl Eq for PublicDataWitness

+ +

impl Eq for PublicDataWrite

+ +

impl Eq for PublicKeys

+ +

impl Eq for PublicKeysHash

+ +

impl Eq for PublicLogs

+ +

impl Eq for Quoted

+ +

impl<Note> Eq for RetrievedNote<Note> +
where + Note: Eq

+ +

impl Eq for SaltedInitializationHash

+ +

impl<let INITIAL_DELAY: u64> Eq for ScheduledDelayChange<INITIAL_DELAY>

+ +

impl<T> Eq for ScheduledValueChange<T> +
where + T: Eq

+ +

impl<T> Eq for Scoped<T> +
where + T: Eq

+ +

impl<T> Eq for SortedTuple<T> +
where + T: Eq

+ +

impl Eq for SpongeBlob

+ +

impl Eq for StateReference

+ +

impl Eq for TestLeafPreimage

+ +

impl Eq for TestValue

+ +

impl Eq for TpkM

+ +

impl Eq for TraitConstraint

+ +

impl Eq for TraitDefinition

+ +

impl Eq for TreeSnapshots

+ +

impl Eq for TxConstantData

+ +

impl Eq for TxContext

+ +

impl Eq for TxEffect

+ +

impl Eq for TxRequest

+ +

impl Eq for Type

+ +

impl Eq for TypeDefinition

+ +

impl<B, K, V> Eq for UHashMap<K, V, B> +
where + K: Eq, + K: Hash, + V: Eq, + B: BuildHasher

+ +

impl Eq for UintNote

+ +

impl Eq for UnaryOp

+ +

impl<let N: u32> Eq for VerificationKey<N>

+ +

impl<let VK_LENGTH: u32> Eq for VkData<VK_LENGTH>

+ +

impl<let N: u32, T> Eq for [T; N] +
where + T: Eq

+ +

impl<T> Eq for [T] +
where + T: Eq

+ +

impl Eq for bool

+ +

impl Eq for i16

+ +

impl Eq for i32

+ +

impl Eq for i64

+ +

impl Eq for i8

+ +

impl<let N: u32> Eq for str<N>

+ +

impl Eq for u1

+ +

impl Eq for u128

+ +

impl Eq for u16

+ +

impl Eq for u32

+ +

impl Eq for u64

+ +

impl Eq for u8

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/cmp/trait.Ord.html b/docs/static/aztec-nr-api/v3.0.2/std/cmp/trait.Ord.html new file mode 100644 index 000000000000..9091e5e7d1ef --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/cmp/trait.Ord.html @@ -0,0 +1,134 @@ + + + + + + +Trait Ord documentation + + + + + +
+ +

Trait Ord

+
pub trait Ord {
+    // Required methods
+    pub fn cmp(self, other: Self) -> Ordering;
+}
+ +

Required methods

+
pub fn cmp(self, other: Self) -> Ordering + +

Implementors

+

impl Ord for ()

+ +

impl<A, B> Ord for (A, B) +
where + A: Ord, + B: Ord

+ +

impl<A, B, C> Ord for (A, B, C) +
where + A: Ord, + B: Ord, + C: Ord

+ +

impl<A, B, C, D> Ord for (A, B, C, D) +
where + A: Ord, + B: Ord, + C: Ord, + D: Ord

+ +

impl<A, B, C, D, E> Ord for (A, B, C, D, E) +
where + A: Ord, + B: Ord, + C: Ord, + D: Ord, + E: Ord

+ +

impl<T> Ord for Option<T> +
where + T: Ord

+ +

impl<let N: u32, T> Ord for [T; N] +
where + T: Ord

+ +

impl<T> Ord for [T] +
where + T: Ord

+ +

impl Ord for bool

+ +

impl Ord for i16

+ +

impl Ord for i32

+ +

impl Ord for i64

+ +

impl Ord for i8

+ +

impl Ord for u128

+ +

impl Ord for u16

+ +

impl Ord for u32

+ +

impl Ord for u64

+ +

impl Ord for u8

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/collections/bounded_vec/index.html b/docs/static/aztec-nr-api/v3.0.2/std/collections/bounded_vec/index.html new file mode 100644 index 000000000000..ca00abdaf478 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/collections/bounded_vec/index.html @@ -0,0 +1,44 @@ + + + + + + +Module bounded_vec documentation + + + + + +
+
aztec-nr - std::collections::bounded_vec
+

Module bounded_vec

+

Structs

    +
  • A BoundedVec<T, MaxLen> is a growable storage similar to a built-in vector except that it +is bounded with a maximum possible length. BoundedVec is also not +subject to the same restrictions vectors are (notably, nested vectors are disallowed).
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/collections/bounded_vec/struct.BoundedVec.html b/docs/static/aztec-nr-api/v3.0.2/std/collections/bounded_vec/struct.BoundedVec.html new file mode 100644 index 000000000000..b15924f22219 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/collections/bounded_vec/struct.BoundedVec.html @@ -0,0 +1,406 @@ + + + + + + +Struct BoundedVec documentation + + + + + +
+ +

Struct BoundedVec

+
pub struct BoundedVec<T, let MaxLen: u32>
+{ /* private fields */ }
+
+
+

A BoundedVec<T, MaxLen> is a growable storage similar to a built-in vector except that it +is bounded with a maximum possible length. BoundedVec is also not +subject to the same restrictions vectors are (notably, nested vectors are disallowed).

+

Since a BoundedVec is backed by a normal array under the hood, growing the BoundedVec by +pushing an additional element is also more efficient - the length only needs to be increased +by one.

+

For these reasons BoundedVec<T, N> should generally be preferred over vectors when there +is a reasonable maximum bound that can be placed on the vector.

+

Example:

+
let mut vector: BoundedVec<Field, 10> = BoundedVec::new();
+for i in 0..5 {
+    vector.push(i);
+}
+assert(vector.len() == 5);
+assert(vector.max_len() == 10);
+

Implementations

+

impl<let MaxLen: u32, T> BoundedVec<T, MaxLen>

+ +
pub fn new() -> Self + +
+

Creates a new, empty vector of length zero.

+

Since this container is backed by an array internally, it still needs an initial value +to give each element. To resolve this, each element is zeroed internally. This value +is guaranteed to be inaccessible unless get_unchecked is used.

+

Example:

+
let empty_vector: BoundedVec<Field, 10> = BoundedVec::new();
+assert(empty_vector.len() == 0);
+

Note that whenever calling new the maximum length of the vector should always be specified +via a type signature:

+
fn good() -> BoundedVec<Field, 10> {
+    // Ok! MaxLen is specified with a type annotation
+    let v1: BoundedVec<Field, 3> = BoundedVec::new();
+    let v2 = BoundedVec::new();
+
+    // Ok! MaxLen is known from the type of `good`'s return value
+    v2
+}
+
+fn bad() {
+    // Error: Type annotation needed
+    // The compiler can't infer `MaxLen` from the following code:
+    let mut v3 = BoundedVec::new();
+    v3.push(5);
+}
+

This defaulting of MaxLen (and numeric generics in general) to zero may change in future noir versions +but for now make sure to use type annotations when using bounded vectors. Otherwise, you will receive a +constraint failure at runtime when the vec is pushed to.

+
pub fn get(self, index: u32) -> T + +
+

Retrieves an element from the vector at the given index, starting from zero.

+

If the given index is equal to or greater than the length of the vector, this +will issue a constraint failure.

+

Example:

+
fn foo<let N: u32>(v: BoundedVec<u32, N>) {
+    let first = v.get(0);
+    let last = v.get(v.len() - 1);
+    assert(first != last);
+}
+
pub fn get_unchecked(self, index: u32) -> T + +
+

Retrieves an element from the vector at the given index, starting from zero, without +performing a bounds check.

+

Since this function does not perform a bounds check on length before accessing the element, +it is unsafe! Use at your own risk!

+

Example:

+
fn sum_of_first_three<let N: u32>(v: BoundedVec<u32, N>) -> u32 {
+    // Always ensure the length is larger than the largest
+    // index passed to get_unchecked
+    assert(v.len() > 2);
+    let first = v.get_unchecked(0);
+    let second = v.get_unchecked(1);
+    let third = v.get_unchecked(2);
+    first + second + third
+}
+
pub fn set(&mut self, index: u32, value: T) + +
+

Writes an element to the vector at the given index, starting from zero.

+

If the given index is equal to or greater than the length of the vector, this will issue a constraint failure.

+

Example:

+
fn foo<let N: u32>(v: BoundedVec<u32, N>) {
+    let first = v.get(0);
+    assert(first != 42);
+    v.set(0, 42);
+    let new_first = v.get(0);
+    assert(new_first == 42);
+}
+
pub fn set_unchecked(&mut self, index: u32, value: T) + +
+

Writes an element to the vector at the given index, starting from zero, without performing a bounds check.

+

Since this function does not perform a bounds check on length before accessing the element, it is unsafe! Use at your own risk!

+

Example:

+
fn set_unchecked_example() {
+    let mut vec: BoundedVec<u32, 5> = BoundedVec::new();
+    vec.extend_from_array([1, 2]);
+
+    // Here we're safely writing within the valid range of `vec`
+    // `vec` now has the value [42, 2]
+    vec.set_unchecked(0, 42);
+
+    // We can then safely read this value back out of `vec`.
+    // Notice that we use the checked version of `get` which would prevent reading unsafe values.
+    assert_eq(vec.get(0), 42);
+
+    // We've now written past the end of `vec`.
+    // As this index is still within the maximum potential length of `v`,
+    // it won't cause a constraint failure.
+    vec.set_unchecked(2, 42);
+    println(vec);
+
+    // This will write past the end of the maximum potential length of `vec`,
+    // it will then trigger a constraint failure.
+    vec.set_unchecked(5, 42);
+    println(vec);
+}
+
pub fn push(&mut self, elem: T) + +
+

Pushes an element to the end of the vector. This increases the length +of the vector by one.

+

Panics if the new length of the vector will be greater than the max length.

+

Example:

+
let mut v: BoundedVec<Field, 2> = BoundedVec::new();
+
+v.push(1);
+v.push(2);
+
+// Panics with failed assertion "push out of bounds"
+v.push(3);
+
pub fn len(self) -> u32 + +
+

Returns the current length of this vector

+

Example:

+
let mut v: BoundedVec<Field, 4> = BoundedVec::new();
+assert(v.len() == 0);
+
+v.push(100);
+assert(v.len() == 1);
+
+v.push(200);
+v.push(300);
+v.push(400);
+assert(v.len() == 4);
+
+let _ = v.pop();
+let _ = v.pop();
+assert(v.len() == 2);
+
pub fn max_len(_self: Self) -> u32 + +
+

Returns the maximum length of this vector. This is always +equal to the MaxLen parameter this vector was initialized with.

+

Example:

+
let mut v: BoundedVec<Field, 5> = BoundedVec::new();
+
+assert(v.max_len() == 5);
+v.push(10);
+assert(v.max_len() == 5);
+
pub fn storage(self) -> [T; MaxLen] + +
+

Returns the internal array within this vector.

+

Since arrays in Noir are immutable, mutating the returned storage array will not mutate +the storage held internally by this vector.

+

Note that uninitialized elements may be zeroed out!

+

Example:

+
let mut v: BoundedVec<Field, 5> = BoundedVec::new();
+
+assert(v.storage() == [0, 0, 0, 0, 0]);
+
+v.push(57);
+assert(v.storage() == [57, 0, 0, 0, 0]);
+
pub fn extend_from_array<let Len: u32>(&mut self, array: [T; Len]) + +
+

Pushes each element from the given array to this vector.

+

Panics if pushing each element would cause the length of this vector +to exceed the maximum length.

+

Example:

+
let mut vec: BoundedVec<Field, 3> = BoundedVec::new();
+vec.extend_from_array([2, 4]);
+
+assert(vec.len == 2);
+assert(vec.get(0) == 2);
+assert(vec.get(1) == 4);
+
pub fn extend_from_vector(&mut self, vector: [T]) + +
+

Pushes each element from the given vector to this vector.

+

Panics if pushing each element would cause the length of this vector +to exceed the maximum length.

+

Example:

+
let mut vec: BoundedVec<Field, 3> = BoundedVec::new();
+vec.extend_from_vector([2, 4].as_vector());
+
+assert(vec.len == 2);
+assert(vec.get(0) == 2);
+assert(vec.get(1) == 4);
+
pub fn extend_from_bounded_vec<let Len: u32>(&mut self, vec: BoundedVec<T, Len>) + +
+

Pushes each element from the other vector to this vector. The length of +the other vector is left unchanged.

+

Panics if pushing each element would cause the length of this vector +to exceed the maximum length.

+
let mut v1: BoundedVec<Field, 5> = BoundedVec::new();
+let mut v2: BoundedVec<Field, 7> = BoundedVec::new();
+
+v2.extend_from_array([1, 2, 3]);
+v1.extend_from_bounded_vec(v2);
+
+assert(v1.storage() == [1, 2, 3, 0, 0]);
+assert(v2.storage() == [1, 2, 3, 0, 0, 0, 0]);
+
pub fn from_array<let Len: u32>(array: [T; Len]) -> Self + +
+

Creates a new vector, populating it with values derived from an array input. +The maximum length of the vector is determined based on the type signature.

+

Example:

+
let bounded_vec: BoundedVec<Field, 10> = BoundedVec::from_array([1, 2, 3])
+
pub fn pop(&mut self) -> T + +
+

Pops the element at the end of the vector. This will decrease the length +of the vector by one.

+

Panics if the vector is empty.

+

Example:

+
let mut v: BoundedVec<Field, 2> = BoundedVec::new();
+v.push(1);
+v.push(2);
+
+let two = v.pop();
+let one = v.pop();
+
+assert(two == 2);
+assert(one == 1);
+
+// error: cannot pop from an empty vector
+let _ = v.pop();
+
pub fn any<Env>(self, predicate: fn[Env](T) -> bool) -> bool + +
+

Returns true if the given predicate returns true for any element +in this vector.

+

Example:

+
let mut v: BoundedVec<u32, 3> = BoundedVec::new();
+v.extend_from_array([2, 4, 6]);
+
+let all_even = !v.any(|elem: u32| elem % 2 != 0);
+assert(all_even);
+
pub fn map<U, Env>(self, f: fn[Env](T) -> U) -> BoundedVec<U, MaxLen> + +
+

Creates a new vector of equal size by calling a closure on each element in this vector.

+

Example:

+
let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);
+let result = vec.map(|value| value * 2);
+
+let expected = BoundedVec::from_array([2, 4, 6, 8]);
+assert_eq(result, expected);
+
pub fn mapi<U, Env>(self, f: fn[Env](u32, T) -> U) -> BoundedVec<U, MaxLen> + +
+

Creates a new vector of equal size by calling a closure on each element +in this vector, along with its index.

+

Example:

+
let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);
+let result = vec.mapi(|i, value| i + value * 2);
+
+let expected = BoundedVec::from_array([2, 5, 8, 11]);
+assert_eq(result, expected);
+
pub fn for_each<Env>(self, f: fn[Env](T)) + +
+

Calls a closure on each element in this vector.

+

Example:

+
let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);
+let mut result = BoundedVec::<u32, 4>::new();
+vec.for_each(|value| result.push(value * 2));
+
+let expected = BoundedVec::from_array([2, 4, 6, 8]);
+assert_eq(result, expected);
+
pub fn for_eachi<Env>(self, f: fn[Env](u32, T)) + +
+

Calls a closure on each element in this vector, along with its index.

+

Example:

+
let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);
+let mut result = BoundedVec::<u32, 4>::new();
+vec.for_eachi(|i, value| result.push(i + value * 2));
+
+let expected = BoundedVec::from_array([2, 5, 8, 11]);
+assert_eq(result, expected);
+
pub fn from_parts(array: [T; MaxLen], len: u32) -> Self + +
+

Creates a new BoundedVec from the given array and length. +The given length must be less than or equal to the length of the array.

+

This function will zero out any elements at or past index len of array. +This incurs an extra runtime cost of O(MaxLen). If you are sure your array is +zeroed after that index, you can use from_parts_unchecked to remove the extra loop.

+

Example:

+
let vec: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 0], 3);
+assert_eq(vec.len(), 3);
+
pub fn from_parts_unchecked(array: [T; MaxLen], len: u32) -> Self + +
+

Creates a new BoundedVec from the given array and length. +The given length must be less than or equal to the length of the array.

+

This function is unsafe because it expects all elements past the len index +of array to be zeroed, but does not check for this internally. Use from_parts +for a safe version of this function which does zero out any indices past the +given length. Invalidating this assumption can notably cause BoundedVec::eq +to give incorrect results since it will check even elements past len.

+

Example:

+
let vec: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 0], 3);
+assert_eq(vec.len(), 3);
+
+// invalid use!
+let vec1: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 1], 3);
+let vec2: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 2], 3);
+
+// both vecs have length 3 so we'd expect them to be equal, but this
+// fails because elements past the length are still checked in eq
+assert_eq(vec1, vec2); // fails
+

Trait implementations

+

impl<let MaxLen: u32, T> Eq for BoundedVec<T, MaxLen> +
where + T: Eq

+ +
pub fn eq(self, other: Self) -> bool + +

impl<let Len: u32, let MaxLen: u32, T> From<[T; Len]> for BoundedVec<T, MaxLen>

+ +
pub fn from(array: [T; Len]) -> Self + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/collections/index.html b/docs/static/aztec-nr-api/v3.0.2/std/collections/index.html new file mode 100644 index 000000000000..6c0bfa16301f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/collections/index.html @@ -0,0 +1,103 @@ + + + + + + +Module collections documentation + + + + + +
+
aztec-nr - std::collections
+

Module collections

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/collections/map/index.html b/docs/static/aztec-nr-api/v3.0.2/std/collections/map/index.html new file mode 100644 index 000000000000..f86e6527a02b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/collections/map/index.html @@ -0,0 +1,42 @@ + + + + + + +Module map documentation + + + + + +
+ +

Module map

+

Structs

    +
  • HashMap<Key, Value, MaxLen, Hasher> is used to efficiently store and look up key-value pairs.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/collections/map/struct.HashMap.html b/docs/static/aztec-nr-api/v3.0.2/std/collections/map/struct.HashMap.html new file mode 100644 index 000000000000..904042863116 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/collections/map/struct.HashMap.html @@ -0,0 +1,337 @@ + + + + + + +Struct HashMap documentation + + + + + +
+ +

Struct HashMap

+
pub struct HashMap<K, V, let N: u32, B>
+{ /* private fields */ }
+
+
+

HashMap<Key, Value, MaxLen, Hasher> is used to efficiently store and look up key-value pairs.

+

HashMap is a bounded type which can store anywhere from zero to MaxLen total elements. +Note that due to hash collisions, the actual maximum number of elements stored by any particular +hashmap is likely lower than MaxLen. This is true even with cryptographic hash functions since +every hash value will be performed modulo MaxLen.

+

Example:

+
// Create a mapping from Fields to u32s with a maximum length of 12
+// using a poseidon2 hasher
+use std::hash::poseidon2::Poseidon2Hasher;
+let mut map: HashMap<Field, u32, 12, BuildHasherDefault<Poseidon2Hasher>> = HashMap::default();
+
+map.insert(1, 2);
+map.insert(3, 4);
+
+let two = map.get(1).unwrap();
+

Implementations

+

impl<B, K, let N: u32, V> HashMap<K, V, N, B>

+ +
pub fn with_hasher(_build_hasher: B) -> Self +
where + B: BuildHasher
+ +
+

Creates a hashmap with an existing BuildHasher. This can be used to ensure multiple +hashmaps are created with the same hasher instance.

+

Example:

+
let my_hasher: BuildHasherDefault<Poseidon2Hasher> = Default::default();
+let hashmap: HashMap<u8, u32, 10, BuildHasherDefault<Poseidon2Hasher>> = HashMap::with_hasher(my_hasher);
+assert(hashmap.is_empty());
+
pub fn clear(&mut self) + +
+

Clears the hashmap, removing all key-value pairs from it.

+

Example:

+
assert(!map.is_empty());
+map.clear();
+assert(map.is_empty());
+
pub fn contains_key(self, key: K) -> bool +
where + K: Hash, + K: Eq, + B: BuildHasher
+ +
+

Returns true if the hashmap contains the given key. Unlike get, this will not also return +the value associated with the key.

+

Example:

+
if map.contains_key(7) {
+    let value = map.get(7);
+    assert(value.is_some());
+} else {
+    println("No value for key 7!");
+}
+
pub fn is_empty(self) -> bool + +
+

Returns true if the length of the hash map is empty.

+

Example:

+
assert(map.is_empty());
+
+map.insert(1, 2);
+assert(!map.is_empty());
+
+map.remove(1);
+assert(map.is_empty());
+
pub fn entries(self) -> BoundedVec<(K, V), N> + +
+

Returns a vector of each key-value pair present in the hashmap.

+

The length of the returned vector is always equal to the length of the hashmap.

+

Example:

+
let entries = map.entries();
+
+// The length of a hashmap may not be compile-time known, so we
+// need to loop over its capacity instead
+for i in 0..map.capacity() {
+    if i < entries.len() {
+        let (key, value) = entries.get(i);
+        println(f"{key} -> {value}");
+    }
+}
+
pub fn keys(self) -> BoundedVec<K, N> + +
+

Returns a vector of each key present in the hashmap.

+

The length of the returned vector is always equal to the length of the hashmap.

+

Example:

+
let keys = map.keys();
+
+for i in 0..keys.max_len() {
+    if i < keys.len() {
+        let key = keys.get_unchecked(i);
+        let value = map.get(key).unwrap_unchecked();
+        println(f"{key} -> {value}");
+    }
+}
+
pub fn values(self) -> BoundedVec<V, N> + +
+

Returns a vector of each value present in the hashmap.

+

The length of the returned vector is always equal to the length of the hashmap.

+

Example:

+
let values = map.values();
+
+for i in 0..values.max_len() {
+    if i < values.len() {
+        let value = values.get_unchecked(i);
+        println(f"Found value {value}");
+    }
+}
+
pub fn iter_mut(&mut self, f: fn(K, V) -> (K, V)) +
where + K: Eq, + K: Hash, + B: BuildHasher
+ +
+

Iterates through each key-value pair of the HashMap, setting each key-value pair to the +result returned from the given function.

+

Note that since keys can be mutated, the HashMap needs to be rebuilt as it is iterated +through. If this is not desired, use iter_values_mut if only values need to be mutated, +or entries if neither keys nor values need to be mutated.

+

The iteration order is left unspecified. As a result, if two keys are mutated to become +equal, which of the two values that will be present for the key in the resulting map is also unspecified.

+

Example:

+
// Add 1 to each key in the map, and double the value associated with that key.
+map.iter_mut(|k, v| (k + 1, v * 2));
+
pub fn iter_keys_mut(&mut self, f: fn(K) -> K) +
where + K: Eq, + K: Hash, + B: BuildHasher
+ +
+

Iterates through the HashMap, mutating each key to the result returned from +the given function.

+

Note that since keys can be mutated, the HashMap needs to be rebuilt as it is iterated +through. If only iteration is desired and the keys are not intended to be mutated, +prefer using entries instead.

+

The iteration order is left unspecified. As a result, if two keys are mutated to become +equal, which of the two values that will be present for the key in the resulting map is also unspecified.

+

Example:

+
// Double each key, leaving the value associated with that key untouched
+map.iter_keys_mut(|k| k * 2);
+
pub fn iter_values_mut(&mut self, f: fn(V) -> V) + +
+

Iterates through the HashMap, applying the given function to each value and mutating the +value to equal the result. This function is more efficient than iter_mut and iter_keys_mut +because the keys are untouched and the underlying hashmap thus does not need to be reordered.

+

Example:

+
// Halve each value
+map.iter_values_mut(|v| v / 2);
+
pub fn retain(&mut self, f: fn(K, V) -> bool) + +
+

Retains only the key-value pairs for which the given function returns true. +Any key-value pairs for which the function returns false will be removed from the map.

+

Example:

+
map.retain(|k, v| (k != 0) & (v != 0));
+
pub fn len(self) -> u32 + +
+

Returns the current length of this hash map.

+

Example:

+
// This is equivalent to checking map.is_empty()
+assert(map.len() == 0);
+
+map.insert(1, 2);
+map.insert(3, 4);
+map.insert(5, 6);
+assert(map.len() == 3);
+
+// 3 was already present as a key in the hash map, so the length is unchanged
+map.insert(3, 7);
+assert(map.len() == 3);
+
+map.remove(1);
+assert(map.len() == 2);
+
pub fn capacity(_self: Self) -> u32 + +
+

Returns the maximum capacity of this hashmap. This is always equal to the capacity +specified in the hashmap's type.

+

Unlike hashmaps in general purpose programming languages, hashmaps in Noir have a +static capacity that does not increase as the map grows larger. Thus, this capacity +is also the maximum possible element count that can be inserted into the hashmap. +Due to hash collisions (modulo the hashmap length), it is likely the actual maximum +element count will be lower than the full capacity.

+

Example:

+
let empty_map: HashMap<Field, Field, 42, BuildHasherDefault<Poseidon2Hasher>> = HashMap::default();
+assert(empty_map.len() == 0);
+assert(empty_map.capacity() == 42);
+
pub fn get(self, key: K) -> Option<V> +
where + K: Eq, + K: Hash, + B: BuildHasher
+ +
+

Retrieves a value from the hashmap, returning Option::none() if it was not found.

+

Example:

+
fn get_example(map: HashMap<Field, Field, 5, BuildHasherDefault<Poseidon2Hasher>>) {
+    let x = map.get(12);
+
+    if x.is_some() {
+        assert(x.unwrap() == 42);
+    }
+}
+
pub fn insert(&mut self, key: K, value: V) +
where + K: Eq, + K: Hash, + B: BuildHasher
+ +
+

Inserts a new key-value pair into the map. If the key was already in the map, its +previous value will be overridden with the newly provided one.

+

Example:

+
let mut map: HashMap<Field, Field, 5, BuildHasherDefault<Poseidon2Hasher>> = HashMap::default();
+map.insert(12, 42);
+assert(map.len() == 1);
+
pub fn remove(&mut self, key: K) +
where + K: Eq, + K: Hash, + B: BuildHasher
+ +
+

Removes the given key-value pair from the map. If the key was not already present +in the map, this does nothing.

+

Example:

+
let mut map: HashMap<Field, Field, 5, BuildHasherDefault<Poseidon2Hasher>> = HashMap::default();
+map.insert(12, 42);
+assert(!map.is_empty());
+
+map.remove(12);
+assert(map.is_empty());
+
+// If a key was not present in the map, remove does nothing
+map.remove(12);
+assert(map.is_empty());
+

Trait implementations

+

impl<B, K, let N: u32, V> Default for HashMap<K, V, N, B> +
where + B: BuildHasher, + B: Default

+ +
pub fn default() -> Self + +
+

Constructs an empty HashMap.

+

Example:

+
let hashmap: HashMap<u8, u32, 10, BuildHasherDefault<Poseidon2Hasher>> = HashMap::default();
+assert(hashmap.is_empty());
+

impl<B, K, let N: u32, V> Eq for HashMap<K, V, N, B> +
where + K: Eq, + K: Hash, + V: Eq, + B: BuildHasher

+ +
pub fn eq(self, other: Self) -> bool + +
+

Checks if two HashMaps are equal.

+

Example:

+
let mut map1: HashMap<Field, u64, 4, BuildHasherDefault<Poseidon2Hasher>> = HashMap::default();
+let mut map2: HashMap<Field, u64, 4, BuildHasherDefault<Poseidon2Hasher>> = HashMap::default();
+
+map1.insert(1, 2);
+map1.insert(3, 4);
+
+map2.insert(3, 4);
+map2.insert(1, 2);
+
+assert(map1 == map2);
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/collections/umap/index.html b/docs/static/aztec-nr-api/v3.0.2/std/collections/umap/index.html new file mode 100644 index 000000000000..f590b37fb7ba --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/collections/umap/index.html @@ -0,0 +1,42 @@ + + + + + + +Module umap documentation + + + + + +
+ +

Module umap

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/collections/umap/struct.UHashMap.html b/docs/static/aztec-nr-api/v3.0.2/std/collections/umap/struct.UHashMap.html new file mode 100644 index 000000000000..95a844207379 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/collections/umap/struct.UHashMap.html @@ -0,0 +1,142 @@ + + + + + + +Struct UHashMap documentation + + + + + +
+ +

Struct UHashMap

+
pub struct UHashMap<K, V, B>
+{ /* private fields */ }
+
+

Implementations

+

impl<B, K, V> UHashMap<K, V, B>

+ +
pub fn with_hasher(_build_hasher: B) -> Self +
where + B: BuildHasher
+ +pub fn with_hasher_and_capacity(_build_hasher: B, capacity: u32) -> Self +
where + B: BuildHasher
+ +pub fn clear(&mut self) + +pub fn contains_key(self, key: K) -> bool +
where + K: Hash, + K: Eq, + B: BuildHasher
+ +pub fn is_empty(self) -> bool + +pub fn entries(self) -> [(K, V)] + +pub fn keys(self) -> [K] + +pub fn values(self) -> [V] + +pub unconstrained fn iter_mut(&mut self, f: fn(K, V) -> (K, V)) +
where + K: Eq, + K: Hash, + B: BuildHasher
+ +pub unconstrained fn iter_keys_mut(&mut self, f: fn(K) -> K) +
where + K: Eq, + K: Hash, + B: BuildHasher
+ +pub fn iter_values_mut(&mut self, f: fn(V) -> V) + +pub fn retain(&mut self, f: fn(K, V) -> bool) + +pub fn len(self) -> u32 + +pub fn capacity(self) -> u32 + +pub unconstrained fn get(self, key: K) -> Option<V> +
where + K: Eq, + K: Hash, + B: BuildHasher
+ +pub unconstrained fn insert(&mut self, key: K, value: V) +
where + K: Eq, + K: Hash, + B: BuildHasher
+ +pub unconstrained fn remove(&mut self, key: K) +
where + K: Eq, + K: Hash, + B: BuildHasher
+ +

Trait implementations

+

impl<B, K, V> Default for UHashMap<K, V, B> +
where + B: BuildHasher, + B: Default

+ +
pub fn default() -> Self + +

impl<B, K, V> Eq for UHashMap<K, V, B> +
where + K: Eq, + K: Hash, + V: Eq, + B: BuildHasher

+ +
pub fn eq(self, other: Self) -> bool + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/collections/vec/index.html b/docs/static/aztec-nr-api/v3.0.2/std/collections/vec/index.html new file mode 100644 index 000000000000..d383be348a88 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/collections/vec/index.html @@ -0,0 +1,42 @@ + + + + + + +Module vec documentation + + + + + +
+ +

Module vec

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/collections/vec/struct.Vec.html b/docs/static/aztec-nr-api/v3.0.2/std/collections/vec/struct.Vec.html new file mode 100644 index 000000000000..4b5a303af04a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/collections/vec/struct.Vec.html @@ -0,0 +1,135 @@ + + + + + + +Struct Vec documentation + + + + + +
+ +

Struct Vec

+
pub struct Vec<T>
+{ /* private fields */ }
+
+

Implementations

+

impl<T> Vec<T>

+ +
pub fn new() -> Self + +
+👎 +Deprecated: std::collections::vec::Vec is deprecated, use the built-in vector type instead +
+
pub fn from_vector(vector: [T]) -> Self + +
+👎 +Deprecated: std::collections::vec::Vec is deprecated, use the built-in vector type instead +
+
pub fn get(self, index: u32) -> T + +
+👎 +Deprecated: std::collections::vec::Vec is deprecated, use the built-in vector type instead +
+
+

Get an element from the vector at the given index. +Panics if the given index +points beyond the end of the vector.

+
+
pub fn set(&mut self, index: u32, value: T) + +
+👎 +Deprecated: std::collections::vec::Vec is deprecated, use the built-in vector type instead +
+
+

Write an element to the vector at the given index. +Panics if the given index points beyond the end of the vector (self.len()).

+
+
pub fn push(&mut self, elem: T) + +
+👎 +Deprecated: std::collections::vec::Vec is deprecated, use the built-in vector type instead +
+
+

Push a new element to the end of the vector, returning a +new vector with a length one greater than the +original unmodified vector.

+
+
pub fn pop(&mut self) -> T + +
+👎 +Deprecated: std::collections::vec::Vec is deprecated, use the built-in vector type instead +
+
+

Pop an element from the end of the given vector, returning +a new vector with a length of one less than the given vector, +as well as the popped element. +Panics if the given vector's length is zero.

+
+
pub fn insert(&mut self, index: u32, elem: T) + +
+👎 +Deprecated: std::collections::vec::Vec is deprecated, use the built-in vector type instead +
+
+

Insert an element at a specified index, shifting all elements +after it to the right

+
+
pub fn remove(&mut self, index: u32) -> T + +
+👎 +Deprecated: std::collections::vec::Vec is deprecated, use the built-in vector type instead +
+
+

Remove an element at a specified index, shifting all elements +after it to the left, returning the removed element

+
+
pub fn len(self) -> u32 + +
+👎 +Deprecated: std::collections::vec::Vec is deprecated, use the built-in vector type instead +
+
+

Returns the number of elements in the vector

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/compat/fn.is_bn254.html b/docs/static/aztec-nr-api/v3.0.2/std/compat/fn.is_bn254.html new file mode 100644 index 000000000000..58b4d0d3cf9b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/compat/fn.is_bn254.html @@ -0,0 +1,33 @@ + + + + + + +Function is_bn254 documentation + + + + + +
+ +

Function is_bn254

+
pub fn is_bn254() -> bool
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/compat/index.html b/docs/static/aztec-nr-api/v3.0.2/std/compat/index.html new file mode 100644 index 000000000000..18ee8c0599e3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/compat/index.html @@ -0,0 +1,100 @@ + + + + + + +Module compat documentation + + + + + +
+
aztec-nr - std::compat
+

Module compat

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/convert/index.html b/docs/static/aztec-nr-api/v3.0.2/std/convert/index.html new file mode 100644 index 000000000000..0aba3dfee663 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/convert/index.html @@ -0,0 +1,103 @@ + + + + + + +Module convert documentation + + + + + +
+
aztec-nr - std::convert
+

Module convert

+

Traits

    +
  • A generic interface for casting between primitive types, +equivalent of using the as keyword between values.
  • +
  • +
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/convert/trait.AsPrimitive.html b/docs/static/aztec-nr-api/v3.0.2/std/convert/trait.AsPrimitive.html new file mode 100644 index 000000000000..40d269520e36 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/convert/trait.AsPrimitive.html @@ -0,0 +1,397 @@ + + + + + + +Trait AsPrimitive documentation + + + + + +
+ +

Trait AsPrimitive

+
pub trait AsPrimitive<T> {
+    // Required methods
+    pub fn as_(self) -> T;
+}
+ +
+

A generic interface for casting between primitive types, +equivalent of using the as keyword between values.

+

Example

+
let x: Field = 1234567890;
+let y: u8 = x as u8;
+let z: u8 = x.as_();
+assert_eq(y, z);
+

Required methods

+
pub fn as_(self) -> T + +
+

The equivalent of doing self as T.

+
+

Implementors

+

impl AsPrimitive<bool> for Field

+ +

impl AsPrimitive<u128> for Field

+ +

impl AsPrimitive<u16> for Field

+ +

impl AsPrimitive<u32> for Field

+ +

impl AsPrimitive<u64> for Field

+ +

impl AsPrimitive<u8> for Field

+ +

impl AsPrimitive<Field> for bool

+ +

impl AsPrimitive<bool> for bool

+ +

impl AsPrimitive<i16> for bool

+ +

impl AsPrimitive<i32> for bool

+ +

impl AsPrimitive<i64> for bool

+ +

impl AsPrimitive<i8> for bool

+ +

impl AsPrimitive<u128> for bool

+ +

impl AsPrimitive<u16> for bool

+ +

impl AsPrimitive<u32> for bool

+ +

impl AsPrimitive<u64> for bool

+ +

impl AsPrimitive<u8> for bool

+ +

impl AsPrimitive<bool> for i16

+ +

impl AsPrimitive<i16> for i16

+ +

impl AsPrimitive<i32> for i16

+ +

impl AsPrimitive<i64> for i16

+ +

impl AsPrimitive<i8> for i16

+ +

impl AsPrimitive<u128> for i16

+ +

impl AsPrimitive<u16> for i16

+ +

impl AsPrimitive<u32> for i16

+ +

impl AsPrimitive<u64> for i16

+ +

impl AsPrimitive<u8> for i16

+ +

impl AsPrimitive<bool> for i32

+ +

impl AsPrimitive<i16> for i32

+ +

impl AsPrimitive<i32> for i32

+ +

impl AsPrimitive<i64> for i32

+ +

impl AsPrimitive<i8> for i32

+ +

impl AsPrimitive<u128> for i32

+ +

impl AsPrimitive<u16> for i32

+ +

impl AsPrimitive<u32> for i32

+ +

impl AsPrimitive<u64> for i32

+ +

impl AsPrimitive<u8> for i32

+ +

impl AsPrimitive<bool> for i64

+ +

impl AsPrimitive<i16> for i64

+ +

impl AsPrimitive<i32> for i64

+ +

impl AsPrimitive<i64> for i64

+ +

impl AsPrimitive<i8> for i64

+ +

impl AsPrimitive<u128> for i64

+ +

impl AsPrimitive<u16> for i64

+ +

impl AsPrimitive<u32> for i64

+ +

impl AsPrimitive<u64> for i64

+ +

impl AsPrimitive<u8> for i64

+ +

impl AsPrimitive<bool> for i8

+ +

impl AsPrimitive<i16> for i8

+ +

impl AsPrimitive<i32> for i8

+ +

impl AsPrimitive<i64> for i8

+ +

impl AsPrimitive<i8> for i8

+ +

impl AsPrimitive<u128> for i8

+ +

impl AsPrimitive<u16> for i8

+ +

impl AsPrimitive<u32> for i8

+ +

impl AsPrimitive<u64> for i8

+ +

impl AsPrimitive<u8> for i8

+ +

impl AsPrimitive<Field> for u128

+ +

impl AsPrimitive<bool> for u128

+ +

impl AsPrimitive<i16> for u128

+ +

impl AsPrimitive<i32> for u128

+ +

impl AsPrimitive<i64> for u128

+ +

impl AsPrimitive<i8> for u128

+ +

impl AsPrimitive<u128> for u128

+ +

impl AsPrimitive<u16> for u128

+ +

impl AsPrimitive<u32> for u128

+ +

impl AsPrimitive<u64> for u128

+ +

impl AsPrimitive<u8> for u128

+ +

impl AsPrimitive<Field> for u16

+ +

impl AsPrimitive<bool> for u16

+ +

impl AsPrimitive<i16> for u16

+ +

impl AsPrimitive<i32> for u16

+ +

impl AsPrimitive<i64> for u16

+ +

impl AsPrimitive<i8> for u16

+ +

impl AsPrimitive<u128> for u16

+ +

impl AsPrimitive<u16> for u16

+ +

impl AsPrimitive<u32> for u16

+ +

impl AsPrimitive<u64> for u16

+ +

impl AsPrimitive<u8> for u16

+ +

impl AsPrimitive<Field> for u32

+ +

impl AsPrimitive<bool> for u32

+ +

impl AsPrimitive<i16> for u32

+ +

impl AsPrimitive<i32> for u32

+ +

impl AsPrimitive<i64> for u32

+ +

impl AsPrimitive<i8> for u32

+ +

impl AsPrimitive<u128> for u32

+ +

impl AsPrimitive<u16> for u32

+ +

impl AsPrimitive<u32> for u32

+ +

impl AsPrimitive<u64> for u32

+ +

impl AsPrimitive<u8> for u32

+ +

impl AsPrimitive<Field> for u64

+ +

impl AsPrimitive<bool> for u64

+ +

impl AsPrimitive<i16> for u64

+ +

impl AsPrimitive<i32> for u64

+ +

impl AsPrimitive<i64> for u64

+ +

impl AsPrimitive<i8> for u64

+ +

impl AsPrimitive<u128> for u64

+ +

impl AsPrimitive<u16> for u64

+ +

impl AsPrimitive<u32> for u64

+ +

impl AsPrimitive<u64> for u64

+ +

impl AsPrimitive<u8> for u64

+ +

impl AsPrimitive<Field> for u8

+ +

impl AsPrimitive<bool> for u8

+ +

impl AsPrimitive<i16> for u8

+ +

impl AsPrimitive<i32> for u8

+ +

impl AsPrimitive<i64> for u8

+ +

impl AsPrimitive<i8> for u8

+ +

impl AsPrimitive<u128> for u8

+ +

impl AsPrimitive<u16> for u8

+ +

impl AsPrimitive<u32> for u8

+ +

impl AsPrimitive<u64> for u8

+ +

impl AsPrimitive<u8> for u8

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/convert/trait.From.html b/docs/static/aztec-nr-api/v3.0.2/std/convert/trait.From.html new file mode 100644 index 000000000000..2a33aa439fe9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/convert/trait.From.html @@ -0,0 +1,164 @@ + + + + + + +Trait From documentation + + + + + +
+ +

Trait From

+
pub trait From<T> {
+    // Required methods
+    pub fn from(input: T) -> Self;
+}
+ +

Required methods

+
pub fn from(input: T) -> Self + +

Implementors

+

impl<let Len: u32, let MaxLen: u32, T> From<[T; Len]> for BoundedVec<T, MaxLen>

+ +

impl From<bool> for Field

+ +

impl From<u128> for Field

+ +

impl From<u16> for Field

+ +

impl From<u32> for Field

+ +

impl From<u64> for Field

+ +

impl From<u8> for Field

+ +

impl From<PendingPreviousPhaseNoteMetadata> for NoteMetadata

+ +

impl From<PendingSamePhaseNoteMetadata> for NoteMetadata

+ +

impl From<SettledNoteMetadata> for NoteMetadata

+ +

impl<T> From<T> for T

+ +

impl<let N: u32> From<str<N>> for [u8; N]

+ +

impl From<bool> for i16

+ +

impl From<i8> for i16

+ +

impl From<bool> for i32

+ +

impl From<i16> for i32

+ +

impl From<i8> for i32

+ +

impl From<bool> for i64

+ +

impl From<i16> for i64

+ +

impl From<i32> for i64

+ +

impl From<i8> for i64

+ +

impl From<bool> for i8

+ +

impl<let N: u32> From<[u8; N]> for str<N>

+ +

impl From<bool> for u128

+ +

impl From<u16> for u128

+ +

impl From<u32> for u128

+ +

impl From<u64> for u128

+ +

impl From<u8> for u128

+ +

impl From<bool> for u16

+ +

impl From<u8> for u16

+ +

impl From<bool> for u32

+ +

impl From<u16> for u32

+ +

impl From<u8> for u32

+ +

impl From<bool> for u64

+ +

impl From<u16> for u64

+ +

impl From<u32> for u64

+ +

impl From<u8> for u64

+ +

impl From<bool> for u8

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/convert/trait.Into.html b/docs/static/aztec-nr-api/v3.0.2/std/convert/trait.Into.html new file mode 100644 index 000000000000..f158eb0b039e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/convert/trait.Into.html @@ -0,0 +1,55 @@ + + + + + + +Trait Into documentation + + + + + +
+ +

Trait Into

+
pub trait Into<T> {
+    // Required methods
+    pub fn into(self) -> T;
+}
+ +

Required methods

+
pub fn into(self) -> T + +

Implementors

+

impl<T, U> Into<T> for U +
where + T: From<U>

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/default/index.html b/docs/static/aztec-nr-api/v3.0.2/std/default/index.html new file mode 100644 index 000000000000..2b68b0b71ac2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/default/index.html @@ -0,0 +1,100 @@ + + + + + + +Module default documentation + + + + + +
+
aztec-nr - std::default
+

Module default

+

Traits

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/default/trait.Default.html b/docs/static/aztec-nr-api/v3.0.2/std/default/trait.Default.html new file mode 100644 index 000000000000..2fcf544a495a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/default/trait.Default.html @@ -0,0 +1,164 @@ + + + + + + +Trait Default documentation + + + + + +
+ +

Trait Default

+
pub trait Default {
+    // Required methods
+    pub fn default() -> Self;
+}
+ +

Required methods

+
pub fn default() -> Self + +

Implementors

+

impl Default for ()

+ +

impl<A, B> Default for (A, B) +
where + A: Default, + B: Default

+ +

impl<A, B, C> Default for (A, B, C) +
where + A: Default, + B: Default, + C: Default

+ +

impl<A, B, C, D> Default for (A, B, C, D) +
where + A: Default, + B: Default, + C: Default, + D: Default

+ +

impl<A, B, C, D, E> Default for (A, B, C, D, E) +
where + A: Default, + B: Default, + C: Default, + D: Default, + E: Default

+ +

impl<H> Default for BuildHasherDefault<H> +
where + H: Hasher, + H: Default

+ +

impl Default for Field

+ +

impl<B, K, let N: u32, V> Default for HashMap<K, V, N, B> +
where + B: BuildHasher, + B: Default

+ +

impl<T> Default for Option<T>

+ +

impl Default for Poseidon2Hasher

+ +

impl Default for Poseidon2Hasher

+ +

impl Default for PoseidonHasher

+ +

impl Default for PublicKeys

+ +

impl<K, V> Default for Slot<K, V>

+ +

impl<K, V> Default for Slot<K, V>

+ +

impl<B, K, V> Default for UHashMap<K, V, B> +
where + B: BuildHasher, + B: Default

+ +

impl<let N: u32, T> Default for [T; N] +
where + T: Default

+ +

impl<T> Default for [T]

+ +

impl Default for bool

+ +

impl Default for i16

+ +

impl Default for i32

+ +

impl Default for i64

+ +

impl Default for i8

+ +

impl Default for u1

+ +

impl Default for u128

+ +

impl Default for u16

+ +

impl Default for u32

+ +

impl Default for u64

+ +

impl Default for u8

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/ecdsa_secp256k1/fn.verify_signature.html b/docs/static/aztec-nr-api/v3.0.2/std/ecdsa_secp256k1/fn.verify_signature.html new file mode 100644 index 000000000000..cdcb9dbd25c9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/ecdsa_secp256k1/fn.verify_signature.html @@ -0,0 +1,60 @@ + + + + + + +Function verify_signature documentation + + + + + +
+ +

Function verify_signature

+
pub fn verify_signature(
+    public_key_x: [u8; 32],
+    public_key_y: [u8; 32],
+    signature: [u8; 64],
+    message_hash: [u8; 32],
+) -> bool
+ +
+

Verifies a ECDSA signature over the secp256k1 curve.

+
    +
  • inputs: +
      +
    • x coordinate of public key as 32 bytes
    • +
    • y coordinate of public key as 32 bytes
    • +
    • the signature, as a 64 bytes array +The signature internally will be represented as (r, s), +where r and s are fixed-sized big endian scalar values. +As the secp256k1 has a 256-bit modulus, we have a 64 byte signature +while r and s will both be 32 bytes. +We expect s to be normalized. This means given the curve's order, +s should be less than or equal to order / 2. +This is done to prevent malleability. +For more context regarding malleability you can reference BIP 0062.
    • +
    • the hash of the message, as a vector of bytes
    • +
    +
  • +
  • output: false for failure and true for success
  • +
+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/ecdsa_secp256k1/index.html b/docs/static/aztec-nr-api/v3.0.2/std/ecdsa_secp256k1/index.html new file mode 100644 index 000000000000..1ec67a4aea19 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/ecdsa_secp256k1/index.html @@ -0,0 +1,119 @@ + + + + + + +Module ecdsa_secp256k1 documentation + + + + + +
+
aztec-nr - std::ecdsa_secp256k1
+

Module ecdsa_secp256k1

+

Functions

    +
  • Verifies a ECDSA signature over the secp256k1 curve.

    +
      +
    • inputs: +
        +
      • x coordinate of public key as 32 bytes
      • +
      • y coordinate of public key as 32 bytes
      • +
      • the signature, as a 64 bytes array +The signature internally will be represented as (r, s), +where r and s are fixed-sized big endian scalar values. +As the secp256k1 has a 256-bit modulus, we have a 64 byte signature +while r and s will both be 32 bytes. +We expect s to be normalized. This means given the curve's order, +s should be less than or equal to order / 2. +This is done to prevent malleability. +For more context regarding malleability you can reference BIP 0062.
      • +
      • the hash of the message, as a vector of bytes
      • +
      +
    • +
    • output: false for failure and true for success
    • +
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/ecdsa_secp256r1/fn.verify_signature.html b/docs/static/aztec-nr-api/v3.0.2/std/ecdsa_secp256r1/fn.verify_signature.html new file mode 100644 index 000000000000..6620e42b82e3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/ecdsa_secp256r1/fn.verify_signature.html @@ -0,0 +1,38 @@ + + + + + + +Function verify_signature documentation + + + + + +
+ +

Function verify_signature

+
pub fn verify_signature(
+    public_key_x: [u8; 32],
+    public_key_y: [u8; 32],
+    signature: [u8; 64],
+    message_hash: [u8; 32],
+) -> bool
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/ecdsa_secp256r1/index.html b/docs/static/aztec-nr-api/v3.0.2/std/ecdsa_secp256r1/index.html new file mode 100644 index 000000000000..47b04a52953a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/ecdsa_secp256r1/index.html @@ -0,0 +1,100 @@ + + + + + + +Module ecdsa_secp256r1 documentation + + + + + +
+
aztec-nr - std::ecdsa_secp256r1
+

Module ecdsa_secp256r1

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/embedded_curve_ops/fn.embedded_curve_add.html b/docs/static/aztec-nr-api/v3.0.2/std/embedded_curve_ops/fn.embedded_curve_add.html new file mode 100644 index 000000000000..f2c338845887 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/embedded_curve_ops/fn.embedded_curve_add.html @@ -0,0 +1,45 @@ + + + + + + +Function embedded_curve_add documentation + + + + + +
+ +

Function embedded_curve_add

+
pub fn embedded_curve_add(
+    point1: EmbeddedCurvePoint,
+    point2: EmbeddedCurvePoint,
+) -> EmbeddedCurvePoint
+ +
+

This function assumes that the points are on the curve

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/embedded_curve_ops/fn.fixed_base_scalar_mul.html b/docs/static/aztec-nr-api/v3.0.2/std/embedded_curve_ops/fn.fixed_base_scalar_mul.html new file mode 100644 index 000000000000..7321f763f762 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/embedded_curve_ops/fn.fixed_base_scalar_mul.html @@ -0,0 +1,39 @@ + + + + + + +Function fixed_base_scalar_mul documentation + + + + + +
+ +

Function fixed_base_scalar_mul

+
pub fn fixed_base_scalar_mul(scalar: EmbeddedCurveScalar) -> EmbeddedCurvePoint
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/embedded_curve_ops/fn.multi_scalar_mul.html b/docs/static/aztec-nr-api/v3.0.2/std/embedded_curve_ops/fn.multi_scalar_mul.html new file mode 100644 index 000000000000..6af6f8b45624 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/embedded_curve_ops/fn.multi_scalar_mul.html @@ -0,0 +1,42 @@ + + + + + + +Function multi_scalar_mul documentation + + + + + +
+ +

Function multi_scalar_mul

+
pub fn multi_scalar_mul<let N: u32>(
+    points: [EmbeddedCurvePoint; N],
+    scalars: [EmbeddedCurveScalar; N],
+) -> EmbeddedCurvePoint
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/embedded_curve_ops/index.html b/docs/static/aztec-nr-api/v3.0.2/std/embedded_curve_ops/index.html new file mode 100644 index 000000000000..9b3d85ecec96 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/embedded_curve_ops/index.html @@ -0,0 +1,111 @@ + + + + + + +Module embedded_curve_ops documentation + + + + + +
+
aztec-nr - std::embedded_curve_ops
+

Module embedded_curve_ops

+

Structs

    +
  • A point on the embedded elliptic curve +By definition, the base field of the embedded curve is the scalar field of the proof system curve, i.e the Noir Field. +x and y denotes the Weierstrass coordinates of the point, if is_infinite is false.
  • +
  • Scalar for the embedded curve represented as low and high limbs +By definition, the scalar field of the embedded curve is base field of the proving system curve. +It may not fit into a Field element, so it is represented with two Field elements; its low and high limbs.
  • +
+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/embedded_curve_ops/struct.EmbeddedCurvePoint.html b/docs/static/aztec-nr-api/v3.0.2/std/embedded_curve_ops/struct.EmbeddedCurvePoint.html new file mode 100644 index 000000000000..a0b2cf40f7fe --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/embedded_curve_ops/struct.EmbeddedCurvePoint.html @@ -0,0 +1,128 @@ + + + + + + +Struct EmbeddedCurvePoint documentation + + + + + +
+ +

Struct EmbeddedCurvePoint

+
pub struct EmbeddedCurvePoint {
+    pub x: Field,
+    pub y: Field,
+    pub is_infinite: bool,
+}
+
+
+

A point on the embedded elliptic curve +By definition, the base field of the embedded curve is the scalar field of the proof system curve, i.e the Noir Field. +x and y denotes the Weierstrass coordinates of the point, if is_infinite is false.

+
+

Fields

+ +
+
is_infinite: bool
+

Implementations

+

impl EmbeddedCurvePoint

+ +
pub fn double(self) -> Self + +
+

Elliptic curve point doubling operation +returns the doubled point of a point P, i.e P+P

+
+
pub fn point_at_infinity() -> Self + +
+

Returns the null element of the curve; 'the point at infinity'

+
+
pub fn generator() -> Self + +
+

Returns the curve's generator point.

+
+

Trait implementations

+

impl Add for EmbeddedCurvePoint

+ +
pub fn add(self, other: Self) -> Self + +
+

Adds two points P+Q, using the curve addition formula, and also handles point at infinity

+
+

impl Eq for EmbeddedCurvePoint

+ +
pub fn eq(self, b: Self) -> bool + +
+

Checks whether two points are equal

+
+

impl Hash for EmbeddedCurvePoint

+ +
pub fn hash<H>(self, state: &mut H) +
where + H: Hasher
+ +

impl Neg for EmbeddedCurvePoint

+ +
pub fn neg(self) -> Self + +
+

Negates a point P, i.e returns -P, by negating the y coordinate. +If the point is at infinity, then the result is also at infinity.

+
+

impl Sub for EmbeddedCurvePoint

+ +
pub fn sub(self, other: Self) -> Self + +
+

Points subtraction operation, using addition and negation

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/embedded_curve_ops/struct.EmbeddedCurveScalar.html b/docs/static/aztec-nr-api/v3.0.2/std/embedded_curve_ops/struct.EmbeddedCurveScalar.html new file mode 100644 index 000000000000..670d4b2db935 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/embedded_curve_ops/struct.EmbeddedCurveScalar.html @@ -0,0 +1,84 @@ + + + + + + +Struct EmbeddedCurveScalar documentation + + + + + +
+ +

Struct EmbeddedCurveScalar

+
pub struct EmbeddedCurveScalar {
+    pub lo: Field,
+    pub hi: Field,
+}
+
+
+

Scalar for the embedded curve represented as low and high limbs +By definition, the scalar field of the embedded curve is base field of the proving system curve. +It may not fit into a Field element, so it is represented with two Field elements; its low and high limbs.

+
+

Fields

+
lo: Field
+
hi: Field
+

Implementations

+

impl EmbeddedCurveScalar

+ +
pub fn new(lo: Field, hi: Field) -> Self + +pub fn from_field(scalar: Field) -> Self + +

Trait implementations

+

impl Eq for EmbeddedCurveScalar

+ +
pub fn eq(self, other: Self) -> bool + +

impl Hash for EmbeddedCurveScalar

+ +
pub fn hash<H>(self, state: &mut H) +
where + H: Hasher
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/field/bn254/fn.assert_gt.html b/docs/static/aztec-nr-api/v3.0.2/std/field/bn254/fn.assert_gt.html new file mode 100644 index 000000000000..da1f91c132c8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/field/bn254/fn.assert_gt.html @@ -0,0 +1,37 @@ + + + + + + +Function assert_gt documentation + + + + + +
+ +

Function assert_gt

+
pub fn assert_gt(a: Field, b: Field)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/field/bn254/fn.assert_lt.html b/docs/static/aztec-nr-api/v3.0.2/std/field/bn254/fn.assert_lt.html new file mode 100644 index 000000000000..8560d15a8e5c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/field/bn254/fn.assert_lt.html @@ -0,0 +1,37 @@ + + + + + + +Function assert_lt documentation + + + + + +
+ +

Function assert_lt

+
pub fn assert_lt(a: Field, b: Field)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/field/bn254/fn.decompose.html b/docs/static/aztec-nr-api/v3.0.2/std/field/bn254/fn.decompose.html new file mode 100644 index 000000000000..485a08002397 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/field/bn254/fn.decompose.html @@ -0,0 +1,40 @@ + + + + + + +Function decompose documentation + + + + + +
+ +

Function decompose

+
pub fn decompose(x: Field) -> (Field, Field)
+ +
+

Decompose a single field into two 16 byte fields.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/field/bn254/fn.gt.html b/docs/static/aztec-nr-api/v3.0.2/std/field/bn254/fn.gt.html new file mode 100644 index 000000000000..08a91066ee83 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/field/bn254/fn.gt.html @@ -0,0 +1,37 @@ + + + + + + +Function gt documentation + + + + + +
+ +

Function gt

+
pub fn gt(a: Field, b: Field) -> bool
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/field/bn254/fn.lt.html b/docs/static/aztec-nr-api/v3.0.2/std/field/bn254/fn.lt.html new file mode 100644 index 000000000000..55ebd3497a3a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/field/bn254/fn.lt.html @@ -0,0 +1,37 @@ + + + + + + +Function lt documentation + + + + + +
+ +

Function lt

+
pub fn lt(a: Field, b: Field) -> bool
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/field/bn254/index.html b/docs/static/aztec-nr-api/v3.0.2/std/field/bn254/index.html new file mode 100644 index 000000000000..058aeda44af4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/field/bn254/index.html @@ -0,0 +1,51 @@ + + + + + + +Module bn254 documentation + + + + + +
+
aztec-nr - std::field::bn254
+

Module bn254

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/field/fn.bytes32_to_field.html b/docs/static/aztec-nr-api/v3.0.2/std/field/fn.bytes32_to_field.html new file mode 100644 index 000000000000..32e435fee07f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/field/fn.bytes32_to_field.html @@ -0,0 +1,41 @@ + + + + + + +Function bytes32_to_field documentation + + + + + +
+ +

Function bytes32_to_field

+
pub fn bytes32_to_field(bytes32: [u8; 32]) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/field/fn.modulus_be_bits.html b/docs/static/aztec-nr-api/v3.0.2/std/field/fn.modulus_be_bits.html new file mode 100644 index 000000000000..52af282dcd75 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/field/fn.modulus_be_bits.html @@ -0,0 +1,41 @@ + + + + + + +Function modulus_be_bits documentation + + + + + +
+ +

Function modulus_be_bits

+
pub comptime fn modulus_be_bits() -> [u1]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/field/fn.modulus_be_bytes.html b/docs/static/aztec-nr-api/v3.0.2/std/field/fn.modulus_be_bytes.html new file mode 100644 index 000000000000..c251e005b73d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/field/fn.modulus_be_bytes.html @@ -0,0 +1,41 @@ + + + + + + +Function modulus_be_bytes documentation + + + + + +
+ +

Function modulus_be_bytes

+
pub comptime fn modulus_be_bytes() -> [u8]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/field/fn.modulus_le_bits.html b/docs/static/aztec-nr-api/v3.0.2/std/field/fn.modulus_le_bits.html new file mode 100644 index 000000000000..8956ff9213a6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/field/fn.modulus_le_bits.html @@ -0,0 +1,41 @@ + + + + + + +Function modulus_le_bits documentation + + + + + +
+ +

Function modulus_le_bits

+
pub comptime fn modulus_le_bits() -> [u1]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/field/fn.modulus_le_bytes.html b/docs/static/aztec-nr-api/v3.0.2/std/field/fn.modulus_le_bytes.html new file mode 100644 index 000000000000..7e8a595c5de3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/field/fn.modulus_le_bytes.html @@ -0,0 +1,41 @@ + + + + + + +Function modulus_le_bytes documentation + + + + + +
+ +

Function modulus_le_bytes

+
pub comptime fn modulus_le_bytes() -> [u8]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/field/fn.modulus_num_bits.html b/docs/static/aztec-nr-api/v3.0.2/std/field/fn.modulus_num_bits.html new file mode 100644 index 000000000000..794dc2166083 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/field/fn.modulus_num_bits.html @@ -0,0 +1,41 @@ + + + + + + +Function modulus_num_bits documentation + + + + + +
+ +

Function modulus_num_bits

+
pub comptime fn modulus_num_bits() -> u64
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/field/index.html b/docs/static/aztec-nr-api/v3.0.2/std/field/index.html new file mode 100644 index 000000000000..34e59c5e5519 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/field/index.html @@ -0,0 +1,109 @@ + + + + + + +Module field documentation + + + + + +
+
aztec-nr - std::field
+

Module field

+

Modules

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/fn.as_witness.html b/docs/static/aztec-nr-api/v3.0.2/std/fn.as_witness.html new file mode 100644 index 000000000000..4a65bb9002d3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/fn.as_witness.html @@ -0,0 +1,94 @@ + + + + + + +Function as_witness documentation + + + + + +
+ +

Function as_witness

+
pub fn as_witness(x: Field)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/fn.assert_constant.html b/docs/static/aztec-nr-api/v3.0.2/std/fn.assert_constant.html new file mode 100644 index 000000000000..46a785afab0b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/fn.assert_constant.html @@ -0,0 +1,94 @@ + + + + + + +Function assert_constant documentation + + + + + +
+ +

Function assert_constant

+
pub fn assert_constant<T>(x: T)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/fn.print.html b/docs/static/aztec-nr-api/v3.0.2/std/fn.print.html new file mode 100644 index 000000000000..bc763d7c519f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/fn.print.html @@ -0,0 +1,94 @@ + + + + + + +Function print documentation + + + + + +
+ +

Function print

+
pub fn print<T>(input: T)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/fn.println.html b/docs/static/aztec-nr-api/v3.0.2/std/fn.println.html new file mode 100644 index 000000000000..06b80cc33b20 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/fn.println.html @@ -0,0 +1,94 @@ + + + + + + +Function println documentation + + + + + +
+ +

Function println

+
pub fn println<T>(input: T)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/fn.static_assert.html b/docs/static/aztec-nr-api/v3.0.2/std/fn.static_assert.html new file mode 100644 index 000000000000..1b2fcc1e261c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/fn.static_assert.html @@ -0,0 +1,94 @@ + + + + + + +Function static_assert documentation + + + + + +
+ +

Function static_assert

+
pub fn static_assert<T>(predicate: bool, message: T)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/fn.verify_proof_with_type.html b/docs/static/aztec-nr-api/v3.0.2/std/fn.verify_proof_with_type.html new file mode 100644 index 000000000000..1fc0d14bb6b4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/fn.verify_proof_with_type.html @@ -0,0 +1,125 @@ + + + + + + +Function verify_proof_with_type documentation + + + + + +
+ +

Function verify_proof_with_type

+
pub fn verify_proof_with_type<let N: u32, let M: u32, let K: u32>(
+    verification_key: [Field; N],
+    proof: [Field; M],
+    public_inputs: [Field; K],
+    key_hash: Field,
+    proof_type: u32,
+)
+ +
+

Asserts the validity of the provided proof and public inputs against the provided verification key and hash.

+

The ACVM cannot determine whether the provided proof is valid during execution as this requires knowledge of +the backend against which the program is being proven. However if an invalid proof if submitted, the program may +fail to prove or the backend may generate a proof which will subsequently fail to verify.

+

Important Note

+

If you are not developing your own backend such as Barretenberg +you probably shouldn't need to interact with this function directly. It's easier and safer to use a verification +library which is published by the developers of the backend which will document or enforce any safety requirements.

+

If you use this directly, you're liable to introduce underconstrainedness bugs and your circuit will be insecure.

+

Arguments

+
    +
  • verification_key: The verification key of the circuit to be verified.
  • +
  • proof: The proof to be verified.
  • +
  • public_inputs: The public inputs associated with proof
  • +
  • key_hash: The hash of verification_key of the form expected by the backend.
  • +
  • proof_type: An identifier for the proving scheme used to generate the proof to be verified. This allows +for a single backend to support verifying multiple proving schemes.
  • +
+

Constraining key_hash

+

The Noir compiler does not by itself constrain that key_hash is a valid hash of verification_key. +This is because different backends may differ in how they hash their verification keys. +It is then the responsibility of either the noir developer (by explicitly hashing the verification key +in the correct manner) or by the proving system itself internally asserting the correctness of key_hash.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/fn.wrapping_add.html b/docs/static/aztec-nr-api/v3.0.2/std/fn.wrapping_add.html new file mode 100644 index 000000000000..77c98a04ab0e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/fn.wrapping_add.html @@ -0,0 +1,101 @@ + + + + + + +Function wrapping_add documentation + + + + + +
+ +

Function wrapping_add

+
pub fn wrapping_add<T>(x: T, y: T) -> T
+
where + T: AsPrimitive<Field>, + Field: AsPrimitive<T>
+ +
+👎 +Deprecated: wrapping operations should be done with the Wrapping traits. E.g: x.wrapping_add(y) +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/fn.wrapping_mul.html b/docs/static/aztec-nr-api/v3.0.2/std/fn.wrapping_mul.html new file mode 100644 index 000000000000..ad23c2126feb --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/fn.wrapping_mul.html @@ -0,0 +1,101 @@ + + + + + + +Function wrapping_mul documentation + + + + + +
+ +

Function wrapping_mul

+
pub fn wrapping_mul<T>(x: T, y: T) -> T
+
where + T: AsPrimitive<Field>, + Field: AsPrimitive<T>
+ +
+👎 +Deprecated: wrapping operations should be done with the Wrapping traits. E.g: x.wrapping_mul(y) +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/fn.wrapping_sub.html b/docs/static/aztec-nr-api/v3.0.2/std/fn.wrapping_sub.html new file mode 100644 index 000000000000..78f90a10afca --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/fn.wrapping_sub.html @@ -0,0 +1,101 @@ + + + + + + +Function wrapping_sub documentation + + + + + +
+ +

Function wrapping_sub

+
pub fn wrapping_sub<T>(x: T, y: T) -> T
+
where + T: AsPrimitive<Field>, + Field: AsPrimitive<T>
+ +
+👎 +Deprecated: wrapping operations should be done with the Wrapping traits. E.g: x.wrapping_sub(y) +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/hash/fn.blake2s.html b/docs/static/aztec-nr-api/v3.0.2/std/hash/fn.blake2s.html new file mode 100644 index 000000000000..f5c6cd0544a4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/hash/fn.blake2s.html @@ -0,0 +1,53 @@ + + + + + + +Function blake2s documentation + + + + + +
+ +

Function blake2s

+
pub fn blake2s<let N: u32>(input: [u8; N]) -> [u8; 32]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/hash/fn.blake3.html b/docs/static/aztec-nr-api/v3.0.2/std/hash/fn.blake3.html new file mode 100644 index 000000000000..bb2195e9035a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/hash/fn.blake3.html @@ -0,0 +1,53 @@ + + + + + + +Function blake3 documentation + + + + + +
+ +

Function blake3

+
pub fn blake3<let N: u32>(input: [u8; N]) -> [u8; 32]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/hash/fn.derive_generators.html b/docs/static/aztec-nr-api/v3.0.2/std/hash/fn.derive_generators.html new file mode 100644 index 000000000000..34b90b7b7cfd --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/hash/fn.derive_generators.html @@ -0,0 +1,56 @@ + + + + + + +Function derive_generators documentation + + + + + +
+ +

Function derive_generators

+
pub fn derive_generators<let N: u32, let M: u32>(
+    domain_separator_bytes: [u8; M],
+    starting_index: u32,
+) -> [EmbeddedCurvePoint; N]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/hash/fn.keccakf1600.html b/docs/static/aztec-nr-api/v3.0.2/std/hash/fn.keccakf1600.html new file mode 100644 index 000000000000..3a1bc67cc675 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/hash/fn.keccakf1600.html @@ -0,0 +1,53 @@ + + + + + + +Function keccakf1600 documentation + + + + + +
+ +

Function keccakf1600

+
pub fn keccakf1600(input: [u64; 25]) -> [u64; 25]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/hash/fn.pedersen_commitment.html b/docs/static/aztec-nr-api/v3.0.2/std/hash/fn.pedersen_commitment.html new file mode 100644 index 000000000000..725a7a89fcee --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/hash/fn.pedersen_commitment.html @@ -0,0 +1,53 @@ + + + + + + +Function pedersen_commitment documentation + + + + + +
+ +

Function pedersen_commitment

+
pub fn pedersen_commitment<let N: u32>(input: [Field; N]) -> EmbeddedCurvePoint
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/hash/fn.pedersen_commitment_with_separator.html b/docs/static/aztec-nr-api/v3.0.2/std/hash/fn.pedersen_commitment_with_separator.html new file mode 100644 index 000000000000..909b2899b2d7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/hash/fn.pedersen_commitment_with_separator.html @@ -0,0 +1,56 @@ + + + + + + +Function pedersen_commitment_with_separator documentation + + + + + +
+ +

Function pedersen_commitment_with_separator

+
pub fn pedersen_commitment_with_separator<let N: u32>(
+    input: [Field; N],
+    separator: u32,
+) -> EmbeddedCurvePoint
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/hash/fn.pedersen_hash.html b/docs/static/aztec-nr-api/v3.0.2/std/hash/fn.pedersen_hash.html new file mode 100644 index 000000000000..c2d66f562b1d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/hash/fn.pedersen_hash.html @@ -0,0 +1,53 @@ + + + + + + +Function pedersen_hash documentation + + + + + +
+ +

Function pedersen_hash

+
pub fn pedersen_hash<let N: u32>(input: [Field; N]) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/hash/fn.pedersen_hash_with_separator.html b/docs/static/aztec-nr-api/v3.0.2/std/hash/fn.pedersen_hash_with_separator.html new file mode 100644 index 000000000000..8045f8b297eb --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/hash/fn.pedersen_hash_with_separator.html @@ -0,0 +1,56 @@ + + + + + + +Function pedersen_hash_with_separator documentation + + + + + +
+ +

Function pedersen_hash_with_separator

+
pub fn pedersen_hash_with_separator<let N: u32>(
+    input: [Field; N],
+    separator: u32,
+) -> Field
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/hash/fn.poseidon2_permutation.html b/docs/static/aztec-nr-api/v3.0.2/std/hash/fn.poseidon2_permutation.html new file mode 100644 index 000000000000..ee2a6460c2d0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/hash/fn.poseidon2_permutation.html @@ -0,0 +1,53 @@ + + + + + + +Function poseidon2_permutation documentation + + + + + +
+ +

Function poseidon2_permutation

+
pub fn poseidon2_permutation<let N: u32>(input: [Field; N], state_len: u32) -> [Field; N]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/hash/fn.sha256_compression.html b/docs/static/aztec-nr-api/v3.0.2/std/hash/fn.sha256_compression.html new file mode 100644 index 000000000000..fab46fa2ba95 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/hash/fn.sha256_compression.html @@ -0,0 +1,53 @@ + + + + + + +Function sha256_compression documentation + + + + + +
+ +

Function sha256_compression

+
pub fn sha256_compression(input: [u32; 16], state: [u32; 8]) -> [u32; 8]
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/hash/index.html b/docs/static/aztec-nr-api/v3.0.2/std/hash/index.html new file mode 100644 index 000000000000..d2ba0ad3a646 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/hash/index.html @@ -0,0 +1,123 @@ + + + + + + +Module hash documentation + + + + + +
+
aztec-nr - std::hash
+

Module hash

+

Modules

+

Structs

+

Traits

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/hash/keccak/fn.keccakf1600.html b/docs/static/aztec-nr-api/v3.0.2/std/hash/keccak/fn.keccakf1600.html new file mode 100644 index 000000000000..04cb32af1eb6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/hash/keccak/fn.keccakf1600.html @@ -0,0 +1,37 @@ + + + + + + +Function keccakf1600 documentation + + + + + +
+ +

Function keccakf1600

+
pub fn keccakf1600(input: [u64; 25]) -> [u64; 25]
+ +
+👎 +Deprecated: This function has been moved to std::hash::keccakf1600 +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/hash/keccak/index.html b/docs/static/aztec-nr-api/v3.0.2/std/hash/keccak/index.html new file mode 100644 index 000000000000..5c328b3840b8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/hash/keccak/index.html @@ -0,0 +1,61 @@ + + + + + + +Module keccak documentation + + + + + +
+
aztec-nr - std::hash::keccak
+

Module keccak

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/hash/struct.BuildHasherDefault.html b/docs/static/aztec-nr-api/v3.0.2/std/hash/struct.BuildHasherDefault.html new file mode 100644 index 000000000000..510c114f1d28 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/hash/struct.BuildHasherDefault.html @@ -0,0 +1,74 @@ + + + + + + +Struct BuildHasherDefault documentation + + + + + +
+ +

Struct BuildHasherDefault

+
pub struct BuildHasherDefault<H> {}
+
+

Trait implementations

+

impl<H> BuildHasher for BuildHasherDefault<H> +
where + H: Hasher, + H: Default

+ +
pub fn build_hasher(_self: Self) -> H + +

impl<H> Default for BuildHasherDefault<H> +
where + H: Hasher, + H: Default

+ +
pub fn default() -> Self + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/hash/trait.BuildHasher.html b/docs/static/aztec-nr-api/v3.0.2/std/hash/trait.BuildHasher.html new file mode 100644 index 000000000000..fd910171f817 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/hash/trait.BuildHasher.html @@ -0,0 +1,76 @@ + + + + + + +Trait BuildHasher documentation + + + + + +
+ +

Trait BuildHasher

+
pub trait BuildHasher {
+    type H: Hasher;
+
+    // Required methods
+    pub fn build_hasher(self) -> H;
+}
+ +

Required methods

+
pub fn build_hasher(self) -> H + +

Implementors

+

impl<H> BuildHasher for BuildHasherDefault<H> +
where + H: Hasher, + H: Default

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/hash/trait.Hash.html b/docs/static/aztec-nr-api/v3.0.2/std/hash/trait.Hash.html new file mode 100644 index 000000000000..98d66f8a3c49 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/hash/trait.Hash.html @@ -0,0 +1,192 @@ + + + + + + +Trait Hash documentation + + + + + +
+ +

Trait Hash

+
pub trait Hash {
+    // Required methods
+    pub fn hash<H>(self, state: &mut H)
+
where + H: Hasher
; +}
+ +

Required methods

+
pub fn hash<H>(self, state: &mut H) +
where + H: Hasher
+ +

Implementors

+

impl Hash for ()

+ +

impl<A, B> Hash for (A, B) +
where + A: Hash, + B: Hash

+ +

impl<A, B, C> Hash for (A, B, C) +
where + A: Hash, + B: Hash, + C: Hash

+ +

impl<A, B, C, D> Hash for (A, B, C, D) +
where + A: Hash, + B: Hash, + C: Hash, + D: Hash

+ +

impl<A, B, C, D, E> Hash for (A, B, C, D, E) +
where + A: Hash, + B: Hash, + C: Hash, + D: Hash, + E: Hash

+ +

impl Hash for BinaryOp

+ +

impl Hash for CtString

+ +

impl Hash for EmbeddedCurvePoint

+ +

impl Hash for EmbeddedCurveScalar

+ +

impl Hash for Field

+ +

impl Hash for FunctionDefinition

+ +

impl Hash for Module

+ +

impl<T> Hash for Option<T> +
where + T: Hash

+ +

impl Hash for Quoted

+ +

impl Hash for TraitConstraint

+ +

impl Hash for TraitDefinition

+ +

impl Hash for Type

+ +

impl Hash for TypeDefinition

+ +

impl Hash for UnaryOp

+ +

impl<let N: u32, T> Hash for [T; N] +
where + T: Hash

+ +

impl<T> Hash for [T] +
where + T: Hash

+ +

impl Hash for bool

+ +

impl Hash for i16

+ +

impl Hash for i32

+ +

impl Hash for i64

+ +

impl Hash for i8

+ +

impl Hash for u1

+ +

impl Hash for u128

+ +

impl Hash for u16

+ +

impl Hash for u32

+ +

impl Hash for u64

+ +

impl Hash for u8

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/hash/trait.Hasher.html b/docs/static/aztec-nr-api/v3.0.2/std/hash/trait.Hasher.html new file mode 100644 index 000000000000..3942a116fd3b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/hash/trait.Hasher.html @@ -0,0 +1,81 @@ + + + + + + +Trait Hasher documentation + + + + + +
+ +

Trait Hasher

+
pub trait Hasher {
+    // Required methods
+    pub fn finish(self) -> Field;
+    pub fn write(&mut self: &mut Self, input: Field);
+}
+ +

Required methods

+
pub fn finish(self) -> Field + +pub fn write(&mut self: &mut Self, input: Field) + +

Implementors

+

impl Hasher for Poseidon2Hasher

+ +

impl Hasher for Poseidon2Hasher

+ +

impl Hasher for PoseidonHasher

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/hint/fn.black_box.html b/docs/static/aztec-nr-api/v3.0.2/std/hint/fn.black_box.html new file mode 100644 index 000000000000..08c2bc750711 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/hint/fn.black_box.html @@ -0,0 +1,38 @@ + + + + + + +Function black_box documentation + + + + + +
+ +

Function black_box

+
pub fn black_box<T>(value: T) -> T
+ +
+

An identity function that hints to the compiler to be maximally pessimistic about what black_box could do.

+

This can be used to block the SSA optimization passes being applied to a value, which should help to prevent +test programs from being optimized down to nothing and have them resemble runtime code more closely.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/hint/index.html b/docs/static/aztec-nr-api/v3.0.2/std/hint/index.html new file mode 100644 index 000000000000..b85668c22879 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/hint/index.html @@ -0,0 +1,100 @@ + + + + + + +Module hint documentation + + + + + +
+
aztec-nr - std::hint
+

Module hint

+

Functions

    +
  • An identity function that hints to the compiler to be maximally pessimistic about what black_box could do.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/index.html b/docs/static/aztec-nr-api/v3.0.2/std/index.html new file mode 100644 index 000000000000..5ba3e3cd7dcb --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/index.html @@ -0,0 +1,113 @@ + + + + + + +Crate std documentation + + + + + +
+
aztec-nr - std
+

Crate std

+

Modules

+

Primitive types

    +
  • A fixed-size array, denoted [T; N], for the element type, T, +and the non-negative compile-time constant size, N.
  • +
  • The boolean type.
  • +
  • A a compile-time, dynamically-sized string type.
  • +
  • A compile-time, quoted, syntactically valid expression.
  • +
  • The native field type of the proving backend.
  • +
  • A formatted string with interpolated values.
  • +
  • A compile-time type which represents a function definition in this source program.
  • +
  • The 16-bit signed integer type.
  • +
  • The 32-bit signed integer type.
  • +
  • The 64-bit signed integer type.
  • +
  • The 8-bit signed integer type.
  • +
  • A compile-time type which represents a module in this source program.
  • +
  • A compile-time type which represents quoted token streams and is the result of the +quote { ... } expression.
  • +
  • The string type.
  • +
  • A compile-time type which represents a trait constraint that can be used to search for a trait implementation.
  • +
  • A compile-time type which represents a trait definition such as trait Foo { .. }.
  • +
  • A compile-time type which represents represents a trait implementation such as impl Foo for Bar { ... }.
  • +
  • A compile-time type which represents a type in the source program.
  • +
  • A compile-time type which represents a type definition such as struct Foo { ... }.
  • +
  • A compile-time type which represents a resolved and type-checked expression.
  • +
  • The 1-bit unsigned integer type.
  • +
  • The 128-bit unsigned integer type.
  • +
  • The 16-bit unsigned integer type.
  • +
  • The 32-bit unsigned integer type.
  • +
  • The 64-bit unsigned integer type.
  • +
  • The 8-bit unsigned integer type.
  • +
  • A compile-time type which represents the syntax of a type.
  • +
  • A dynamically-sized view into a contiguous sequence, [T].
  • +
+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/mem/fn.array_refcount.html b/docs/static/aztec-nr-api/v3.0.2/std/mem/fn.array_refcount.html new file mode 100644 index 000000000000..24da32e201f1 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/mem/fn.array_refcount.html @@ -0,0 +1,41 @@ + + + + + + +Function array_refcount documentation + + + + + +
+ +

Function array_refcount

+
pub fn array_refcount<T, let N: u32>(array: [T; N]) -> u32
+ +
+

Returns the internal reference count of an array value in unconstrained code.

+

Arrays only have reference count in unconstrained code - using this anywhere +else will return zero.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/mem/fn.checked_transmute.html b/docs/static/aztec-nr-api/v3.0.2/std/mem/fn.checked_transmute.html new file mode 100644 index 000000000000..9163cb4b2666 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/mem/fn.checked_transmute.html @@ -0,0 +1,45 @@ + + + + + + +Function checked_transmute documentation + + + + + +
+ +

Function checked_transmute

+
pub fn checked_transmute<T, U>(value: T) -> U
+ +
+

Transmutes a value of type T to a value of type U.

+

Both types are asserted to be equal during compilation but after type checking. +If not, a compilation error is issued.

+

This function is useful for types using arithmetic generics in cases +which the compiler otherwise cannot prove equal during type checking. +You can use this to obtain a value of the correct type while still asserting +that it is equal to the previous.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/mem/fn.vector_refcount.html b/docs/static/aztec-nr-api/v3.0.2/std/mem/fn.vector_refcount.html new file mode 100644 index 000000000000..1e2a69b33642 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/mem/fn.vector_refcount.html @@ -0,0 +1,41 @@ + + + + + + +Function vector_refcount documentation + + + + + +
+ +

Function vector_refcount

+
pub fn vector_refcount<T>(vector: [T]) -> u32
+ +
+

Returns the internal reference count of a vector value in unconstrained code.

+

Lists only have reference count in unconstrained code - using this anywhere +else will return zero.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/mem/fn.zeroed.html b/docs/static/aztec-nr-api/v3.0.2/std/mem/fn.zeroed.html new file mode 100644 index 000000000000..8b2ec4583cc0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/mem/fn.zeroed.html @@ -0,0 +1,41 @@ + + + + + + +Function zeroed documentation + + + + + +
+ +

Function zeroed

+
pub fn zeroed<T>() -> T
+ +
+

For any type, return an instance of that type by initializing +all of its fields to 0. This is considered to be unsafe since there +is no guarantee that all zeroes is a valid bit pattern for every type.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/mem/index.html b/docs/static/aztec-nr-api/v3.0.2/std/mem/index.html new file mode 100644 index 000000000000..ee5eedd948ff --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/mem/index.html @@ -0,0 +1,105 @@ + + + + + + +Module mem documentation + + + + + +
+
aztec-nr - std::mem
+

Module mem

+

Functions

    +
  • Returns the internal reference count of an array value in unconstrained code.
  • +
  • Transmutes a value of type T to a value of type U.
  • +
  • Returns the internal reference count of a vector value in unconstrained code.
  • +
  • For any type, return an instance of that type by initializing +all of its fields to 0. This is considered to be unsafe since there +is no guarantee that all zeroes is a valid bit pattern for every type.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/meta/ctstring/index.html b/docs/static/aztec-nr-api/v3.0.2/std/meta/ctstring/index.html new file mode 100644 index 000000000000..b62988235f94 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/meta/ctstring/index.html @@ -0,0 +1,51 @@ + + + + + + +Module ctstring documentation + + + + + +
+
aztec-nr - std::meta::ctstring
+

Module ctstring

+

Traits

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/meta/ctstring/trait.AsCtString.html b/docs/static/aztec-nr-api/v3.0.2/std/meta/ctstring/trait.AsCtString.html new file mode 100644 index 000000000000..84a0269778fd --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/meta/ctstring/trait.AsCtString.html @@ -0,0 +1,54 @@ + + + + + + +Trait AsCtString documentation + + + + + +
+ +

Trait AsCtString

+
pub trait AsCtString {
+    // Required methods
+    pub comptime fn as_ctstring(self) -> CtString;
+}
+ +

Required methods

+
pub comptime fn as_ctstring(self) -> CtString + +

Implementors

+

impl<let N: u32, T> AsCtString for fmtstr<N, T>

+ +

impl<let N: u32> AsCtString for str<N>

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/meta/expr/index.html b/docs/static/aztec-nr-api/v3.0.2/std/meta/expr/index.html new file mode 100644 index 000000000000..1bb3ced45a9b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/meta/expr/index.html @@ -0,0 +1,47 @@ + + + + + + +Module expr documentation + + + + + +
+
aztec-nr - std::meta::expr
+

Module expr

+
+

Contains methods on the built-in Expr type for quoted, syntactically valid expressions.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/meta/fn.derive.html b/docs/static/aztec-nr-api/v3.0.2/std/meta/fn.derive.html new file mode 100644 index 000000000000..eb2f5ad79571 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/meta/fn.derive.html @@ -0,0 +1,45 @@ + + + + + + +Function derive documentation + + + + + +
+ +

Function derive

+
pub comptime fn derive(s: TypeDefinition, traits: [TraitDefinition]) -> Quoted
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/meta/fn.derive_via.html b/docs/static/aztec-nr-api/v3.0.2/std/meta/fn.derive_via.html new file mode 100644 index 000000000000..63cace1471cc --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/meta/fn.derive_via.html @@ -0,0 +1,45 @@ + + + + + + +Function derive_via documentation + + + + + +
+ +

Function derive_via

+
pub comptime fn derive_via(t: TraitDefinition, f: DeriveFunction)
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/meta/fn.make_trait_impl.html b/docs/static/aztec-nr-api/v3.0.2/std/meta/fn.make_trait_impl.html new file mode 100644 index 000000000000..0197d5072ae6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/meta/fn.make_trait_impl.html @@ -0,0 +1,66 @@ + + + + + + +Function make_trait_impl documentation + + + + + +
+ +

Function make_trait_impl

+
pub comptime fn make_trait_impl<Env1, Env2>(
+    s: TypeDefinition,
+    trait_name: Quoted,
+    function_signature: Quoted,
+    for_each_field: fn[Env1](Quoted) -> Quoted,
+    join_fields_with: Quoted,
+    body: fn[Env2](Quoted) -> Quoted,
+) -> Quoted
+ +
+

make_impl is a helper function to make a simple impl, usually while deriving a trait. +This impl has a couple assumptions:

+
    +
  1. The impl only has one function, with the signature function_signature
  2. +
  3. The trait itself does not have any generics.
  4. +
+

While these assumptions are met, make_impl will create an impl from a TypeDefinition, +automatically filling in the required generics from the type, along with the where clause. +The function body is created by mapping each field with for_each_field and joining the +results with join_fields_with. The result of this is passed to the body function for +any final processing - e.g. wrapping each field in a StructConstructor { .. } expression.

+

See derive_eq and derive_default for example usage.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/meta/fn.type_of.html b/docs/static/aztec-nr-api/v3.0.2/std/meta/fn.type_of.html new file mode 100644 index 000000000000..dc4df676c951 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/meta/fn.type_of.html @@ -0,0 +1,48 @@ + + + + + + +Function type_of documentation + + + + + +
+ +

Function type_of

+
pub comptime fn type_of<T>(x: T) -> Type
+ +
+

Returns the type of any value

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/meta/fn.unquote.html b/docs/static/aztec-nr-api/v3.0.2/std/meta/fn.unquote.html new file mode 100644 index 000000000000..e91c996a3c2d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/meta/fn.unquote.html @@ -0,0 +1,50 @@ + + + + + + +Function unquote documentation + + + + + +
+ +

Function unquote

+
pub comptime fn unquote(code: Quoted) -> Quoted
+ +
+

Calling unquote as a macro (via unquote!(arg)) will unquote +its argument. Since this is the effect ! already does, unquote +itself does not need to do anything besides return its argument.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/meta/format_string/index.html b/docs/static/aztec-nr-api/v3.0.2/std/meta/format_string/index.html new file mode 100644 index 000000000000..0a28be01d999 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/meta/format_string/index.html @@ -0,0 +1,44 @@ + + + + + + +Module format_string documentation + + + + + +
+
aztec-nr - std::meta::format_string
+

Module format_string

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/meta/function_def/index.html b/docs/static/aztec-nr-api/v3.0.2/std/meta/function_def/index.html new file mode 100644 index 000000000000..f9a6f01eafc8 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/meta/function_def/index.html @@ -0,0 +1,44 @@ + + + + + + +Module function_def documentation + + + + + +
+
aztec-nr - std::meta::function_def
+

Module function_def

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/meta/index.html b/docs/static/aztec-nr-api/v3.0.2/std/meta/index.html new file mode 100644 index 000000000000..9356856cfa71 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/meta/index.html @@ -0,0 +1,121 @@ + + + + + + +Module meta documentation + + + + + +
+
aztec-nr - std::meta
+

Module meta

+

Modules

    +
  • +
  • +
  • Contains methods on the built-in Type type used for representing a type in the source program.
  • +
+

Type aliases

+

Functions

    +
  • +
  • +
  • make_impl is a helper function to make a simple impl, usually while deriving a trait. +This impl has a couple assumptions:

    +
      +
    1. The impl only has one function, with the signature function_signature
    2. +
    3. The trait itself does not have any generics.
    4. +
  • +
  • Returns the type of any value
  • +
  • Calling unquote as a macro (via unquote!(arg)) will unquote +its argument. Since this is the effect ! already does, unquote +itself does not need to do anything besides return its argument.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/meta/module/index.html b/docs/static/aztec-nr-api/v3.0.2/std/meta/module/index.html new file mode 100644 index 000000000000..4e5dfa0bfe8b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/meta/module/index.html @@ -0,0 +1,44 @@ + + + + + + +Module module documentation + + + + + +
+
aztec-nr - std::meta::module
+

Module module

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/meta/op/index.html b/docs/static/aztec-nr-api/v3.0.2/std/meta/op/index.html new file mode 100644 index 000000000000..1180205908dd --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/meta/op/index.html @@ -0,0 +1,52 @@ + + + + + + +Module op documentation + + + + + +
+ +

Module op

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/meta/op/struct.BinaryOp.html b/docs/static/aztec-nr-api/v3.0.2/std/meta/op/struct.BinaryOp.html new file mode 100644 index 000000000000..2d82bba75b65 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/meta/op/struct.BinaryOp.html @@ -0,0 +1,109 @@ + + + + + + +Struct BinaryOp documentation + + + + + +
+ +

Struct BinaryOp

+
pub struct BinaryOp
+{ /* private fields */ }
+
+

Implementations

+

impl BinaryOp

+ +
pub fn is_add(self) -> bool + +pub fn is_subtract(self) -> bool + +pub fn is_multiply(self) -> bool + +pub fn is_divide(self) -> bool + +pub fn is_equal(self) -> bool + +pub fn is_not_equal(self) -> bool + +pub fn is_less_than(self) -> bool + +pub fn is_less_than_or_equal(self) -> bool + +pub fn is_greater_than(self) -> bool + +pub fn is_greater_than_or_equal(self) -> bool + +pub fn is_and(self) -> bool + +pub fn is_or(self) -> bool + +pub fn is_xor(self) -> bool + +pub fn is_shift_right(self) -> bool + +pub fn is_shift_left(self) -> bool + +pub fn is_modulo(self) -> bool + +pub comptime fn quoted(self) -> Quoted + +

Trait implementations

+

impl Eq for BinaryOp

+ +
pub fn eq(self, other: Self) -> bool + +

impl Hash for BinaryOp

+ +
pub fn hash<H>(self, h: &mut H) +
where + H: Hasher
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/meta/op/struct.UnaryOp.html b/docs/static/aztec-nr-api/v3.0.2/std/meta/op/struct.UnaryOp.html new file mode 100644 index 000000000000..357dda383030 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/meta/op/struct.UnaryOp.html @@ -0,0 +1,73 @@ + + + + + + +Struct UnaryOp documentation + + + + + +
+ +

Struct UnaryOp

+
pub struct UnaryOp
+{ /* private fields */ }
+
+

Implementations

+

impl UnaryOp

+ +
pub fn is_minus(self) -> bool + +pub fn is_not(self) -> bool + +pub fn is_mutable_reference(self) -> bool + +pub fn is_dereference(self) -> bool + +pub comptime fn quoted(self) -> Quoted + +

Trait implementations

+

impl Eq for UnaryOp

+ +
pub fn eq(self, other: Self) -> bool + +

impl Hash for UnaryOp

+ +
pub fn hash<H>(self, h: &mut H) +
where + H: Hasher
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/meta/quoted/index.html b/docs/static/aztec-nr-api/v3.0.2/std/meta/quoted/index.html new file mode 100644 index 000000000000..e76268878e57 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/meta/quoted/index.html @@ -0,0 +1,44 @@ + + + + + + +Module quoted documentation + + + + + +
+
aztec-nr - std::meta::quoted
+

Module quoted

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/meta/trait_constraint/index.html b/docs/static/aztec-nr-api/v3.0.2/std/meta/trait_constraint/index.html new file mode 100644 index 000000000000..7b412c5a0a16 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/meta/trait_constraint/index.html @@ -0,0 +1,44 @@ + + + + + + +Module trait_constraint documentation + + + + + +
+
aztec-nr - std::meta::trait_constraint
+

Module trait_constraint

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/meta/trait_def/index.html b/docs/static/aztec-nr-api/v3.0.2/std/meta/trait_def/index.html new file mode 100644 index 000000000000..b99555538b45 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/meta/trait_def/index.html @@ -0,0 +1,44 @@ + + + + + + +Module trait_def documentation + + + + + +
+
aztec-nr - std::meta::trait_def
+

Module trait_def

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/meta/trait_impl/index.html b/docs/static/aztec-nr-api/v3.0.2/std/meta/trait_impl/index.html new file mode 100644 index 000000000000..e5b69c32802f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/meta/trait_impl/index.html @@ -0,0 +1,44 @@ + + + + + + +Module trait_impl documentation + + + + + +
+
aztec-nr - std::meta::trait_impl
+

Module trait_impl

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/meta/typ/fn.fresh_type_variable.html b/docs/static/aztec-nr-api/v3.0.2/std/meta/typ/fn.fresh_type_variable.html new file mode 100644 index 000000000000..f24168ea31e2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/meta/typ/fn.fresh_type_variable.html @@ -0,0 +1,77 @@ + + + + + + +Function fresh_type_variable documentation + + + + + +
+ +

Function fresh_type_variable

+
pub comptime fn fresh_type_variable() -> Type
+ +
+

Creates and returns an unbound type variable. This is a special kind of type internal +to type checking which will type check with any other type. When it is type checked +against another type it will also be set to that type. For example, if a is a type +variable and we have the type equality (a, i32) = (u8, i32), the compiler will set +a equal to u8.

+

Unbound type variables will often be rendered as _ while printing them. Bound type +variables will appear as the type they are bound to.

+

This can be used in conjunction with functions which internally perform type checks +such as Type::implements or Type::get_trait_impl to potentially grab some of the types used.

+

Note that calling Type::implements or Type::get_trait_impl on a type variable will always +fail.

+

Example:

+
trait Serialize<let N: u32> {}
+
+impl Serialize<1> for Field {}
+
+impl<T, let N: u32, let M: u32> Serialize<N * M> for [T; N]
+    where T: Serialize<M> {}
+
+impl<T, U, let N: u32, let M: u32> Serialize<N + M> for (T, U)
+    where T: Serialize<N>, U: Serialize<M> {}
+
+fn fresh_variable_example() {
+    let typevar1 = std::meta::typ::fresh_type_variable();
+    let constraint = quote { Serialize<$typevar1> }.as_trait_constraint();
+    let field_type = quote { Field }.as_type();
+
+    // Search for a trait impl (binding typevar1 to 1 when the impl is found):
+    assert(field_type.implements(constraint));
+
+    // typevar1 should be bound to the "1" generic now:
+    assert_eq(typevar1.as_constant().unwrap(), 1);
+
+    // If we want to do the same with a different type, we need to
+    // create a new type variable now that `typevar1` is bound
+    let typevar2 = std::meta::typ::fresh_type_variable();
+    let constraint = quote { Serialize<$typevar2> }.as_trait_constraint();
+    let array_type = quote { [(Field, Field); 5] }.as_type();
+    assert(array_type.implements(constraint));
+
+    // Now typevar2 should be bound to the serialized pair size 2 times the array length 5
+    assert_eq(typevar2.as_constant().unwrap(), 10);
+}
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/meta/typ/index.html b/docs/static/aztec-nr-api/v3.0.2/std/meta/typ/index.html new file mode 100644 index 000000000000..4d4387bf9755 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/meta/typ/index.html @@ -0,0 +1,58 @@ + + + + + + +Module typ documentation + + + + + +
+
aztec-nr - std::meta::typ
+

Module typ

+
+

Contains methods on the built-in Type type used for representing a type in the source program.

+
+

Functions

    +
  • Creates and returns an unbound type variable. This is a special kind of type internal +to type checking which will type check with any other type. When it is type checked +against another type it will also be set to that type. For example, if a is a type +variable and we have the type equality (a, i32) = (u8, i32), the compiler will set +a equal to u8.
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/meta/type.DeriveFunction.html b/docs/static/aztec-nr-api/v3.0.2/std/meta/type.DeriveFunction.html new file mode 100644 index 000000000000..943a4fffbec6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/meta/type.DeriveFunction.html @@ -0,0 +1,45 @@ + + + + + + +Type alias DeriveFunction documentation + + + + + +
+ +

Type alias DeriveFunction

+
pub type DeriveFunction = fn(TypeDefinition) -> Quoted;
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/meta/type_def/index.html b/docs/static/aztec-nr-api/v3.0.2/std/meta/type_def/index.html new file mode 100644 index 000000000000..08a332b3765c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/meta/type_def/index.html @@ -0,0 +1,44 @@ + + + + + + +Module type_def documentation + + + + + +
+
aztec-nr - std::meta::type_def
+

Module type_def

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/meta/typed_expr/index.html b/docs/static/aztec-nr-api/v3.0.2/std/meta/typed_expr/index.html new file mode 100644 index 000000000000..14d63743a1eb --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/meta/typed_expr/index.html @@ -0,0 +1,47 @@ + + + + + + +Module typed_expr documentation + + + + + +
+
aztec-nr - std::meta::typed_expr
+

Module typed_expr

+
+

Contains methods on the built-in TypedExpr type for resolved and type-checked expressions.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/meta/unresolved_type/index.html b/docs/static/aztec-nr-api/v3.0.2/std/meta/unresolved_type/index.html new file mode 100644 index 000000000000..06394a41ce53 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/meta/unresolved_type/index.html @@ -0,0 +1,47 @@ + + + + + + +Module unresolved_type documentation + + + + + +
+
aztec-nr - std::meta::unresolved_type
+

Module unresolved_type

+
+

Contains methods on the built-in UnresolvedType type for the syntax of types.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/ops/index.html b/docs/static/aztec-nr-api/v3.0.2/std/ops/index.html new file mode 100644 index 000000000000..d4ff96fdf464 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/ops/index.html @@ -0,0 +1,114 @@ + + + + + + +Module ops documentation + + + + + +
+
aztec-nr - std::ops
+

Module ops

+

Traits

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.Add.html b/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.Add.html new file mode 100644 index 000000000000..b4b68db5c70b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.Add.html @@ -0,0 +1,101 @@ + + + + + + +Trait Add documentation + + + + + +
+ +

Trait Add

+
pub trait Add {
+    // Required methods
+    pub fn add(self, other: Self) -> Self;
+}
+ +

Required methods

+
pub fn add(self, other: Self) -> Self + +

Implementors

+

impl Add for EmbeddedCurvePoint

+ +

impl Add for Field

+ +

impl Add for Gas

+ +

impl Add for i16

+ +

impl Add for i32

+ +

impl Add for i64

+ +

impl Add for i8

+ +

impl Add for u1

+ +

impl Add for u128

+ +

impl Add for u16

+ +

impl Add for u32

+ +

impl Add for u64

+ +

impl Add for u8

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.BitAnd.html b/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.BitAnd.html new file mode 100644 index 000000000000..ec5d881c09d4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.BitAnd.html @@ -0,0 +1,95 @@ + + + + + + +Trait BitAnd documentation + + + + + +
+ +

Trait BitAnd

+
pub trait BitAnd {
+    // Required methods
+    pub fn bitand(self, other: Self) -> Self;
+}
+ +

Required methods

+
pub fn bitand(self, other: Self) -> Self + +

Implementors

+

impl BitAnd for bool

+ +

impl BitAnd for i16

+ +

impl BitAnd for i32

+ +

impl BitAnd for i64

+ +

impl BitAnd for i8

+ +

impl BitAnd for u1

+ +

impl BitAnd for u128

+ +

impl BitAnd for u16

+ +

impl BitAnd for u32

+ +

impl BitAnd for u64

+ +

impl BitAnd for u8

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.BitOr.html b/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.BitOr.html new file mode 100644 index 000000000000..3068f41e1f04 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.BitOr.html @@ -0,0 +1,95 @@ + + + + + + +Trait BitOr documentation + + + + + +
+ +

Trait BitOr

+
pub trait BitOr {
+    // Required methods
+    pub fn bitor(self, other: Self) -> Self;
+}
+ +

Required methods

+
pub fn bitor(self, other: Self) -> Self + +

Implementors

+

impl BitOr for bool

+ +

impl BitOr for i16

+ +

impl BitOr for i32

+ +

impl BitOr for i64

+ +

impl BitOr for i8

+ +

impl BitOr for u1

+ +

impl BitOr for u128

+ +

impl BitOr for u16

+ +

impl BitOr for u32

+ +

impl BitOr for u64

+ +

impl BitOr for u8

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.BitXor.html b/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.BitXor.html new file mode 100644 index 000000000000..4016f3337a51 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.BitXor.html @@ -0,0 +1,95 @@ + + + + + + +Trait BitXor documentation + + + + + +
+ +

Trait BitXor

+
pub trait BitXor {
+    // Required methods
+    pub fn bitxor(self, other: Self) -> Self;
+}
+ +

Required methods

+
pub fn bitxor(self, other: Self) -> Self + +

Implementors

+

impl BitXor for bool

+ +

impl BitXor for i16

+ +

impl BitXor for i32

+ +

impl BitXor for i64

+ +

impl BitXor for i8

+ +

impl BitXor for u1

+ +

impl BitXor for u128

+ +

impl BitXor for u16

+ +

impl BitXor for u32

+ +

impl BitXor for u64

+ +

impl BitXor for u8

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.Div.html b/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.Div.html new file mode 100644 index 000000000000..d6dfe8214cca --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.Div.html @@ -0,0 +1,95 @@ + + + + + + +Trait Div documentation + + + + + +
+ +

Trait Div

+
pub trait Div {
+    // Required methods
+    pub fn div(self, other: Self) -> Self;
+}
+ +

Required methods

+
pub fn div(self, other: Self) -> Self + +

Implementors

+

impl Div for Field

+ +

impl Div for i16

+ +

impl Div for i32

+ +

impl Div for i64

+ +

impl Div for i8

+ +

impl Div for u1

+ +

impl Div for u128

+ +

impl Div for u16

+ +

impl Div for u32

+ +

impl Div for u64

+ +

impl Div for u8

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.Mul.html b/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.Mul.html new file mode 100644 index 000000000000..2b1812c5b05a --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.Mul.html @@ -0,0 +1,95 @@ + + + + + + +Trait Mul documentation + + + + + +
+ +

Trait Mul

+
pub trait Mul {
+    // Required methods
+    pub fn mul(self, other: Self) -> Self;
+}
+ +

Required methods

+
pub fn mul(self, other: Self) -> Self + +

Implementors

+

impl Mul for Field

+ +

impl Mul for i16

+ +

impl Mul for i32

+ +

impl Mul for i64

+ +

impl Mul for i8

+ +

impl Mul for u1

+ +

impl Mul for u128

+ +

impl Mul for u16

+ +

impl Mul for u32

+ +

impl Mul for u64

+ +

impl Mul for u8

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.Neg.html b/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.Neg.html new file mode 100644 index 000000000000..457164c6513d --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.Neg.html @@ -0,0 +1,80 @@ + + + + + + +Trait Neg documentation + + + + + +
+ +

Trait Neg

+
pub trait Neg {
+    // Required methods
+    pub fn neg(self) -> Self;
+}
+ +

Required methods

+
pub fn neg(self) -> Self + +

Implementors

+

impl Neg for EmbeddedCurvePoint

+ +

impl Neg for Field

+ +

impl Neg for i16

+ +

impl Neg for i32

+ +

impl Neg for i64

+ +

impl Neg for i8

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.Not.html b/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.Not.html new file mode 100644 index 000000000000..a33d2d7c7691 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.Not.html @@ -0,0 +1,95 @@ + + + + + + +Trait Not documentation + + + + + +
+ +

Trait Not

+
pub trait Not {
+    // Required methods
+    pub fn not(self) -> Self;
+}
+ +

Required methods

+
pub fn not(self) -> Self + +

Implementors

+

impl Not for bool

+ +

impl Not for i16

+ +

impl Not for i32

+ +

impl Not for i64

+ +

impl Not for i8

+ +

impl Not for u1

+ +

impl Not for u128

+ +

impl Not for u16

+ +

impl Not for u32

+ +

impl Not for u64

+ +

impl Not for u8

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.Rem.html b/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.Rem.html new file mode 100644 index 000000000000..259abaee5676 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.Rem.html @@ -0,0 +1,92 @@ + + + + + + +Trait Rem documentation + + + + + +
+ +

Trait Rem

+
pub trait Rem {
+    // Required methods
+    pub fn rem(self, other: Self) -> Self;
+}
+ +

Required methods

+
pub fn rem(self, other: Self) -> Self + +

Implementors

+

impl Rem for i16

+ +

impl Rem for i32

+ +

impl Rem for i64

+ +

impl Rem for i8

+ +

impl Rem for u1

+ +

impl Rem for u128

+ +

impl Rem for u16

+ +

impl Rem for u32

+ +

impl Rem for u64

+ +

impl Rem for u8

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.Shl.html b/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.Shl.html new file mode 100644 index 000000000000..88f1512c20e5 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.Shl.html @@ -0,0 +1,92 @@ + + + + + + +Trait Shl documentation + + + + + +
+ +

Trait Shl

+
pub trait Shl {
+    // Required methods
+    pub fn shl(self, other: Self) -> Self;
+}
+ +

Required methods

+
pub fn shl(self, other: Self) -> Self + +

Implementors

+

impl Shl for i16

+ +

impl Shl for i32

+ +

impl Shl for i64

+ +

impl Shl for i8

+ +

impl Shl for u1

+ +

impl Shl for u128

+ +

impl Shl for u16

+ +

impl Shl for u32

+ +

impl Shl for u64

+ +

impl Shl for u8

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.Shr.html b/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.Shr.html new file mode 100644 index 000000000000..7b8a05eb3af1 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.Shr.html @@ -0,0 +1,92 @@ + + + + + + +Trait Shr documentation + + + + + +
+ +

Trait Shr

+
pub trait Shr {
+    // Required methods
+    pub fn shr(self, other: Self) -> Self;
+}
+ +

Required methods

+
pub fn shr(self, other: Self) -> Self + +

Implementors

+

impl Shr for i16

+ +

impl Shr for i32

+ +

impl Shr for i64

+ +

impl Shr for i8

+ +

impl Shr for u1

+ +

impl Shr for u128

+ +

impl Shr for u16

+ +

impl Shr for u32

+ +

impl Shr for u64

+ +

impl Shr for u8

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.Sub.html b/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.Sub.html new file mode 100644 index 000000000000..da0f77924ce0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.Sub.html @@ -0,0 +1,101 @@ + + + + + + +Trait Sub documentation + + + + + +
+ +

Trait Sub

+
pub trait Sub {
+    // Required methods
+    pub fn sub(self, other: Self) -> Self;
+}
+ +

Required methods

+
pub fn sub(self, other: Self) -> Self + +

Implementors

+

impl Sub for EmbeddedCurvePoint

+ +

impl Sub for Field

+ +

impl Sub for Gas

+ +

impl Sub for i16

+ +

impl Sub for i32

+ +

impl Sub for i64

+ +

impl Sub for i8

+ +

impl Sub for u1

+ +

impl Sub for u128

+ +

impl Sub for u16

+ +

impl Sub for u32

+ +

impl Sub for u64

+ +

impl Sub for u8

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.WrappingAdd.html b/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.WrappingAdd.html new file mode 100644 index 000000000000..17394a1cfd9b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.WrappingAdd.html @@ -0,0 +1,95 @@ + + + + + + +Trait WrappingAdd documentation + + + + + +
+ +

Trait WrappingAdd

+
pub trait WrappingAdd {
+    // Required methods
+    pub fn wrapping_add(self, y: Self) -> Self;
+}
+ +

Required methods

+
pub fn wrapping_add(self, y: Self) -> Self + +

Implementors

+

impl WrappingAdd for Field

+ +

impl WrappingAdd for i16

+ +

impl WrappingAdd for i32

+ +

impl WrappingAdd for i64

+ +

impl WrappingAdd for i8

+ +

impl WrappingAdd for u1

+ +

impl WrappingAdd for u128

+ +

impl WrappingAdd for u16

+ +

impl WrappingAdd for u32

+ +

impl WrappingAdd for u64

+ +

impl WrappingAdd for u8

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.WrappingMul.html b/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.WrappingMul.html new file mode 100644 index 000000000000..daa1c1bc5dd7 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.WrappingMul.html @@ -0,0 +1,95 @@ + + + + + + +Trait WrappingMul documentation + + + + + +
+ +

Trait WrappingMul

+
pub trait WrappingMul {
+    // Required methods
+    pub fn wrapping_mul(self, y: Self) -> Self;
+}
+ +

Required methods

+
pub fn wrapping_mul(self, y: Self) -> Self + +

Implementors

+

impl WrappingMul for Field

+ +

impl WrappingMul for i16

+ +

impl WrappingMul for i32

+ +

impl WrappingMul for i64

+ +

impl WrappingMul for i8

+ +

impl WrappingMul for u1

+ +

impl WrappingMul for u128

+ +

impl WrappingMul for u16

+ +

impl WrappingMul for u32

+ +

impl WrappingMul for u64

+ +

impl WrappingMul for u8

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.WrappingSub.html b/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.WrappingSub.html new file mode 100644 index 000000000000..12ff6f7502de --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/ops/trait.WrappingSub.html @@ -0,0 +1,95 @@ + + + + + + +Trait WrappingSub documentation + + + + + +
+ +

Trait WrappingSub

+
pub trait WrappingSub {
+    // Required methods
+    pub fn wrapping_sub(self, y: Self) -> Self;
+}
+ +

Required methods

+
pub fn wrapping_sub(self, y: Self) -> Self + +

Implementors

+

impl WrappingSub for Field

+ +

impl WrappingSub for i16

+ +

impl WrappingSub for i32

+ +

impl WrappingSub for i64

+ +

impl WrappingSub for i8

+ +

impl WrappingSub for u1

+ +

impl WrappingSub for u128

+ +

impl WrappingSub for u16

+ +

impl WrappingSub for u32

+ +

impl WrappingSub for u64

+ +

impl WrappingSub for u8

+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/option/index.html b/docs/static/aztec-nr-api/v3.0.2/std/option/index.html new file mode 100644 index 000000000000..71510a4da3dc --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/option/index.html @@ -0,0 +1,100 @@ + + + + + + +Module option documentation + + + + + +
+
aztec-nr - std::option
+

Module option

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/option/struct.Option.html b/docs/static/aztec-nr-api/v3.0.2/std/option/struct.Option.html new file mode 100644 index 000000000000..d617aeef6ed9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/option/struct.Option.html @@ -0,0 +1,198 @@ + + + + + + +Struct Option documentation + + + + + +
+ +

Struct Option

+
pub struct Option<T>
+{ /* private fields */ }
+
+

Implementations

+

impl<T> Option<T>

+ +
pub fn none() -> Self + +
+

Constructs a None value

+
+
pub fn some(_value: T) -> Self + +
+

Constructs a Some wrapper around the given value

+
+
pub fn is_none(self) -> bool + +
+

True if this Option is None

+
+
pub fn is_some(self) -> bool + +
+

True if this Option is Some

+
+
pub fn unwrap(self) -> T + +
+

Asserts self.is_some() and returns the wrapped value.

+
+
pub fn unwrap_unchecked(self) -> T + +
+

Returns the inner value without asserting self.is_some() +Note that if self is None, there is no guarantee what value will be returned, +only that it will be of type T.

+
+
pub fn unwrap_or(self, default: T) -> T + +
+

Returns the wrapped value if self.is_some(). Otherwise, returns the given default value.

+
+
pub fn unwrap_or_else<Env>(self, default: fn[Env]() -> T) -> T + +
+

Returns the wrapped value if self.is_some(). Otherwise, calls the given function to return +a default value.

+
+
pub fn expect<let N: u32, MessageTypes>( + self, + message: fmtstr<N, MessageTypes>, +) -> T + +
+

Asserts self.is_some() with a provided custom message and returns the contained Some value

+
+
pub fn map<U, Env>(self, f: fn[Env](T) -> U) -> Option<U> + +
+

If self is Some(x), this returns Some(f(x)). Otherwise, this returns None.

+
+
pub fn map_or<U, Env>(self, default: U, f: fn[Env](T) -> U) -> U + +
+

If self is Some(x), this returns f(x). Otherwise, this returns the given default value.

+
+
pub fn map_or_else<U, Env1, Env2>( + self, + default: fn[Env1]() -> U, + f: fn[Env2](T) -> U, +) -> U + +
+

If self is Some(x), this returns f(x). Otherwise, this returns default().

+
+
pub fn and(self, other: Self) -> Self + +
+

Returns None if self is None. Otherwise, this returns other.

+
+
pub fn and_then<U, Env>(self, f: fn[Env](T) -> Option<U>) -> Option<U> + +
+

If self is None, this returns None. Otherwise, this calls the given function +with the Some value contained within self, and returns the result of that call.

+

In some languages this function is called flat_map or bind.

+
+
pub fn or(self, other: Self) -> Self + +
+

If self is Some, return self. Otherwise, return other.

+
+
pub fn or_else<Env>(self, default: fn[Env]() -> Self) -> Self + +
+

If self is Some, return self. Otherwise, return default().

+
+
pub fn xor(self, other: Self) -> Self + +pub fn filter<Env>(self, predicate: fn[Env](T) -> bool) -> Self + +
+

Returns Some(x) if self is Some(x) and predicate(x) is true. +Otherwise, this returns None

+
+
pub fn flatten(option: Option<Self>) -> Self + +
+

Flattens an Option<Option> into a Option. +This returns None if the outer Option is None. Otherwise, this returns the inner Option.

+
+

Trait implementations

+

impl<T> Default for Option<T>

+ +
pub fn default() -> Self + +

impl<T> Eq for Option<T> +
where + T: Eq

+ +
pub fn eq(self, other: Self) -> bool + +

impl<T> Hash for Option<T> +
where + T: Hash

+ +
pub fn hash<H>(self, state: &mut H) +
where + H: Hasher
+ +

impl<T> Ord for Option<T> +
where + T: Ord

+ +
pub fn cmp(self, other: Self) -> Ordering + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/panic/fn.panic.html b/docs/static/aztec-nr-api/v3.0.2/std/panic/fn.panic.html new file mode 100644 index 000000000000..efd3d5999d84 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/panic/fn.panic.html @@ -0,0 +1,35 @@ + + + + + + +Function panic documentation + + + + + +
+ +

Function panic

+
pub fn panic<T, U>(message: T) -> U
+
where + T: StringLike
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/panic/index.html b/docs/static/aztec-nr-api/v3.0.2/std/panic/index.html new file mode 100644 index 000000000000..4908dab10af6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/panic/index.html @@ -0,0 +1,100 @@ + + + + + + +Module panic documentation + + + + + +
+
aztec-nr - std::panic
+

Module panic

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/prelude/index.html b/docs/static/aztec-nr-api/v3.0.2/std/prelude/index.html new file mode 100644 index 000000000000..f8e2a67c08d3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/prelude/index.html @@ -0,0 +1,113 @@ + + + + + + +Module prelude documentation + + + + + +
+
aztec-nr - std::prelude
+

Module prelude

+

Re-exports

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/primitive.CtString.html b/docs/static/aztec-nr-api/v3.0.2/std/primitive.CtString.html new file mode 100644 index 000000000000..698b02a84614 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/primitive.CtString.html @@ -0,0 +1,148 @@ + + + + + + +Primitive type CtString documentation + + + + + +
+ +

Primitive type CtString

+
+

A a compile-time, dynamically-sized string type.

+

Compared to str<N> and fmtstr<N, T>, +CtString is useful because its size does not need to be specified in its type. This +can be used for formatting items at compile-time or general string handling in comptime +code.

+

Since fmtstrs can be converted into CtStrings, you can make use of their formatting +abilities in CtStrings by formatting in fmtstrs then converting the result to a CtString +afterward.

+

Implementations

+

impl CtString

+ +
pub comptime fn new() -> Self + +pub comptime fn append_str<let N: u32>(self, s: str<N>) -> Self + +pub comptime fn append_fmtstr<let N: u32, T>(self, s: fmtstr<N, T>) -> Self + +pub comptime fn as_quoted_str(self) -> Quoted + +
+

CtString cannot directly return a str since the size would not be known. +To get around this, we return a quoted str and the underlying str can +be accessed using macro insertion foo.as_quoted_str!().

+
+

Trait implementations

+

impl Append for CtString

+ +
pub fn empty() -> Self + +pub fn append(self, other: Self) -> Self + +

impl Eq for CtString

+ +
pub comptime fn eq(self, other: Self) -> bool + +

impl Hash for CtString

+ +
pub comptime fn hash<H>(self, state: &mut H) +
where + H: Hasher
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/primitive.Expr.html b/docs/static/aztec-nr-api/v3.0.2/std/primitive.Expr.html new file mode 100644 index 000000000000..800868367943 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/primitive.Expr.html @@ -0,0 +1,370 @@ + + + + + + +Primitive type Expr documentation + + + + + +
+ +

Primitive type Expr

+
+

A compile-time, quoted, syntactically valid expression.

+

An Expr can be obtained using Quoted::as_expr:

+
fn main() {
+    comptime {
+        let expr = quote { 1 + 2 }.as_expr().unwrap();
+    }
+}
+

Implementations

+

impl Expr

+ +
pub comptime fn as_array(self) -> Option<[Self]> + +
+

If this expression is an array literal [elem1, ..., elemN], this returns a vector of each element in the array.

+
+
pub comptime fn as_assert(self) -> Option<(Self, Option<Self>)> + +
+

If this expression is an assert, this returns the assert expression and the optional message.

+
+
pub comptime fn as_assert_eq(self) -> Option<(Self, Self, Option<Self>)> + +
+

If this expression is an assert_eq, this returns the left-hand-side and right-hand-side +expressions, together with the optional message.

+
+
pub comptime fn as_assign(self) -> Option<(Self, Self)> + +
+

If this expression is an assignment, this returns a tuple with the left hand side +and right hand side in order.

+
+
pub comptime fn as_binary_op(self) -> Option<(Self, BinaryOp, Self)> + +
+

If this expression is a binary operator operation <lhs> <op> <rhs>, +return the left-hand side, operator, and the right-hand side of the operation.

+
+
pub comptime fn as_block(self) -> Option<[Self]> + +
+

If this expression is a block { stmt1; stmt2; ...; stmtN }, return +a vector containing each statement.

+
+
pub comptime fn as_bool(self) -> Option<bool> + +
+

If this expression is a boolean literal, return that literal.

+
+
pub comptime fn as_cast(self) -> Option<(Self, UnresolvedType)> + +
+

If this expression is a cast expression expr as type, returns the casted +expression and the type to cast to.

+
+
pub comptime fn as_comptime(self) -> Option<[Self]> + +
+

If this expression is a comptime { stmt1; stmt2; ...; stmtN } block, +return each statement in the block.

+
+
pub comptime fn as_constructor(self) -> Option<(UnresolvedType, [(Quoted, Self)])> + +
+

If this expression is a constructor Type { field1: expr1, ..., fieldN: exprN }, +return the type and the fields.

+
+
pub comptime fn as_for(self) -> Option<(Quoted, Self, Self)> + +
+

If this expression is a for statement over a single expression, return the identifier, +the expression and the for loop body.

+
+
pub comptime fn as_for_range(self) -> Option<(Quoted, Self, Self, Self)> + +
+

If this expression is a for statement over a range, return the identifier, +the range start, the range end and the for loop body.

+
+
pub comptime fn as_function_call(self) -> Option<(Self, [Self])> + +
+

If this expression is a function call foo(arg1, ..., argN), return +the function and a vector of each argument.

+
+
pub comptime fn as_if(self) -> Option<(Self, Self, Option<Self>)> + +
+

If this expression is an if condition { then_branch } else { else_branch }, +return the condition, then branch, and else branch. If there is no else branch, +None is returned for that branch instead.

+
+
pub comptime fn as_index(self) -> Option<(Self, Self)> + +
+

If this expression is an index into an array array[index], return the +array and the index.

+
+
pub comptime fn as_integer(self) -> Option<(Field, bool)> + +
+

If this expression is an integer literal, return the integer as a field +as well as whether the integer is negative (true) or not (false).

+
+
pub comptime fn as_lambda( + self, +) -> Option<([(Self, Option<UnresolvedType>)], Option<UnresolvedType>, Self)> + +
+

If this expression is a lambda, returns the parameters, return type and body.

+
+
pub comptime fn as_let(self) -> Option<(Self, Option<UnresolvedType>, Self)> + +
+

If this expression is a let statement, returns the let pattern as an Expr, +the optional type annotation, and the assigned expression.

+
+
pub comptime fn as_member_access(self) -> Option<(Self, Quoted)> + +
+

If this expression is a member access foo.bar, return the struct/tuple +expression and the field. The field will be represented as a quoted value.

+
+
pub comptime fn as_method_call(self) -> Option<(Self, Quoted, [UnresolvedType], [Self])> + +
+

If this expression is a method call foo.bar::<generic1, ..., genericM>(arg1, ..., argN), return +the receiver, method name, a vector of each generic argument, and a vector of each argument.

+
+
pub comptime fn as_repeated_element_array(self) -> Option<(Self, Self)> + +
+

If this expression is a repeated element array [elem; length], return +the repeated element and the length expressions.

+
+
pub comptime fn as_repeated_element_vector(self) -> Option<(Self, Self)> + +
+

If this expression is a repeated element vector [elem; length], return +the repeated element and the length expressions.

+
+
pub comptime fn as_repeated_element_slice(self) -> Option<(Self, Self)> + +
+👎 +Deprecated: This method has been renamed to `as_repeated_element_vector` +
+
+

If this expression is a repeated element vector [elem; length], return +the repeated element and the length expressions. +This method is deprecated in favor of as_repeated_element_vector

+
+
pub comptime fn as_vector(self) -> Option<[Self]> + +
+

If this expression is a vector literal @[elem1, ..., elemN], +return each element of the vector.

+
+
pub comptime fn as_slice(self) -> Option<[Self]> + +
+👎 +Deprecated: This method has been renamed to `as_vector` +
+
+

If this expression is a vector literal @[elem1, ..., elemN], +return each element of the vector. +This method is deprecated in favor of as_vector

+
+
pub comptime fn as_tuple(self) -> Option<[Self]> + +
+

If this expression is a tuple (field1, ..., fieldN), +return each element of the tuple.

+
+
pub comptime fn as_unary_op(self) -> Option<(UnaryOp, Self)> + +
+

If this expression is a unary operation <op> <rhs>, +return the unary operator as well as the right-hand side expression.

+
+
pub comptime fn as_unsafe(self) -> Option<[Self]> + +
+

If this expression is an unsafe { stmt1; ...; stmtN } block, +return each statement inside in a vector.

+
+
pub comptime fn has_semicolon(self) -> bool + +
+

Returns true if this expression is trailed by a semicolon.

+

Example:

+
comptime {
+    let expr1 = quote { 1 + 2 }.as_expr().unwrap();
+    let expr2 = quote { 1 + 2; }.as_expr().unwrap();
+
+    assert(expr1.as_binary_op().is_some());
+    assert(expr2.as_binary_op().is_some());
+
+    assert(!expr1.has_semicolon());
+    assert(expr2.has_semicolon());
+}
+
pub comptime fn is_break(self) -> bool + +
+

Returns true if this expression is break.

+
+
pub comptime fn is_continue(self) -> bool + +
+

Returns true if this expression is continue.

+
+
pub comptime fn modify<Env>(self, f: fn[Env](Self) -> Option<Self>) -> Self + +
+

Applies a mapping function to this expression and to all of its sub-expressions. +f will be applied to each sub-expression first, then applied to the expression itself.

+

This happens recursively for every expression within self.

+

For example, calling modify on (@[1], @[2, 3]) with an f that returns Option::some +for expressions that are integers, doubling them, would return (@[2], @[4, 6]).

+
+
pub comptime fn quoted(self) -> Quoted + +
+

Returns this expression as a Quoted value. It's the same as quote { $self }.

+
+
pub comptime fn resolve(self, in_function: Option<FunctionDefinition>) -> TypedExpr + +
+

Resolves and type-checks this expression and returns the result as a TypedExpr.

+

The in_function argument specifies where the expression is resolved:

+
    +
  • If it's none, the expression is resolved in the function where resolve was called
  • +
  • If it's some, the expression is resolved in the given function
  • +
+

If any names used by this expression are not in scope or if there are any type errors, +this will give compiler errors as if the expression was written directly into +the current comptime function.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/primitive.Field.html b/docs/static/aztec-nr-api/v3.0.2/std/primitive.Field.html new file mode 100644 index 000000000000..e3aed4984d03 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/primitive.Field.html @@ -0,0 +1,307 @@ + + + + + + +Primitive type Field documentation + + + + + +
+ +

Primitive type Field

+
+

The native field type of the proving backend.

+

The size of a Noir field depends on the elliptic curve's finite field for the proving backend adopted. +For example, a field would be a 254-bit integer when paired with the default backend that spans the Grumpkin curve.

+

Fields support integer arithmetic.

+

If proving efficiency is of priority, fields should be used as a default for solving problems. +Smaller integer types (e.g. u64) incur extra range constraints.

+
+

Implementations

+

impl Field

+ +
pub fn assert_max_bit_size<let BIT_SIZE: u32>(self) + +
+

Asserts that self can be represented in bit_size bits.

+

Failures

+

Causes a constraint failure for Field values exceeding 2^{bit_size}.

+
+
pub fn to_le_bits<let N: u32>(self) -> [u1; N] + +
+

Decomposes self into its little endian bit decomposition as a [u1; N] array. +This array will be zero padded should not all bits be necessary to represent self.

+

Failures

+

Causes a constraint failure for Field values exceeding 2^N as the resulting array will not +be able to represent the original Field.

+

Safety

+

The bit decomposition returned is canonical and is guaranteed to not overflow the modulus.

+
+
pub fn to_be_bits<let N: u32>(self) -> [u1; N] + +
+

Decomposes self into its big endian bit decomposition as a [u1; N] array. +This array will be zero padded should not all bits be necessary to represent self.

+

Failures

+

Causes a constraint failure for Field values exceeding 2^N as the resulting array will not +be able to represent the original Field.

+

Safety

+

The bit decomposition returned is canonical and is guaranteed to not overflow the modulus.

+
+
pub fn to_le_bytes<let N: u32>(self) -> [u8; N] + +
+

Decomposes self into its little endian byte decomposition as a [u8;N] array +This array will be zero padded should not all bytes be necessary to represent self.

+

Failures

+

The length N of the array must be big enough to contain all the bytes of the 'self', +and no more than the number of bytes required to represent the field modulus

+

Safety

+

The result is ensured to be the canonical decomposition of the field element

+
+
pub fn to_be_bytes<let N: u32>(self) -> [u8; N] + +
+

Decomposes self into its big endian byte decomposition as a [u8;N] array of length required to represent the field modulus +This array will be zero padded should not all bytes be necessary to represent self.

+

Failures

+

The length N of the array must be big enough to contain all the bytes of the 'self', +and no more than the number of bytes required to represent the field modulus

+

Safety

+

The result is ensured to be the canonical decomposition of the field element

+
+
pub fn pow_32(self, exponent: Self) -> Self + +pub fn sgn0(self) -> u1 + +pub fn lt(self, another: Self) -> bool + +pub fn from_le_bytes<let N: u32>(bytes: [u8; N]) -> Self + +
+

Convert a little endian byte array to a field element. +If the provided byte array overflows the field modulus then the Field will silently wrap around.

+
+
pub fn from_be_bytes<let N: u32>(bytes: [u8; N]) -> Self + +
+

Convert a big endian byte array to a field element. +If the provided byte array overflows the field modulus then the Field will silently wrap around.

+
+

Trait implementations

+

impl Add for Field

+ +
pub fn add(self, other: Self) -> Self + +

impl AsPrimitive<bool> for Field

+ +
pub fn as_(self) -> bool + +

impl AsPrimitive<u128> for Field

+ +
pub fn as_(self) -> u128 + +

impl AsPrimitive<u16> for Field

+ +
pub fn as_(self) -> u16 + +

impl AsPrimitive<u32> for Field

+ +
pub fn as_(self) -> u32 + +

impl AsPrimitive<u64> for Field

+ +
pub fn as_(self) -> u64 + +

impl AsPrimitive<u8> for Field

+ +
pub fn as_(self) -> u8 + +

impl Default for Field

+ +
pub fn default() -> Self + +

impl Div for Field

+ +
pub fn div(self, other: Self) -> Self + +

impl Eq for Field

+ +
pub fn eq(self, other: Self) -> bool + +

impl From<bool> for Field

+ +
pub fn from(value: bool) -> Self + +

impl From<u128> for Field

+ +
pub fn from(value: u128) -> Self + +

impl From<u16> for Field

+ +
pub fn from(value: u16) -> Self + +

impl From<u32> for Field

+ +
pub fn from(value: u32) -> Self + +

impl From<u64> for Field

+ +
pub fn from(value: u64) -> Self + +

impl From<u8> for Field

+ +
pub fn from(value: u8) -> Self + +

impl Hash for Field

+ +
pub fn hash<H>(self, state: &mut H) +
where + H: Hasher
+ +

impl Mul for Field

+ +
pub fn mul(self, other: Self) -> Self + +

impl Neg for Field

+ +
pub fn neg(self) -> Self + +

impl Sub for Field

+ +
pub fn sub(self, other: Self) -> Self + +

impl WrappingAdd for Field

+ +
pub fn wrapping_add(self, y: Self) -> Self + +

impl WrappingMul for Field

+ +
pub fn wrapping_mul(self, y: Self) -> Self + +

impl WrappingSub for Field

+ +
pub fn wrapping_sub(self, y: Self) -> Self + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/primitive.FunctionDefinition.html b/docs/static/aztec-nr-api/v3.0.2/std/primitive.FunctionDefinition.html new file mode 100644 index 000000000000..ed002c434327 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/primitive.FunctionDefinition.html @@ -0,0 +1,173 @@ + + + + + + +Primitive type FunctionDefinition documentation + + + + + +
+ +

Primitive type FunctionDefinition

+
+

A compile-time type which represents a function definition in this source program.

+

A FunctionDefinition is passed as the first argument to a macro attribute on +top of a function:

+
#[attr]
+fn foo() {}
+
+comptime fn attr(function: FunctionDefinition) {
+    println(function.name()); // prints "quote { foo }"
+}
+

Implementations

+

impl FunctionDefinition

+ +
pub comptime fn add_attribute<let N: u32>(self, attribute: str<N>) + +pub comptime fn as_typed_expr(self) -> TypedExpr + +pub comptime fn body(self) -> Expr + +pub comptime fn has_named_attribute<let N: u32>(self, name: str<N>) -> bool + +pub comptime fn is_unconstrained(self) -> bool + +pub comptime fn module(self) -> Module + +pub comptime fn name(self) -> Quoted + +pub comptime fn parameters(self) -> [(Quoted, Type)] + +pub comptime fn return_type(self) -> Type + +pub comptime fn set_body(self, body: Expr) + +pub comptime fn set_parameters(self, parameters: [(Quoted, Type)]) + +pub comptime fn set_return_type(self, return_type: Type) + +pub comptime fn set_return_public(self, public: bool) + +pub comptime fn set_return_data(self) + +pub comptime fn set_unconstrained(self, value: bool) + +pub comptime fn visibility(self) -> Quoted + +

Trait implementations

+

impl Eq for FunctionDefinition

+ +
pub comptime fn eq(self, other: Self) -> bool + +

impl Hash for FunctionDefinition

+ +
pub comptime fn hash<H>(self, state: &mut H) +
where + H: Hasher
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/primitive.Module.html b/docs/static/aztec-nr-api/v3.0.2/std/primitive.Module.html new file mode 100644 index 000000000000..a56541b01db0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/primitive.Module.html @@ -0,0 +1,157 @@ + + + + + + +Primitive type Module documentation + + + + + +
+ +

Primitive type Module

+
+

A compile-time type which represents a module in this source program.

+

A Module is passed as the first argument to a macro attribute on top of a module:

+
#[attr]
+mod foo {}
+
+comptime fn attr(module: Module) {
+    println(module.name()); // outputs "quote { foo }"
+}
+

It can also be obtained using Quoted::as_module:

+
mod foo {}
+
+fn main() {
+    comptime {
+        let module = quote { foo }.as_module().unwrap();
+        println(module.name()); // outputs "quote { foo }"
+    }
+}
+

Implementations

+

impl Module

+ +
pub comptime fn add_item(self, item: Quoted) + +pub comptime fn has_named_attribute<let N: u32>(self, name: str<N>) -> bool + +pub comptime fn is_contract(self) -> bool + +pub comptime fn functions(self) -> [FunctionDefinition] + +pub comptime fn structs(self) -> [TypeDefinition] + +pub comptime fn child_modules(self) -> [Self] + +pub comptime fn name(self) -> Quoted + +pub comptime fn parent(self) -> Option<Self> + +

Trait implementations

+

impl Eq for Module

+ +
pub comptime fn eq(self, other: Self) -> bool + +

impl Hash for Module

+ +
pub comptime fn hash<H>(self, state: &mut H) +
where + H: Hasher
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/primitive.Quoted.html b/docs/static/aztec-nr-api/v3.0.2/std/primitive.Quoted.html new file mode 100644 index 000000000000..01d37558118f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/primitive.Quoted.html @@ -0,0 +1,141 @@ + + + + + + +Primitive type Quoted documentation + + + + + +
+ +

Primitive type Quoted

+
+

A compile-time type which represents quoted token streams and is the result of the +quote { ... } expression.

+
+

Implementations

+

impl Quoted

+ +
pub comptime fn as_expr(self) -> Option<Expr> + +pub comptime fn as_module(self) -> Option<Module> + +pub comptime fn as_trait_constraint(self) -> TraitConstraint + +pub comptime fn as_type(self) -> Type + +pub comptime fn tokens(self) -> [Self] + +

Trait implementations

+

impl Append for Quoted

+ +
pub comptime fn empty() -> Self + +pub comptime fn append(self, other: Self) -> Self + +

impl Eq for Quoted

+ +
pub comptime fn eq(self, other: Self) -> bool + +

impl Hash for Quoted

+ +
pub comptime fn hash<H>(self, state: &mut H) +
where + H: Hasher
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/primitive.TraitConstraint.html b/docs/static/aztec-nr-api/v3.0.2/std/primitive.TraitConstraint.html new file mode 100644 index 000000000000..ab68195b6c0f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/primitive.TraitConstraint.html @@ -0,0 +1,120 @@ + + + + + + +Primitive type TraitConstraint documentation + + + + + +
+ +

Primitive type TraitConstraint

+
+

A compile-time type which represents a trait constraint that can be used to search for a trait implementation.

+

This is similar syntactically to just the trait itself, but can also contain generic arguments. +E.g. Eq, Default, BuildHasher<Poseidon2Hasher>.

+

A TraitConstraint can be obtained using Quoted::as_trait_constraint:

+
fn main() {
+    comptime {
+        let constraint = quote { Eq }.as_trait_constraint();
+        println(constraint); // outputs "Eq"
+    }
+}
+

Trait implementations

+

impl Eq for TraitConstraint

+ +
pub comptime fn eq(self, other: Self) -> bool + +

impl Hash for TraitConstraint

+ +
pub comptime fn hash<H>(self, state: &mut H) +
where + H: Hasher
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/primitive.TraitDefinition.html b/docs/static/aztec-nr-api/v3.0.2/std/primitive.TraitDefinition.html new file mode 100644 index 000000000000..877d85549062 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/primitive.TraitDefinition.html @@ -0,0 +1,127 @@ + + + + + + +Primitive type TraitDefinition documentation + + + + + +
+ +

Primitive type TraitDefinition

+
+

A compile-time type which represents a trait definition such as trait Foo { .. }.

+

A TraitDefinition is passed as the first argument to a macro attribute on top of a trait:

+
#[attr]
+trait Foo {}
+
+comptime fn attr(trait_definition: TraitDefinition) {
+    println(trait_definition); // outputs "Foo"
+}
+

Implementations

+

impl TraitDefinition

+ +
pub comptime fn as_trait_constraint(_self: Self) -> TraitConstraint + +

Trait implementations

+

impl Eq for TraitDefinition

+ +
pub comptime fn eq(self, other: Self) -> bool + +

impl Hash for TraitDefinition

+ +
pub comptime fn hash<H>(self, state: &mut H) +
where + H: Hasher
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/primitive.TraitImpl.html b/docs/static/aztec-nr-api/v3.0.2/std/primitive.TraitImpl.html new file mode 100644 index 000000000000..7bff23eabbb4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/primitive.TraitImpl.html @@ -0,0 +1,108 @@ + + + + + + +Primitive type TraitImpl documentation + + + + + +
+ +

Primitive type TraitImpl

+
+

A compile-time type which represents represents a trait implementation such as impl Foo for Bar { ... }.

+
+

Implementations

+

impl TraitImpl

+ +
pub comptime fn trait_generic_args(self) -> [Type] + +pub comptime fn methods(self) -> [FunctionDefinition] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/primitive.Type.html b/docs/static/aztec-nr-api/v3.0.2/std/primitive.Type.html new file mode 100644 index 000000000000..0019ee87be1f --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/primitive.Type.html @@ -0,0 +1,257 @@ + + + + + + +Primitive type Type documentation + + + + + +
+ +

Primitive type Type

+
+

A compile-time type which represents a type in the source program.

+

It can be obtained using [Quoted::as_type](../std/primitive.Quoted.html#as_type):

+
fn main() {
+    comptime {
+        let typ = quote { i32 }.as_type();
+        println(typ); // outputs "i32"
+    }
+}
+

Implementations

+

impl Type

+ +
pub comptime fn as_array(self) -> Option<(Self, Self)> + +
+

If this type is an array, return a pair of (element type, size type).

+

Example:

+
comptime {
+    let array_type = quote { [Field; 3] }.as_type();
+    let (field_type, three_type) = array_type.as_array().unwrap();
+
+    assert(field_type.is_field());
+    assert_eq(three_type.as_constant().unwrap(), 3);
+}
+
pub comptime fn as_constant(self) -> Option<u32> + +
+

If this type is a constant integer (such as the 3 in the array type [Field; 3]), +return the numeric constant.

+
+
pub comptime fn as_integer(self) -> Option<(bool, u8)> + +
+

If this is an integer type, return a boolean which is true +if the type is signed, as well as the number of bits of this integer type.

+
+
pub comptime fn as_mutable_reference(self) -> Option<Self> + +
+

If this is a mutable reference type &mut T, returns the mutable type T.

+
+
pub comptime fn as_vector(self) -> Option<Self> + +
+

If this is a vector type, return the element type of the vector.

+
+
pub comptime fn as_slice(self) -> Option<Self> + +
+👎 +Deprecated: This method has been renamed to `as_vector` +
+
+

If this is a vector type, return the element type of the vector.

+
+
pub comptime fn as_str(self) -> Option<Self> + +
+

If this is a str<N> type, returns the length N as a type.

+
+
pub comptime fn as_struct(self) -> Option<(TypeDefinition, [Self])> + +
+👎 +Deprecated: This method has been renamed to `as_data_type` +
+
pub comptime fn as_data_type(self) -> Option<(TypeDefinition, [Self])> + +
+

If this is a struct or enum type, returns the type in addition to any generic arguments on this type.

+
+
pub comptime fn as_tuple(self) -> Option<[Self]> + +
+

If this is a tuple type, returns each element type of the tuple.

+
+
pub comptime fn get_trait_impl(self, constraint: TraitConstraint) -> Option<TraitImpl> + +
+

Retrieves the trait implementation that implements the given +trait constraint for this type. If the trait constraint is not +found, None is returned. Note that since the concrete trait implementation +for a trait constraint specified from a where clause is unknown, +this function will return None in these cases. If you only want to know +whether a type implements a trait, use implements instead.

+

Example:

+
comptime {
+    let field_type = quote { Field }.as_type();
+    let default = quote { Default }.as_trait_constraint();
+
+    let the_impl: TraitImpl = field_type.get_trait_impl(default).unwrap();
+    assert(the_impl.methods().len(), 1);
+}
+
pub comptime fn implements(self, constraint: TraitConstraint) -> bool + +
+

Returns true if this type implements the given trait. Note that unlike +get_trait_impl this will also return true for any where constraints +in scope.

+

Example:

+
fn foo<T>() where T: Default {
+    comptime {
+        let field_type = quote { Field }.as_type();
+        let default = quote { Default }.as_trait_constraint();
+        assert(field_type.implements(default));
+
+        let t = quote { T }.as_type();
+        assert(t.implements(default));
+    }
+}
+
pub comptime fn is_bool(self) -> bool + +
+

Returns true if this type is bool.

+
+
pub comptime fn is_field(self) -> bool + +
+

Returns true if this type is Field.

+
+
pub comptime fn is_unit(self) -> bool + +
+

Returns true if this type is the unit () type.

+
+

Trait implementations

+

impl Eq for Type

+ +
pub comptime fn eq(self, other: Self) -> bool + +
+

Note that this is syntactic equality, this is not the same as whether two types will type check +to be the same type. Unless type inference or generics are being used however, users should not +typically have to worry about this distinction.

+
+

impl Hash for Type

+ +
pub comptime fn hash<H>(self, state: &mut H) +
where + H: Hasher
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/primitive.TypeDefinition.html b/docs/static/aztec-nr-api/v3.0.2/std/primitive.TypeDefinition.html new file mode 100644 index 000000000000..472b9b367f22 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/primitive.TypeDefinition.html @@ -0,0 +1,188 @@ + + + + + + +Primitive type TypeDefinition documentation + + + + + +
+ +

Primitive type TypeDefinition

+
+

A compile-time type which represents a type definition such as struct Foo { ... }.

+

A TypeDefinition is passed as the first argument to a macro attribute on top of a struct:

+
#[attr]
+struct Foo {}
+
+comptime fn attr(type_definition: TypeDefinition) {
+    println(type_definition.name()); // outputs "Foo"
+}
+

Implementations

+

impl TypeDefinition

+ +
pub comptime fn add_attribute<let N: u32>(self, attribute: str<N>) + +pub comptime fn add_generic<let N: u32>(self, generic_name: str<N>) -> Type + +pub comptime fn as_type(self) -> Type + +
+

Return a syntactic version of this type definition as a type. +For example, type Foo<A, B> { ... }) would return Foo<A, B> when called with this method.

+
+
pub comptime fn as_type_with_generics(self, generics: [Type]) -> Option<Type> + +
+

Return this type applied to the given generic arguments. +For example, given type Foo<A, B> { ... }) could be applied to [quote[i32].as_type(), quote[Field].as_type()].as_vector() +to return Foo<i32, Field>.

+

If an incorrect number of generic arguments are given, this function will return None. +Otherwise, this function returns Some with the resulting type inside.

+
+
pub comptime fn has_named_attribute<let N: u32>(self, name: str<N>) -> bool + +pub comptime fn generics(self) -> [(Type, Option<Type>)] + +
+

Return (type, option) pairs of each generic in this type definition. +If a generic is numeric, the second element of the pair will contain the numeric type.

+
+
pub comptime fn fields(self, generic_args: [Type]) -> [(Quoted, Type, Quoted)] + +
+

Returns (name, type, visibility) tuples of each field in this type. +Any generic types used in each field type is automatically substituted with the +provided generic arguments.

+
+
pub comptime fn fields_as_written(self) -> [(Quoted, Type, Quoted)] + +
+

Returns (name, type, visibility) tuples of each field in this type. Each type is as-is +with any generic arguments unchanged. Unless the field types are not needed, +users should generally prefer to use TypeDefinition::fields over this +function if possible.

+
pub comptime fn module(self) -> Module + +pub comptime fn name(self) -> Quoted + +pub comptime fn set_fields(self, new_fields: [(Quoted, Type, Quoted)]) + +
+

Sets the fields of this type to the given fields vector. +All existing fields of the type will be overridden with the given fields. +Each element of the fields vector corresponds to the name and type of a field. +Each name is expected to be a single identifier.

+
+

Trait implementations

+

impl Eq for TypeDefinition

+ +
pub comptime fn eq(self, other: Self) -> bool + +

impl Hash for TypeDefinition

+ +
pub comptime fn hash<H>(self, state: &mut H) +
where + H: Hasher
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/primitive.TypedExpr.html b/docs/static/aztec-nr-api/v3.0.2/std/primitive.TypedExpr.html new file mode 100644 index 000000000000..16dc21c9f595 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/primitive.TypedExpr.html @@ -0,0 +1,121 @@ + + + + + + +Primitive type TypedExpr documentation + + + + + +
+ +

Primitive type TypedExpr

+
+

A compile-time type which represents a resolved and type-checked expression.

+

A TypedExpr can be obtained using Expr::resolve:

+
fn main() {
+    comptime {
+        let expr = quote { [1, 2, 3].len() }.as_expr().unwrap();
+        let typ = expr.resolve(Option::none());
+        println(typ.get_type().unwrap()); // outputs "u32"
+    }
+}
+

Implementations

+

impl TypedExpr

+ +
pub comptime fn as_function_definition(self) -> Option<FunctionDefinition> + +
+

If this expression refers to a function definitions, returns it. Otherwise returns Option::none().

+
+
pub comptime fn get_type(self) -> Option<Type> + +
+

Returns the type of the expression, if the expression could be resolved without errors.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/primitive.UnresolvedType.html b/docs/static/aztec-nr-api/v3.0.2/std/primitive.UnresolvedType.html new file mode 100644 index 000000000000..7173437bea09 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/primitive.UnresolvedType.html @@ -0,0 +1,143 @@ + + + + + + +Primitive type UnresolvedType documentation + + + + + +
+ +

Primitive type UnresolvedType

+
+

A compile-time type which represents the syntax of a type.

+

That is, it could be for example [Foo; 3] without necessarilly Foo existing in the source program.

+
+

Implementations

+

impl UnresolvedType

+ +
pub comptime fn as_mutable_reference(self) -> Option<Self> + +
+

If this is a mutable reference type &mut T, returns the mutable type T.

+
+
pub comptime fn as_vector(self) -> Option<Self> + +
+

If this is a vector [T].as_vector(), returns the element type T.

+
+
pub comptime fn as_slice(self) -> Option<Self> + +
+👎 +Deprecated: This method has been renamed to `as_vector` +
+
+

If this is a vector [T].as_vector(), returns the element type T.

+
+
pub comptime fn is_bool(self) -> bool + +
+

Returns true if this type is bool.

+
+
pub comptime fn is_field(self) -> bool + +
+

Returns true if this type refers to the Field type.

+
+
pub comptime fn is_unit(self) -> bool + +
+

Returns true if this type is the unit () type.

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/primitive.array.html b/docs/static/aztec-nr-api/v3.0.2/std/primitive.array.html new file mode 100644 index 000000000000..334a6b51fc84 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/primitive.array.html @@ -0,0 +1,302 @@ + + + + + + +Primitive type array documentation + + + + + +
+ +

Primitive type array

+
+

A fixed-size array, denoted [T; N], for the element type, T, +and the non-negative compile-time constant size, N.

+

There are two syntactic forms for creating an array:

+
    +
  • A vector with each element, i.e., [x, y, z].
  • +
  • A repeat expression [expr; N] where N is how many times to repeat expr in the array.
  • +
+
+

Implementations

+

impl<let N: u32, T> [T; N]

+ +
pub fn sort(self) -> Self +
where + T: Ord, + T: Eq
+ +
+

Returns a new sorted array. The original array remains untouched. Notice that this function will +only work for arrays of fields or integers, not for any arbitrary type. This is because the sorting +logic it uses internally is optimized specifically for these values. If you need a sort function to +sort any type, you should use the Self::sort_via function.

+

Example:

+
fn main() {
+    let arr = [42, 32];
+    let sorted = arr.sort();
+    assert(sorted == [32, 42]);
+}
+

impl<let N: u32, T> [T; N]

+ +
pub fn sort_via<Env>(self, ordering: fn[Env](T, T) -> bool) -> Self +
where + T: Eq
+ +
+

Returns a new sorted array by sorting it with a custom comparison function. +The original array remains untouched. +The ordering function must return true if the first argument should be sorted to be before the second argument or is equal to the second argument.

+

Using this method with an operator like < that does not return true for equal values will result in an assertion failure for arrays with equal elements.

+

Example:

+
fn main() {
+    let arr = [42, 32]
+    let sorted_ascending = arr.sort_via(|a, b| a <= b);
+    assert(sorted_ascending == [32, 42]); // verifies
+
+    let sorted_descending = arr.sort_via(|a, b| a >= b);
+    assert(sorted_descending == [32, 42]); // does not verify
+}
+

impl<let N: u32, T> [T; N]

+ +
pub fn len(self) -> u32 + +
+

Returns the length of this array.

+
fn len(self) -> Field
+

example

+
fn main() {
+    let array = [42, 42];
+    assert(array.len() == 2);
+}
+
pub fn as_vector(self) -> [T] + +
+

Returns this array as a vector.

+
let array = [1, 2];
+let vector = array.as_vector();
+assert_eq(vector, [1, 2].as_vector());
+
pub fn as_slice(self) -> [T] + +
+👎 +Deprecated: This method has been renamed to `as_vector` +
+
+

Returns this array as a vector. +This method is deprecated in favor of as_vector.

+
let array = [1, 2];
+let vector = array.as_slice();
+assert_eq(vector, [1, 2].as_vector());
+
pub fn map<U, Env>(self, f: fn[Env](T) -> U) -> [U; N] + +
+

Applies a function to each element of this array, returning a new array containing the mapped elements.

+

Example:

+
let a = [1, 2, 3];
+let b = a.map(|a| a * 2);
+assert_eq(b, [2, 4, 6]);
+
pub fn mapi<U, Env>(self, f: fn[Env](u32, T) -> U) -> [U; N] + +
+

Applies a function to each element of this array along with its index, +returning a new array containing the mapped elements.

+

Example:

+
let a = [1, 2, 3];
+let b = a.mapi(|i, a| i + a * 2);
+assert_eq(b, [2, 5, 8]);
+
pub fn for_each<Env>(self, f: fn[Env](T)) + +
+

Applies a function to each element of this array.

+

Example:

+
let a = [1, 2, 3];
+let mut b = [0; 3];
+let mut i = 0;
+a.for_each(|x| {
+    b[i] = x;
+    i += 1;
+});
+assert_eq(a, b);
+
pub fn for_eachi<Env>(self, f: fn[Env](u32, T)) + +
+

Applies a function to each element of this array along with its index.

+

Example:

+
let a = [1, 2, 3];
+let mut b = [0; 3];
+a.for_eachi(|i, x| {
+    b[i] = x;
+});
+assert_eq(a, b);
+
pub fn fold<U, Env>(self, accumulator: U, f: fn[Env](U, T) -> U) -> U + +
+

Applies a function to each element of the array, returning the final accumulated value. The first +parameter is the initial value.

+

This is a left fold, so the given function will be applied to the accumulator and first element of +the array, then the second, and so on. For a given call the expected result would be equivalent to:

+
let a1 = [1];
+let a2 = [1, 2];
+let a3 = [1, 2, 3];
+
+let f = |a, b| a - b;
+a1.fold(10, f); //=> f(10, 1)
+a2.fold(10, f); //=> f(f(10, 1), 2)
+a3.fold(10, f); //=> f(f(f(10, 1), 2), 3)
+
+assert_eq(a3.fold(10, f), 10 - 1 - 2 - 3);
+
pub fn reduce<Env>(self, f: fn[Env](T, T) -> T) -> T + +
+

Same as fold, but uses the first element as the starting element.

+

Requires the input array to be non-empty.

+

Example:

+
fn main() {
+    let arr = [1, 2, 3, 4];
+    let reduced = arr.reduce(|a, b| a + b);
+    assert(reduced == 10);
+}
+
pub fn all<Env>(self, predicate: fn[Env](T) -> bool) -> bool + +
+

Returns true if all the elements in this array satisfy the given predicate.

+

Example:

+
fn main() {
+    let arr = [2, 2, 2, 2, 2];
+    let all = arr.all(|a| a == 2);
+    assert(all);
+}
+
pub fn any<Env>(self, predicate: fn[Env](T) -> bool) -> bool + +
+

Returns true if any of the elements in this array satisfy the given predicate.

+

Example:

+
fn main() {
+    let arr = [2, 2, 2, 2, 5];
+    let any = arr.any(|a| a == 5);
+    assert(any);
+}
+
pub fn concat<let M: u32>(self, array2: [T; M]) -> [T; N + M] + +
+

Concatenates this array with another array.

+

Example:

+
fn main() {
+    let arr1 = [1, 2, 3, 4];
+    let arr2 = [6, 7, 8, 9, 10, 11];
+    let concatenated_arr = arr1.concat(arr2);
+    assert(concatenated_arr == [1, 2, 3, 4, 6, 7, 8, 9, 10, 11]);
+}
+

impl<let N: u32> [u8; N]

+ +
pub fn as_str_unchecked(self) -> str<N> + +
+

Converts a byte array of type [u8; N] to a string. Note that this performs no UTF-8 validation - +the given array is interpreted as-is as a string.

+

Example:

+
fn main() {
+    let hi = [104, 105].as_str_unchecked();
+    assert_eq(hi, "hi");
+}
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/primitive.bool.html b/docs/static/aztec-nr-api/v3.0.2/std/primitive.bool.html new file mode 100644 index 000000000000..e0ad89fb9784 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/primitive.bool.html @@ -0,0 +1,199 @@ + + + + + + +Primitive type bool documentation + + + + + +
+ +

Primitive type bool

+
+

The boolean type.

+

The bool represents a value, which could only be either true or false. +If you cast a bool into an integer, true will be 1 and false will be 0.

+
+

Trait implementations

+

impl AsPrimitive<Field> for bool

+ +
pub fn as_(self) -> Field + +

impl AsPrimitive<bool> for bool

+ +
pub fn as_(self) -> Self + +

impl AsPrimitive<i16> for bool

+ +
pub fn as_(self) -> i16 + +

impl AsPrimitive<i32> for bool

+ +
pub fn as_(self) -> i32 + +

impl AsPrimitive<i64> for bool

+ +
pub fn as_(self) -> i64 + +

impl AsPrimitive<i8> for bool

+ +
pub fn as_(self) -> i8 + +

impl AsPrimitive<u128> for bool

+ +
pub fn as_(self) -> u128 + +

impl AsPrimitive<u16> for bool

+ +
pub fn as_(self) -> u16 + +

impl AsPrimitive<u32> for bool

+ +
pub fn as_(self) -> u32 + +

impl AsPrimitive<u64> for bool

+ +
pub fn as_(self) -> u64 + +

impl AsPrimitive<u8> for bool

+ +
pub fn as_(self) -> u8 + +

impl BitAnd for bool

+ +
pub fn bitand(self, other: Self) -> Self + +

impl BitOr for bool

+ +
pub fn bitor(self, other: Self) -> Self + +

impl BitXor for bool

+ +
pub fn bitxor(self, other: Self) -> Self + +

impl Default for bool

+ +
pub fn default() -> Self + +

impl Eq for bool

+ +
pub fn eq(self, other: Self) -> Self + +

impl Hash for bool

+ +
pub fn hash<H>(self, state: &mut H) +
where + H: Hasher
+ +

impl Not for bool

+ +
pub fn not(self) -> Self + +

impl Ord for bool

+ +
pub fn cmp(self, other: Self) -> Ordering + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/primitive.fmtstr.html b/docs/static/aztec-nr-api/v3.0.2/std/primitive.fmtstr.html new file mode 100644 index 000000000000..7de861283f46 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/primitive.fmtstr.html @@ -0,0 +1,121 @@ + + + + + + +Primitive type fmtstr documentation + + + + + +
+ +

Primitive type fmtstr

+
+

A formatted string with interpolated values.

+

Example

+
fn main() {
+  let x = 1;
+  let y = 2;
+  let sum = 3;
+  let f = f"{x} + {y} is {sum}"; // prints "0x01 + 0x02 is 0x03"
+  println(f);
+}
+

Implementations

+

impl<let N: u32, T> fmtstr<N, T>

+ +
pub comptime fn quoted_contents(self) -> Quoted + +
+

Returns the format string contents (that is, without the leading and trailing double quotes) as a Quoted value.

+
+
pub comptime fn as_quoted_str(self) -> Quoted + +
+

Returns the format string contents (with the leading and trailing double quotes) as a Quoted string literal (not a format string literal).

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/primitive.i16.html b/docs/static/aztec-nr-api/v3.0.2/std/primitive.i16.html new file mode 100644 index 000000000000..a8a1e74cdf13 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/primitive.i16.html @@ -0,0 +1,257 @@ + + + + + + +Primitive type i16 documentation + + + + + +
+ +

Primitive type i16

+
+

The 16-bit signed integer type.

+
+

Trait implementations

+

impl Add for i16

+ +
pub fn add(self, other: Self) -> Self + +

impl AsPrimitive<bool> for i16

+ +
pub fn as_(self) -> bool + +

impl AsPrimitive<i16> for i16

+ +
pub fn as_(self) -> Self + +

impl AsPrimitive<i32> for i16

+ +
pub fn as_(self) -> i32 + +

impl AsPrimitive<i64> for i16

+ +
pub fn as_(self) -> i64 + +

impl AsPrimitive<i8> for i16

+ +
pub fn as_(self) -> i8 + +

impl AsPrimitive<u128> for i16

+ +
pub fn as_(self) -> u128 + +

impl AsPrimitive<u16> for i16

+ +
pub fn as_(self) -> u16 + +

impl AsPrimitive<u32> for i16

+ +
pub fn as_(self) -> u32 + +

impl AsPrimitive<u64> for i16

+ +
pub fn as_(self) -> u64 + +

impl AsPrimitive<u8> for i16

+ +
pub fn as_(self) -> u8 + +

impl BitAnd for i16

+ +
pub fn bitand(self, other: Self) -> Self + +

impl BitOr for i16

+ +
pub fn bitor(self, other: Self) -> Self + +

impl BitXor for i16

+ +
pub fn bitxor(self, other: Self) -> Self + +

impl Default for i16

+ +
pub fn default() -> Self + +

impl Div for i16

+ +
pub fn div(self, other: Self) -> Self + +

impl Eq for i16

+ +
pub fn eq(self, other: Self) -> bool + +

impl From<bool> for i16

+ +
pub fn from(value: bool) -> Self + +

impl From<i8> for i16

+ +
pub fn from(value: i8) -> Self + +

impl Hash for i16

+ +
pub fn hash<H>(self, state: &mut H) +
where + H: Hasher
+ +

impl Mul for i16

+ +
pub fn mul(self, other: Self) -> Self + +

impl Neg for i16

+ +
pub fn neg(self) -> Self + +

impl Not for i16

+ +
pub fn not(self) -> Self + +

impl Ord for i16

+ +
pub fn cmp(self, other: Self) -> Ordering + +

impl Rem for i16

+ +
pub fn rem(self, other: Self) -> Self + +

impl Shl for i16

+ +
pub fn shl(self, other: Self) -> Self + +

impl Shr for i16

+ +
pub fn shr(self, other: Self) -> Self + +

impl Sub for i16

+ +
pub fn sub(self, other: Self) -> Self + +

impl WrappingAdd for i16

+ +
pub fn wrapping_add(self, y: Self) -> Self + +

impl WrappingMul for i16

+ +
pub fn wrapping_mul(self, y: Self) -> Self + +

impl WrappingSub for i16

+ +
pub fn wrapping_sub(self, y: Self) -> Self + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/primitive.i32.html b/docs/static/aztec-nr-api/v3.0.2/std/primitive.i32.html new file mode 100644 index 000000000000..26eb3dad0f82 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/primitive.i32.html @@ -0,0 +1,262 @@ + + + + + + +Primitive type i32 documentation + + + + + +
+ +

Primitive type i32

+
+

The 32-bit signed integer type.

+
+

Trait implementations

+

impl Add for i32

+ +
pub fn add(self, other: Self) -> Self + +

impl AsPrimitive<bool> for i32

+ +
pub fn as_(self) -> bool + +

impl AsPrimitive<i16> for i32

+ +
pub fn as_(self) -> i16 + +

impl AsPrimitive<i32> for i32

+ +
pub fn as_(self) -> Self + +

impl AsPrimitive<i64> for i32

+ +
pub fn as_(self) -> i64 + +

impl AsPrimitive<i8> for i32

+ +
pub fn as_(self) -> i8 + +

impl AsPrimitive<u128> for i32

+ +
pub fn as_(self) -> u128 + +

impl AsPrimitive<u16> for i32

+ +
pub fn as_(self) -> u16 + +

impl AsPrimitive<u32> for i32

+ +
pub fn as_(self) -> u32 + +

impl AsPrimitive<u64> for i32

+ +
pub fn as_(self) -> u64 + +

impl AsPrimitive<u8> for i32

+ +
pub fn as_(self) -> u8 + +

impl BitAnd for i32

+ +
pub fn bitand(self, other: Self) -> Self + +

impl BitOr for i32

+ +
pub fn bitor(self, other: Self) -> Self + +

impl BitXor for i32

+ +
pub fn bitxor(self, other: Self) -> Self + +

impl Default for i32

+ +
pub fn default() -> Self + +

impl Div for i32

+ +
pub fn div(self, other: Self) -> Self + +

impl Eq for i32

+ +
pub fn eq(self, other: Self) -> bool + +

impl From<bool> for i32

+ +
pub fn from(value: bool) -> Self + +

impl From<i16> for i32

+ +
pub fn from(value: i16) -> Self + +

impl From<i8> for i32

+ +
pub fn from(value: i8) -> Self + +

impl Hash for i32

+ +
pub fn hash<H>(self, state: &mut H) +
where + H: Hasher
+ +

impl Mul for i32

+ +
pub fn mul(self, other: Self) -> Self + +

impl Neg for i32

+ +
pub fn neg(self) -> Self + +

impl Not for i32

+ +
pub fn not(self) -> Self + +

impl Ord for i32

+ +
pub fn cmp(self, other: Self) -> Ordering + +

impl Rem for i32

+ +
pub fn rem(self, other: Self) -> Self + +

impl Shl for i32

+ +
pub fn shl(self, other: Self) -> Self + +

impl Shr for i32

+ +
pub fn shr(self, other: Self) -> Self + +

impl Sub for i32

+ +
pub fn sub(self, other: Self) -> Self + +

impl WrappingAdd for i32

+ +
pub fn wrapping_add(self, y: Self) -> Self + +

impl WrappingMul for i32

+ +
pub fn wrapping_mul(self, y: Self) -> Self + +

impl WrappingSub for i32

+ +
pub fn wrapping_sub(self, y: Self) -> Self + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/primitive.i64.html b/docs/static/aztec-nr-api/v3.0.2/std/primitive.i64.html new file mode 100644 index 000000000000..e2e99faef6d4 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/primitive.i64.html @@ -0,0 +1,267 @@ + + + + + + +Primitive type i64 documentation + + + + + +
+ +

Primitive type i64

+
+

The 64-bit signed integer type.

+
+

Trait implementations

+

impl Add for i64

+ +
pub fn add(self, other: Self) -> Self + +

impl AsPrimitive<bool> for i64

+ +
pub fn as_(self) -> bool + +

impl AsPrimitive<i16> for i64

+ +
pub fn as_(self) -> i16 + +

impl AsPrimitive<i32> for i64

+ +
pub fn as_(self) -> i32 + +

impl AsPrimitive<i64> for i64

+ +
pub fn as_(self) -> Self + +

impl AsPrimitive<i8> for i64

+ +
pub fn as_(self) -> i8 + +

impl AsPrimitive<u128> for i64

+ +
pub fn as_(self) -> u128 + +

impl AsPrimitive<u16> for i64

+ +
pub fn as_(self) -> u16 + +

impl AsPrimitive<u32> for i64

+ +
pub fn as_(self) -> u32 + +

impl AsPrimitive<u64> for i64

+ +
pub fn as_(self) -> u64 + +

impl AsPrimitive<u8> for i64

+ +
pub fn as_(self) -> u8 + +

impl BitAnd for i64

+ +
pub fn bitand(self, other: Self) -> Self + +

impl BitOr for i64

+ +
pub fn bitor(self, other: Self) -> Self + +

impl BitXor for i64

+ +
pub fn bitxor(self, other: Self) -> Self + +

impl Default for i64

+ +
pub fn default() -> Self + +

impl Div for i64

+ +
pub fn div(self, other: Self) -> Self + +

impl Eq for i64

+ +
pub fn eq(self, other: Self) -> bool + +

impl From<bool> for i64

+ +
pub fn from(value: bool) -> Self + +

impl From<i16> for i64

+ +
pub fn from(value: i16) -> Self + +

impl From<i32> for i64

+ +
pub fn from(value: i32) -> Self + +

impl From<i8> for i64

+ +
pub fn from(value: i8) -> Self + +

impl Hash for i64

+ +
pub fn hash<H>(self, state: &mut H) +
where + H: Hasher
+ +

impl Mul for i64

+ +
pub fn mul(self, other: Self) -> Self + +

impl Neg for i64

+ +
pub fn neg(self) -> Self + +

impl Not for i64

+ +
pub fn not(self) -> Self + +

impl Ord for i64

+ +
pub fn cmp(self, other: Self) -> Ordering + +

impl Rem for i64

+ +
pub fn rem(self, other: Self) -> Self + +

impl Shl for i64

+ +
pub fn shl(self, other: Self) -> Self + +

impl Shr for i64

+ +
pub fn shr(self, other: Self) -> Self + +

impl Sub for i64

+ +
pub fn sub(self, other: Self) -> Self + +

impl WrappingAdd for i64

+ +
pub fn wrapping_add(self, y: Self) -> Self + +

impl WrappingMul for i64

+ +
pub fn wrapping_mul(self, y: Self) -> Self + +

impl WrappingSub for i64

+ +
pub fn wrapping_sub(self, y: Self) -> Self + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/primitive.i8.html b/docs/static/aztec-nr-api/v3.0.2/std/primitive.i8.html new file mode 100644 index 000000000000..cd08b4831a22 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/primitive.i8.html @@ -0,0 +1,252 @@ + + + + + + +Primitive type i8 documentation + + + + + +
+ +

Primitive type i8

+
+

The 8-bit signed integer type.

+
+

Trait implementations

+

impl Add for i8

+ +
pub fn add(self, other: Self) -> Self + +

impl AsPrimitive<bool> for i8

+ +
pub fn as_(self) -> bool + +

impl AsPrimitive<i16> for i8

+ +
pub fn as_(self) -> i16 + +

impl AsPrimitive<i32> for i8

+ +
pub fn as_(self) -> i32 + +

impl AsPrimitive<i64> for i8

+ +
pub fn as_(self) -> i64 + +

impl AsPrimitive<i8> for i8

+ +
pub fn as_(self) -> Self + +

impl AsPrimitive<u128> for i8

+ +
pub fn as_(self) -> u128 + +

impl AsPrimitive<u16> for i8

+ +
pub fn as_(self) -> u16 + +

impl AsPrimitive<u32> for i8

+ +
pub fn as_(self) -> u32 + +

impl AsPrimitive<u64> for i8

+ +
pub fn as_(self) -> u64 + +

impl AsPrimitive<u8> for i8

+ +
pub fn as_(self) -> u8 + +

impl BitAnd for i8

+ +
pub fn bitand(self, other: Self) -> Self + +

impl BitOr for i8

+ +
pub fn bitor(self, other: Self) -> Self + +

impl BitXor for i8

+ +
pub fn bitxor(self, other: Self) -> Self + +

impl Default for i8

+ +
pub fn default() -> Self + +

impl Div for i8

+ +
pub fn div(self, other: Self) -> Self + +

impl Eq for i8

+ +
pub fn eq(self, other: Self) -> bool + +

impl From<bool> for i8

+ +
pub fn from(value: bool) -> Self + +

impl Hash for i8

+ +
pub fn hash<H>(self, state: &mut H) +
where + H: Hasher
+ +

impl Mul for i8

+ +
pub fn mul(self, other: Self) -> Self + +

impl Neg for i8

+ +
pub fn neg(self) -> Self + +

impl Not for i8

+ +
pub fn not(self) -> Self + +

impl Ord for i8

+ +
pub fn cmp(self, other: Self) -> Ordering + +

impl Rem for i8

+ +
pub fn rem(self, other: Self) -> Self + +

impl Shl for i8

+ +
pub fn shl(self, other: Self) -> Self + +

impl Shr for i8

+ +
pub fn shr(self, other: Self) -> Self + +

impl Sub for i8

+ +
pub fn sub(self, other: Self) -> Self + +

impl WrappingAdd for i8

+ +
pub fn wrapping_add(self, y: Self) -> Self + +

impl WrappingMul for i8

+ +
pub fn wrapping_mul(self, y: Self) -> Self + +

impl WrappingSub for i8

+ +
pub fn wrapping_sub(self, y: Self) -> Self + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/primitive.str.html b/docs/static/aztec-nr-api/v3.0.2/std/primitive.str.html new file mode 100644 index 000000000000..06c0c0b0aa71 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/primitive.str.html @@ -0,0 +1,115 @@ + + + + + + +Primitive type str documentation + + + + + +
+ +

Primitive type str

+
+

The string type.

+

Denoted str<N>, its length N must be known at compile-time.

+
+

Implementations

+

impl<let N: u32> str<N>

+ +
pub fn as_bytes(self) -> [u8; N] + +
+

Converts the given string into a byte array

+
+
pub fn as_bytes_vec(self) -> [u8] + +
+

return a byte vector of the str content

+
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/primitive.u1.html b/docs/static/aztec-nr-api/v3.0.2/std/primitive.u1.html new file mode 100644 index 000000000000..ee092715f0a3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/primitive.u1.html @@ -0,0 +1,187 @@ + + + + + + +Primitive type u1 documentation + + + + + +
+ +

Primitive type u1

+
+

The 1-bit unsigned integer type.

+
+

Trait implementations

+

impl Add for u1

+ +
pub fn add(self, other: Self) -> Self + +

impl BitAnd for u1

+ +
pub fn bitand(self, other: Self) -> Self + +

impl BitOr for u1

+ +
pub fn bitor(self, other: Self) -> Self + +

impl BitXor for u1

+ +
pub fn bitxor(self, other: Self) -> Self + +

impl Default for u1

+ +
pub fn default() -> Self + +

impl Div for u1

+ +
pub fn div(self, other: Self) -> Self + +

impl Eq for u1

+ +
pub fn eq(self, other: Self) -> bool + +

impl Hash for u1

+ +
pub fn hash<H>(self, state: &mut H) +
where + H: Hasher
+ +

impl Mul for u1

+ +
pub fn mul(self, other: Self) -> Self + +

impl Not for u1

+ +
pub fn not(self) -> Self + +

impl Rem for u1

+ +
pub fn rem(self, other: Self) -> Self + +

impl Shl for u1

+ +
pub fn shl(self, other: Self) -> Self + +

impl Shr for u1

+ +
pub fn shr(self, other: Self) -> Self + +

impl Sub for u1

+ +
pub fn sub(self, other: Self) -> Self + +

impl WrappingAdd for u1

+ +
pub fn wrapping_add(self, y: Self) -> Self + +

impl WrappingMul for u1

+ +
pub fn wrapping_mul(self, y: Self) -> Self + +

impl WrappingSub for u1

+ +
pub fn wrapping_sub(self, y: Self) -> Self + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/primitive.u128.html b/docs/static/aztec-nr-api/v3.0.2/std/primitive.u128.html new file mode 100644 index 000000000000..e4fe2a09659b --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/primitive.u128.html @@ -0,0 +1,272 @@ + + + + + + +Primitive type u128 documentation + + + + + +
+ +

Primitive type u128

+
+

The 128-bit unsigned integer type.

+
+

Trait implementations

+

impl Add for u128

+ +
pub fn add(self, other: Self) -> Self + +

impl AsPrimitive<Field> for u128

+ +
pub fn as_(self) -> Field + +

impl AsPrimitive<bool> for u128

+ +
pub fn as_(self) -> bool + +

impl AsPrimitive<i16> for u128

+ +
pub fn as_(self) -> i16 + +

impl AsPrimitive<i32> for u128

+ +
pub fn as_(self) -> i32 + +

impl AsPrimitive<i64> for u128

+ +
pub fn as_(self) -> i64 + +

impl AsPrimitive<i8> for u128

+ +
pub fn as_(self) -> i8 + +

impl AsPrimitive<u128> for u128

+ +
pub fn as_(self) -> Self + +

impl AsPrimitive<u16> for u128

+ +
pub fn as_(self) -> u16 + +

impl AsPrimitive<u32> for u128

+ +
pub fn as_(self) -> u32 + +

impl AsPrimitive<u64> for u128

+ +
pub fn as_(self) -> u64 + +

impl AsPrimitive<u8> for u128

+ +
pub fn as_(self) -> u8 + +

impl BitAnd for u128

+ +
pub fn bitand(self, other: Self) -> Self + +

impl BitOr for u128

+ +
pub fn bitor(self, other: Self) -> Self + +

impl BitXor for u128

+ +
pub fn bitxor(self, other: Self) -> Self + +

impl Default for u128

+ +
pub fn default() -> Self + +

impl Div for u128

+ +
pub fn div(self, other: Self) -> Self + +

impl Eq for u128

+ +
pub fn eq(self, other: Self) -> bool + +

impl From<bool> for u128

+ +
pub fn from(value: bool) -> Self + +

impl From<u16> for u128

+ +
pub fn from(value: u16) -> Self + +

impl From<u32> for u128

+ +
pub fn from(value: u32) -> Self + +

impl From<u64> for u128

+ +
pub fn from(value: u64) -> Self + +

impl From<u8> for u128

+ +
pub fn from(value: u8) -> Self + +

impl Hash for u128

+ +
pub fn hash<H>(self, state: &mut H) +
where + H: Hasher
+ +

impl Mul for u128

+ +
pub fn mul(self, other: Self) -> Self + +

impl Not for u128

+ +
pub fn not(self) -> Self + +

impl Ord for u128

+ +
pub fn cmp(self, other: Self) -> Ordering + +

impl Rem for u128

+ +
pub fn rem(self, other: Self) -> Self + +

impl Shl for u128

+ +
pub fn shl(self, other: Self) -> Self + +

impl Shr for u128

+ +
pub fn shr(self, other: Self) -> Self + +

impl Sub for u128

+ +
pub fn sub(self, other: Self) -> Self + +

impl WrappingAdd for u128

+ +
pub fn wrapping_add(self, y: Self) -> Self + +

impl WrappingMul for u128

+ +
pub fn wrapping_mul(self, y: Self) -> Self + +

impl WrappingSub for u128

+ +
pub fn wrapping_sub(self, y: Self) -> Self + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/primitive.u16.html b/docs/static/aztec-nr-api/v3.0.2/std/primitive.u16.html new file mode 100644 index 000000000000..7b6685e61987 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/primitive.u16.html @@ -0,0 +1,257 @@ + + + + + + +Primitive type u16 documentation + + + + + +
+ +

Primitive type u16

+
+

The 16-bit unsigned integer type.

+
+

Trait implementations

+

impl Add for u16

+ +
pub fn add(self, other: Self) -> Self + +

impl AsPrimitive<Field> for u16

+ +
pub fn as_(self) -> Field + +

impl AsPrimitive<bool> for u16

+ +
pub fn as_(self) -> bool + +

impl AsPrimitive<i16> for u16

+ +
pub fn as_(self) -> i16 + +

impl AsPrimitive<i32> for u16

+ +
pub fn as_(self) -> i32 + +

impl AsPrimitive<i64> for u16

+ +
pub fn as_(self) -> i64 + +

impl AsPrimitive<i8> for u16

+ +
pub fn as_(self) -> i8 + +

impl AsPrimitive<u128> for u16

+ +
pub fn as_(self) -> u128 + +

impl AsPrimitive<u16> for u16

+ +
pub fn as_(self) -> Self + +

impl AsPrimitive<u32> for u16

+ +
pub fn as_(self) -> u32 + +

impl AsPrimitive<u64> for u16

+ +
pub fn as_(self) -> u64 + +

impl AsPrimitive<u8> for u16

+ +
pub fn as_(self) -> u8 + +

impl BitAnd for u16

+ +
pub fn bitand(self, other: Self) -> Self + +

impl BitOr for u16

+ +
pub fn bitor(self, other: Self) -> Self + +

impl BitXor for u16

+ +
pub fn bitxor(self, other: Self) -> Self + +

impl Default for u16

+ +
pub fn default() -> Self + +

impl Div for u16

+ +
pub fn div(self, other: Self) -> Self + +

impl Eq for u16

+ +
pub fn eq(self, other: Self) -> bool + +

impl From<bool> for u16

+ +
pub fn from(value: bool) -> Self + +

impl From<u8> for u16

+ +
pub fn from(value: u8) -> Self + +

impl Hash for u16

+ +
pub fn hash<H>(self, state: &mut H) +
where + H: Hasher
+ +

impl Mul for u16

+ +
pub fn mul(self, other: Self) -> Self + +

impl Not for u16

+ +
pub fn not(self) -> Self + +

impl Ord for u16

+ +
pub fn cmp(self, other: Self) -> Ordering + +

impl Rem for u16

+ +
pub fn rem(self, other: Self) -> Self + +

impl Shl for u16

+ +
pub fn shl(self, other: Self) -> Self + +

impl Shr for u16

+ +
pub fn shr(self, other: Self) -> Self + +

impl Sub for u16

+ +
pub fn sub(self, other: Self) -> Self + +

impl WrappingAdd for u16

+ +
pub fn wrapping_add(self, y: Self) -> Self + +

impl WrappingMul for u16

+ +
pub fn wrapping_mul(self, y: Self) -> Self + +

impl WrappingSub for u16

+ +
pub fn wrapping_sub(self, y: Self) -> Self + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/primitive.u32.html b/docs/static/aztec-nr-api/v3.0.2/std/primitive.u32.html new file mode 100644 index 000000000000..ad5e11cff5a3 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/primitive.u32.html @@ -0,0 +1,262 @@ + + + + + + +Primitive type u32 documentation + + + + + +
+ +

Primitive type u32

+
+

The 32-bit unsigned integer type.

+
+

Trait implementations

+

impl Add for u32

+ +
pub fn add(self, other: Self) -> Self + +

impl AsPrimitive<Field> for u32

+ +
pub fn as_(self) -> Field + +

impl AsPrimitive<bool> for u32

+ +
pub fn as_(self) -> bool + +

impl AsPrimitive<i16> for u32

+ +
pub fn as_(self) -> i16 + +

impl AsPrimitive<i32> for u32

+ +
pub fn as_(self) -> i32 + +

impl AsPrimitive<i64> for u32

+ +
pub fn as_(self) -> i64 + +

impl AsPrimitive<i8> for u32

+ +
pub fn as_(self) -> i8 + +

impl AsPrimitive<u128> for u32

+ +
pub fn as_(self) -> u128 + +

impl AsPrimitive<u16> for u32

+ +
pub fn as_(self) -> u16 + +

impl AsPrimitive<u32> for u32

+ +
pub fn as_(self) -> Self + +

impl AsPrimitive<u64> for u32

+ +
pub fn as_(self) -> u64 + +

impl AsPrimitive<u8> for u32

+ +
pub fn as_(self) -> u8 + +

impl BitAnd for u32

+ +
pub fn bitand(self, other: Self) -> Self + +

impl BitOr for u32

+ +
pub fn bitor(self, other: Self) -> Self + +

impl BitXor for u32

+ +
pub fn bitxor(self, other: Self) -> Self + +

impl Default for u32

+ +
pub fn default() -> Self + +

impl Div for u32

+ +
pub fn div(self, other: Self) -> Self + +

impl Eq for u32

+ +
pub fn eq(self, other: Self) -> bool + +

impl From<bool> for u32

+ +
pub fn from(value: bool) -> Self + +

impl From<u16> for u32

+ +
pub fn from(value: u16) -> Self + +

impl From<u8> for u32

+ +
pub fn from(value: u8) -> Self + +

impl Hash for u32

+ +
pub fn hash<H>(self, state: &mut H) +
where + H: Hasher
+ +

impl Mul for u32

+ +
pub fn mul(self, other: Self) -> Self + +

impl Not for u32

+ +
pub fn not(self) -> Self + +

impl Ord for u32

+ +
pub fn cmp(self, other: Self) -> Ordering + +

impl Rem for u32

+ +
pub fn rem(self, other: Self) -> Self + +

impl Shl for u32

+ +
pub fn shl(self, other: Self) -> Self + +

impl Shr for u32

+ +
pub fn shr(self, other: Self) -> Self + +

impl Sub for u32

+ +
pub fn sub(self, other: Self) -> Self + +

impl WrappingAdd for u32

+ +
pub fn wrapping_add(self, y: Self) -> Self + +

impl WrappingMul for u32

+ +
pub fn wrapping_mul(self, y: Self) -> Self + +

impl WrappingSub for u32

+ +
pub fn wrapping_sub(self, y: Self) -> Self + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/primitive.u64.html b/docs/static/aztec-nr-api/v3.0.2/std/primitive.u64.html new file mode 100644 index 000000000000..6d11788c1b50 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/primitive.u64.html @@ -0,0 +1,267 @@ + + + + + + +Primitive type u64 documentation + + + + + +
+ +

Primitive type u64

+
+

The 64-bit unsigned integer type.

+
+

Trait implementations

+

impl Add for u64

+ +
pub fn add(self, other: Self) -> Self + +

impl AsPrimitive<Field> for u64

+ +
pub fn as_(self) -> Field + +

impl AsPrimitive<bool> for u64

+ +
pub fn as_(self) -> bool + +

impl AsPrimitive<i16> for u64

+ +
pub fn as_(self) -> i16 + +

impl AsPrimitive<i32> for u64

+ +
pub fn as_(self) -> i32 + +

impl AsPrimitive<i64> for u64

+ +
pub fn as_(self) -> i64 + +

impl AsPrimitive<i8> for u64

+ +
pub fn as_(self) -> i8 + +

impl AsPrimitive<u128> for u64

+ +
pub fn as_(self) -> u128 + +

impl AsPrimitive<u16> for u64

+ +
pub fn as_(self) -> u16 + +

impl AsPrimitive<u32> for u64

+ +
pub fn as_(self) -> u32 + +

impl AsPrimitive<u64> for u64

+ +
pub fn as_(self) -> Self + +

impl AsPrimitive<u8> for u64

+ +
pub fn as_(self) -> u8 + +

impl BitAnd for u64

+ +
pub fn bitand(self, other: Self) -> Self + +

impl BitOr for u64

+ +
pub fn bitor(self, other: Self) -> Self + +

impl BitXor for u64

+ +
pub fn bitxor(self, other: Self) -> Self + +

impl Default for u64

+ +
pub fn default() -> Self + +

impl Div for u64

+ +
pub fn div(self, other: Self) -> Self + +

impl Eq for u64

+ +
pub fn eq(self, other: Self) -> bool + +

impl From<bool> for u64

+ +
pub fn from(value: bool) -> Self + +

impl From<u16> for u64

+ +
pub fn from(value: u16) -> Self + +

impl From<u32> for u64

+ +
pub fn from(value: u32) -> Self + +

impl From<u8> for u64

+ +
pub fn from(value: u8) -> Self + +

impl Hash for u64

+ +
pub fn hash<H>(self, state: &mut H) +
where + H: Hasher
+ +

impl Mul for u64

+ +
pub fn mul(self, other: Self) -> Self + +

impl Not for u64

+ +
pub fn not(self) -> Self + +

impl Ord for u64

+ +
pub fn cmp(self, other: Self) -> Ordering + +

impl Rem for u64

+ +
pub fn rem(self, other: Self) -> Self + +

impl Shl for u64

+ +
pub fn shl(self, other: Self) -> Self + +

impl Shr for u64

+ +
pub fn shr(self, other: Self) -> Self + +

impl Sub for u64

+ +
pub fn sub(self, other: Self) -> Self + +

impl WrappingAdd for u64

+ +
pub fn wrapping_add(self, y: Self) -> Self + +

impl WrappingMul for u64

+ +
pub fn wrapping_mul(self, y: Self) -> Self + +

impl WrappingSub for u64

+ +
pub fn wrapping_sub(self, y: Self) -> Self + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/primitive.u8.html b/docs/static/aztec-nr-api/v3.0.2/std/primitive.u8.html new file mode 100644 index 000000000000..c917d1da364e --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/primitive.u8.html @@ -0,0 +1,260 @@ + + + + + + +Primitive type u8 documentation + + + + + +
+ +

Primitive type u8

+
+

The 8-bit unsigned integer type.

+
+

Trait implementations

+

impl Add for u8

+ +
pub fn add(self, other: Self) -> Self + +

impl AsPrimitive<Field> for u8

+ +
pub fn as_(self) -> Field + +

impl AsPrimitive<bool> for u8

+ +
pub fn as_(self) -> bool + +

impl AsPrimitive<i16> for u8

+ +
pub fn as_(self) -> i16 + +

impl AsPrimitive<i32> for u8

+ +
pub fn as_(self) -> i32 + +

impl AsPrimitive<i64> for u8

+ +
pub fn as_(self) -> i64 + +

impl AsPrimitive<i8> for u8

+ +
pub fn as_(self) -> i8 + +

impl AsPrimitive<u128> for u8

+ +
pub fn as_(self) -> u128 + +

impl AsPrimitive<u16> for u8

+ +
pub fn as_(self) -> u16 + +

impl AsPrimitive<u32> for u8

+ +
pub fn as_(self) -> u32 + +

impl AsPrimitive<u64> for u8

+ +
pub fn as_(self) -> u64 + +

impl AsPrimitive<u8> for u8

+ +
pub fn as_(self) -> Self + +

impl BitAnd for u8

+ +
pub fn bitand(self, other: Self) -> Self + +

impl BitOr for u8

+ +
pub fn bitor(self, other: Self) -> Self + +

impl BitXor for u8

+ +
pub fn bitxor(self, other: Self) -> Self + +

impl Default for u8

+ +
pub fn default() -> Self + +

impl Div for u8

+ +
pub fn div(self, other: Self) -> Self + +

impl Eq for u8

+ +
pub fn eq(self, other: Self) -> bool + +

impl From<bool> for u8

+ +
pub fn from(value: bool) -> Self + +

impl<let N: u32> From<str<N>> for [u8; N]

+ +
pub fn from(s: str<N>) -> Self + +
+

Returns an array of the string bytes.

+
+

impl Hash for u8

+ +
pub fn hash<H>(self, state: &mut H) +
where + H: Hasher
+ +

impl Mul for u8

+ +
pub fn mul(self, other: Self) -> Self + +

impl Not for u8

+ +
pub fn not(self) -> Self + +

impl Ord for u8

+ +
pub fn cmp(self, other: Self) -> Ordering + +

impl Rem for u8

+ +
pub fn rem(self, other: Self) -> Self + +

impl Shl for u8

+ +
pub fn shl(self, other: Self) -> Self + +

impl Shr for u8

+ +
pub fn shr(self, other: Self) -> Self + +

impl Sub for u8

+ +
pub fn sub(self, other: Self) -> Self + +

impl WrappingAdd for u8

+ +
pub fn wrapping_add(self, y: Self) -> Self + +

impl WrappingMul for u8

+ +
pub fn wrapping_mul(self, y: Self) -> Self + +

impl WrappingSub for u8

+ +
pub fn wrapping_sub(self, y: Self) -> Self + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/primitive.vector.html b/docs/static/aztec-nr-api/v3.0.2/std/primitive.vector.html new file mode 100644 index 000000000000..759f71799c1c --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/primitive.vector.html @@ -0,0 +1,200 @@ + + + + + + +Primitive type vector documentation + + + + + +
+ +

Primitive type vector

+
+

A dynamically-sized view into a contiguous sequence, [T].

+

There are two syntactic forms for creating a vector:

+
    +
  • A vector with each element, i.e., [x, y, z].as_vector().
  • +
  • A repeat expression [expr; N].as_vector() where N is how many times to repeat expr in the vector.
  • +
+
+

Implementations

+

impl<T> [T]

+ +
pub fn len(self) -> u32 + +
+

Returns the length of the vector.

+
+
pub fn push_back(self, elem: T) -> Self + +
+

Push a new element to the end of the vector, returning a +new vector with a length one greater than the +original unmodified vector.

+
+
pub fn push_front(self, elem: T) -> Self + +
+

Push a new element to the front of the vector, returning a +new vector with a length one greater than the +original unmodified vector.

+
+
pub fn pop_back(self) -> (Self, T) + +
+

Remove the last element of the vector, returning the +popped vector and the element in a tuple

+
+
pub fn pop_front(self) -> (T, Self) + +
+

Remove the first element of the vector, returning the +element and the popped vector in a tuple

+
+
pub fn insert(self, index: u32, elem: T) -> Self + +
+

Insert an element at a specified index, shifting all elements +after it to the right

+
+
pub fn remove(self, index: u32) -> (Self, T) + +
+

Remove an element at a specified index, shifting all elements +after it to the left, returning the altered vector and +the removed element

+
+
pub fn append(self, other: Self) -> Self + +
+

Append each element of the other vector to the end of self. +This returns a new vector and leaves both input vectors unchanged.

+
+
pub fn as_array<let N: u32>(self) -> [T; N] + +pub fn map<U, Env>(self, f: fn[Env](T) -> U) -> [U] + +pub fn mapi<U, Env>(self, f: fn[Env](u32, T) -> U) -> [U] + +pub fn for_each<Env>(self, f: fn[Env](T)) + +pub fn for_eachi<Env>(self, f: fn[Env](u32, T)) + +pub fn fold<U, Env>(self, accumulator: U, f: fn[Env](U, T) -> U) -> U + +pub fn reduce<Env>(self, f: fn[Env](T, T) -> T) -> T + +pub fn filter<Env>(self, predicate: fn[Env](T) -> bool) -> Self + +pub fn join(self, separator: T) -> T +
where + T: Append
+ +pub fn all<Env>(self, predicate: fn[Env](T) -> bool) -> bool + +pub fn any<Env>(self, predicate: fn[Env](T) -> bool) -> bool + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/runtime/fn.is_unconstrained.html b/docs/static/aztec-nr-api/v3.0.2/std/runtime/fn.is_unconstrained.html new file mode 100644 index 000000000000..c5495332dbe0 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/runtime/fn.is_unconstrained.html @@ -0,0 +1,33 @@ + + + + + + +Function is_unconstrained documentation + + + + + +
+ +

Function is_unconstrained

+
pub fn is_unconstrained() -> bool
+ +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/runtime/index.html b/docs/static/aztec-nr-api/v3.0.2/std/runtime/index.html new file mode 100644 index 000000000000..c22d58816937 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/runtime/index.html @@ -0,0 +1,100 @@ + + + + + + +Module runtime documentation + + + + + +
+
aztec-nr - std::runtime
+

Module runtime

+

Functions

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/string/index.html b/docs/static/aztec-nr-api/v3.0.2/std/string/index.html new file mode 100644 index 000000000000..870723461340 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/string/index.html @@ -0,0 +1,93 @@ + + + + + + +Module string documentation + + + + + +
+
aztec-nr - std::string
+

Module string

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/test/index.html b/docs/static/aztec-nr-api/v3.0.2/std/test/index.html new file mode 100644 index 000000000000..9c73b6c4d245 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/test/index.html @@ -0,0 +1,100 @@ + + + + + + +Module test documentation + + + + + +
+
aztec-nr - std::test
+

Module test

+

Structs

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/test/struct.OracleMock.html b/docs/static/aztec-nr-api/v3.0.2/std/test/struct.OracleMock.html new file mode 100644 index 000000000000..2329ba69adee --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/test/struct.OracleMock.html @@ -0,0 +1,62 @@ + + + + + + +Struct OracleMock documentation + + + + + +
+ +

Struct OracleMock

+
pub struct OracleMock
+{ /* private fields */ }
+
+

Implementations

+

impl OracleMock

+ +
pub unconstrained fn mock<let N: u32>(name: str<N>) -> Self + +pub unconstrained fn with_params<P>(self, params: P) -> Self + +pub unconstrained fn get_last_params<P>(self) -> P + +pub unconstrained fn returns<R>(self, returns: R) -> Self + +pub unconstrained fn times(self, times: u64) -> Self + +pub unconstrained fn clear(self) + +pub unconstrained fn times_called(self) -> Field + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/std/vector/index.html b/docs/static/aztec-nr-api/v3.0.2/std/vector/index.html new file mode 100644 index 000000000000..4fb1ae1042a2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/std/vector/index.html @@ -0,0 +1,93 @@ + + + + + + +Module vector documentation + + + + + +
+
aztec-nr - std::vector
+

Module vector

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/styles.css b/docs/static/aztec-nr-api/v3.0.2/styles.css new file mode 100644 index 000000000000..f526dd2318e2 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/styles.css @@ -0,0 +1,350 @@ +:root { + color-scheme: light dark; + + --main-color: light-dark(black, #ddd); + --main-background-color: light-dark(white, #353535); + --code-color: light-dark(#f5f5f5, #2a2a2a); + --link-color: light-dark(#3873ad, #fdbf35); + --header-border-color: light-dark(#ddd, #d2d2d2); + --crate-color: light-dark(var(--link-color), #d2991d); + --module-color: var(--crate-color); + --struct-color: light-dark(#ad378a, #2dbfb8); + --trait-color: light-dark(#6e4fc9, #b78cf2); + --type-color: var(--struct-color); + --global-color: var(--crate-color); + --fn-color: light-dark(#ad7c37, #2bab63); + --primitive-color: var(--struct-color); + --sidebar-color: light-dark(#f5f5f5, #505050); + --comment-color: light-dark(#8e908c, #8d8d8b); + --target-color: light-dark(#fdffd3, #494a3d); + --target-highlight-color: light-dark(#9b7b14, #ad7c37); + --deprecated-color: light-dark(#fff5d6, #314559); + --kw-color: light-dark(#8959a8, #ab8ac1); + --bool-var-color: light-dark(#c82829, #ee6868); + --number-color: light-dark(#718c00, #83a300); + --string-color: light-dark(#718c00, #83a300); + --doccomment-color: light-dark(#4d4d4c, #8ca375); + --interpolation-color: light-dark(#119850, #bcca7d); + + --sidebar-toggle-height: 82px; +} + +body { + font-family: "Fira Sans", Arial, NanumBarunGothic, sans-serif; + font-weight: 500; + font-size: 1rem; + margin: 0; + display: flex; + flex-direction: column; + flex-wrap: nowrap; + color: var(--main-color); + background-color: var(--main-background-color); +} + +#main-contents { + display: flex; + flex-direction: row; + flex-wrap: nowrap; + flex-grow: 1; +} + +main { + padding: 28px 15px 40px 45px; + max-width: 960px; + position: relative; + flex-grow: 1; +} + +a { + color: var(--link-color); + text-decoration: none; +} + +pre { + padding: 14px; + background-color: var(--code-color); +} + +code { + font-family: "Source Code Pro",monospace; + text-wrap: auto; + white-space: pre-wrap; +} + +:target { + animation-name: highlight-target; + animation-duration: 0.5s; + background-color: var(--target-color); +} + +@keyframes highlight-target { + 0% { background-color: var(--main-background-color); } + 10% { background-color: var(--main-background-color); } + 12% { background-color: var(--target-highlight-color); } + 100% { background-color: var(--target-color); } +} + +.code-header { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} + +h1, h2 { + line-height: 1.25; + padding-top: 3px; + padding-bottom: 9px; +} + +h1, h2, h3, h4 { + margin: 25px 0 15px 0; +} + +h2 { + font-size: 1.375em; + border-bottom: 1px solid var(--header-border-color); +} + +ul.item-list, ul.sidebar-list { + list-style-type: none; + width: 100%; + margin: 0; + padding: 0; +} + +.item-list { + display: table; +} + +.item-list>li { + display: table-row; + width: 100%; + line-height: 2em; +} + +.item-list>li>.item-name { + width: 33%; + display: table-cell; + padding-right: 1.25em; +} + +.item-list>li>.item-description { + display: table-cell; + font-family: "Source Serif 4", NanumBarunGothic, serif; +} + +.comments { + font-family: "Source Serif 4", NanumBarunGothic, serif; +} + +.comments code, .item-description code { + background-color: var(--code-color); + border-radius: 6px; + padding: 0 0.125em; + font-weight: 400; + font-size: 0.94em; +} + +.crate { + color: var(--crate-color); +} + +.module { + color: var(--module-color); +} + +.struct { + color: var(--struct-color); +} + +.trait { + color: var(--trait-color); +} + +.type { + color: var(--type-color); +} + +.global { + color: var(--global-color); +} + +.fn { + color: var(--fn-color); +} + +.primitive { + color: var(--primitive-color); +} + +.padded-methods { + padding-left: 2em; +} + +.padded-description { + padding-left: 2em; +} + +.sidebar { + scrollbar-width: thin; + background-color: var(--sidebar-color); + overflow-y: scroll; + overscroll-behavior: contain; + position: sticky; + height: 100vh; + top: 0; + left: 0; + padding: 16px 15px 10px 24px; +} + +.sidebar h1 { + border-bottom: 0; + margin: 0; +} + +.sidebar h2 { + border-bottom: 0; + margin: 0; + margin-top: 30px; +} + +.sidebar h2#crate-name { + border-bottom: 0; + margin: 0; + margin-top: 10px; +} + +.sidebar h1 a, .sidebar h2 a { + color: var(--main-color); +} + +.sidebar h3 { + border-bottom: 0; + margin: 0; + margin-top: 15px; + margin-bottom: 15px; +} + +.sidebar li { + line-height: 2em; +} + +.comment { + color: var(--comment-color); +} + +.where-clause { + font-size: 0.875em; + white-space: pre-wrap; +} + +.deprecated { + background-color: var(--deprecated-color); + padding: 3px; + margin-bottom: 5px; + border-radius: 3px; + width: fit-content; + font-family: "Source Serif 4", NanumBarunGothic, serif; +} + +.emoji { + text-shadow: 0 0 black,-1px 0 0 black,0 1px 0 black,0 -1px 0 black; + margin-right: 0.3em; +} + +.kw { + color: var(--kw-color); +} + +.bool-var { + color: var(--bool-var-color); +} + +.number { + color: var(--number-color); +} + +.string { + color: var(--string-color); +} + +.doccomment { + color: var(--doccomment-color); +} + +.interpolation { + color: var(--interpolation-color); +} + +#sidebar-toggle { + display: flex; + flex-direction: row; + flex-grow: 1; + width: 100%; + background-color: var(--sidebar-color); + height: var(--sidebar-toggle-height); + position: sticky; + top: 0; + z-index: 10; +} + +#sidebar-toggle button { + background-color: var(--sidebar-color); + border: none; + width: 80px; + height: 80px; + padding: 1px 6px; +} + +#sidebar-toggle-title { + flex-grow: 1; + text-align: center; + align-self: center; + font-size: 1.5em; + font-weight: bold; + overflow-x: hidden; +} + +/* mobile */ +@media (max-width: 1199px) { + body { + font-size: 2rem; + } + + .sidebar { + display: none; + width: 100%; + } + + :target { + scroll-margin-top: var(--sidebar-toggle-height); + } +} + +/* desktop */ +@media (min-width: 1200px) { + body { + font-size: 1rem; + } + + .sidebar { + font-size: 0.875em; + width: 306px; + } + + #sidebar-toggle { + display: none; + } +} + +@media (prefers-color-scheme: light) { + #sidebar-toggle button::before { + content: url('data:image/svg+xml, '); + } +} + +@media (prefers-color-scheme: dark) { + #sidebar-toggle button::before { + content: url('data:image/svg+xml, '); + } +} \ No newline at end of file diff --git a/docs/static/aztec-nr-api/v3.0.2/uint_note/index.html b/docs/static/aztec-nr-api/v3.0.2/uint_note/index.html new file mode 100644 index 000000000000..fd38e9515bac --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/uint_note/index.html @@ -0,0 +1,43 @@ + + + + + + +Crate uint_note documentation + + + + + +
+
aztec-nr - uint_note
+

Crate uint_note

+

Modules

+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/uint_note/uint_note/index.html b/docs/static/aztec-nr-api/v3.0.2/uint_note/uint_note/index.html new file mode 100644 index 000000000000..31e37e8573f6 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/uint_note/uint_note/index.html @@ -0,0 +1,44 @@ + + + + + + +Module uint_note documentation + + + + + +
+
aztec-nr - uint_note::uint_note
+

Module uint_note

+

Structs

    +
  • A partial instance of a UintNote. This value represents a private commitment to the owner, randomness and storage +slot, but the value field has not yet been set. A partial note can be completed in public with the complete +function (revealing the value to the public), resulting in a UintNote that can be used like any other one (except +of course that its value is known).
  • +
  • A private note representing a numeric value associated to an account (e.g. a token balance).
  • +
  • +
+
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/uint_note/uint_note/struct.PartialUintNote.html b/docs/static/aztec-nr-api/v3.0.2/uint_note/uint_note/struct.PartialUintNote.html new file mode 100644 index 000000000000..bc08d9442fda --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/uint_note/uint_note/struct.PartialUintNote.html @@ -0,0 +1,113 @@ + + + + + + +Struct PartialUintNote documentation + + + + + +
+ +

Struct PartialUintNote

+
pub struct PartialUintNote
+{ /* private fields */ }
+
+
+

A partial instance of a UintNote. This value represents a private commitment to the owner, randomness and storage +slot, but the value field has not yet been set. A partial note can be completed in public with the complete +function (revealing the value to the public), resulting in a UintNote that can be used like any other one (except +of course that its value is known).

+
+

Implementations

+

impl PartialUintNote

+ +
pub fn complete(self, context: PublicContext, completer: AztecAddress, value: u128) + +
+

Completes the partial note, creating a new note that can be used like any other UintNote.

+
+
pub fn complete_from_private( + self, + context: &mut PrivateContext, + completer: AztecAddress, + value: u128, +) + +
+

Completes the partial note, creating a new note that can be used like any other UintNote. Same as complete +function but works from private context.

+
+
pub fn compute_validity_commitment(self, completer: AztecAddress) -> Field + +
+

Computes a validity commitment for this partial note. The commitment cryptographically binds the note's private +data with the designated completer address. When the note is later completed in public execution, we can load +this commitment from the nullifier tree and verify that both the partial note (e.g. that the storage slot +corresponds to the correct owner, and that we're using the correct state variable) and completer are +legitimate.

+
+

Trait implementations

+

impl Deserialize for PartialUintNote

+ +
pub fn deserialize(serialized: [Field; 1]) -> Self + +

impl Eq for PartialUintNote

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl FromField for PartialUintNote

+ +
pub fn from_field(field: Field) -> Self + +

impl Packable for PartialUintNote

+ +
pub fn pack(self) -> [Field; 1] + +pub fn unpack(packed: [Field; 1]) -> Self + +

impl Serialize for PartialUintNote

+ +
pub fn serialize(self) -> [Field; 1] + +

impl ToField for PartialUintNote

+ +
pub fn to_field(self) -> Field + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/uint_note/uint_note/struct.UintNote.html b/docs/static/aztec-nr-api/v3.0.2/uint_note/uint_note/struct.UintNote.html new file mode 100644 index 000000000000..c9be61e976d9 --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/uint_note/uint_note/struct.UintNote.html @@ -0,0 +1,136 @@ + + + + + + +Struct UintNote documentation + + + + + +
+ +

Struct UintNote

+
pub struct UintNote {
+    pub value: u128,
+}
+
+
+

A private note representing a numeric value associated to an account (e.g. a token balance).

+
+

Fields

+
value: u128
+
+

The number stored in the note.

+
+

Implementations

+

impl UintNote

+ +
pub fn partial( + owner: AztecAddress, + storage_slot: Field, + context: &mut PrivateContext, + recipient: AztecAddress, + completer: AztecAddress, +) -> PartialUintNote + +
+

Creates a partial note that will hide the owner and storage slot but not the value, since the note will be later +completed in public. This is a powerful technique for scenarios in which the value cannot be known in private +(e.g. because it depends on some public state, such as a DEX).

+

This function inserts a partial note validity commitment into the nullifier tree to be later on able to verify +that the partial note and completer are legitimate. See function docs of compute_validity_commitment for more +details.

+

Each partial note should only be used once, since otherwise multiple notes would be linked together and known to +belong to the same owner.

+

As part of the partial note creation process, a log will be sent to recipient so that they can discover the +note. recipient will typically be the same as owner.

+
+

Trait implementations

+

impl Deserialize for UintNote

+ +
pub fn deserialize(serialized: [Field; 1]) -> Self + +

impl Eq for UintNote

+ +
pub fn eq(_self: Self, _other: Self) -> bool + +

impl NoteHash for UintNote

+ +
pub fn compute_note_hash( + self, + owner: AztecAddress, + storage_slot: Field, + randomness: Field, +) -> Field + +pub fn compute_nullifier( + self, + context: &mut PrivateContext, + owner: AztecAddress, + note_hash_for_nullification: Field, +) -> Field + +pub unconstrained fn compute_nullifier_unconstrained( + self, + owner: AztecAddress, + note_hash_for_nullification: Field, +) -> Field + +

impl NoteProperties<UintNoteProperties> for UintNote

+ +
pub fn properties() -> UintNoteProperties + +

impl NoteType for UintNote

+ +
pub fn get_id() -> Field + +

impl Packable for UintNote

+ +
pub fn pack(self) -> [Field; 1] + +pub fn unpack(packed: [Field; 1]) -> Self + +

impl Serialize for UintNote

+ +
pub fn serialize(self) -> [Field; 1] + +
+
+ + diff --git a/docs/static/aztec-nr-api/v3.0.2/uint_note/uint_note/struct.UintNoteProperties.html b/docs/static/aztec-nr-api/v3.0.2/uint_note/uint_note/struct.UintNoteProperties.html new file mode 100644 index 000000000000..512f3bf67cab --- /dev/null +++ b/docs/static/aztec-nr-api/v3.0.2/uint_note/uint_note/struct.UintNoteProperties.html @@ -0,0 +1,44 @@ + + + + + + +Struct UintNoteProperties documentation + + + + + +
+ +

Struct UintNoteProperties

+
pub struct UintNoteProperties {
+    pub value: PropertySelector,
+}
+
+

Fields

+ +
+
+ +