Skip to content

Add shielded commitment and nullifier primitives#152

Open
TommoHCIO wants to merge 1 commit into
Zyntarivoid:mainfrom
TommoHCIO:soroban-shielded-primitives-33
Open

Add shielded commitment and nullifier primitives#152
TommoHCIO wants to merge 1 commit into
Zyntarivoid:mainfrom
TommoHCIO:soroban-shielded-primitives-33

Conversation

@TommoHCIO

Copy link
Copy Markdown

Summary

Addresses #33 by adding shielded commitment and nullifier storage primitives to the Soroban contract scaffold.

Changes

  • Added persistent Commitment(BytesN<32>) and Nullifier(BytesN<32>) storage keys.
  • Added insert_commitment with duplicate-commitment rejection and a typed CommitmentInserted event.
  • Added consume_nullifier with replay prevention and a typed NullifierConsumed event.
  • Added read helpers for commitment membership and nullifier-use checks.
  • Documented the privacy-scaffold boundary in veilend-soroban/README.md.
  • Added focused host tests for membership marking, duplicate commitment rejection, nullifier consumption, and nullifier replay rejection.

Verification

cargo fmt
cargo test -p veillend-contract
# test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

git diff --check
# no output

Notes

This intentionally does not implement zero-knowledge proof verification or token-note lifecycle logic yet. It establishes the stable storage keys and replay/duplicate guards that future shielded flows can build on.

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.

1 participant