diff --git a/README.md b/README.md index 13344f3e..675157e1 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ npm install @docknetwork/wallet-sdk-react-native **There are some scripts and additional dependencies required.** Please check our [examples](https://github.com/docknetwork/wallet-sdk/tree/master/examples) folder for detailed steps. -## React Native Example +## React Native example The following example will create a wallet and allow the user to add credentials to it, displaying the count of documents added to the wallet. Notice that all documents are accessible through the `documents` object. @@ -72,7 +72,7 @@ The [Truvera Documentation Portal](https://docs.truvera.io) aggregates documenta For more details you should read [the getting started guide](https://github.com/docknetwork/wallet-sdk/blob/master/docs/getting-started.md). -### Key Features +### Key features - [Biometric Plugin](https://github.com/docknetwork/wallet-sdk/blob/master/docs/biometric-plugin.md) - [Ecosystem Tools](https://github.com/docknetwork/wallet-sdk/blob/master/docs/ecosystem-tools.md) - [Cloud Wallet](https://github.com/docknetwork/wallet-sdk/blob/master/docs/cloud-wallet.md) diff --git a/docs/biometric-plugin.md b/docs/biometric-plugin.md index 7eaeb407..1a7a68b9 100644 --- a/docs/biometric-plugin.md +++ b/docs/biometric-plugin.md @@ -178,7 +178,7 @@ At the time of verification, the verifier can request the biometric check creden The biometric ID should not contain the user's actual biometric information. When enrolling a holder in the biometric service, it might be useful to issue an enrolment credential containing the biometric template, the generated biometric ID and any other needed information to identify a returning user. This credential can be verified to get the user's information before checking their biometric. By storing this information with the holder, it avoids the biometric service having to store that PII outside of the control of the holder. The holder should only share a biometric enrollment credential with the biometric service that issued it. -## TrustX Biometric Plugin +## TrustX biometric plugin The TrustX biometric plugin uses the TrustX API to perform biometric verification and implements the IDVProvider interface. diff --git a/docs/cloud-wallet.md b/docs/cloud-wallet.md index 0e1dda51..0d6a09e3 100644 --- a/docs/cloud-wallet.md +++ b/docs/cloud-wallet.md @@ -1,27 +1,27 @@ -# Cloud Wallet Documentation +# Cloud Wallet documentation -The Truvera Cloud Wallet provides SaaS hosted secure storage of a user's identity data. The contents of an individual cloud wallet are accessed through a wallet application. The Cloud Wallet APIs support synchronization between the cloud storage and local storage of a wallet application. In addition to standard mobile or web wallet applications, the Cloud Wallet also allows credentials to be used in existing web sites through embedded widgets. The Cloud Wallet is especially useful for non-human identity use cases, such as organizational identity wallets and wallets for AI agents. +The Truvera Cloud Wallet provides SaaS hosted secure storage of a user's identity data. The contents of an individual cloud wallet are accessed through a wallet application. The Truvera Cloud Wallet APIs support synchronization between the cloud storage and local storage of a wallet application. In addition to standard mobile or web wallet applications, the Cloud Wallet also allows credentials to be used in existing web sites through embedded widgets. The Cloud Wallet is especially useful for non-human identity use cases, such as organizational identity wallets and wallets for AI agents. The implementation is in: `@docknetwork/wallet-sdk-core/src/cloud-wallet` -## Feature Overview +## Feature overview -The Truvera Cloud Wallet service hosts individual wallets for each user. The user's wallet stores encrypted documents that usually contain verifiable credentials. The service includes an [Encrypted Data Vault (EDV)](https://digitalbazaar.github.io/encrypted-data-vaults/) to securely store, sync, and manage documents. The Truvera Platform includes an EDV instance that can be used as part of a Truvera solution, but you can also deploy an EDV instance within your infrastructure if you prefer to host the encrypted user data. In most solutions, documents should be encrypted by the wallet application before being stored in the cloud wallet so that it cannot be read by the organization hosting the EDV. +The Truvera Cloud Wallet service hosts individual wallets for each user. The user's wallet stores encrypted documents that usually contain verifiable credentials. The service includes an [Encrypted Data Vault (EDV)](https://digitalbazaar.github.io/encrypted-data-vaults/) to securely store, sync, and manage documents. The Truvera Platform includes an EDV instance that can be used as part of a Truvera solution, but you can also deploy an EDV instance within your infrastructure if you prefer to host the encrypted user data. In most solutions, documents should be encrypted by the wallet application before being stored in a cloud wallet so that it cannot be read by the organization hosting the EDV. -Once initialized, the Cloud Wallet automatically synchronizes documents between the EDV and the wallet application, allowing you to add, update, and remove credentials without dealing with the synchronization logic. +Once initialized, the Cloud Wallet service automatically synchronizes documents between the EDV and the wallet application, allowing you to add, update, and remove credentials without dealing with the synchronization logic. Each holder's individual cloud wallet is accessed using a key in the holder's possession. This key can be stored in the local storage of a wallet application, or derived from a biometric of the holder's. A recovery mnemonic can be used to recover a lost master key. -## Usage Example +## Usage example The example below demonstrates how to initialize and use the Cloud Wallet for managing documents. -### Step 1: Initialize the Data Store +### Step 1: Initialize the data store First, you need to create local data storage to connect to the credential wallet. -#### For Mobile and Node.js +#### For mobile and Node.js ```ts import {createDataStore} from '@docknetwork/wallet-sdk-data-store-typeorm/lib'; @@ -33,7 +33,7 @@ const dataStore = await createDataStore({ }); ``` -#### For Browser +#### For browser ```ts import {createDataStore} from '@docknetwork/wallet-sdk-data-store-web/lib'; @@ -44,9 +44,9 @@ const dataStore = await createDataStore({ }); ``` -### Step 2: Generate Wallet Key and Mnemonic +### Step 2: Generate wallet key and mnemonic -Next, we generate a key and mnemonic for interacting with the cloud wallet. Use the same Cloud Wallet key across multiple devices to access the same documents. These keys are used to encrypt, decrypt, and locate documents in the EDV. +Next, we generate a key and mnemonic for interacting with a cloud wallet. Use the same cloud wallet key across multiple devices to access the same documents. These keys are used to encrypt, decrypt, and locate documents in the EDV. ```ts import {generateCloudWalletMasterKey} from '@docknetwork/wallet-sdk-core/lib/cloud-wallet'; @@ -85,7 +85,7 @@ await pullDocuments(); The `pullDocuments` function synchronizes the EDV and the wallet by comparing documents and updating the data store accordingly. Documents can be credentials or messages. -### Step 4: Create a New Wallet +### Step 4: Create a new wallet Now, create a credential wallet inside of the data storage. This will allow you to add, update, and remove documents. @@ -97,7 +97,7 @@ const wallet = await createWallet({ }); ``` -### Step 5: Add a Document to the Wallet +### Step 5: Add a document to the wallet You can add a document to the wallet using the following code: @@ -111,15 +111,15 @@ const document = { await wallet.addDocument(document); ``` -### Issuing Credentials to Cloud Wallet +### Issuing credentials to a cloud wallet You can issue credentials directly to a cloud wallet using the Truvera Workspace or the Truvera API. The credential will be automatically distributed to the holder's cloud wallet through the DIDComm protocol, eliminating the need for direct API calls or manual credential handling. -#### Important Requirement +#### Important requirement For the DIDComm automatic distribution to work properly, the **subject ID of the credential must be set to the holder's DID** when issuing the credential. This enables the system to route the credential to the correct wallet. -#### Receiving Credentials in Cloud Wallet +#### Receiving credentials in a cloud wallet After a credential has been issued to a holder's DID, the cloud wallet only needs to fetch and process DIDComm messages to receive it: @@ -139,7 +139,7 @@ await messageProvider.fetchMessages(); await messageProvider.processDIDCommMessages(); ``` -### Full Example +### Full example ```ts import {createDataStore} from '@docknetwork/wallet-sdk-data-store-web/lib'; @@ -182,17 +182,17 @@ example(); ``` -## Multi-Key Authentication +## Multi-key authentication -The Cloud Wallet supports multiple authentication methods to unlock the same wallet, providing both security and convenience. +The Truvera Cloud Wallet supports multiple authentication methods to unlock the same wallet, providing both security and convenience. -### Available Authentication Methods +### Available authentication methods 1. **Mnemonic-based authentication**: The traditional recovery phrase approach 2. **Biometric authentication**: Using fingerprints, facial recognition, or other biometric data 3. **Future extensions**: Can be extended to support passkeys and other authentication methods -### How Multi-Key Authentication Works +### How multi-key authentication works The Cloud Wallet uses a key mapping system that allows a secondary key (e.g. derived from biometrics) to unlock the same master key that was originally derived from a mnemonic phrase. @@ -204,7 +204,7 @@ We will provide an example of how this two-vault architecture can be used to all Note that the biometric sample used to authenticate to a cloud wallet could also be provided to a [biometric service](https://github.com/docknetwork/wallet-sdk/blob/master/docs/biometric-plugin.md) in order to issue a new biometric check credential as described in [biometric bound credentials](https://docs.truvera.io/solutions/biometric-bound-credentials). -#### Step 1: Enroll User with Biometric Data +#### Step 1: Enroll user with biometric data To set up biometric authentication, enroll the user with their biometric data and identifier: @@ -233,7 +233,7 @@ The enrollment process: In this example, the user email address is provided as a unique identifier to look up the biometric template for highly secure one-to-one biometric matching. The identifier is not shared with issuers or verifiers and any identifier may be used so long as it is convenient for the holder to remember. Phone numbers are another common choice. Biometric solutions that support one-to-n matching might be sufficient for many scenarios and would allow the user to avoid having to remember and provide an identifier. If you use an identifier, remember to verify that the user is actually in control of the identifier or an attacker could register the identifier and prevent the legitimate holder from accessing the service. -#### Step 2: Authenticate with Biometrics +#### Step 2: Authenticate with biometrics Next, when the user wants to access their wallet, they can authenticate with their biometric data: @@ -271,7 +271,7 @@ The authentication process: 4. Decrypts the master key 5. Uses the master key to access the CloudWalletVault -### Wallet Recovery +### Wallet recovery This architecture allows solution developers to design the recovery mechanism that makes sense for your use case. @@ -282,7 +282,7 @@ Alternatively, one or more recovery keys can be stored in the KeyMappingVault. A If a biometrically derived key can no longer be generated, then a recovery key should be used to enroll a new biometric. Any biometric-bound credentials will need to be reissued with the new biometric. -## Organizational Wallets +## Organizational wallets Verifiable credentials can help automate many processes that include organization identity, such as credit worthiness or Know-Your-Business (KYB) checks. Organization information that originates with a third party and then must be privately shared with a relying party is well suited to verifiable credentials. diff --git a/docs/ecosystem-tools.md b/docs/ecosystem-tools.md index 8a0bd39a..ecff1089 100644 --- a/docs/ecosystem-tools.md +++ b/docs/ecosystem-tools.md @@ -7,7 +7,7 @@ The functions of an ecosystem are further described in [the Ecosystem Tools sect The Truvera Wallet SDK implementation of ecosystem tools is in: [packages/core/src/ecosystem-tools.ts](https://github.com/docknetwork/wallet-sdk/blob/5dfbcb197b848802478d2f7a697286a8c3c28823/packages/core/src/ecosystem-tools.ts#L4) -## Usage Example +## Usage example Below is an example demonstrating how to use getEcosystems to retrieve ecosystem information based on an issuer's DID. @@ -30,7 +30,7 @@ async function fetchEcosystemDetails() { fetchEcosystemDetails(); ``` -## Expected Output +## Expected output When you run the above code, you should expect output similar to this: @@ -46,7 +46,7 @@ When you run the above code, you should expect output similar to this: This JSON output contains the details of the ecosystems associated with the given issuerDID. -## Integration Tests +## Integration tests For more examples and usage, please refer to the integration test at: https://github.com/docknetwork/wallet-sdk/blob/master/integration-tests/ecosystem-tools.test.ts diff --git a/docs/getting-started.md b/docs/getting-started.md index 681e0e49..f6755461 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -1,4 +1,4 @@ -# Getting Started with the Truvera Wallet SDK +# Getting started with the Truvera Wallet SDK This guide walks you through the process of setting up the Truvera Wallet SDK, creating a wallet, managing decentralized identifiers (DIDs), adding credentials, and verifying them. @@ -12,9 +12,9 @@ npm install @docknetwork/wallet-sdk-core @docknetwork/wallet-sdk-data-store-type The `@docknetwork/wallet-sdk-core` provides the core wallet functionality, while `@docknetwork/wallet-sdk-data-store-typeorm` handles data persistence using a local SQLite database. -## Usage Example +## Usage example -### 1. Initialize the Data Store +### 1. Initialize the data store Before creating a wallet, you need to set up a data store to manage the persistence of wallet data such as DIDs and credentials. Here’s how to create a local data store: @@ -32,7 +32,7 @@ This code initializes an SQLite database to store wallet data locally on the dev If you want to store data in the Truvera Cloud Wallet, please refer to the [Cloud Wallet Documentation](cloud-wallet.md) for detailed instructions and configuration options. -### 2. Create a New Wallet +### 2. Create a new wallet Once the data store is set up, you can create a wallet. The wallet will act as a container for managing your documents, DIDs, and credentials. @@ -62,7 +62,7 @@ console.log(defaultDID); // Example output: did:key:z6MkrcDhePAr5J44Htf6CLSQpZFUGGec4kPVVmERaY9Seijw ``` -### 4. Add a Credential to the Wallet +### 4. Add a credential to the wallet Once you have a wallet and a DID, you can start managing credentials. In this example, you will import a credential from a URL into the wallet. @@ -87,7 +87,7 @@ console.log(credentials); In this example, the credential is fetched from a specified URI and imported into the wallet. The `getAuthCode` function is used to handle any authentication, such as providing a password if required. -### 5. Verify a Credential +### 5. Verify a credential The Truvera Wallet SDK provides built-in functionality for verifying credentials. This is especially useful when interacting with third parties who need to verify your credentials. The verification controller manages this process. Below is an example of how to start a verification, select which credentials to reveal, create a presentation, and submit it for verification. diff --git a/docs/index.md b/docs/index.md index 2b46b66a..ebe6349d 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,4 +1,4 @@ -# Truvera Wallet SDK Documentation +# Truvera Wallet SDK documentation - [@docknetwork/wallet-sdk-core](./api/core.md) - [@docknetwork/wallet-sdk-wasm](./api/wasm.md) diff --git a/docs/other-topics.md b/docs/other-topics.md index 956add19..5bda177f 100644 --- a/docs/other-topics.md +++ b/docs/other-topics.md @@ -1,4 +1,4 @@ -# Other Topics +# Other topics ## Using WebAssembly diff --git a/examples/nodejs-example/readme.md b/examples/nodejs-example/readme.md index 22651e47..931e240c 100644 --- a/examples/nodejs-example/readme.md +++ b/examples/nodejs-example/readme.md @@ -1,4 +1,4 @@ -# Wallet SDK NodeJS Example +# Wallet SDK NodeJS examples This example illustrates how to install the Truvera Wallet SDK in a Node.js application. ## Installation steps @@ -7,12 +7,12 @@ This example illustrates how to install the Truvera Wallet SDK in a Node.js appl npm install ``` -## OID4VC Example +## OID4VC example In this example, we will show how to use OID4VC to import credentials and then list them using the Wallet SDK. You can read more about OID4VC in [our docs](https://docs.dock.io/developer-documentation/key-standards/interoperability-with-openid/openid-issuance-and-verification-integration-guide) -### Step 1: Generate an OpenID Issuer and Credential Offer +### Step 1: Generate an OpenID issuer and credential offer To get started, define your environment variables to access the Truvera API: @@ -39,7 +39,7 @@ OID4VC offer undefined was created. Copy your OID4VC URL: openid-credential-offer://?credential_offer=%7B%...... ``` -### Step 2: Import the Credential into the Wallet +### Step 2: Import the credential into the wallet Now that you have an OID4VC URL, you can import it into the wallet using the Wallet SDK. @@ -59,12 +59,15 @@ npm run oid4vc-example The example above creates an instance of the Wallet SDK, imports the credential into the wallet, and then logs the list of credentials available in the user database. Note that the imported credential is stored locally on the device, and in this Node.js example, it uses SQLite for storage. -## Verification Example +## Verification example -In this example, we will show how to use the SDK to verify a credential. +We provide two examples for credential verification using the SDK. ``` bash -npm run oid4vc-example +npm run verification-submission-example +``` +``` bash +npm run verification-evaluation-example ```