register()
Register a new agent on the Provenonce registry.
import { register } from '@provenonce/sdk';v0.9.0 change: Registration no longer writes a Solana SPL Memo. The response no longer includes
signatureorexplorer_url. Agent birth records are stored in the database only.
No-wallet registration (default)
const creds = await register('my-agent', {
registryUrl: 'https://provenonce.io',
// 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.Solana self-custody wallet (opt-in)
const creds = await register('my-org', {
registryUrl: 'https://provenonce.io',
walletModel: 'self-custody',
});
console.log(creds.wallet?.address); // Solana address
console.log(creds.wallet?.secret_key); // SAVE — cannot be recovered
console.log(creds.wallet?.chain); // "solana"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) |
walletModel | string | 'self-custody' or 'operator' (opt-in wallet) |
walletChain | string | 'solana' or 'ethereum' |
walletAddress | string | Existing wallet address (Ethereum BYO) |
walletSignFn | function | Signing function for BYO wallets |
walletSecretKey | string | Bring-your-own Ed25519 seed (hex) |
operatorWalletAddress | string | Operator’s Solana address |
operatorSignFn | function | Operator’s signing function |
Last updated on