Skip to content

Commit c2a4d31

Browse files
committed
reordering
1 parent e0abc28 commit c2a4d31

File tree

18 files changed

+92
-31
lines changed

18 files changed

+92
-31
lines changed

docs/docs-words.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ undeflow
325325
Undercollateralized
326326
underconstrained
327327
unleaked
328+
unlinkability
328329
unncessary
329330
unreverted
330331
unrleated

docs/docs/aztec/concepts/pxe/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,4 @@ Oracles are pieces of data that are injected into a smart contract function from
106106
To learn how to develop on top of the PXE, refer to these guides:
107107

108108
- [Run more than one PXE on your local machine](../../../developers/guides/local_env/sandbox.md#running-multiple-pxes-in-the-sandbox)
109-
- [Use in-built oracles including oracles for arbitrary data](../../../developers/guides/smart_contracts/how_to_use_capsules.md)
109+
- [Use in-built oracles including oracles for arbitrary data](../../../developers/guides/smart_contracts/advanced/how_to_use_capsules.md)

docs/docs/aztec/smart_contracts/oracles/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: Learn about oracles in Aztec, which provide external data to smart
77

88
This page goes over what oracles are in Aztec and how they work.
99

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).
1111

1212
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.
1313

@@ -33,4 +33,4 @@ Oracles introduce **non-determinism** into a circuit, and thus are `unconstraine
3333

3434
Find a full list [on GitHub](https://github.com/AztecProtocol/aztec-packages/tree/master/noir-projects/aztec-nr/aztec/src/oracle).
3535

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).

docs/docs/developers/guides/local_env/sandbox.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ Note that you do not need to restart the sandbox in order to start sending prove
205205
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.
206206

207207
:::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)
209209
:::
210210

211211
## Running Multiple PXEs in the Sandbox
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"position": 11,
3+
"collapsible": true,
4+
"collapsed": true,
5+
"label": "Advanced Topics"
6+
}

docs/docs/developers/guides/smart_contracts/common_patterns.md renamed to docs/docs/developers/guides/smart_contracts/advanced/common_patterns.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Note - you could also create a note and send it to the user. The problem is ther
3939

4040
### Reading public storage in private
4141

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.
4343
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).
4444

4545
E.g. when using `PublicImmutable`
@@ -75,13 +75,13 @@ In this situation, try to mark the public function as `internal`. This ensures y
7575

7676
### Moving public data into the private domain
7777

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).
7979

8080
### Discovering my notes
8181

8282
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:
8383

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)
8585
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.
8686

8787
#include_code offchain_delivery yarn-project/end-to-end/src/composed/e2e_persistence.test.ts typescript
@@ -110,7 +110,7 @@ Hence, it's necessary to add a "randomness" field to your note to prevent such a
110110

111111
### L1 -- L2 interactions
112112

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:
114114

115115
1. L1 -> L2 message flow
116116
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
124124
There are several patterns here:
125125

126126
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.
128128

129129
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!
130130

@@ -146,7 +146,7 @@ PS: when calling from private to public, `msg_sender` is the contract address wh
146146

147147
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.
148148

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).
150150

151151
Here is an example from the voting contract:
152152

docs/docs/developers/guides/smart_contracts/get_notes.md renamed to docs/docs/developers/guides/smart_contracts/advanced/get_notes.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: Get Notes
3-
sidebar_position: 4
43
tags: [private-state, smart-contracts, notes]
54
description: Learn how to get notes from a data oracle in Aztec.nr.
65
---

docs/docs/developers/guides/smart_contracts/how_to_use_capsules.md renamed to docs/docs/developers/guides/smart_contracts/advanced/how_to_use_capsules.md

File renamed without changes.

docs/docs/developers/guides/smart_contracts/profiling_transactions.md renamed to docs/docs/developers/guides/smart_contracts/advanced/profiling_transactions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ An Aztec transaction typically consists of a private and a public part. The priv
99

1010
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.
1111

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).
1313

1414
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.
1515

1616
## Prerequisites
1717

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)
1919
- `aztec-wallet` installed (installed as part of the Sandbox)
2020

2121
## Profiling using aztec-wallet

docs/docs/developers/guides/smart_contracts/authwit.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,15 @@ tags: [accounts, authwit]
55
sidebar_position: 7
66
---
77

8-
This page introduces the authwit library and how you can use it in your Aztec.nr smart contracts. [Skip to the usage](#usage).
8+
This page introduces the authwit library and how you can use it in your Aztec.nr smart contracts.
99

10-
For a guide on using authwit in Aztec.js, [read this](../js_apps/authwit.md).
10+
For a conceptual overview of authwits, see [Authentication Witnesses](../../../aztec/concepts/advanced/authwit.md).
1111

12-
## Prerequisite reading
13-
14-
- [Authwit](../../../aztec/concepts/advanced/authwit.md)
12+
Read more about how to use authwits in Aztec.js [here](../js_apps/authwit.md).
1513

1614
## Introduction
1715

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.
1917

2018
How it works logically is explained in the [concepts](../../../aztec/concepts/advanced/authwit.md) but we will do a short recap here.
2119

0 commit comments

Comments
 (0)