Skip to content
Merged
Show file tree
Hide file tree
Changes from 69 commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
9c6c3e1
initial restructure, broken
catmcgee Dec 30, 2024
eb30ea7
scripts
catmcgee Dec 31, 2024
978dc5d
sidebars
catmcgee Dec 31, 2024
4b490bb
some links
catmcgee Jan 2, 2025
674b776
concepts rearranging
catmcgee Jan 8, 2025
cdc1fec
fix build
catmcgee Jan 8, 2025
6098351
Merge branch 'master' into docs/restructure-feedback
catmcgee Jan 8, 2025
d347638
node docs drqafts
catmcgee Jan 9, 2025
6bcafcc
tidied up
catmcgee Jan 10, 2025
23e9868
governance and upgrades docs
catmcgee Jan 10, 2025
5015d04
tyo
catmcgee Jan 14, 2025
308fbe7
Merge remote-tracking branch 'origin' into docs/restructure-feedback
catmcgee Jan 14, 2025
05642b7
bb
catmcgee Jan 14, 2025
70fbcba
bb
catmcgee Jan 14, 2025
60558f7
bb
catmcgee Jan 14, 2025
dff94a9
broken links
catmcgee Jan 14, 2025
b8bc309
prover docs
catmcgee Jan 14, 2025
371f58c
Merge branch 'master' into docs/restructure-feedback
catmcgee Jan 14, 2025
c05d1b5
upgrades
catmcgee Jan 16, 2025
e78f17a
added aztec strqter
catmcgee Jan 16, 2025
19b5f58
broken links
catmcgee Jan 16, 2025
865108c
Merge branch 'master' into docs/restructure-feedback
catmcgee Jan 16, 2025
5a2024f
redirects
catmcgee Jan 16, 2025
b381605
merge
catmcgee Jan 16, 2025
f0b8c90
oops
catmcgee Jan 16, 2025
d6a88e8
Merge branch 'master' into docs/restructure-feedback
catmcgee Jan 16, 2025
947b942
delete unnecessary index page
catmcgee Jan 16, 2025
294a2b8
build
catmcgee Jan 17, 2025
9849ded
Merge remote-tracking branch 'origin/master' into docs/restructure-fe…
catmcgee Jan 17, 2025
a84275f
links
catmcgee Jan 17, 2025
a20f348
title
catmcgee Jan 17, 2025
2e21362
some final touches
catmcgee Jan 17, 2025
fdd1fab
feedback
catmcgee Jan 23, 2025
93dcf0c
feedback
catmcgee Feb 3, 2025
8af9988
pedro suggestions
catmcgee Feb 3, 2025
3a5d9a4
sequencer concept docs are drafts
catmcgee Feb 3, 2025
cadb097
conflicts
catmcgee Feb 3, 2025
f13dbaf
bb
catmcgee Feb 3, 2025
6b50ded
bb
catmcgee Feb 3, 2025
a97ebbb
bb
catmcgee Feb 3, 2025
e068808
paclagejson
catmcgee Feb 3, 2025
9c96ce6
yarnlock
catmcgee Feb 4, 2025
ead0d23
setting soe things as drafts
catmcgee Feb 4, 2025
061a1ba
broken links
catmcgee Feb 4, 2025
d93fe61
Merge branch 'master' into docs/restructure-feedback
catmcgee Feb 4, 2025
bfefcb1
Merge branch 'master' into docs/restructure-feedback
catmcgee Feb 4, 2025
152d9a3
remove network concepts (per amin, outdated)
catmcgee Feb 4, 2025
a8eb27f
remove references to network docs
catmcgee Feb 4, 2025
3f14bb8
pls build
catmcgee Feb 4, 2025
096e1cb
Merge branch 'master' into docs/restructure-feedback
catmcgee Feb 4, 2025
c5e4cdc
monorepo links
catmcgee Feb 4, 2025
e1fa087
Merge branch 'master' into docs/restructure-feedback
catmcgee Feb 4, 2025
019a009
Merge branch 'master' into docs/restructure-feedback
catmcgee Feb 4, 2025
ffb268b
bbg
catmcgee Feb 5, 2025
d2f1a79
bb
catmcgee Feb 5, 2025
a55717c
josh suggestison
catmcgee Feb 5, 2025
5b47f05
mistek
catmcgee Feb 5, 2025
4e77e2e
fix build
critesjosh Feb 5, 2025
3d5d9cc
Merge branch 'master' into docs/restructure-feedback
critesjosh Feb 5, 2025
9bf540f
remove comments from docusaursu config
catmcgee Feb 5, 2025
a6f1624
Merge branch 'master' into docs/restructure-feedback
catmcgee Feb 5, 2025
43d4c29
Merge remote-tracking branch 'origin' into docs/restructure-feedback
catmcgee Feb 5, 2025
260bf03
note page
catmcgee Feb 5, 2025
83e7bbf
Merge remote-tracking branch 'origin' into docs/notes-page
catmcgee Feb 5, 2025
95202db
notes pae
catmcgee Feb 5, 2025
8671153
Merge branch 'master' into docs/notes-page
catmcgee Feb 5, 2025
9a27a87
notes docs
catmcgee Feb 5, 2025
51e3b6e
broken anchor
catmcgee Feb 5, 2025
3098529
Merge branch 'master' into docs/notes-page
catmcgee Feb 5, 2025
2b47ebe
Apply suggestions from code review
catmcgee Feb 6, 2025
da0fa33
Update notes.md
catmcgee Feb 6, 2025
c6c0493
edits
critesjosh Feb 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions docs/docs/aztec/concepts/storage/notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: Notes (UTXOs)
sidebar_position: 5
tags: [notes, storage]
---

import Image from "@theme/IdealImage";

The [state model page](./state_model.md) explains that there is a difference between public and private state. Private state uses UTXOs, also known as notes. This page introduces the concept of UTXOs and how notes are abstracted on Aztec.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we say what UTXOs are (unspent transaction outputs, similar to bitcoin) ? Or should we assume this is pre-requisite knowledge?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i added a (unspent transaction outputs) which i think is enough considering the rest of the page


## What are notes?

In an account-based model such as Ethereum, each account owns a specific amount of asset. In a UTXO model, each note has an owner. Notes are encrypted pieces of data that can only be decrypted by their owner. To change the owner of a note, Aztec destroys the original note, creates a nullifier, and creates a new note that is encrypted to the new owner. This helps to maintain privacy.
Comment thread
catmcgee marked this conversation as resolved.
Outdated

<Image img={require("/img/public-and-private-state-diagram.png")} />

Notes are comparable to cash. 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. Only you and the cashier are aware of this transaction.

## Abstracting notes from 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 their own note types. This means they can specify how they are interacted with, nullified, transferred, and displayed.
Comment thread
catmcgee marked this conversation as resolved.
Outdated

To understand note abstraction in Aztec.nr, you can read the [Build section](../../../developers/guides/smart_contracts/writing_contracts/notes/index.md).
15 changes: 2 additions & 13 deletions docs/docs/aztec/concepts/storage/state_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,13 @@ Internal to the Aztec network, public state is stored and updated by the sequenc

## Private State

Private state must be treated differently from public state and this must be expressed in the semantics of Aztec.nr.

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 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 and this must be represented in the language semantics of manipulating private state.

### Abstracting UTXO's from App's / Users

The goal of the Aztec.nr smart contract library is to abstract the UTXO model away from an app user / developer, contract developers are the only actor who should have to think about UTXO's.

This is achieved with two main features:

1. Users sign over transactions, not over specific UTXO's
2. Aztec.nr contracts support developer defined `unconstrained` getter functions to help dApp's make sense of UTXO's. e.g `getBalance()`. These functions can be called outside of a transaction context to read private state.
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.

## Further reading

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/aztec/concepts/wallets/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Due to limitations in the current architecture, privacy keys need to be availabl

## 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#complete-address). 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.
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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ sidebar_position: 3
tags: [contracts, notes]
---

Notes are the fundamental data structure in Aztec when working with private state. In this section there are guides about how to work with `AddressNote`, `ValueNote`, and custom notes in Aztec.nr. You can learn more about notes in the [concepts section](../../../../../aztec/concepts/storage/state_model.md).
Notes are the fundamental data structure in Aztec when working with private state. Using Aztec.nr, developers can define note types which allow flexibility in how notes are stored and nullified.

In this section there are guides about how to work with `AddressNote`, `ValueNote`, and custom notes in Aztec.nr. You can learn more about notes in the [concepts section](../../../../../aztec/concepts/storage/notes.md).