Integrate on chain KYC dev guide
You want your app to gate an action behind proof of a KYC credential, verified without your app ever seeing the underlying personal data.
Who this is for: developers adding a KYC-gated flow (an allowlist, a mint, a transfer) to a Lumia app. Prerequisites: Networks & Endpoints; KYC (concept) if you haven't already read what KYC means in Lumia's compliance model.
How it works
The verifier flow is a two-call REST handshake, documented in full at /reference/rest-apis/kyc-verifier-api. This page walks through using it; that page is the endpoint table.
Your backend calls
POST /sign-inon the verifier, scoped to the network you're checking against.The response includes a
qrCodeand asessionID. Your frontend renders the QR code; the user scans it with their credential wallet.Your backend polls
GET /status?sessionID=...until it returns a terminal status (success/approved, orfailed).Only once status is successful does your app grant the gated action.
Steps
Pick the network you're scoping the check to
Use its confirmed chain ID from /reference/networks.
Do not use 1952959480: that's a retired network some older examples label "Lumia Testnet," and it is not Beam.
Start a session
const res = await fetch("https://verifier-backend.privado.id/sign-in", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
chainID: "2030232745", // Beam, see /reference/networks; do not use 1952959480
scope: [
{
circuitId: "<your circuit ID>", // from your verifier/circuit configuration
id: 1,
query: {
allowedIssuers: ["*"], // restrict this for a production check
context: "<your query context>",
type: "<your credential type>",
credentialSubject: {},
},
},
],
skipClaimRevocationCheck: false,
}),
});
const { qrCode, sessionID } = await res.json();Render the QR code
Render qrCode for the user to scan with their credential wallet.
Poll for status
async function pollStatus(sessionID) {
const res = await fetch(`https://verifier-backend.privado.id/status?sessionID=${sessionID}`);
const { status } = await res.json();
return status; // "success" / "approved" / "failed" / a pending state; see /reference/rest-apis/kyc-verifier-api
}Grant the gated action
On a successful status, grant the gated action in your app/contract logic.
Verify it worked
Run the flow end to end with a test credential wallet: confirm /sign-in returns a scannable QR and a sessionID, that scanning it changes /status from pending to success/approved, and that your app's gated action becomes available only after that.
Troubleshooting
Last updated
Was this helpful?