Free 30-min Web3 Consultation
Book Now
Smart Contract Security Audits
Learn More
Custom DeFi Protocol Development
Explore
Full-Stack Web3 dApp Development
View Services
Free 30-min Web3 Consultation
Book Now
Smart Contract Security Audits
Learn More
Custom DeFi Protocol Development
Explore
Full-Stack Web3 dApp Development
View Services
Free 30-min Web3 Consultation
Book Now
Smart Contract Security Audits
Learn More
Custom DeFi Protocol Development
Explore
Full-Stack Web3 dApp Development
View Services
Free 30-min Web3 Consultation
Book Now
Smart Contract Security Audits
Learn More
Custom DeFi Protocol Development
Explore
Full-Stack Web3 dApp Development
View Services
LABS
Guides

How to Design Selective Disclosure Workflows

A technical guide for developers on implementing selective disclosure mechanisms using zero-knowledge proofs. Covers cryptographic primitives, circuit design, and integration patterns for privacy-preserving applications.
Chainscore © 2026
introduction
PRIVACY PATTERNS

How to Design Selective Disclosure Workflows

A guide to implementing privacy-preserving data sharing by revealing only necessary information from verifiable credentials.

Selective disclosure is a core privacy feature of Verifiable Credentials (VCs) that allows a holder to prove specific claims from a credential without revealing the entire document. Instead of presenting a full driver's license to prove you are over 21, you can generate a cryptographic proof that only contains your birth date and its validity, hiding your name, address, and license number. This is enabled by zero-knowledge proofs (ZKPs) and signature schemes like BBS+ (Boneh-Boyen-Shacham) or CL signatures, which allow the derivation of a new, minimal proof from a signed credential.

Designing an effective workflow starts with defining the data minimization requirements. What is the absolute minimum data the verifier needs? For age verification, it's just a birthDate > threshold statement. For employment checks, it might be jobTitle == "Engineer" AND issuer == "CompanyXYZ". Map these requirements to the credential schema. The schema defines the structure, but the presentation definition—often using formats like DIF Presentation Exchange—specifies exactly which claims must be disclosed and any predicates (e.g., age >= 18) required for the interaction.

The technical implementation involves the holder's wallet or agent. When a verifier sends a presentation request, the wallet uses a selective disclosure protocol to create a Verifiable Presentation. For a BBS+ signed credential, this involves creating a derived proof that cryptographically blinds undisclosed attributes. The verifier can then check this proof against the issuer's public key without seeing the hidden data. Libraries like Hyperledger Aries or Veramo provide SDKs to handle this complexity. For example, using Veramo, you can create a selective disclosure presentation with a few lines of code defining the disclosed fields.

Consider the user experience (UX) and consent. The interface should clearly show the user what data is being requested versus what will actually be shared. A best practice is to implement a two-step review: first show the full credential data, then show a preview of the derived presentation with hidden fields masked. This builds trust. Furthermore, workflows should support holder-initiated sharing and verifier-pull models, depending on the use case, such as logging into a dApp versus a background check.

Finally, audit and test your workflow for security. Ensure the cryptographic proofs are sound and that your implementation doesn't accidentally leak metadata. Use standardized test suites from W3C VC Test Suite or OpenID Connect for Verifiable Credentials. Remember, the goal is to enable trust through verification while upholding the principle of data minimization, a key requirement under regulations like GDPR. A well-designed selective disclosure system reduces liability and builds user confidence in decentralized identity ecosystems.

prerequisites
FOUNDATIONAL CONCEPTS

Prerequisites and Required Knowledge

Before designing selective disclosure workflows, you need a solid grasp of the underlying cryptographic primitives, data formats, and identity standards that make them possible.

