import { ConcordiumGRPCClient } from '../../grpc/index.js'; import { AttributeKey, HexString, Network } from '../../types.js'; import { BlockHash } from '../../types/index.js'; import { CredentialStatus, CredentialsInputsIdentity, DIDString } from '../../web3-id/index.js'; import { VerifiableCredentialV1 } from './index.js'; import { AtomicStatementV1 } from './proof.js'; import { ZKProofV4 } from './types.js'; /** * A verifiable credential based on identity information from an identity provider. * This credential type contains zero-knowledge proofs about identity attributes * without revealing the actual identity information. */ type IdentityCredential = { /** Type identifiers for this credential format */ type: ['VerifiableCredential', 'ConcordiumVerifiableCredentialV1', 'ConcordiumIdBasedCredential']; /** The credential subject containing identity-based statements */ credentialSubject: { /** The identity disclosure information also acts as ephemeral ID */ id: HexString; /** Statements about identity attributes (should match request) */ statement: AtomicStatementV1[]; }; /** ISO formatted datetime specifying when the credential is valid from */ validFrom: string; /** ISO formatted datetime specifying when the credential expires */ validUntil: string; /** The zero-knowledge proof for attestation */ proof: ZKProofV4; /** Issuer of the original ID credential */ issuer: DIDString; }; /** * A verifiable credential based on identity information from an identity provider. * This credential type contains zero-knowledge proofs about identity attributes * without revealing the actual identity information. */ export type Identity = IdentityCredential; /** * A verifiable credential based on an account credential on the Concordium blockchain. * This credential type contains zero-knowledge proofs about account credentials * and their associated identity attributes. */ type AccountCredential = { /** Type identifiers for this credential format */ type: ['VerifiableCredential', 'ConcordiumVerifiableCredentialV1', 'ConcordiumAccountBasedCredential']; /** The credential subject containing account-based statements */ credentialSubject: { /** The account credential identifier as a DID */ id: DIDString; /** Statements about account attributes (should match request) */ statement: AtomicStatementV1[]; }; /** The zero-knowledge proof for attestation */ proof: ZKProofV4; /** The issuer of the ID credential used to open the account credential */ issuer: DIDString; }; /** * A verifiable credential based on an account credential on the Concordium blockchain. * This credential type contains zero-knowledge proofs about account credentials * and their associated identity attributes. */ export type Account = AccountCredential; /** * Union type representing all supported verifiable credential formats * in Concordium verifiable presentations. * * The structure is reminiscent of a w3c verifiable credential */ type Credential = IdentityCredential | AccountCredential; /** * Union type representing all supported verifiable credential formats * in Concordium verifiable presentations. * * The structure is reminiscent of a w3c verifiable credential */ export type Type = Credential; export declare function isIdentityCredential(credential: Credential): credential is IdentityCredential; export declare function isAccountCredential(credential: Credential): credential is AccountCredential; /** * The public data needed to verify an account based verifiable credential. */ export type AccountVerificationMaterial = { /** Union tag */ type: 'account'; /** Issuer of the credential. */ issuer: number; /** Commitments for the ID attributes of the account */ commitments: Partial>; }; /** * The public data needed to verify an identity based verifiable credential. */ export type IdentityVerificationMaterial = CredentialsInputsIdentity; /** * Union type of all verification material types used for verification. * These inputs contain the public credential data needed to verify proofs. */ export type VerificationMaterial = AccountVerificationMaterial | IdentityVerificationMaterial; /** Contains the credential status and inputs required to verify a corresponding credential proof */ export type MetadataVerificationResult = { /** The credential status */ status: CredentialStatus; /** The public data required to verify a corresponding credential proof */ inputs: VerificationMaterial; }; /** * Verifies the public metadata of the {@linkcode VerifiableCredentialProof}. * * @param credential - The credential proof to verify metadata for * @param grpc - The {@linkcode ConcordiumGRPCClient} to use for querying * @param network - The target network * @param [blockHash] - The block to verify the proof at. If not specified, the last finalized block is used. * * @returns The corresponding verification material along with a credential status if successful. * @throws If credential metadata could not be successfully verified */ export declare function verifyMetadata(credential: VerifiableCredentialV1.Type, grpc: ConcordiumGRPCClient, network: Network, blockHash?: BlockHash.Type): Promise; export {};