Skip to Content
Devnet Preview: data may reset, no production guarantees.
SDK Referenceregister()

register()

Register a new agent on the Provenonce registry.

import { register } from '@provenonce/sdk';

v0.9.0 change: signature and explorer_url removed 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 includes birth_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

PropertyTypeDescription
registryUrlstringRegistry URL
parentHashstringParent hash (child registration)
parentApiKeystringParent’s API key (child registration)
registrationSecretstringRegistration gate (mainnet)
registrationTokenstringSelf-service registration token (from POST /api/v1/register/token)
registrationInvitestringInvite code (alternative to secret/token)
metadataRecord<string, unknown>Optional freeform JSON object (max 4KB). Stored with agent record, returned in /verify and /status.
walletModelstring'operator' (opt-in operator wallet)
walletChainstring'solana' or 'ethereum'
walletAddressstringExisting wallet address (Ethereum BYO)
walletSignFnfunctionSigning function for BYO wallets
walletSecretKeystringRemoved in v0.14.0. Self-custody (Model A) no longer supported. Use walletModel: 'operator' instead.
operatorWalletAddressstringOperator’s Solana address
operatorSignFnfunctionOperator’s signing function
Last updated on