Selective disclosure is built on verifiable credentials (VCs) and zero-knowledge proofs (ZKPs). A verifiable credential is a tamper-evident digital claim, like a digital driver's license, issued by a trusted entity. The W3C's Verifiable Credentials Data Model is the core standard defining their structure using JSON-LD or JWT formats. You must understand the key roles in this model: the issuer (who creates the credential), the holder (who stores it), and the verifier (who requests proof). The holder uses a verifiable presentation to share specific claims from one or more VCs with a verifier.

To enable selective disclosure without revealing the entire credential, you need specific cryptographic tools. BBS+ (Boneh-Boyen-Shacham) signatures are a cornerstone, allowing a holder to cryptographically derive a proof from a signed credential that reveals only selected attributes. For more complex logic, zk-SNARKs or zk-STARKs can prove statements like "I am over 18" without revealing the birth date itself. Familiarity with these proof systems, their trade-offs in proof size and computational cost, and libraries like @mattrglobal/bbs-signatures or snarkjs is essential for implementation.

You must also decide on a holder storage and key management strategy. Credentials are stored in a digital wallet, which can be custodial (managed by a service) or non-custodial (user-held). The holder must securely manage their Decentralized Identifier (DID) and associated private keys to sign presentations. Standards like DID-Core and DIDComm are relevant for establishing secure communication channels between holders and verifiers. This infrastructure is critical for user autonomy and security.

Finally, designing the workflow requires mapping the real-world policy to a machine-verifiable logic. You need to define: which attributes are required (firstName, over18), the trust framework (which issuers are accepted), and the proof format. This is often expressed using a presentation definition, as specified by the Presentation Exchange specification. You'll transform a legal or business rule like "prove residency and age ≥ 21" into a structured request that a wallet can understand and fulfill with a ZK proof.

key-concepts-text
TUTORIAL

Core Cryptographic Concepts for Selective Disclosure

This guide explains the cryptographic primitives that enable users to prove specific claims from a credential without revealing the entire document, a fundamental capability for privacy-preserving identity systems.

Selective disclosure is powered by zero-knowledge proofs (ZKPs) and digital signatures. The core idea is to allow a prover (the credential holder) to generate a proof for a verifier that certain statements about their data are true, without revealing the data itself. This is distinct from simply showing a redacted document, as the cryptographic proof verifiably links the disclosed data to the original, tamper-evident issuer signature. Common schemes used in decentralized identity, like BBS+ signatures and CL signatures, are specifically designed to support this property, enabling predicates like "I am over 18" to be proven from a signed credential containing your full birthdate.

The workflow begins with credential issuance. An issuer signs a set of claims (e.g., name, date_of_birth, national_id) using a signature scheme that supports selective disclosure. The signature binds all claims together. When the holder needs to prove a specific claim, they initiate a presentation protocol. They create a derived proof or presentation that includes only the disclosed attributes (e.g., name) and a ZKP that convinces the verifier the undisclosed attributes (e.g., date_of_birth) were part of the original, validly signed credential. The verifier checks this proof against the issuer's public key.

Implementing this requires careful design. You must define which attributes are disclosable and which might support predicate proofs (e.g., date_of_birth >= 2005-01-01). Libraries like anoncreds-rs (for BBS+) or zkp-ecdsa provide the cryptographic operations. A basic flow in pseudocode involves: issuer_sign(credential, issuer_priv_key) -> signed_credential, then holder_create_presentation(signed_credential, disclosed_attributes, nonce) -> presentation, and finally verifier_verify_presentation(presentation, issuer_pub_key, nonce) -> true/false. The nonce prevents replay attacks.

Advanced use cases involve compound proofs across multiple credentials. For instance, proving you live in a specific city could combine a proof of residence from one issuer and a proof of age from another, without revealing the credentials' other data. This is enabled by proof composition techniques. Furthermore, signature schemes with efficient revocation, like accumulator-based methods, allow issuers to revoke credentials without compromising the selective disclosure properties for still-valid holders.

