Skip to content

docs(yellow-paper): Note hash, nullifier, and public data trees#3518

Merged
LHerskind merged 1 commit into
masterfrom
palla/yellow-paper-l2-state
Dec 6, 2023
Merged

docs(yellow-paper): Note hash, nullifier, and public data trees#3518
LHerskind merged 1 commit into
masterfrom
palla/yellow-paper-l2-state

Conversation

@spalladino

Copy link
Copy Markdown
Contributor

Related to #3087

@spalladino spalladino mentioned this pull request Dec 1, 2023

@LHerskind LHerskind left a comment

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.

I think this is good. Will be extending on it for state in a separate PR.


# State

Global state in the Aztec Network is represented by a set of Merkle trees: the [Note Hash tree](./note_hash_tree.md), [Nullifier tree](./nullifier_tree.md), and [Public Data tree](./public_data_tree.md) reflect the latest state of the chain.

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.

There are additional state. But I will add it in an extension to this pr.


Global state in the Aztec Network is represented by a set of Merkle trees: the [Note Hash tree](./note_hash_tree.md), [Nullifier tree](./nullifier_tree.md), and [Public Data tree](./public_data_tree.md) reflect the latest state of the chain.

Merkle trees are either [append-only](./tree_impls.md#append-only-merkle-trees), for storing immutable data, or [indexed](./tree_impls.md#indexed-merkle-trees), for storing data that requires proofs of non-membership.

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.

the wording with immutable can be a little weird. The nullifiers are immutable, but the leaves in the tree won't be because of the successor references.

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.

True, but it's not a property of indexed trees to have immutable values (eg the public data tree is indexed and not immutable).


The Note Hash tree is an [append-only Merkle tree](./tree_impls.md#append-only-merkle-trees) that stores siloed note hashes as its elements. Each element in the tree is a 254-bit altBN-254 scalar field element. This tree is part of the global state, and allows to prove existence of private notes via Merkle membership proofs.

Note commitments are immutable once created, since notes cannot be modified. Still, notes can be consumed, which means they can no longer be used. To preserve privacy, a consumed note is not removed from the tree, otherwise it would be possible to link the transaction that created a note with the one that consumed it. Instead, a note is consumed by emitting a deterministic [nullifier](./nullifier_tree.md).

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.

We should probably be very consistent on calling either commitments or note hashes.

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.

Agree. Do we have a consensus on which we should use?

@LHerskind LHerskind merged commit 0e2db8b into master Dec 6, 2023
@LHerskind LHerskind deleted the palla/yellow-paper-l2-state branch December 6, 2023 16:11
alexghr pushed a commit that referenced this pull request Dec 6, 2023
🤖 I have created a release *beep* *boop*
---


<details><summary>aztec-packages: 0.16.7</summary>

##
[0.16.7](aztec-packages-v0.16.6...aztec-packages-v0.16.7)
(2023-12-06)


### Features

* Encapsulated Goblin
([#3524](#3524))
([2f08423](2f08423))


### Bug Fixes

* Extract whole archive instead of subset
([#3604](#3604))
([cb000d8](cb000d8))


### Documentation

* **yellow-paper:** Note hash, nullifier, and public data trees
([#3518](#3518))
([0e2db8b](0e2db8b))
</details>

<details><summary>barretenberg.js: 0.16.7</summary>

##
[0.16.7](barretenberg.js-v0.16.6...barretenberg.js-v0.16.7)
(2023-12-06)


### Miscellaneous

* **barretenberg.js:** Synchronize aztec-packages versions
</details>

<details><summary>barretenberg: 0.16.7</summary>

##
[0.16.7](barretenberg-v0.16.6...barretenberg-v0.16.7)
(2023-12-06)


### Features

* Encapsulated Goblin
([#3524](#3524))
([2f08423](2f08423))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
AztecBot added a commit to AztecProtocol/barretenberg that referenced this pull request Dec 7, 2023
🤖 I have created a release *beep* *boop*
---


<details><summary>aztec-packages: 0.16.7</summary>

##
[0.16.7](AztecProtocol/aztec-packages@aztec-packages-v0.16.6...aztec-packages-v0.16.7)
(2023-12-06)


### Features

* Encapsulated Goblin
([#3524](AztecProtocol/aztec-packages#3524))
([2f08423](AztecProtocol/aztec-packages@2f08423))


### Bug Fixes

* Extract whole archive instead of subset
([#3604](AztecProtocol/aztec-packages#3604))
([cb000d8](AztecProtocol/aztec-packages@cb000d8))


### Documentation

* **yellow-paper:** Note hash, nullifier, and public data trees
([#3518](AztecProtocol/aztec-packages#3518))
([0e2db8b](AztecProtocol/aztec-packages@0e2db8b))
</details>

<details><summary>barretenberg.js: 0.16.7</summary>

##
[0.16.7](AztecProtocol/aztec-packages@barretenberg.js-v0.16.6...barretenberg.js-v0.16.7)
(2023-12-06)


### Miscellaneous

* **barretenberg.js:** Synchronize aztec-packages versions
</details>

<details><summary>barretenberg: 0.16.7</summary>

##
[0.16.7](AztecProtocol/aztec-packages@barretenberg-v0.16.6...barretenberg-v0.16.7)
(2023-12-06)


### Features

* Encapsulated Goblin
([#3524](AztecProtocol/aztec-packages#3524))
([2f08423](AztecProtocol/aztec-packages@2f08423))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants