When to Use It
Selective Disclosure is useful when a yes/no proof is not enough to decide the final user experience. A verification program can prove a broad condition, but the Verifier may still need the exact disclosed value to choose the right reward, access level, or next step. A common example is a membership rewards flow:- A user proves they hold a valid membership credential.
- A broad ZK condition such as
membershipTier > bronzeconfirms they are eligible for rewards. - If the Verifier only gets that broad result, a Gold member may miss rewards that are specific to the Gold tier.
- With Selective Disclosure, the Verifier can request
membershipTier, confirm the value isgold, and grant the Gold reward.
- A loyalty program that discloses
rewardPointsonly after the credential is verified. - A KYC Verifier that needs
countryCodeandkycLevelto route the user through the correct compliance flow. - A ticketing partner that needs
seatTierto issue a physical wristband at the venue. - A fintech onboarding step where an analyst reviews disclosed
verifiedAttimestamps.
Prerequisites
Before using Selective Disclosure you need:- Sandbox environment — Selective Disclosure is currently available only in Sandbox.
- Latest AIR Kit SDK — Install or upgrade to the latest version of
@mocanetwork/airkit. - Issuer with disclosure enabled — The Issuer of the credential must have Allow data disclosure turned on for the issuance program.
- Active verification program — A published verification program in the Developer Dashboard (Verifier → Programs).
- Partner JWT with
scope=verify— See Partner Authentication.
Step 1: Enable Disclosure on the Issuance Program
Selective Disclosure must be enabled by the Issuer at the program level. As a Verifier, you cannot request disclosed data unless the Issuer has opted in.1
Open the Developer Dashboard
Sign in to the Developer Dashboard with your Issuer account.
2
Create or edit an issuance program
Navigate to Issuer → Programs and either create a new program (Issue Pricing) or open an existing one to edit.
3
Expand Advanced set up
In the credential form, expand the Advanced set up section.
4
Enable Allow data disclosure
Toggle Allow data disclosure on, then save the program.
Step 2: Request Disclosure During Verification
On the Verifier side, passfieldsToDisclose to airService.verifyCredential. There are two supported shapes.
Disclose the Entire Credential Subject
Pass'*' to receive every field in the credential subject.
- Web
Disclose Specific Fields
Pass an array of field names from the credential subject. Only the listed fields are returned.Field names in
fieldsToDisclose must match keys defined in the credential schema. Fields the Issuer has not enabled for disclosure are silently omitted.Response Shape
When the verification result isCompliant, disclosed fields are returned inside the W3C Verifiable Presentation on verifiablePresentation, as the credentialSubject of the embedded credential.
credentialSubject mirrors the subject shape you defined when issuing the credential, narrowed to the fields your verifier requested.
Deprecated as of 1.11. Disclosure used to be returned on a top-level
disclosedData object alongside zkProofs and transactionHash. Those fields are no longer populated — read verifiablePresentation instead. See the 1.11.1 release notes.Behavior and Limits
- Disclosed fields are only returned when
status === "Compliant". Non-compliant verifications never expose credential data. - If the Issuer has not enabled Allow data disclosure on the program,
fieldsToDiscloseis ignored and no disclosed claims appear in the presentation. - Requesting fields that do not exist on the schema or were not enabled for disclosure does not fail the verification — those fields are simply absent.
- Disclosure is additive, not a replacement for verification. Where the program requires a zero-knowledge proof, that proof is generated and validated regardless of which fields you disclose, and is returned on
verifiablePresentation.proof. fieldsToDiscloseis required forSD_JWT_VCprograms — an empty array or an omitted value is rejected. For those programsverifiableCredential[0]is a compact string rather than an object, so type-check before readingcredentialSubject.
Related
Verifying Credentials
The base verification flow that Selective Disclosure builds on.
Partner Authentication
Generate the
scope=verify Partner JWT used as authToken.