When designing a system, key considerations include: the computational overhead of proof generation/verification (BBS+ is more intensive than CL), blind signing protocols for issuer privacy, and schema design to isolate sensitive data into separate, selectively disclosable attributes. Standards like W3C Verifiable Credentials Data Integrity with BBS+ signatures provide an interoperable framework. The result is user-controlled data sharing that minimizes exposure while maximizing cryptographic trust.

common-design-patterns
WORKFLOW ARCHITECTURE

Common Selective Disclosure Design Patterns

Selective disclosure allows users to prove specific claims from a credential without revealing the entire document. These are the most common design patterns for implementing this in Web3 systems.

DEVELOPER TOOLS

ZK Framework Comparison for Selective Disclosure

A comparison of popular zero-knowledge frameworks for building selective disclosure applications, focusing on developer experience and protocol capabilities.

Feature / MetricCircom + SnarkJSHalo2 (Zcash / Scroll)RISC ZeroNoir (Aztec)

Primary Language

Circom

Rust

Rust

Noir (Rust-like)

Proof System

Groth16 / PLONK

Halo2 (PLONKish)

zk-STARK

PLONK / UltraPLONK

Trusted Setup Required

Recursive Proof Support

Via PLONK

Via UltraPLONK

Developer Tooling Maturity

High

Medium

Medium

Growing

On-chain Verification Gas Cost

~500k gas

~300k gas

~1.5M gas

~450k gas

Native Privacy Features

Yes (MASP)

Yes (Aztec Network)

Main Use Case

General-purpose ZK

ZK-EVMs, Private payments

ZK-VMs, Verifiable compute

Private smart contracts

step-by-step-implementation
IMPLEMENTATION GUIDE

How to Design Selective Disclosure Workflows

A practical guide for developers to implement selective disclosure, a core privacy feature of verifiable credentials, using modern cryptographic primitives.

Selective disclosure allows a credential holder to prove specific claims from a larger credential without revealing the entire document. This is fundamental for user privacy in decentralized identity systems. The workflow is built upon zero-knowledge proofs (ZKPs) or BBS+ signatures, enabling cryptographic verification of partial statements. For example, a user can prove they are over 21 from a digital driver's license without disclosing their exact birth date, name, or address. The core components are the issuer who signs the credential, the holder who manages it, and the verifier who requests and checks proofs.

Designing a workflow begins with defining the credential schema. Use a structured data model, like those from the W3C Verifiable Credentials Data Model, to specify all possible claims. For a KYC credential, attributes might include fullName, dateOfBirth, nationality, and address. The issuer cryptographically signs this full set of attributes, creating the base verifiable credential. This credential is then issued to the holder's wallet, such as a SSI wallet or a smart contract acting as a custodian.

The holder's application must integrate a proving library to generate disclosure proofs. When a verifier (e.g., a dApp) requests proof of specific claims, the holder's software constructs a presentation. Using libraries like @mattrglobal/bbs-signatures for BBS+ or snarkjs for ZK-SNARKs, the holder generates a proof that only reveals the requested attributes. The code snippet below demonstrates initiating a BBS+ proof for a selective disclosure request:

javascript
const derivedProof = await bbs.deriveProof({
  signature: originalSignature,
  publicKey: issuerPublicKey,
  messages: originalMessages, // All credential attributes
  revealed: [0, 2], // Indices of attributes to disclose (e.g., name and nationality)
  nonce: randomNonce
});

The verifier's role is to validate the proof against the issuer's public key and the disclosed claims. Verification does not require the original credential or the hidden data. The verifier checks the cryptographic proof and the disclosed data against its business logic (e.g., country === 'US'). This process should be integrated into the verifier's backend or smart contract. For on-chain verification, consider gas-efficient ZK circuits or using verifier smart contracts like those in the Iden3 protocol. Always include a challenge nonce in the proof request to prevent replay attacks.

Key architectural decisions impact security and usability. Choose between signature-based (BBS+) and ZK circuit-based approaches; BBS+ is often simpler for predicate proofs ('over 18'), while ZK circuits allow for complex computations. Blind signing protocols can prevent issuers from learning the final values they sign, enhancing privacy. Consider holder binding mechanisms to ensure proofs come from the legitimate credential owner, potentially using a cryptographic commitment to a holder's key. Finally, design for revocation using status lists, smart contracts, or accumulator schemes without compromising the selective disclosure property.

Test your implementation thoroughly. Create unit tests for proof derivation and verification across all disclosure combinations. Use test vectors from specifications like the BBS+ RFC. For mainnet deployment, conduct audits on any custom cryptographic code or smart contracts. Monitor for updates to underlying libraries and standards. A well-designed selective disclosure workflow is a critical privacy-preserving layer for DeFi, DAO governance, and enterprise authentication systems.

circuit-design-considerations
CIRCUIT DESIGN AND OPTIMIZATION

How to Design Selective Disclosure Workflows

Selective disclosure allows users to prove specific claims from a credential without revealing the entire document, a core privacy feature for on-chain identity and compliance.

A selective disclosure workflow is a multi-step process that begins with credential issuance and ends with verifiable proof verification. The core components are: the Issuer (who creates the signed credential), the Holder (who stores it and generates proofs), and the Verifier (who requests and checks proofs). The workflow's security and privacy depend on the cryptographic circuit that defines which attributes can be revealed, hidden, or used in predicate checks (e.g., proving age > 18 without revealing the birth date). Common standards for this include W3C Verifiable Credentials with ZK proofs or IETF's SD-JWT.

Designing the circuit logic is the critical engineering phase. You must define the disclosure types for each attribute: Revealed (shared in plaintext), Hidden (not shared at all), or Predicate (used in a logical statement). For example, a KYC credential might reveal a user's country of residence, hide their exact address, and use a predicate to prove their account balance exceeds a minimum threshold. This is implemented using zero-knowledge proof systems like Circom, Noir, or zkSnark libraries, where the circuit code enforces these disclosure rules.

Optimization focuses on proof size and verification gas costs, especially for on-chain verification. Techniques include: using optimal elliptic curves (e.g., BN254 for Ethereum), minimizing the number of constraints in your circuit, and employing recursive proof aggregation. For instance, the Semaphore protocol optimizes identity proofs by using Merkle tree membership circuits with efficient hashing. Always benchmark different backends (Groth16, Plonk, Halo2) for your specific use case, as verification gas can vary by over 200,000 gas units between implementations.

Implement the workflow with a developer SDK for ease of integration. For Ethereum, consider libzerius or zkkit for Circom. A typical flow in code involves: 1) The issuer signs a credential with a private key. 2) The holder generates a ZK proof using the circuit, the credential, and their chosen disclosure map. 3) The verifier checks the proof and the issuer's signature. Here's a conceptual snippet for a proof generation call using a hypothetical SDK:

javascript
const proof = await zkProver.generateProof(circuitWasm, {
  credential: signedVC,
  revealedAttrs: ['country'],
  predicates: [{ attribute: 'balance', operation: 'gt', value: 1000 }]
});

Security audits are non-negotiable. Common pitfalls include: circuits that inadvertently leak info through timing or proof validity, insecure randomness during proof generation, and flawed trust assumptions in the issuer's key management. Use established auditing firms and open-source your circuits for community review. Furthermore, design for revocation. Integrate a revocation registry (like a smart contract mapping or a sparse Merkle tree) that your circuit checks against, ensuring proofs from revoked credentials fail verification without revealing the revoked credential's identifier.

Finally, consider the user experience. The holder's wallet or agent must manage credentials and generate proofs seamlessly. Standards like Decentralized Identifiers (DIDs) and CHAPI (Credential Handler API) help here. The future of these workflows involves cross-chain verification, where a proof generated from a credential on one chain (e.g., Polygon ID) is verified on another (e.g., Arbitrum), requiring circuit compatibility and standardized verification contracts.

use-cases
SELECTIVE DISCLOSURE

Real-World Use Cases and Examples

Selective disclosure enables users to prove specific claims from their credentials without revealing the entire document. These examples show how to design workflows for privacy-preserving verification.

03

Selective Credit Scoring for Lending

Enable undercollateralized lending by allowing users to prove a credit score threshold or income range without exposing their full financial history.

  • Core Mechanism: Use zk-SNARKs on chain to verify claims from off-chain signed attestations.
  • Credential Source: A verifiable credential from a credit bureau or institutional partner.
  • Smart Contract Logic: The lending pool's contract verifies the ZKP, which cryptographically confirms the user's score is above 700, for example.
  • Privacy Benefit: The lender never sees the actual score, the user's address isn't linked to the credential issuer, and sensitive data stays off-chain.
< 1 sec
Proof Verification Time
05

Healthcare Data Sharing

Allow patients to share specific health data, like a vaccination status or lab result range, with employers or insurers without exposing their full medical record.

  • Core Mechanism: W3C Verifiable Credentials with BBS+ signatures support selective disclosure natively.
  • Credential Source: A digitally signed health record from a hospital or doctor's system.
  • Design Pattern: The patient's digital wallet receives a VC. When asked for proof of a COVID-19 vaccination, the wallet creates a derived verifiable presentation containing only that claim, signed with a BBS+ proof.
  • Standard: This aligns with the W3C-CCG specifications for privacy-preserving verifiable credentials.
SELECTIVE DISCLOSURE

Frequently Asked Questions

Common technical questions and solutions for developers implementing selective disclosure workflows with verifiable credentials.

Selective disclosure is a privacy-preserving feature of Verifiable Credentials (VCs) that allows a holder to prove specific claims from a credential without revealing the entire document. It works using cryptographic techniques like BBS+ signatures or CL signatures, which enable zero-knowledge proofs.

For example, a user with a driver's license VC containing name, date of birth, and address can generate a proof that they are over 21, revealing only that derived claim. The verifier can cryptographically check the proof's validity against the issuer's public key without seeing the user's birth date or other data. This is foundational for minimal disclosure and data minimization principles in decentralized identity.

security-and-auditing
SECURITY CONSIDERATIONS AND AUDITING

How to Design Selective Disclosure Workflows

Selective disclosure allows users to prove specific claims from a credential without revealing the entire document, a critical privacy feature for verifiable credentials.

A selective disclosure workflow is a cryptographic protocol that enables a credential holder to generate a verifiable presentation containing only the necessary attributes for a given interaction. Instead of sharing a full diploma, a user could prove they are over 21 or hold a specific certification. Core to this is the use of zero-knowledge proofs (ZKPs) or BBS+ signatures, which allow the verifier to cryptographically check the validity of the revealed claims without seeing the hidden data or the issuer's public key. This minimizes data exposure and enhances user privacy by default.

Designing a secure workflow starts with defining the data minimization requirements. For each verification scenario, identify the absolute minimum set of claims needed. Technically, this involves structuring the original W3C Verifiable Credential with discrete, individually disclosable claims. Using libraries like json-ld-signatures or frameworks supporting BBS+ signatures (e.g., AnonCreds, @mattrglobal/bbs-signatures), you can create a derived proof. A common pattern is to use a presentation request from the verifier that specifies the required claims and any predicates (e.g., "age" >= 18), to which the holder's wallet responds with a selective disclosure presentation.

Key security considerations include signature replay attacks and correlation risks. Each presentation should include a unique nonce from the verifier to prevent replay. To avoid correlation across sessions, ensure the disclosed proof does not leak a consistent identifier. Schema design is also crucial; avoid nesting essential claims inside objects that cannot be partially disclosed. Audit your implementation against the OWASP Top 10 for SSI and ensure your ZKP circuits or BBS+ implementations are from audited libraries. Regularly test for edge cases where a malicious holder might try to prove a false predicate by manipulating the disclosed JSON structure.

For developers, here is a conceptual flow using a BBS+ signature scheme:

javascript
// Holder creates a selective disclosure from a signed credential
const derivedProof = await bbs.createProof({
  message: fullCredential.credentialSubject, // All claims
  proof: fullCredential.proof, // Original BBS+ signature
  nonce: verifierNonce,
  revealed: [0, 2] // Indices of claims to reveal (e.g., name, birthdate)
});
// The verifier checks only the revealed claims
const isVerified = await bbs.verifyProof({
  proof: derivedProof,
  nonce: verifierNonce,
  revealedMessages: [revealedName, revealedBirthdate]
});

This ensures the verifier learns only revealedName and revealedBirthdate, with the proof validating they were originally signed by the trusted issuer.

Finally, integrate selective disclosure into a user-centric consent dashboard. The wallet UI should clearly show what is being requested versus what will be shared. Logging and auditing on the verifier's side should record only the proof validity and the fact that a specific predicate was satisfied, not the actual claim values. This approach, aligning with regulations like GDPR's data minimization principle, builds user trust and creates more robust, privacy-preserving verification systems. Always refer to the latest W3C Verifiable Credentials Implementation Guidelines and conduct third-party audits for any custom cryptographic implementations.

conclusion
IMPLEMENTATION GUIDE

Conclusion and Next Steps

This guide has outlined the core principles and technical patterns for building selective disclosure workflows. The next step is to apply these concepts to your specific use case.

Selective disclosure is a foundational pattern for privacy-preserving applications. By leveraging zero-knowledge proofs (ZKPs) and verifiable credentials, you can build systems where users prove specific claims—like being over 18 or having a sufficient credit score—without revealing the underlying data. The key architectural components are the Issuer (creates the credential), the Holder (stores and presents it), and the Verifier (requests and validates proofs). Frameworks like Hyperledger AnonCreds, Veramo, and Sismo's ZK Badges provide the tooling to implement these flows.

To design an effective workflow, start by mapping the data minimization requirements. Identify the exact predicate a verifier needs to check (e.g., age > 18) versus the raw data (dateOfBirth). Then, choose a proving system: zk-SNARKs (e.g., Circom, Halo2) for complex logic and succinct proofs, or BBS+ signatures for simpler, pre-defined claim presentations. Your issuance logic, often a smart contract or trusted backend service, must cryptographically sign the credentials, binding them to the holder's decentralized identifier (DID).

For developers, integrating these flows involves several concrete steps. Use a library like @veramo/core to create and manage DIDs and credentials. For ZK proofs, a circuit written in Circom might define the age-check logic, compiled and used with a proving key. The verification is then performed on-chain or off-chain using the corresponding verification key. Always audit the credential schema and circuit logic to ensure the proof correctly enforces the intended constraint without leaking information.

Looking forward, consider these advanced topics and next steps for your project:

Explore On-Chain Verification

Integrate with verifier smart contracts on Ethereum, Polygon, or other EVM chains using libraries like snarkjs for Groth16 or the semaphore protocol for group membership proofs.

Implement Revocation

Add a revocation registry (like a smart contract or a verifiable data registry) to allow issuers to invalidate credentials without compromising holder privacy.

Test with Real Data

Prototype your workflow using testnets and frameworks like the w3c VC Test Suite to ensure interoperability and compliance with standards.

The ecosystem is rapidly evolving. Stay updated on emerging standards like W3C Verifiable Credentials 2.0 and Decentralized Identifiers (DID). Engage with the community through the DIF (Decentralized Identity Foundation) and W3C Credentials Community Group. For further learning, review the code for open-source projects like Veramo's plugin ecosystem, iden3's circomlib, and Ontology's DID solutions. Building robust selective disclosure is a step toward a more private and user-sovereign digital world.

How to Design Selective Disclosure Workflows with ZK-SNARKs | ChainScore Guides