@keyringnetwork/circuits
v4.1.0
Published
TypeScript SDK for interacting with Keyring zero-knowledge circuits. Provides high-level APIs for proof generation, verification, and cryptographic operations.
Keywords
Readme
@keyringnetwork/circuits
TypeScript SDK for interacting with Keyring zero-knowledge circuits. Provides high-level APIs for proof generation, verification, and cryptographic operations.
Overview
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
Installation
npm install @keyringnetwork/circuits
# or
pnpm add @keyringnetwork/circuitsConfiguration
The SDK requires initialization with cryptographic backends:
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
});Testing
# Run all tests
pnpm test
Development
Building
# Build the package
pnpm build
# Watch mode for development
pnpm devRequirements
- Node.js >= 22.0.0
- TypeScript >= 5.0.0
Browser Support
The SDK supports modern browsers with WebAssembly and BigInt support. For older browsers, polyfills may be required.
