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
Copy file name to clipboardExpand all lines: docs/docs/aztec/smart_contracts/oracles/index.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ description: Learn about oracles in Aztec, which provide external data to smart
7
7
8
8
This page goes over what oracles are in Aztec and how they work.
9
9
10
-
Looking for a hands-on guide? You can learn how to use oracles in a smart contract [here](../../../developers/guides/smart_contracts/how_to_use_capsules.md).
10
+
Looking for a hands-on guide? You can learn how to use oracles in a smart contract [here](../../../developers/guides/smart_contracts/advanced/how_to_use_capsules.md).
11
11
12
12
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.
13
13
@@ -33,4 +33,4 @@ Oracles introduce **non-determinism** into a circuit, and thus are `unconstraine
33
33
34
34
Find a full list [on GitHub](https://github.com/AztecProtocol/aztec-packages/tree/master/noir-projects/aztec-nr/aztec/src/oracle).
35
35
36
-
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 service with your custom oracle included. If you want to inject some arbitrary data that does not have a dedicated oracle, you can use [capsules](../../../developers/guides/smart_contracts/how_to_use_capsules.md).
36
+
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 service with your custom oracle included. If you want to inject some arbitrary data that does not have a dedicated oracle, you can use [capsules](../../../developers/guides/smart_contracts/advanced/how_to_use_capsules.md).
Copy file name to clipboardExpand all lines: docs/docs/developers/guides/local_env/sandbox.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -205,7 +205,7 @@ Note that you do not need to restart the sandbox in order to start sending prove
205
205
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.
206
206
207
207
:::note
208
-
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](../../guides/smart_contracts/profiling_transactions.md)
208
+
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](../../guides/smart_contracts/advanced/profiling_transactions.md)
Copy file name to clipboardExpand all lines: docs/docs/developers/guides/smart_contracts/advanced/common_patterns.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ Note - you could also create a note and send it to the user. The problem is ther
39
39
40
40
### Reading public storage in private
41
41
42
-
You can read public storage in private domain by leveraging the private getters of `PublicImmutable` (for values that never change) and `DelayedPublicMutable` (for values that change infrequently, see [delayed public mutable state](./storage_types.md#delayed-public-mutable) for details) state variables.
42
+
You can read public storage in private domain by leveraging the private getters of `PublicImmutable` (for values that never change) and `DelayedPublicMutable` (for values that change infrequently, see [delayed public mutable state](../storage_types.md#delayed-public-mutable) for details) state variables.
43
43
Values that change frequently (`PublicMutable`) cannot be read in private as for those we need access to the tip of the chain and only a sequencer has access to that (and sequencer executes only public functions).
44
44
45
45
E.g. when using `PublicImmutable`
@@ -75,13 +75,13 @@ In this situation, try to mark the public function as `internal`. This ensures y
75
75
76
76
### Moving public data into the private domain
77
77
78
-
See [partial notes](../../../aztec/concepts/advanced/storage/partial_notes.md). Partial notes are how public balances are transferred to private [in the NFT contract](../../tutorials/codealong/contract_tutorials/nft_contract.md).
78
+
See [partial notes](../../../../aztec/concepts/advanced/storage/partial_notes.md). Partial notes are how public balances are transferred to private [in the NFT contract](../../../tutorials/codealong/contract_tutorials/nft_contract.md).
79
79
80
80
### Discovering my notes
81
81
82
82
When you send someone a note, the note hash gets added to the note hash tree. To spend the note, the receiver needs to get the note itself (the note hash preimage). There are two ways you can get a hold of your notes:
83
83
84
-
1. When sending someone a note, emit the note log to the recipient (the function encrypts the log in such a way that only a recipient can decrypt it). PXE then tries to decrypt all the encrypted logs, and stores the successfully decrypted one. [More info here](./how_to_emit_event.md)
84
+
1. When sending someone a note, emit the note log to the recipient (the function encrypts the log in such a way that only a recipient can decrypt it). PXE then tries to decrypt all the encrypted logs, and stores the successfully decrypted one. [More info here](../how_to_emit_event.md)
85
85
2. Manually delivering it via a custom contract method, if you choose to not emit logs to save gas or when creating a note in the public domain and want to consume it in private domain (`encrypt_and_emit_note` shouldn't be called in the public domain because everything is public), like in the previous section where we created a note in public that doesn't have a designated owner.
@@ -110,7 +110,7 @@ Hence, it's necessary to add a "randomness" field to your note to prevent such a
110
110
111
111
### L1 -- L2 interactions
112
112
113
-
Refer to [Token Portal codealong tutorial on bridging tokens between L1 and L2](../../tutorials/codealong/js_tutorials/token_bridge.md) and/or [Uniswap smart contract example that shows how to swap on L1 using funds on L2](../../tutorials/codealong/js_tutorials/uniswap/index.md). Both examples show how to:
113
+
Refer to [Token Portal codealong tutorial on bridging tokens between L1 and L2](../../../tutorials/codealong/js_tutorials/token_bridge.md) and/or [Uniswap smart contract example that shows how to swap on L1 using funds on L2](../../../tutorials/codealong/js_tutorials/uniswap/index.md). Both examples show how to:
114
114
115
115
1. L1 -> L2 message flow
116
116
2. L2 -> L1 message flow
@@ -124,7 +124,7 @@ To send a note to someone, they need to have a key which we can encrypt the note
124
124
There are several patterns here:
125
125
126
126
1. Give the contract a key and share it amongst all participants. This leaks privacy, as anyone can see all the notes in the contract.
127
-
2.`transfer_to_public` funds into the contract - this is used in the [Uniswap smart contract example where a user sends private funds into a Uniswap Portal contract which eventually withdraws to L1 to swap on L1 Uniswap](../../tutorials/codealong/js_tutorials/uniswap/index.md). This works like Ethereum - to achieve contract composability, you move funds into the public domain. This way the contract doesn't even need keys.
127
+
2.`transfer_to_public` funds into the contract - this is used in the [Uniswap smart contract example where a user sends private funds into a Uniswap Portal contract which eventually withdraws to L1 to swap on L1 Uniswap](../../../tutorials/codealong/js_tutorials/uniswap/index.md). This works like Ethereum - to achieve contract composability, you move funds into the public domain. This way the contract doesn't even need keys.
128
128
129
129
There are several other designs we are discussing through [in this discourse post](https://discourse.aztec.network/t/how-to-handle-private-escrows-between-two-parties/2440) but they need some changes in the protocol or in our demo contract. If you are interested in this discussion, please participate in the discourse post!
130
130
@@ -146,7 +146,7 @@ PS: when calling from private to public, `msg_sender` is the contract address wh
146
146
147
147
In the [Prevent the same user flow from happening twice using nullifier](#prevent-the-same-user-flow-from-happening-twice-using-nullifiers), we recommended using nullifiers. But what you put in the nullifier is also as important.
148
148
149
-
E.g. for a voting contract, if your nullifier simply emits just the `user_address`, then privacy can easily be leaked via a preimage attack as nullifiers are deterministic (have no randomness), especially if there are few users of the contract. So you need some kind of randomness. You can add the user's secret key into the nullifier to add randomness. We call this "nullifier secrets" as explained [here](../../../aztec/concepts/accounts/keys.md#nullifier-keys).
149
+
E.g. for a voting contract, if your nullifier simply emits just the `user_address`, then privacy can easily be leaked via a preimage attack as nullifiers are deterministic (have no randomness), especially if there are few users of the contract. So you need some kind of randomness. You can add the user's secret key into the nullifier to add randomness. We call this "nullifier secrets" as explained [here](../../../../aztec/concepts/accounts/keys.md#nullifier-keys).
Copy file name to clipboardExpand all lines: docs/docs/developers/guides/smart_contracts/advanced/profiling_transactions.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,13 +9,13 @@ An Aztec transaction typically consists of a private and a public part. The priv
9
9
10
10
Since proof generation is an expensive operation that needs to be done on the client side, it is important to optimize the private contract logic. It is desirable to keep the gate count of circuits representing the private contract logic as low as possible.
11
11
12
-
A private transaction can involve multiple function calls. It starts with an account `entrypoint()` which may call several private functions to execute the application logic, which in turn might call other functions. Moreover, every private function call has to go through a round of kernel circuits. Read more about the transaction lifecycle [here](../../../aztec/concepts/transactions.md).
12
+
A private transaction can involve multiple function calls. It starts with an account `entrypoint()` which may call several private functions to execute the application logic, which in turn might call other functions. Moreover, every private function call has to go through a round of kernel circuits. Read more about the transaction lifecycle [here](../../../../aztec/concepts/transactions.md).
13
13
14
14
In this guide, we will look at how to profile the private execution of a transaction, allowing you to get the gate count of each private function within the transaction, including the kernel circuits.
15
15
16
16
## Prerequisites
17
17
18
-
-`aztec-nargo` installed (go to [Sandbox section](../../reference/environment_reference/sandbox-reference.md) for installation instructions)
18
+
-`aztec-nargo` installed (go to [Sandbox section](../../../reference/environment_reference/sandbox-reference.md) for installation instructions)
19
19
-`aztec-wallet` installed (installed as part of the Sandbox)
Read more about how to use authwits in Aztec.js [here](../js_apps/authwit.md).
15
13
16
14
## Introduction
17
15
18
-
Authentication Witness (authwit) is a scheme for authentication actions on Aztec, so users can allow third-parties (eg other contracts) to execute an action on their behalf. Authwits can only authorize actions for contracts that your account is calling, they cannot be used to permit other users to take actions on your behalf.
16
+
Authentication Witness (authwit) is a scheme for authentication actions on Aztec, so users can allow third-parties (e.g. other contracts) to execute an action on their behalf. Authwits can only authorize actions for contracts that your account is calling, they cannot be used to permit other users to take actions on your behalf.
19
17
20
18
How it works logically is explained in the [concepts](../../../aztec/concepts/advanced/authwit.md) but we will do a short recap here.
0 commit comments