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

Docs editorial, three more docs #554

Merged
merged 3 commits into from
Apr 8, 2024
Merged

Docs editorial, three more docs #554

merged 3 commits into from
Apr 8, 2024

Conversation

kmurphypolygon
Copy link
Contributor

  • Assets
  • Execution
  • State

Copy link
Collaborator

@Dominik1999 Dominik1999 left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks. I left some comments.


All native assets in Miden are stored directly in accounts, like Ether in Ethereum. Miden does not track ownership of assets using global hashmaps, e.g., ERC20 contracts. Storage of assets locally in accounts provides privacy and the ability for client-side proofs. That is because ownership changes always involve only one account and not the change of a global hashmap. Thus, they can happen in parallel. Additionally, asset exchange is censorship resistant at this level because there is no global contract the transfer must pass through. Finally, users can pay fees in any asset.
All native assets in Miden are stored directly in accounts, like Ether in Ethereum. Miden does not track asset ownership using global hashmaps, e.g., ERC20 contracts. Local asset storage in accounts provides privacy and the ability for client-side proofs. That is because ownership changes are reflected only on an account and not on a global hashmap. Thus, these changes can happen in parallel. Additionally, asset exchange is censorship resistant at this level because there is no global contract the transfer must pass through. Finally, users can pay fees in any asset.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this difference is important:

That is because ownership changes are reflected only on an account and not on a global hashmap.

We should emphasize that the ownership change in Miden is reflected only in the owning account and not an ERC20 account (which is a global hashmap).


### Storage
[Accounts](https://0xpolygonmiden.github.io/miden-base/architecture/accounts.html) and [notes](https://0xpolygonmiden.github.io/miden-base/architecture/notes.html) contain asset vaults that are used to store assets. Accounts can keep unlimited assets in a Sparse Merkle Tree called `account vault`. Notes can only store up to `255` distinct assets.

[Accounts](accounts.md) and [notes](notes.md) contain asset vaults that are used to store assets. Accounts can keep unlimited assets in a Sparse Merkle Tree called `account vault`. Notes can store up to `255` distinct assets.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: can you change Sparse Merkle Tree to sparse Merkle tree?

* Parallel transactions executed concurrently by distinct actors.
* Concurrent state model that allows block production without knowing the full state.

Privacy is enforced by a UTXO-like state model consisting of notes and nullifiers combined with off-chain execution using zero-knowledge proofs. State bloat describes the ever growing state stored in blockchain nodes. Polygon Miden addresses this challenge via its state model that enables concurrent off-chain execution and off-chain storage. Simply put, users can store their own data locally which reduces the burden on the network while integrity is ensured using zero-knowledge.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you make two paragraphs for this? The paragraph should explain (in short) how we achieve the goals above. Privacy and parallelism by UTXO-like state and zkProofs. State bloat minimization by our new state model.


### Account database
The latest account states - and data for onchain accounts - are recorded in a Sparse Merkle Tree which maps account IDs to account hashes and account data if needed.

The latest account states - and data for onchain accounts - are recorded in a Sparse Merkle Tree which maps account IDs to account hashes, and account data if needed.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: can you again write sparse Merkle tree instead of Sparse Merkle Tree?


### Nullifier database
Nullifiers are stored in a Sparse Merkle Tree, which maps [Note Nullifiers](https://0xpolygonmiden.github.io/miden-base/architecture/notes.html#note-nullifier) to block numbers at which the nullifiers were inserted into the chain (or to $0$ for nullifiers which haven't been recorded yet). Nullifiers provide information on whether a specific note has been consumed. The database allows proving that a given nullifier is not in the database.

Nullifiers are stored in a Sparse Merkle Tree, which maps [note nullifiers](notes.md#note-nullifier-to-ensure-private-consumption) to block numbers at which the nullifiers are inserted into the chain (or to $0$ for nullifiers which haven't been recorded yet). Nullifiers provide information on whether a specific note has been consumed. The database allows proving that a given nullifier is not in the database.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: can you change Sparse Merkle Tree to sparse Merkle tree

Copy link
Collaborator

Choose a reason for hiding this comment

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

and also here, should we change the number format to 0 instead of $0$?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's coming up as $0$ in the text so I'm assuming that's correct .. this must be a format change from the other platform

docs/architecture/state.md Show resolved Hide resolved
Copy link
Collaborator

@Dominik1999 Dominik1999 left a comment

Choose a reason for hiding this comment

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

Looks good, thanks a lot. IO left 4 small comments. After addressing them I think we can merge

docs/architecture/state.md Show resolved Hide resolved
@@ -18,70 +25,75 @@ The Miden Node(s) maintain three databases to describe the state:
![Architecture core concepts](../img/architecture/state/state.png){ width="80%" }
</center>

These databases are represented by authenticated data structures; for easily proving that items were added to or removed from a database, and so that a commitment to the database is very small.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I stumbled upon this sentence, can you maybe rephrase to

These databases are represented by authenticated data structures, enabling easy proof of items being added to or removed from a database and ensuring that the commitment to the database remains very small.

@@ -18,70 +25,75 @@ The Miden Node(s) maintain three databases to describe the state:
![Architecture core concepts](../img/architecture/state/state.png){ width="80%" }
</center>

These databases are represented by authenticated data structures; for easily proving that items were added to or removed from a database, and so that a commitment to the database is very small.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
These databases are represented by authenticated data structures; for easily proving that items were added to or removed from a database, and so that a commitment to the database is very small.
These databases are represented by authenticated data structures; for easily proving that items were added to or removed from a database, and so that a commitment to the database is very small.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I stumbled upon this sentence, can you maybe rephrase it?

Copy link
Contributor

Choose a reason for hiding this comment

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

Reads more simpler for me, in this way:

These databases are represented by authenticated data structures that enable easy proof of items added to or removed from a database. This ensures that the commitment to the database remains very small.

@Dominik1999 Dominik1999 merged commit 475d653 into main Apr 8, 2024
7 of 8 checks passed
@Dominik1999 Dominik1999 deleted the docs/three-more branch April 8, 2024 14:43
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.

3 participants