provnzero-sdk
v1.1.0-beta.1
Published
ProvnZero ZDR Client SDK - X25519 + AES-256-GCM
Readme
ProvnZero SDK (TypeScript)
The TypeScript/Node.js SDK for the ProvnZero proxy. It handles HPKE sealing, key exchange, and VEX receipt parsing.
Features
- Standard HPKE: Implements HPKE Base mode via
@noble. - Async API: Clean Promise-based interface.
- Zero-Dependency Core: Lightweight footprint.
- Client-Side Sealing: Manages ephemeral keypairs and session isolation automatically.
Installation
npm install provnzero-sdkBasic Usage
import { ProvnZeroClient } from 'provnzero-sdk';
const client = new ProvnZeroClient('http://localhost:3001');
async function askSecurely() {
try {
const response = await client.send({
prompt: "What is the capital of France?",
provider: "openai"
});
console.log("AI Response:", response.text);
console.log("VEX Receipt:", response.receipt);
} catch (err) {
console.error("Secure call failed:", err);
}
}
askSecurely();Security
The SDK performs client-side sealing before the prompt ever leaves your memory.
- It requests the server's public key.
- It generates a fresh ephemeral keypair.
- It performs HPKE
setup_senderto derive a secret key. - It seals the prompt using AES-256-GCM.
- Only the ciphertext and encapsulated key are sent to the proxy.
Development
# Install dependencies
npm install
# Build the SDK
npm run build
# Run tests
npm testLicense
Apache 2.0
