anon-identity
Version:
Decentralized identity framework with DIDs, Verifiable Credentials, and privacy-preserving selective disclosure
69 lines • 2.14 kB
TypeScript
import { JsonLdProcessor } from '../ld/jsonld-processor';
import { VerifiableCredentialV2, Proof } from '../types/vc2';
/**
* BBS+ based selective disclosure options
*/
export interface BbsSelectiveDisclosureOptions {
attributesToReveal: string[];
holderDID?: string;
nonce?: string;
jsonLdProcessor?: JsonLdProcessor;
}
/**
* BBS+ based selective disclosure result
*/
export interface BbsSelectiveDisclosureResult {
derivedCredential: VerifiableCredentialV2;
derivedProof: Proof;
revealedPaths: string[];
}
/**
* BBS+ based selective disclosure for Verifiable Credentials
*/
export declare class BbsSelectiveDisclosure {
private suite;
private jsonLdProcessor;
constructor(jsonLdProcessor?: JsonLdProcessor);
/**
* Create a derived credential with selective disclosure
*/
deriveCredential(originalCredential: VerifiableCredentialV2, options: BbsSelectiveDisclosureOptions): Promise<BbsSelectiveDisclosureResult>;
/**
* Verify a derived credential
*/
verifyDerivedCredential(derivedCredential: VerifiableCredentialV2, issuerPublicKey: Uint8Array, expectedNonce?: string): Promise<boolean>;
/**
* Create a JSON-LD frame for selective disclosure
*/
private createFrame;
/**
* Extract revealed paths from original and framed credentials
*/
private extractRevealedPaths;
/**
* Recursively extract paths
*/
private extractPathsRecursive;
/**
* Check if proof is BBS+ signature
*/
private isBbsProof;
/**
* Check if proof is BBS+ derived proof
*/
private isBbsDerivedProof;
/**
* Estimate the privacy level of a selective disclosure
* Returns a score from 0 (all revealed) to 1 (minimal revelation)
*/
estimatePrivacyLevel(originalCredential: VerifiableCredentialV2, revealedPaths: string[]): Promise<number>;
/**
* Extract all attribute paths from a credential
*/
private extractAllPaths;
/**
* Recursively extract all paths
*/
private extractAllPathsRecursive;
}
//# sourceMappingURL=bbs-selective-disclosure.d.ts.map