Share an encrypted credential
Once you have an encrypted message containing the credential in a format that a wallet can make sense of, you need to make it available to the holder. This can be achieved in different methods:
Share via message: Use secure DID messaging to the wallet, which would generate a wallet push notification for the holder to accept the new credential.
Share via QR code/Deeplink: Host the message and reference in a QR code/Deeplink.
The credential is sent directly to the wallet and will not require the user to go to a website or perform any action other than accepting the new credential.
Share via message
You can use the MATTR VII platform messaging endpoint to send the credential as a message to the holder. If they have enabled notifications on their wallet, they will receive a push notification, and if they haven't they will be alerted the next time they open the app.
Request
Make the following request to send the encrypted message:
1POST https://YOUR_TENANT_URL/v1/messaging/send
1{
2 "to": "{SUBJECT_DID}",
3 "message": {MESSAGE_ENCRYPTED.jwe }}
4}
to
: Use your Subject DID. In production environments you must have a secure way to obtain it:Use DID Auth for any new interactions.
Ask the user to share their wallet DID (MATTR Showcase wallet or MATTR GO users can do this by navigating to Settings > Advanced > Public DID).
Request an existing credential as part of a verification workflow, and extract the DID from that interaction.
message
: Use the JWE object from the encrypted message.
Response
A 200
response indicates that the message payload was sent to the service endpoint of the dereferenced DID Document (or the default MATTR service endpoint).
On the holder's mobile device, they should see a notification message appear. Tapping on the message would require authenticating using biometrics or PIN number. The app should then navigate to the credential offer screen, where they can view and accept the credential.
Share via QR code or Deeplink
The MATTR Showcase Wallet will follow valid 302
redirects to online resources. This allows making the encrypted message available to wallet holders and construct a URL that can be included in a QR code or deeplink.
Make the following request to base64url
encode the JWE
object from the encrypted message to make it URL safe:
1https://YOUR_HOST_PROVIDER.com?request={{base64url(jwe)}}
Now create a redirect to the hosted encoded response:
1Redirect Content
2redirectid=1234567. request=ewogICAgInByb3RlY3RlZCI6ICJleUpoYkdjaU9pSllRekl3VUNKOSIsCiAgICAicmVjaXBpZW50cyI6IFsKICAgICAgewogICAgICAgICJoZWFkZXIiOiB7CiAgICAgICAgICAiYWxnIjogIkVDREgtMVBVK0EyNTZLVyIsCiAgICAgICAgICAia2lkIjogImRpZDprZXk6ejZNa2Z4UVU3ZHk4ZUt4eUhwRz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08xNjBtdl95ZVluSU9JVW5RRU9HeGNXU0tWQ2lKbU1jWGFkeHRFV2syanFJdGJKaUR4b09XczRkMzRlYVdlYlZ5b05PaGNhaW03VVpRcTB0RS1HcEZpOFNaWm1PbW5JeEwwbGdaWVlrdldINVdWWS1uN0JlNmM5S29NWXZRVkZRNjlFbmRjcVMwekxWNnVuVjBhWi0zQ1RYVTFDdmZTS1oxb2JzRW96RTFlbFlaYXdLaUFVWFFFb2UyaGhTbWQ2M2IzUVNiZHVMRFBzPSIsCiAgICAiaXYiOiAiUUtUcTk5WTlOam5XSUR2VTFYbGRQMjNqNWVxWGFtcmYiLAogICAgInRhZyI6ICJUWGZFY0Uxd0ZNT09qRTBHQ0NJN0JBPT0iCiAgfQ
Once the redirect is setup, you can share the message as either a QR code or a deep link.
QR code
Construct a URL of the following structure:
1didcomm://https://YOUR_HOST_PROVIDER.com?redirectid=1234567
Convert it to a QR code using any QR encoder such as QR Code Generator or QR Server.
When the holder opens the MATTR Showcase Wallet and scans this QR code, it will follow the redirect you have configured and navigate to the credential offer screen in the wallet, where they can view and accept the credential.
Deep link
Construct a URL of the following structure:
1didcomm://https://YOUR_HOST_PROVIDER.com?redirectid=1234567
Perform base64url
encoding:
1echo -n 'didcomm://https://YOUR_HOST_PROVIDER.com?redirectid=1234567' | base64url
Combine the encoded URL with the wallet bundle id to create a wallet deeplink:
1global.mattr.wallet://accept/ZGlkY29tbTovL2h0dHBzOi8vWU9VUl9IT1NUX1BST1ZJREVSLmNvbT9yZWRpcmVjdGlkPTEyMzQ1Njc
When the holder follows this URL from their device, it will open the MATTR Showcase Wallet, follow the configured redirect and navigate to the credential offer screen in the wallet, where they can view and accept the credential.