Introduction
Notes:
- In Zcash, a note represents a specific amount of value associated with a shielded payment address. Notes are akin to coins in traditional cryptocurrencies but are designed to maintain privacy.
Components of Notes:
- Value: The amount of currency the note represents.
- Diversifier: A part of the shielded address used to generate the note's address.
- Transmission Key: Used for encrypting the note to the recipient.
- Randomness: Used in the note’s cryptographic commitments.
- Memo Field: Optional field for including additional information.
- Notes allow users to transfer value privately within the Zcash network. When a note is created, it is committed to, and this commitment is later used to prove ownership and prevent double-spending.
Note Commitment Tree:
- The note commitment tree is a Merkle tree structure used in Zcash to keep track of all commitments (hashes) of shielded notes that have been created.
- When a note is created, its commitment is added to the note commitment tree. The Merkle root of this tree is included in the Zcash blockchain, which allows for efficient proof that a particular note commitment exists within the tree.
- Merkle Proof: A path in the tree that allows proving the inclusion of a note’s commitment without revealing other notes.
- The tree structure allows Zcash to maintain privacy while ensuring that notes are valid and can be spent. The tree's root is included in transactions as part of the zk-SNARK proof, ensuring the integrity of the commitments.
Nullifier Sets:
- Nullifiers are cryptographic identifiers derived from notes when they are spent. Each note has a unique nullifier, ensuring it can only be spent once.
- When a note is spent, its nullifier is revealed and added to the nullifier set. If a nullifier appears more than once, the transaction is considered invalid, preventing double-spending.
- Nullifier Set: A collection of all nullifiers seen in the blockchain, used to check if a note has already been spent.
- Nullifiers maintain the non-repeatability of note spending, ensuring that once a note is used in a transaction, it cannot be used again.
Sending Notes:
- Encryption: Notes are encrypted using the recipient’s transmission key, ensuring that only the recipient can view and spend the note.
- Commitment: The sender commits to the note’s value and randomness, which is added to the note commitment tree.
- Transaction Inclusion: The encrypted note and its commitment are included in a transaction, which is then broadcast to the network.
- Privacy Features:
- The note’s details (amount, recipient) are kept private through zk-SNARK proofs, ensuring that only the involved parties know the transaction details.