feat: Selective disclosure proofs using Merkle trees of credential fields (#67) - #73
Open
jotel-dev wants to merge 1 commit into
Open
Conversation
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.
Description
Closes #67.
This PR adds selective disclosure capabilities to StellarID using Merkle tree proofs. Subjects can selectively disclose specific attributes (e.g., proving
age: 30) to third-party verifiers without revealing other fields contained within the credential.Changes Made
SelectiveCredentialstruct containingmerkle_root: BytesN<32>andfield_count.DataKey::SelectiveCredential(u64)andDataKey::SelectiveCredentialCount.SHA-256(field_name_xdr || ":" || field_value_xdr).merkle_root.hash_leaf(env, field_name, field_value) -> BytesN<32>compute_merkle_root(env, leaves) -> BytesN<32>verify_merkle_proof(env, leaf, proof, root, index) -> boolissue_selective_credential,get_selective_credential,verify_credential_field,has_valid_field.docs/ARCHITECTURE.md.Test Plan & Verification
test_selective_disclosure_merkle_tree: Builds a 4-leaf Merkle tree credential, generates sibling proofs, and verifies individual field disclosure on-chain.cargo test.