Wallets
Our Wallet API was created for any use case that requires a self-sovereign identity wallet in the cloud. This might include cases where the subject of the wallet is not the holder of the wallet. For example, pets or IoT devices.
In some cases, users may not have the ability to maintain a mobile wallet on their phone, and instead it would be more useful to have the wallet hosted on a server.
Here are some useful resources to get started:
Authentication
To begin using the Wallet API, an organization will need to be created on Trinsic Studio and that access token and subscription key should be included in the headers of each API call.
Create a Wallet
POST /api/wallets
To begin using the Wallet API, first you'll need to create a new custodian wallet. This wallet is hosted on the Trinsic Agency, and will be associated with whichever organization's accessToken was used to create the wallet.
API Reference
Parameters
You can specify the following optional parameters.
ownerName
[string] - The name of the wallet. This should be a human readable alias that will be displayed as the name of wallet with new connections.
Response
Creating a wallet responds with a WalletContract object:
walletId
[string] - The GUID that represents the wallet internally
Accept an Invitation
POST /api/{walletId}/connections/invitation
Once your wallet has been created, you can use your wallet to accept connection invitations and begin receiving credentials.
To accept an invitation, simply input the base64 escaped invitation data and the wallet ID. This invitation data is formatted according to the Aries Connection Protocol.
API Reference
Parameters
You can specify the following optional parameters.
walletId
[string] - The id of the wallet. Can be found in the response body of the Create Wallet or List Wallets endpoints.invitation
[string] - The invitation data as a base64 encoded json string. Trinsic Studio or Credentials API can create invitations to test out making a connection.
Response
The response body will include a ConnectionContract:
List Credentials
GET /api/{walletId}/credentials
Any credentials that have been sent to the wallet can be listed with this endpoint.
The credentialId
and state
of the credential can be discovered here.
Response
Accept a Credential Offer
POST /api/{walletId}/credentials/{credentialId}
Any of the credentials in state "Offered" are ready to be accepted. Once a credential is accepted it will be issued directly to the wallet.
Parameters
You must specify the following parameters.
walletId
[string] - The id of the wallet. Can be found in the response body of the Create Wallet or List Wallets endpoints.credentialId
[string] - The id of the credential that has been sent to the wallet. Can be found with the List Credentials endpoint.
API Reference
List Verifications for Connection
GET /api/{walletId}/verifications/connection/{connectionId}
Whenever an organization has sent a verification request to a custodian wallet, there is a three step process for the custody wallet to respond to the verification request. The first step is to list the verifications that have been sent to the wallet. The connectionId should be included in this request. This can be found in the List Connections endpoint.
Response
Respond to a Verification Request Automatically
PUT /api/{walletId}/verifications/{verificationId}/autoSelect
The last step is to respond to a verification request with the correct credentials. Each verification includes a list of requested attributes and a list of restrictions for which credentials will be accepted.
To respond easily, an automatic selection endpoint will choose the first credential that matches the verification policies. If there are no credentials that match, the verification will be sent back with an empty response for that attribute.
Parameters
You must specify the following parameters.
walletId
[string] - The id of the wallet. Can be found in the response body of the Create Wallet or List Wallets endpoints.verificationId
[string] - The id of the verification that has been sent to the wallet. Can be found with the List Verifications endpoint.
API Reference
Get a List of Available Credentials
GET /api/{walletId}/verifications/{verificationId}/availableCredentials
If the selection process needs to be more specific, use this endpoint to discover the available credentials that fulfill the requirements of the verification request.
Response
Respond to Verification Request with Specific Credentials
PUT /api/{walletId}/verifications/{verificationId}
Once the available credentials have been listed, use the response to select which credentials should be sent along with the verification response.
Request Paramaters
walletId
verificationId
body
: