The Verida Wallet supports zkPass verifiable credentials. This allows users to receive and store zkPass credentials as well as reply to proof requests in a privacy-preserving way thanks to zkPass technology.
Users can install the Verida Wallet to receive verifiable credentials from Issuers using the Zero Knowledge technology. These credentials are stored in your Vault (your private and secured storage space on the Verida Network) and therefore shown in the Verida Wallet alongside other credentials.
Verifiers can also send you zkPass proof requests. The Verida Wallet will automatically generate the Zero-Knowledge proof (ZKP) for you and send it to the Verifier. The Zero-Knowledge proof means no data is actually shared with the Verifier, only the fact that you have a valid credential satisfying the request.
const did = "..."; // Verida Did
// Get message object from verida context
const messaging = await context.getMessaging();
// setup a callback to show the response
await messaging.onMessage((data) => {
// This callback should be called once user shares credential
console.log('Received credentials: ', data);
});
const messageType = "inbox/type/dataRequest";
const config = {
did,
recipientContextName: "Verida: Vault",
};
const dataToSend = {
requestSchema: "https://common.schemas.verida.io/credential/base/v0.2.0/schema.json",
filter: {
$or: [
{ credentialSchema: "https://common.schemas.verida.io/credential/zkpass/v0.1.0/schema.json" }
]
},
userSelect: true,
};
// This is the DID the message will go to
const requestFromDID = did;
const messageSubject = "Please select your verifiable credential to verify",
const res = await messaging.send(
requestFromDID,
messageType,
dataToSend,
msg.messageSubject,
config
);
console.log("Request sent");
If you don't have credentials in your Verida Wallet, you can issue zkPass credential through the proof-connector. You need to provide veridaDid where generated credential will go to in the url. For example, the url can be like this:
import TransgateConnect from "@zkpass/transgate-js-sdk";
// You can create your own app in zkPass dashboard.
const ZKPASS_APP_ID = "bced693b-bedc-464c-8250-566743ff5855";
// The schema Id for Uber account ownership verification
const schemaId = "ef39adb26c88439591279e25e7856b61";
// Create the connector instance
const connector = new TransgateConnect(ZKPASS_APP_ID);
// Check if the TransGate extension is installed
// If it returns false, please prompt to install it from chrome web store
const isAvailable = await connector.isTransgateAvailable();
if (isAvailable) {
const res = await connector.launch(schemaId);
return res;
} else {
throw new Error("You need to install zkPass extension");
}
It will redirect you to the platform (For example: Binance) and once you click Start button in TransGate extension, the the process should start.
The proof-connector can verify a zero-knowledge proof generated from a zkPass credential stored in the user's Verida Wallet. More information is available in the zkPass Verification documentation.