Introduction

In the physical world, we as people have numerous ways of identifying ourselves (a passport, driving license or birth certificate for example). They are each used in different contexts, and can have different fields of information but they are share one defining characteristic, they are accepted as proof of identity and are called “physical credentials”.

We have exactly the same need in the digital world and for this reason, the concept of “verified credentials” were created. A Verified Credential (VC) is a way to represent a digital identity in a way that can be shared and verified by others. They can be digital representations of physical credentials (like a passport) or they can be entirely digital (like an email address).

Specific to Dynamic, verified credentials can map to things like oauth (i.e. Facebook and Google), email, blockchain wallets, passkeys and more (these are called “formats”). Each format has its own set of fields and information that can be shared. They also always have a “provider” which is the service that issued the credential (i.e. Google, Apple, Dynamic).

Accessing Verified Credentials

As you probably already read in the accessing users section, you can access verified credentials as part of the user profile, so once you have that it is as simple as accessing the verifiedCredentials array.

import { useDynamicContext } from '@dynamic-labs/sdk-react-core';

const { user } = useDynamicContext();

const verifiedCredentialsArray = user?.verifiedCredentials;

Verified Credential Structure

Fields Applicable to All VCs

FieldDescription
idInternal ID for this VC
format: JwtVerifiedCredentialFormatEnum[Optional] - Type of VC, e.g., email. See JwtVerifiedCredentialFormatEnum for more details.
publicIdentifier?[Optional] - Common way to reference the VC, e.g., email address for email VCs or the name of a user for Google VC.
email?[Optional] - Email associated with the VC.

Fields Specific to OAuth

FieldDescription
oauthProvider?[Optional] - Social provider associated with the VC, e.g., Apple. See ProviderEnum for more details.
oauthAccountId?[Optional] - ID associated with the social provider for the VC.
oauthDisplayName?[Optional] - Display name associated with the social provider for the VC.
oauthUsername?[Optional] - Username associated with the social provider for the VC.
oauthEmails?[Optional] - Emails associated with the social provider for the VC.
oauthAccountPhotos?[Optional] - Photos associated with the social provider for the VC.
refId?[Optional] - If using OAuth, this is the embedded wallet ID associated with the social account.
previousUsers?[Optional] - User IDs who were previously associated with the VC.

Fields Specific to Wallets

FieldDescription
walletName?[Optional] - Wallet name associated with the VC.
address?[Optional] - Wallet address associated with the VC.
chain?[Optional] - Chain associated with the VC.
walletProvider?[Optional] - Type of wallet. See WalletProviderEnum for more details.
walletProperties?[Optional] - Generally only used for embedded wallets with Turnkey. See WalletProperties for more details.
embeddedWalletId?[Optional] - ID of the embedded wallet associated with the VC.
nameService?[Optional] - ENS data name and avatar URL, if one is associated with the wallet in the VC. See NameServiceData for more details.
signerRefId?[Optional] - For smart contract wallets, this is the wallet ID of the signer for the SCW.

NameServiceData

FieldDescription
avatar?: string[Optional] - avatar associated with the ens
name?: string[Optional] - name associated with the ens

WalletProviderEnum

‘browserExtension’ || ‘custodialService’ || ‘walletConnect’ || ‘qrCode’ || ‘deepLink’ || ‘embeddedWallet’ || ‘smartContractWallet’

WalletProperties

FieldDescription
turnkeySubOrganizationId?: string[Optional] - turnkey sub organization ID associated with wallet
turnkeyHDWalletId?: string[Optional] - turnkey HD wallet ID associated with the the wallet
isAuthenticatorAttached?: boolean[Optional] - is authenticator i.e. passkey attached to the wallet

JwtVerifiedCredentialFormatEnum

‘blockchain’ || ‘email’ || ‘oauth’ || ‘passkey’

ProviderEnum

‘emailOnly’ || ‘magicLink’ || ‘apple’ || ‘bitbucket’ || ‘discord’ || ‘facebook’ || ‘github’ || ‘gitlab’ || ‘google’ || ‘instagram’ || ‘linkedin’ || ‘microsoft’ || ‘twitch’ || ‘twitter’ || ‘blocto’ || ‘banxa’ || ‘dynamic’ || ‘alchemy’ || ‘zerodev’ || ‘turnkey’