You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
solution for:
- #2265
- handles renaming noir-libs -> aztec-nr
- renames what was aztec-nr to just aztec
aztec-nr lives here (with full history):
- https://github.com/AztecProtocol/aztec-nr
- once this is merged it can be made public and a nice readme put on it
Copy file name to clipboardexpand all lines: docs/docs/concepts/foundation/accounts/keys.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -71,7 +71,7 @@ In a future version, encryption keys will be differentiated between incoming and
71
71
72
72
An application in Aztec.nr can access the encryption public key for a given address using the oracle call `get_public_key`, which you can then use for calls such as `emit_encrypted_log`:
In order to be able to provide the public encryption key for a given address, that public key needs to have been registered in advance. At the moment, there is no broadcasting mechanism for public keys, which means that you will need to manually register all addresses you intend to send encrypted notes to. You can do this via the `registerRecipient` method of the Aztec RPC server, callable either via aztec.js or the CLI. Note that any accounts you own that have been added to the RPC server are automatically registered.
@@ -83,7 +83,7 @@ In addition to deriving encryption keys, the privacy master key is used for deri
83
83
84
84
An application in Aztec.nr can request a nullifier from the current user for computing the nullifier of a note via the `get_secret_key` oracle call:
Copy file name to clipboardexpand all lines: docs/docs/dev_docs/contracts/portals/main.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ As time passes, a sequencer will see your tx, the juicy fee provided and include
37
37
To consume the message, we can use the `consume_l1_to_l2_message` function within the `context` struct.
38
38
The `msg_key` is the hash of the message produced from the `sendL2Message` call, the `content` is the content of the message, and the `secret` is the pre-image hashed to compute the `secretHash`.
Computing the `content` might be a little clunky in its current form, as we are still adding a number of bytes utilities. A good example exists within the [Non-native token example](https://github.com/AztecProtocol/aztec-packages/blob/master/yarn-project/noir-contracts/src/contracts/non_native_token_contract/src/hash.nr).
43
43
@@ -63,7 +63,7 @@ The portal must ensure that the sender is as expected. One way to do this, is to
63
63
64
64
To send a message to L1 from your Aztec contract, you must use the `message_portal` function on the `context`. When messaging to L1, only the `content` is required (as field).
When sending a message from L2 to L1 we don't need to pass recipient, deadline, secret nor fees. Recipient is populated with the attached portal and the remaining values are not needed as the message is inserted into the outbox at the same time as it was included in a block (for the inbox it could be inserted and then only included in rollup block later).
Copy file name to clipboardexpand all lines: docs/docs/dev_docs/contracts/state_variables.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -28,15 +28,15 @@ The BoolSerialisationMethods is part of the Aztec stdlib:
28
28
29
29
It contains methods that instruct its PublicState wrapper how to serialise and deserialise a boolean to and from a Field, which is the data type being saved in the public state tree.
30
30
31
-
The Aztec stdlib provides serialization methods for various common types. Check [here](https://github.com/AztecProtocol/aztec-packages/blob/master/yarn-project/noir-libs/aztec-noir/src/types/type_serialisation) for the complete list.
31
+
The Aztec stdlib provides serialization methods for various common types. Check [here](https://github.com/AztecProtocol/aztec-packages/blob/master/yarn-project/aztec-nr/aztec/src/types/type_serialisation) for the complete list.
32
32
33
33
### Custom types
34
34
35
35
It's possible to create a public state for any types. Simply define methods that guide the PublicState wrapper in serialising the custom type to field(s) to store in the public state tree, and deserialising the field(s) retrieved from the tree back to the custom type.
36
36
37
37
The methods should be implemented in a struct that conforms to the following interface:
Developers can design instances of `NoteGetterOptions`, to determine how notes should be filtered and returned to the functions of their smart contracts.
Copy file name to clipboardexpand all lines: docs/docs/dev_docs/contracts/syntax.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
[Noir](https://noir-lang.org/) is a language which is agnostic to proof systems and use cases. Rather than baking Aztec-specific keywords and smart contract types directly into Noir (which would break this agnosticism), we have developed a library -- written in Noir -- whose types and methods provide rich smart contract semantics.
4
4
5
-
On top of [Noir's stdlib](https://noir-lang.org/standard_library/array_methods), we provide [Aztec.nr](https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/noir-libs) for writing contracts on Aztec.
5
+
On top of [Noir's stdlib](https://noir-lang.org/standard_library/array_methods), we provide [Aztec.nr](https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/aztec-nr) for writing contracts on Aztec.
6
6
7
7
Aztec.nr contains abstractions which remove the need to understand the low-level Aztec protocol. Notably, it provides:
Copy file name to clipboardexpand all lines: docs/docs/dev_docs/dapps/testing.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -133,7 +133,7 @@ To query storage directly, you'll need to know the slot you want to access. This
133
133
134
134
Private state in the Aztec Network is represented via sets of [private notes](../../concepts/foundation/state_model.md#private-state). In our token contract example, the balance of a user is represented as a set of unspent value notes, each with their own corresponding numeric value.
We can query the RPC server for all notes encrypted for a given user in a contract slot. For this example, we'll get all notes encrypted for the `owner` user that are stored on the token contract address and on the slot we calculated earlier. To calculate the actual balance, we extract the `value` of each note, which is the first element, and sum them up.
Copy file name to clipboardexpand all lines: docs/docs/dev_docs/wallets/writing_an_account_contract.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ Public Key: 0x0ede151adaef1cfcc1b3e152ea39f00c5cda3f3857cef00decb049d283672dc71
32
32
33
33
The important part of this contract is the `entrypoint` function, which will be the first function executed in any transaction originated from this account. This function has two main responsibilities: 1) authenticating the transaction and 2) executing calls. It receives a `payload` with the list of function calls to execute, as well as a signature over that payload.
Using the `EntrypointPayload` struct is not mandatory. You can package the instructions to be carried out by your account contract however you want. However, the entrypoint payload already provides a set of helper functions, both in Noir and Typescript, that can save you a lot of time when writing a new account contract.
@@ -48,7 +48,7 @@ We authenticate the transaction. To do this, we serialise and Pedersen-hash the
48
48
49
49
Last, we execute the calls in the payload struct. The `execute_calls` helper function runs through the private and public calls included in the entrypoint payload and executes them:
Note the usage of the `_with_packed_args` variant of [`call_public_function` and `call_private_function`](../contracts/functions.md#calling-functions). Due to Noir limitations, we cannot include more than a small number of arguments in a function call. However, we can bypass this restriction by using a hash of the arguments in a function call, which gets automatically expanded to the full set of arguments when the nested call is executed. We call this _argument packing_.
0 commit comments