VeilCore SDK
The VeilCore Software Development Kit (SDK) allows developers to interact with the VeilCore OS from client-side applications. It provides a TypeScript wrapper around the complex cryptographic functions needed to generate proofs and manage identities.
Installation
The SDK is available via the npm registry. It is compatible with both Node.js and browser environments.
Bash
npm install @veilcore/sdk @solana/web3.jsInitialization
To start interacting with the network, you must instantiate the VeilClient. This client manages the connection to the VeilNodes and the underlying Solana cluster.
TypeScript
import { VeilClient, NetworkType } from '@veilcore/sdk';
import { Connection } from '@solana/web3.js';
// Initialize Solana Connection
const solanaConnection = new Connection("https://api.devnet.solana.com");
// Initialize Veil Client
const client = new VeilClient({
network: NetworkType.Devnet,
connection: solanaConnection,
payer: userWallet // The wallet paying for transaction fees
});
await client.connect();Core Classes
AgentIdentity
This class manages the local key pairs and DID resolution.
create(): Generates a new random identity locally.load(privateKey): Loads an existing identity from a private key string.sign(message): Signs a payload using the ZK-friendly signature scheme.
Prover
This class handles the client-side generation of ZK-STARKs.
TypeScript
Last updated