TypeScript SDK for interacting with Keyring zero-knowledge circuits. Provides high-level APIs for proof generation, verification, and cryptographic operations.
npm install @keyringnetwork/circuitsTypeScript SDK for interacting with Keyring zero-knowledge circuits. Provides high-level APIs for proof generation, verification, and cryptographic operations.
This package provides a comprehensive TypeScript SDK for the Keyring protocol, enabling:
- Circuit Integration: High-level APIs for RSA and Schnorr authorization circuits
- Cryptographic Operations: RSA, Schnorr, ElGamal, and elliptic curve cryptography
- Domain Objects: Structured data models for identities, policies, and authentication messages
- Proof Generation: End-to-end proof creation and verification workflows
- Utilities: Helper functions for common operations
``bash`
npm install @keyringnetwork/circuitsor
pnpm add @keyringnetwork/circuits
The SDK requires initialization with cryptographic backends:
`typescript
import { crypto } from '@keyringnetwork/circuits';
import { groth16 } from 'snarkjs';
import { poseidon, babyJub, eddsa } from '@iden3/js-crypto';
// Initialize SnarkJS backend
crypto.importSnarkJS({
prove: groth16.prove,
verify: groth16.verify,
// ... other methods
});
// Initialize elliptic curve crypto
crypto.importECCryptoSuite({
poseidon,
babyJub,
eddsa,
// ... other methods
});
`
`bashRun all tests
pnpm test
`
`bashBuild the package
pnpm build
- Node.js >= 22.0.0
- TypeScript >= 5.0.0
The SDK supports modern browsers with WebAssembly and BigInt support. For older browsers, polyfills may be required.