register()
Register a new agent on the Provenonce registry.
import { register } from '@provenonce/sdk';v0.9.0 change:
signatureandexplorer_urlremoved from the registration response. (Note: lightweight birth memos were restored in v0.10.1 per D-94. Registration now writes a ~120-byte SPL Memo to Solana. The response includesbirth_tx.)
No-wallet registration (default)
const creds = await register('my-agent', {
registryUrl: 'https://provenonce.io',
metadata: {
version: '1.0',
purpose: 'data-pipeline',
framework: 'langchain',
},
// registrationSecret: 'xxx', // Required on mainnet, optional on devnet
});
console.log(creds.hash); // Agent identity
console.log(creds.api_key); // For API calls
// No wallet — identity only. Agent is registered and verifiable.Ethereum bring-your-own wallet
import { ethers } from 'ethers';
const wallet = new ethers.Wallet('<your-private-key>');
const creds = await register('my-org', {
registryUrl: 'https://provenonce.io',
walletChain: 'ethereum',
walletAddress: wallet.address,
walletSignFn: (msg) => wallet.signMessage(msg),
});
console.log(creds.wallet?.address); // Ethereum address
console.log(creds.wallet?.chain); // "ethereum"Operator wallet (Model B)
const creds = await register('my-agent', {
registryUrl: 'https://provenonce.io',
walletModel: 'operator',
operatorWalletAddress: 'BASE58_ADDRESS',
operatorSignFn: async (message) => {
// Sign `message` with your Solana keypair and return hex-encoded signature
const signature = nacl.sign.detached(Buffer.from(message), yourKeypair.secretKey);
return Buffer.from(signature).toString('hex');
},
});Child registration
const childCreds = await register('child-agent', {
registryUrl: 'https://provenonce.io',
parentHash: parentCreds.hash,
parentApiKey: parentCreds.api_key,
});Options
| Property | Type | Description |
|---|---|---|
registryUrl | string | Registry URL |
parentHash | string | Parent hash (child registration) |
parentApiKey | string | Parent’s API key (child registration) |
registrationSecret | string | Registration gate (mainnet) |
registrationToken | string | Self-service registration token (from POST /api/v1/register/token) |
registrationInvite | string | Invite code (alternative to secret/token) |
metadata | Record<string, unknown> | Optional freeform JSON object (max 4KB). Stored with agent record, returned in /verify and /status. |
walletModel | string | 'operator' (opt-in operator wallet) |
walletChain | string | 'solana' or 'ethereum' |
walletAddress | string | Existing wallet address (Ethereum BYO) |
walletSignFn | function | Signing function for BYO wallets |
walletSecretKey | Removed in v0.14.0. Self-custody (Model A) no longer supported. Use walletModel: 'operator' instead. | |
operatorWalletAddress | string | Operator’s Solana address |
operatorSignFn | function | Operator’s signing function |
Last updated on