Enroll a user locally on-device
During the enrollment process, the user creates a credential directly on their own device. To maintain security, only a cryptographic commitment (a hash of the secret) is generated and stored/registered; the actual credential secret never leaves the user's device.
// On the user's device
const secret = generateCredential();
const commitment = poseidonHash(secret);
register({ commitment });