Zero-knowledge proof security toolkit for passwordless authentication and privacy-preserving verification
npm install identify-sdkZero-knowledge proof security toolkit for passwordless authentication and privacy-preserving verification.
``bash`
npm install identify-sdk
`javascript
const { init } = require('identify-sdk');
async function main() {
// Initialize the SDK
const client = await init();
// Generate authentication proof
const result = client.generateProof(
"user_password", // secret
2000, // birth year
{ targetYear: 2025, limitAge: 20 },
serverChallenge, // from server
saltHex // from server
);
// Send result.proof and result.hash to server for verification
console.log(result.proof, result.hash);
}
main();
`
Initialize the SDK and return a client.
Options:
- wasmPath - Custom path to identify.wasmprovingKeyPath
- - Custom path to user.pkconfig
- - Default configuration
Generate a ZKP authentication proof.
Parameters:
- secret - User's password/secretbirthYear
- - User's birth yearconfig
- - { targetYear, limitAge }challenge
- - Server-issued challenge (number)saltHex
- - Salt in hex format
Returns:
`javascript`
{
proof: "hex string",
hash: "commitment string",
binding: "binding string",
salt: "salt hex"
}
Generate an age-only verification proof.
TypeScript types are included:
`typescript`
import { init, Config, ProofResult } from 'identify-sdk';
Use the Go SDK for server-side verification:
`bash`
go get github.com/ghdehrl12345/identify_sdk@latest
`go
import "github.com/ghdehrl12345/identify_sdk/auth"
verifier, _ := auth.NewVerifier()
ok, _ := verifier.VerifyLogin(proofBytes, commitment, salt, challenge)
``
MIT