Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docs): applied structure feedback #9288

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

catmcgee
Copy link
Contributor

@catmcgee catmcgee commented Oct 21, 2024

@catmcgee catmcgee changed the title moved things around feat(docs): applied structure feedback Nov 26, 2024
@catmcgee catmcgee marked this pull request as ready for review November 26, 2024 11:17
@AztecBot
Copy link
Collaborator

AztecBot commented Nov 26, 2024

Docs Preview

Hey there! 👋 You can check your preview at https://6746402650f173fe3befcf5a--aztec-docs-dev.netlify.app

Copy link
Contributor

@critesjosh critesjosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall I really like this new structure. It feels cleaner and simpler.

I left a lot of comments, but many are minor editorial suggestions.

Can we add a link to aztec-starter somewhere? Perhaps on a "Getting Started" page in the How-to Guides section?


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 - Slots aren't real
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Private State Slots - Slots aren't real
## Private State Slots

keep headings simple


## Private State Slots - Slots aren't real

Private storage is a different beast. As you might remember from [Hybrid State Model](../storage/state_model/index.md), private state is stored in encrypted logs and the corresponding private state commitments in append-only tree where each leaf is a commitment. Being 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 lookups at a specific storage slot would leak information in the context of private state. If you could look up a specific address balance just by looking at the storage slot, even if encrypted you would be able to see it changing! That is not good privacy.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Private storage is a different beast. As you might remember from [Hybrid State Model](../storage/state_model/index.md), private state is stored in encrypted logs and the corresponding private state commitments in append-only tree where each leaf is a commitment. Being 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 lookups at a specific storage slot would leak information in the context of private state. If you could look up a specific address balance just by looking at the storage slot, even if encrypted you would be able to see it changing! That is not good privacy.
Private storage is a different beast. As you might remember from [Hybrid State Model](../storage/state_model/index.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.

It's not about lookups, it's about updates, right? You can privately read ethereum state, but with an account model, you can't privately update values without revealing a lot of information about what you are doing.


### But how?

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 \$ balance might be the sum of all the notes in your wallet.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 \$ balance might be the sum of all the notes in your wallet.
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.


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.

### But how?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### But how?
### Implementation

note_hash = H(logical_storage_slot, note_content_hash);
```

This siloing (there will be more) is done in the application circuit, since it is not necessary for security of the network (but only the application).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This siloing (there will be more) is done in the application circuit, since it is not necessary for security of the network (but only the application).
Note hash siloing is done in the application circuit, since it is not necessary for security of the network (but only the application).

use token::Token;
```

###
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still unfinished?

@@ -1,17 +1,20 @@
---
id: index
sidebar_position: 0
title: Guides
title: Guides and Tutorials
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to get Rafi and David to take a glance at this page (https://6745d8432cc71f5fffa51888--aztec-docs-dev.netlify.app/guides) and provide their input based on their conversations with devs.

@@ -26,7 +26,7 @@ Along the way you will:

### Install tools

Please ensure that you already have [Installed the Sandbox](../../../guides/developer_guides/getting_started)
Please ensure that the you already have [Installed the Sandbox](../../../guides/getting_started)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Please ensure that the you already have [Installed the Sandbox](../../../guides/getting_started)
Please ensure that you already have [Installed the Sandbox](../../../guides/getting_started)

@@ -69,4 +69,4 @@ yarn node --experimental-vm-modules $(yarn bin jest) --testRegex '.*\.test\.mjs$

## Next steps

Now that you have finished the tutorial, you can learn more about [writing contracts with Noir](../../../aztec/smart_contracts_overview.md) or read about the [fundamental concepts behind Aztec Network](../../../aztec/overview.md).
Now that you have finished the tutorial, you can follow a tutorial for [writing contracts with Noir](../../contract_tutorials/counter_contract.md) or read about the [fundamental concepts behind Aztec Network](../../../../aztec/concepts_overview.md).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If folks are meant to follow the tutorials sequentially down the sidebar, maybe remove this section, since it just links back to the top. Or we could redirect them elsewhere?

@@ -19,28 +19,28 @@
to = "/tutorials/codealong/simple_dapp"

[[redirects]]
from = "/tutorials/contract_tutorials/advanced/token_bridge/typescript_glue_code"
to = "/tutorials/codealong/contract_tutorials/advanced/token_bridge/typescript_glue_code"
from = "/tutorials/contract_tutorials//token_bridge/typescript_glue_code"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
from = "/tutorials/contract_tutorials//token_bridge/typescript_glue_code"
from = "/tutorials/contract_tutorials//token_bridge/typescript_glue_code"

looks like there a lot of // in the paths in this file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants