Skip to main content

Trust Network

WalletSdk.trust exposes WalletTrust — the wallet-side client for the Trust Network. It answers two questions during wallet flows:

  • Issuance: is this issuer a trusted member for the offered credential type?
  • Presentation: is this verifier a trusted member, and will it accept a credential from this issuer?

It also serves branding (names, logos, policy links) that the SDK threads into prompts so your consent UI can show who the user is dealing with.

final trust = sdk.trust;
trust.issuer; // WalletIssuerTrust
trust.verifier; // WalletVerifierTrust

Enforcement modes​

Behavior follows the TrustNetworkMode returned by your trustNetworkModeProvider (see Configuration):

ModeIssuancePresentation
offNo checks; branding lookups return nullNo checks
warnConsent prompt shows an untrusted-issuer warningVerifierTrustPrompt asks the user to proceed or abort
strictFlow blocked for untrusted issuersFlow aborted without a prompt (VerifierTrustCheckResult.isStrictBlock)

The provider is consulted at decision points, so a settings toggle takes effect immediately.

Issuer trust — sdk.trust.issuer​

The checks themselves run automatically inside acceptOffer. Use the public methods for custom UI:

// Trust-network member id for an issuer DID.
final memberId = await sdk.trust.issuer.getMemberIdByDid(issuerDid);

// Issuer branding for a credential type (null when trust mode is off
// or the issuer is not a member).
final branding = await sdk.trust.issuer.loadIssuerMemberBranding(
issuerDid: issuerDid,
credentialType: 'VerifiedPerson',
);
// branding: memberId, name, logo, website, privacyPolicy, termsOfService

// Card artwork / display config for a credential type.
final display = await sdk.trust.issuer.getCredentialTypePresentation(
issuerDid: issuerDid,
credentialType: 'VerifiedPerson',
);
// display: name, backgroundImage, logoUrl

// Which issuers a given verifier accepts for a credential type
// (e.g. "get this credential from..." UI).
final issuers = await sdk.trust.issuer.listIssuersForVerifierAndCredentialType(
verifierMemberId: verifierMemberId,
credentialType: 'VerifiedPerson',
);
if (issuers.isTrustNetworkEnabled) {
for (final item in issuers.issuers) {
print('${item.name} — ${item.website}');
}
}

// Resolve a relative asset path from the trust network into an absolute URL.
final logoUrl = sdk.trust.issuer.resolveAssetUrl(relativeLogoPath);

WalletIssuerTrust also implements the IssuerTrustEvaluator port (validateOfferEndpoints, evaluateIssuedCredential) used internally by the issuance flow.

Verifier trust — sdk.trust.verifier​

Verifier checks run automatically inside handleLink / present. Public methods:

// Explicit trust check against a presentation definition.
final check = await sdk.trust.verifier.checkVerifierTrust(
verifierMemberId: verifierMemberId,
presentationDefinition: definition,
);
// check: isTrusted, errorMessage, isStrictBlock, trustNetworkMode

// Verifier branding for presentation screens.
final branding = await sdk.trust.verifier.loadVerifierBranding(
verifierDisplayNameFallback: fallbackName,
presentationDefinitionUri: definitionUri,
originalPresentationUrl: originalUrl,
);

// Why a specific credential is not acceptable to a verifier
// (diagnostic message; null when trust mode is off).
final reason = await sdk.trust.verifier.explainCredentialNotAcceptableByVerifier(
issuerMemberId: issuerMemberId,
credentialType: 'VerifiedPerson',
verifierMemberId: verifierMemberId,
);

// Raw member record.
final member = await sdk.trust.verifier.getMemberById(memberId);

For OpenID4VP intake, prepareOpenId4VpTrust and validateVerifierEndpoints build and validate the trust context — handleLink calls these for you.

VerifierTrustCheckResult​

FieldDescription
isTrustedTrust verdict
errorMessageDiagnostic reason when untrusted
isStrictBlocktrue when strict mode requires aborting the flow
trustNetworkModeMode active when the result was produced (trustModeOff / trustModeWarn / trustModeStrict getters)

Cache hygiene​

Trust-network responses are cached. Clear the cache when a user signs out so the next user starts clean:

await sdk.trust.clearCacheOnLogout();