Skip to content

Start typing to search the documentation.

Verification Result

The VerificationResult type is the response returned by SelfBackendVerifier.verify() from @selfxyz/core. It contains the verification status, disclosed identity attributes, and user context data.

VerificationResult

type VerificationResult = {
  attestationId: AttestationId;
  isValidDetails: {
    isValid: boolean;
    isMinimumAgeValid: boolean;
    isOfacValid: boolean;
  };
  forbiddenCountriesList: string[];
  discloseOutput: GenericDiscloseOutput;
  userData: {
    userIdentifier: string;
    userDefinedData: string;
  };
};

Fields

FieldTypeDescription
attestationIdAttestationIdIdentifier for the attestation type (passport, national ID, etc.)
isValidDetails.isValidbooleanWhether the ZK proof verified successfully on-chain
isValidDetails.isMinimumAgeValidbooleanWhether the user meets the configured minimum age requirement
isValidDetails.isOfacValidbooleanWhether the user passed the OFAC sanctions check
forbiddenCountriesListstring[]Country codes unpacked from the proof’s public signals
discloseOutputGenericDiscloseOutputDisclosed identity attributes from the ZK circuit
userData.userIdentifierstringUser identifier extracted from the verification context
userData.userDefinedDatastringApplication-defined data passed through the verification flow

GenericDiscloseOutput

The disclosed identity attributes requested during verification. Only fields that were requested in the disclosure configuration will contain meaningful values.

type GenericDiscloseOutput = {
  nullifier: string;
  forbiddenCountriesListPacked: string[];
  issuingState: string;
  name: string;
  idNumber: string;
  nationality: string;
  dateOfBirth: string;
  gender: string;
  expiryDate: string;
  minimumAge: string;
  ofac: boolean[];
};

Fields

FieldTypeDescription
nullifierstringUnique nullifier derived from the proof (prevents double-use)
forbiddenCountriesListPackedstring[]Packed representation of forbidden countries from the circuit
issuingStatestringThree-letter code of the document’s issuing country
namestringFull name from the identity document
idNumberstringDocument number
nationalitystringThree-letter nationality code
dateOfBirthstringDate of birth
genderstringGender as recorded on the document
expiryDatestringDocument expiry date
minimumAgestringThe verified minimum age value
ofacboolean[]OFAC check results

VerificationConfig

The configuration passed to SelfBackendVerifier to specify what checks to perform.

type VerificationConfig = {
  minimumAge?: number;
  excludedCountries?: Country3LetterCode[];
  ofac?: boolean;
};
FieldTypeDescription
minimumAgenumber (optional)Minimum age requirement. Verification fails if the user is younger.
excludedCountriesCountry3LetterCode[] (optional)List of three-letter country codes to exclude
ofacboolean (optional)Whether to check the user against the OFAC sanctions list