-
Notifications
You must be signed in to change notification settings - Fork 3
Add zk-nullifier example and reorganize zk/ folder #28
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
base: main
Are you sure you want to change the base?
Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (12)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the 📝 WalkthroughWalkthroughREADME.md reorganized: per-operation entries (create, update, close, reinit, burn) added with Anchor and Native cross-links; zk-id section retitled to "ZK Programs" and expanded with Full and Basic examples including zk-id, zk-nullifier, and zk-merkle-proof; minor formatting and path corrections applied. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
83c4c38 to
1e5f303
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In @README.md:
- Around line 21-22: Update the README entry for the "close" operation to state
that it not only clears account data and preserves the account address but also
reclaims the account's rent (freeing lamports) — highlight that this
distinguishes close from burn and that the preserved address can be reused for
reinitialization; change the line starting with "**close** - Clear account data
and preserve its address" to include "reclaims rent" and a short contrast to
"burn" while leaving the Anchor and Native links intact.
- Around line 25-26: Update the README entry for the "burn" operation to
explicitly state that burning permanently deletes a compressed account and
prevents the account address from being reused; reference the "burn" operation
name (and its links "Anchor" and "Native") and add a short contrasting clause
noting that this differs from "close" operations which allow address
reinitialization.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (64)
.github/workflows/rust-tests.ymlis excluded by none and included by nonezk/zk-id/.gitignoreis excluded by none and included by nonezk/zk-id/Anchor.tomlis excluded by none and included by nonezk/zk-id/CLAUDE.mdis excluded by none and included by nonezk/zk-id/Cargo.lockis excluded by!**/*.lockand included by nonezk/zk-id/Cargo.tomlis excluded by none and included by nonezk/zk-id/README.mdis excluded by none and included by nonezk/zk-id/Xargo.tomlis excluded by none and included by nonezk/zk-id/build.rsis excluded by none and included by nonezk/zk-id/circuits/README.mdis excluded by none and included by nonezk/zk-id/circuits/compressed_account.circomis excluded by none and included by nonezk/zk-id/circuits/compressed_account_merkle_proof.circomis excluded by none and included by nonezk/zk-id/circuits/credential.circomis excluded by none and included by nonezk/zk-id/circuits/merkle_proof.circomis excluded by none and included by nonezk/zk-id/package-lock.jsonis excluded by!**/package-lock.jsonand included by nonezk/zk-id/package.jsonis excluded by none and included by nonezk/zk-id/scripts/clean.shis excluded by none and included by nonezk/zk-id/scripts/setup.shis excluded by none and included by nonezk/zk-id/src/lib.rsis excluded by none and included by nonezk/zk-id/src/verifying_key.rsis excluded by none and included by nonezk/zk-id/tests/circuit.rsis excluded by none and included by nonezk/zk-id/tests/test.rsis excluded by none and included by nonezk/zk-merkle-proof/.gitignoreis excluded by none and included by nonezk/zk-merkle-proof/Cargo.lockis excluded by!**/*.lockand included by nonezk/zk-merkle-proof/Cargo.tomlis excluded by none and included by nonezk/zk-merkle-proof/README.mdis excluded by none and included by nonezk/zk-merkle-proof/Xargo.tomlis excluded by none and included by nonezk/zk-merkle-proof/build.rsis excluded by none and included by nonezk/zk-merkle-proof/circuits/README.mdis excluded by none and included by nonezk/zk-merkle-proof/circuits/account_merkle_proof.circomis excluded by none and included by nonezk/zk-merkle-proof/circuits/compressed_account.circomis excluded by none and included by nonezk/zk-merkle-proof/circuits/compressed_account_merkle_proof.circomis excluded by none and included by nonezk/zk-merkle-proof/circuits/credential.circomis excluded by none and included by nonezk/zk-merkle-proof/circuits/merkle_proof.circomis excluded by none and included by nonezk/zk-merkle-proof/package-lock.jsonis excluded by!**/package-lock.jsonand included by nonezk/zk-merkle-proof/package.jsonis excluded by none and included by nonezk/zk-merkle-proof/scripts/clean.shis excluded by none and included by nonezk/zk-merkle-proof/scripts/setup.shis excluded by none and included by nonezk/zk-merkle-proof/src/lib.rsis excluded by none and included by nonezk/zk-merkle-proof/src/verifying_key.rsis excluded by none and included by nonezk/zk-merkle-proof/tests/test.rsis excluded by none and included by nonezk/zk-nullifier/.gitignoreis excluded by none and included by nonezk/zk-nullifier/Anchor.tomlis excluded by none and included by nonezk/zk-nullifier/CLAUDE.mdis excluded by none and included by nonezk/zk-nullifier/Cargo.lockis excluded by!**/*.lockand included by nonezk/zk-nullifier/Cargo.tomlis excluded by none and included by nonezk/zk-nullifier/README.mdis excluded by none and included by nonezk/zk-nullifier/Xargo.tomlis excluded by none and included by nonezk/zk-nullifier/build.rsis excluded by none and included by nonezk/zk-nullifier/circuits/batch_nullifier.circomis excluded by none and included by nonezk/zk-nullifier/circuits/batchnullifier.circomis excluded by none and included by nonezk/zk-nullifier/circuits/nullifier.circomis excluded by none and included by nonezk/zk-nullifier/nullifier-flow.mmdis excluded by none and included by nonezk/zk-nullifier/package-lock.jsonis excluded by!**/package-lock.jsonand included by nonezk/zk-nullifier/package.jsonis excluded by none and included by nonezk/zk-nullifier/programs/zk_nullifieris excluded by none and included by nonezk/zk-nullifier/scripts/clean.shis excluded by none and included by nonezk/zk-nullifier/scripts/setup.shis excluded by none and included by nonezk/zk-nullifier/sequence-diagram.mmdis excluded by none and included by nonezk/zk-nullifier/src/batch_verifying_key.rsis excluded by none and included by nonezk/zk-nullifier/src/lib.rsis excluded by none and included by nonezk/zk-nullifier/src/verifying_key.rsis excluded by none and included by nonezk/zk-nullifier/tests/test_batch.rsis excluded by none and included by nonezk/zk-nullifier/tests/test_single.rsis excluded by none and included by none
📒 Files selected for processing (1)
README.md
🧰 Additional context used
🧠 Learnings (20)
📓 Common learnings
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: zk-id/README.md:0-0
Timestamp: 2026-01-10T19:25:43.342Z
Learning: Applies to zk-id/**/*.rs : Implement credential nullifier pattern to ensure each credential can only be used once per `verification_id`, using the event account address as a nullifier
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/UPDATE_FROM_INPUT_QUEUE.md:0-0
Timestamp: 2025-11-24T17:58:10.392Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/merkle_tree.rs : In src/merkle_tree.rs, implement BatchedMerkleTreeAccount::update_tree_from_input_queue method for batch nullify operations on StateV2 trees. The method must verify ZKP proving correctness of: old_root + queue nullifiers → new_root, update tree root, increment tree sequence_number, increment tree nullifier_next_index by zkp_batch_size, mark ZKP batch as inserted, transition batch state to Inserted when all ZKP batches complete, and zero out bloom filter when current batch is 50% inserted.
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: zk-id/CLAUDE.md:0-0
Timestamp: 2026-01-10T19:27:00.938Z
Learning: Applies to zk-id/**/*.rs : Nullifier computation: Nullifier = Poseidon(verification_id, credential_private_key) to prevent double-use per verification context
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: zk-id/circuits/README.md:0-0
Timestamp: 2026-01-10T19:25:50.479Z
Learning: Applies to zk-id/circuits/**/*credential*.circom : Implement nullifier generation using Poseidon hash of verification_id and credential_secret to prevent double-spending
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: zk-id/README.md:0-0
Timestamp: 2026-01-10T19:25:43.342Z
Learning: This is a minimal example for verifying zk inclusion proofs and not a full zk identity protocol or production-ready implementation - refer to Iden3 or Semaphore for production identity protocols
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: zk-id/README.md:0-0
Timestamp: 2026-01-10T19:25:43.342Z
Learning: Applies to zk-id/**/*.rs : Verify zero-knowledge proofs of credential ownership using the `zk_verify_credential` instruction with Groth16 verification and create encrypted event accounts to store verification results on-chain
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/INSERT_INPUT_QUEUE.md:0-0
Timestamp: 2025-11-24T17:57:14.561Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/merkle_tree.rs : In `BatchedMerkleTreeAccount::insert_nullifier_into_queue`, update hash chain store with Poseidon hash: `Poseidon(prev_hash_chain, nullifier)`
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: zk-id/README.md:0-0
Timestamp: 2026-01-10T19:25:43.342Z
Learning: Applies to zk-id/**/*.rs : Ensure credential verification is private by not exposing the credential during zk proof verification (use a relayer or freshly funded keypair for full privacy of the transaction payer)
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: zk-id/CLAUDE.md:0-0
Timestamp: 2026-01-10T19:27:00.938Z
Learning: Applies to zk-id/**/*.circom : Circuit must verify nullifier equals Poseidon(verification_id, credentialPrivateKey)
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: zk-id/CLAUDE.md:0-0
Timestamp: 2026-01-10T19:27:00.938Z
Learning: Applies to zk-id/**/*.circom : ZK circuit must verify 26-level Merkle proof of credential account inclusion
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: basic-operations/anchor/README.md:0-0
Timestamp: 2026-01-10T19:25:03.366Z
Learning: Each operation (create, update, close, reinit, burn) is an independent Anchor project with its own workspace, program, and tests
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: basic-operations/CLAUDE.md:0-0
Timestamp: 2026-01-10T19:26:21.240Z
Learning: Applies to basic-operations/**/{anchor,native}/**/src/**/*.rs : Verify current state matches on-chain data before executing close, update, or burn operations
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: basic-operations/native/README.md:0-0
Timestamp: 2026-01-10T19:25:12.548Z
Learning: Applies to basic-operations/native/**/{src,programs}/**/*.rs : Native Solana programs must implement five core operations: create (initialize compressed account), update (modify data), close (reclaim rent), reinit (reinitialize closed account), and burn (permanently destroy)
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/CLAUDE.md:0-0
Timestamp: 2026-01-12T14:27:56.316Z
Learning: Applies to programs/compressed-token/program/docs/ctoken/{CREATE,CLOSE,TRANSFER,TRANSFER_CHECKED,APPROVE,REVOKE,MINT_TO,MINT_TO_CHECKED,BURN,BURN_CHECKED,FREEZE_ACCOUNT,THAW_ACCOUNT}.md : CToken account operations documentation should be organized in a ctoken/ subdirectory with files for account creation, closure, transfers, approval delegation, minting, burning, and freeze/thaw operations
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: basic-operations/CLAUDE.md:0-0
Timestamp: 2026-01-10T19:26:21.240Z
Learning: All basic-operations programs should demonstrate create, update, close, reinit, and burn operations
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/CLAUDE.md:0-0
Timestamp: 2025-11-24T17:56:00.229Z
Learning: Applies to program-libs/batched-merkle-tree/docs/**/*.md : All documentation for accounts, operations, and concepts must reference corresponding markdown files (TREE_ACCOUNT.md, QUEUE_ACCOUNT.md, etc.) and source file locations
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/CLAUDE.md:0-0
Timestamp: 2026-01-12T14:27:56.316Z
Learning: Applies to programs/compressed-token/program/docs/compressed_token/{TRANSFER2,MINT_ACTION,FREEZE,THAW,CREATE_TOKEN_POOL,ADD_TOKEN_POOL}.md : Compressed token operations documentation should be organized in a compressed_token/ subdirectory with separate files for TRANSFER2.md (batch transfer with compress/decompress), MINT_ACTION.md (mint operations), FREEZE.md (freeze operations), THAW.md (thaw operations), CREATE_TOKEN_POOL.md (initial token pool creation), and ADD_TOKEN_POOL.md (additional token pools)
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: basic-operations/CLAUDE.md:0-0
Timestamp: 2026-01-10T19:26:21.240Z
Learning: Applies to basic-operations/**/{anchor,native}/**/burn/src/**/*.rs : Burn operations must permanently delete accounts via `LightAccount::new_burn()` so addresses cannot be reused
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: basic-operations/CLAUDE.md:0-0
Timestamp: 2026-01-10T19:26:21.240Z
Learning: Applies to basic-operations/**/{anchor,native}/**/close/src/**/*.rs : Close operations must preserve the account address for potential reinitialization via `LightAccount::new_close()`
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: sdk-tests/sdk-ctoken-test/README.md:0-0
Timestamp: 2025-12-07T03:17:28.803Z
Learning: Applies to sdk-tests/sdk-ctoken-test/**/README.md : Document program instructions and their parameters (instruction index, instruction name, and builder pattern usage) in README.md
📚 Learning: 2026-01-10T19:26:21.240Z
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: basic-operations/CLAUDE.md:0-0
Timestamp: 2026-01-10T19:26:21.240Z
Learning: Applies to basic-operations/**/{anchor,native}/**/src/**/*.rs : Verify current state matches on-chain data before executing close, update, or burn operations
Applied to files:
README.md
📚 Learning: 2026-01-10T19:25:12.548Z
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: basic-operations/native/README.md:0-0
Timestamp: 2026-01-10T19:25:12.548Z
Learning: Applies to basic-operations/native/**/{src,programs}/**/*.rs : Native Solana programs must implement five core operations: create (initialize compressed account), update (modify data), close (reclaim rent), reinit (reinitialize closed account), and burn (permanently destroy)
Applied to files:
README.md
📚 Learning: 2026-01-10T19:25:21.661Z
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: counter/anchor/README.md:0-0
Timestamp: 2026-01-10T19:25:21.661Z
Learning: Applies to counter/anchor/**/*.test.ts : Demonstrate client-side interaction with compressed accounts using `lightprotocol/stateless.js` and `lightprotocol/zk-compression-cli` libraries in TypeScript tests
Applied to files:
README.md
📚 Learning: 2026-01-10T19:26:31.226Z
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: counter/CLAUDE.md:0-0
Timestamp: 2026-01-10T19:26:31.226Z
Learning: Applies to counter/**/{anchor,native,pinocchio}/src/**/*.rs : Use LightAccount::new_init() for counter account creation, new_mut() for state updates, and new_close() for account deletion
Applied to files:
README.md
📚 Learning: 2026-01-10T19:25:03.366Z
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: basic-operations/anchor/README.md:0-0
Timestamp: 2026-01-10T19:25:03.366Z
Learning: Applies to basic-operations/anchor/**/*.test.ts : TypeScript tests must demonstrate client-side interaction with compressed accounts using 'lightprotocol/stateless.js'
Applied to files:
README.md
📚 Learning: 2026-01-10T19:26:21.240Z
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: basic-operations/CLAUDE.md:0-0
Timestamp: 2026-01-10T19:26:21.240Z
Learning: Applies to basic-operations/**/{anchor,native}/**/reinit/src/**/*.rs : Reinitialize closed accounts using `LightAccount::new_empty()` with proof that the address is currently empty
Applied to files:
README.md
📚 Learning: 2026-01-10T19:26:21.240Z
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: basic-operations/CLAUDE.md:0-0
Timestamp: 2026-01-10T19:26:21.240Z
Learning: Applies to basic-operations/**/anchor/**/src/**/*.rs : Use Poseidon hashing via `light_sdk::account::LightAccount` in Anchor framework implementations
Applied to files:
README.md
📚 Learning: 2026-01-10T19:26:21.240Z
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: basic-operations/CLAUDE.md:0-0
Timestamp: 2026-01-10T19:26:21.240Z
Learning: Applies to basic-operations/**/{anchor,native}/**/burn/src/**/*.rs : Burn operations must permanently delete accounts via `LightAccount::new_burn()` so addresses cannot be reused
Applied to files:
README.md
📚 Learning: 2026-01-10T19:26:21.240Z
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: basic-operations/CLAUDE.md:0-0
Timestamp: 2026-01-10T19:26:21.240Z
Learning: Applies to basic-operations/**/{anchor,native}/**/close/src/**/*.rs : Close operations must preserve the account address for potential reinitialization via `LightAccount::new_close()`
Applied to files:
README.md
📚 Learning: 2026-01-10T19:26:01.412Z
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: account-comparison/CLAUDE.md:0-0
Timestamp: 2026-01-10T19:26:01.412Z
Learning: Applies to account-comparison/programs/**/tests/test_compressed_account.rs : Include Light Protocol tests in test_compressed_account.rs to verify compressed account operations using LightAccount primitives
Applied to files:
README.md
📚 Learning: 2026-01-10T19:25:43.342Z
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: zk-id/README.md:0-0
Timestamp: 2026-01-10T19:25:43.342Z
Learning: This is a minimal example for verifying zk inclusion proofs and not a full zk identity protocol or production-ready implementation - refer to Iden3 or Semaphore for production identity protocols
Applied to files:
README.md
📚 Learning: 2025-11-24T17:54:42.219Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/system/README.md:0-0
Timestamp: 2025-11-24T17:54:42.219Z
Learning: Light Protocol system program is usable for ZK Compression on Solana
Applied to files:
README.md
📚 Learning: 2026-01-10T19:25:43.342Z
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: zk-id/README.md:0-0
Timestamp: 2026-01-10T19:25:43.342Z
Learning: Applies to zk-id/**/*.rs : Verify zero-knowledge proofs of credential ownership using the `zk_verify_credential` instruction with Groth16 verification and create encrypted event accounts to store verification results on-chain
Applied to files:
README.md
📚 Learning: 2026-01-10T19:25:43.342Z
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: zk-id/README.md:0-0
Timestamp: 2026-01-10T19:25:43.342Z
Learning: Applies to zk-id/**/*.js : Use SnarkJS library for generating and verifying zero-knowledge proofs in JavaScript
Applied to files:
README.md
📚 Learning: 2026-01-10T19:25:43.342Z
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: zk-id/README.md:0-0
Timestamp: 2026-01-10T19:25:43.342Z
Learning: Applies to zk-id/**/*.circom : Define zero-knowledge circuits in Circom language files using the compressed_account_merkle_proof circuit pattern
Applied to files:
README.md
📚 Learning: 2026-01-10T19:25:43.342Z
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: zk-id/README.md:0-0
Timestamp: 2026-01-10T19:25:43.342Z
Learning: Applies to zk-id/**/*.rs : Ensure credential verification is private by not exposing the credential during zk proof verification (use a relayer or freshly funded keypair for full privacy of the transaction payer)
Applied to files:
README.md
📚 Learning: 2025-11-24T17:54:38.537Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/README.md:0-0
Timestamp: 2025-11-24T17:54:38.537Z
Learning: Implement compressed token program interfaces for third-party token creation and usage on Solana using ZK Compression
Applied to files:
README.md
📚 Learning: 2025-11-24T17:54:33.614Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/anchor/README.md:0-0
Timestamp: 2025-11-24T17:54:33.614Z
Learning: Implement the Compressed Token Program interface for creating and using compressed tokens on Solana with ZK Compression
Applied to files:
README.md
📚 Learning: 2026-01-10T19:27:00.938Z
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: zk-id/CLAUDE.md:0-0
Timestamp: 2026-01-10T19:27:00.938Z
Learning: Applies to zk-id/**/*.circom : ZK circuit must verify 26-level Merkle proof of credential account inclusion
Applied to files:
README.md
🔇 Additional comments (2)
README.md (2)
52-52: LGTM! Path correctly updated for zk/ folder reorganization.The path update from
./zk-idto./zk/zk-idcorrectly reflects the repository reorganization described in the PR objectives, where the zk-id example was moved into the zk/ folder for better organization.
16-16: No change needed—create-nullifier is intentionally Anchor-only.The CLAUDE.md documentation explicitly defines five core basic operations (create, update, close, reinit, burn) that require both Anchor and Native implementations for platform parity. Create-nullifier is a supplementary feature that exists only in Anchor, and the README correctly reflects this distinction by linking it separately. The "pattern inconsistency" you identified is actually intentional architecture.
Likely an incorrect or invalid review comment.
| - **close** - Clear account data and preserve its address | ||
| - [Anchor](./basic-operations/anchor/close) | [Native](./basic-operations/native/programs/close) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
Enhance the close operation description to mention rent reclamation.
The description should highlight that close operations reclaim rent, which is a key benefit of this operation compared to burn.
Based on learnings, close operations preserve the account address for potential reinitialization while reclaiming rent.
📝 Suggested enhancement
-- **close** - Clear account data and preserve its address
+- **close** - Reclaim rent and preserve the account address for reinitialization📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - **close** - Clear account data and preserve its address | |
| - [Anchor](./basic-operations/anchor/close) | [Native](./basic-operations/native/programs/close) | |
| - **close** - Reclaim rent and preserve the account address for reinitialization | |
| - [Anchor](./basic-operations/anchor/close) | [Native](./basic-operations/native/programs/close) |
🤖 Prompt for AI Agents
In @README.md around lines 21 - 22, Update the README entry for the "close"
operation to state that it not only clears account data and preserves the
account address but also reclaims the account's rent (freeing lamports) —
highlight that this distinguishes close from burn and that the preserved address
can be reused for reinitialization; change the line starting with "**close** -
Clear account data and preserve its address" to include "reclaims rent" and a
short contrast to "burn" while leaving the Anchor and Native links intact.
| - **burn** - Permanently delete a compressed account | ||
| - [Anchor](./basic-operations/anchor/burn) | [Native](./basic-operations/native/programs/burn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
Clarify that burn prevents address reuse.
The description should explicitly state that burned accounts cannot have their addresses reused, which is the critical distinction from close operations.
Based on learnings, burn operations permanently delete accounts so addresses cannot be reused, unlike close operations which preserve addresses for reinitialization.
📝 Suggested enhancement
-- **burn** - Permanently delete a compressed account
+- **burn** - Permanently delete a compressed account (address cannot be reused)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - **burn** - Permanently delete a compressed account | |
| - [Anchor](./basic-operations/anchor/burn) | [Native](./basic-operations/native/programs/burn) | |
| - **burn** - Permanently delete a compressed account (address cannot be reused) | |
| - [Anchor](./basic-operations/anchor/burn) | [Native](./basic-operations/native/programs/burn) |
🤖 Prompt for AI Agents
In @README.md around lines 25 - 26, Update the README entry for the "burn"
operation to explicitly state that burning permanently deletes a compressed
account and prevents the account address from being reused; reference the "burn"
operation name (and its links "Anchor" and "Native") and add a short contrasting
clause noting that this differs from "close" operations which allow address
reinitialization.
9f9450b to
034f8aa
Compare
034f8aa to
04247d5
Compare
237112c to
ae715e7
Compare
- Move zk-id from root to zk/ folder - Add zk-nullifier: single and batch (4x) nullifier creation with Groth16 - Add zk-merkle-proof: merkle proof verification with compressed accounts - Update CI to test zk/zk-id, zk/zk-nullifier, zk/zk-merkle-proof
ae715e7 to
8bab0d0
Compare
- zk-nullifier: Remove unused blake3 dependency - zk-id: Update merkle proof circuit import path - zk-merkle-proof: Add Anchor.toml, fix circuit import
881199e to
edd47a2
Compare
… pattern - verifying_key.rs → nullifier_1.rs - batch_verifying_key.rs → nullifier_batch_4.rs
| component hasher[levels]; | ||
|
|
||
| component indexBits = Num2Bits(levels); | ||
| component indexBits = Num2Bits_strict(levels); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why strict?
| // Range check: leafIndex < 2^levels | ||
| component indexRange = LessThan(levels + 1); | ||
| indexRange.in[0] <== leafIndex; | ||
| indexRange.in[1] <== 1 << levels; | ||
| indexRange.out === 1; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not required
| nullifiers[i] = Nullifier(); | ||
| nullifiers[i].verification_id <== verification_id; | ||
| nullifiers[i].nullifier <== nullifier[i]; | ||
| nullifiers[i].secret <== secret[i]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import and use template Nullifier() {
zk-nullifier: - Split nullifier.circom into template + nullifier_main.circom - Fixes multiple main components error when batchnullifier includes nullifier zk-merkle-proof & zk-id: - Replace Num2Bits_strict(levels) with Num2Bits(levels) - Remove redundant LessThan range check (Num2Bits already constrains) - Remove unused comparators.circom import
… pattern - nullifier.circom: template-only library (Nullifier + BatchNullifier) - nullifier_1.circom: entry point for single nullifier - nullifier_4.circom: entry point for batch of 4 nullifiers - Update setup.sh to compile new circuit files Following circomlib best practice: templates in library files, minimal entry points.
Summary
Test plan
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.