[Tutorial] Managing Private State (#232)#511
Open
richard202605 wants to merge 1 commit into
Open
Conversation
Bounty submission for issue midnightntwrk#232 - [Tutorial] Managing private state. Deliverables: - TUTORIAL.md: 2,600+ word tutorial covering private state in Compact - private-voting.compact: Full private voting contract with commitment-reveal - private-vault.compact: Private balance vault with state machine pattern - README.md: Submission summary and file descriptions Covers: 1. Ledger state vs transient state 2. Declaring and using private state variables 3. The disclose() function and privacy implications 4. Best practices: nonces, minimal disclosure, separation of concerns 5. Design patterns: state machines, commitment-reveal, off-chain storage 6. Testing private state with the Compact simulator
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bounty Submission: Issue #232
This tutorial covers private state management in Midnight Compact:
ledgerfor hidden data with cryptographic commitmentsdisclose()Function — Selective disclosure and its privacy implicationsDeliverables
Files
TUTORIAL.md— Complete tutorial covering private state management in Compactprivate-voting.compact— Full-featured private voting contract (commitment-reveal, nullifiers, Merkle trees, selective disclosure, nonce protection)private-vault.compact— Private balance vault (deposit/withdraw/transfer, state machine, conditional disclosure, off-chain metadata)README.md— Submission summary and file descriptionsKey Takeaways for Developers
circuitfunctions to prove properties without revealing valuesReady for review.