Skip to content

feat: Privacy-preserving identity aggregator with anonymous XOR accumulator set membership proofs (#65) - #71

Merged
michaelvic123 merged 4 commits into
laugh-tales:mainfrom
jotel-dev:issue-65-privacy-preserving-identity-aggregator
Jul 30, 2026
Merged

feat: Privacy-preserving identity aggregator with anonymous XOR accumulator set membership proofs (#65)#71
michaelvic123 merged 4 commits into
laugh-tales:mainfrom
jotel-dev:issue-65-privacy-preserving-identity-aggregator

Conversation

@jotel-dev

Copy link
Copy Markdown
Contributor

Description

Closes #65.

This PR introduces an anonymous, privacy-preserving cryptographic accumulator for each credential schema. It allows wallet subjects to prove valid membership in a schema holder set using a snapshot witness without revealing their specific wallet address or credential ID.

Changes Made

  • Storage Keys: Added DataKey::SchemaAccumulator(u32) and DataKey::SchemaHolderCount(u32).
  • Accumulator Cryptography:
    • Accumulator formula: $\text{acc}{\text{new}} = \text{SHA-256}(\text{acc}{\text{old}} \oplus \text{SHA-256}(\text{subject_bytes}))$.
    • Initial state: 32 bytes of zeros (0x00...00).
  • State Maintenance: Automatically updates schema accumulators and holder counts during issue_credential, batch_issue_credentials, bridge_credential, issue_multisig_credential, and revoke_credential.
  • Public Interface:
    • get_schema_accumulator(env, schema_id) -> BytesN<32>
    • get_schema_holder_count(env, schema_id) -> u32
    • generate_membership_witness(env, subject, schema_id) -> (BytesN<32>, BytesN<32>)
    • verify_membership_witness(env, schema_id, subject_hash, snapshot) -> bool
  • Documentation: Documented XOR accumulator mechanics in docs/ARCHITECTURE.md.

Test Plan & Verification

  • test_schema_accumulator_issue_and_revoke: Verifies accumulator state transitions on credential issuance and revocation, witness generation, and snapshot verification.
  • All unit tests passing via cargo test.

@michaelvic123
michaelvic123 merged commit d9dd9c4 into laugh-tales:main Jul 30, 2026
0 of 3 checks passed
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.

Implement privacy-preserving identity aggregator with anonymous credential set membership proof

2 participants