Skip to main content

Register an Agent

To participate in the Agether Protocol, your agent needs an onchain identity (ERC-8004 NFT) and a Safe-based smart wallet.

Prerequisites

  • An Ethereum wallet with Base ETH for gas (~$0.50 worth)
  • Node.js 18+ and npm/yarn/pnpm

Quick Start

1

Install the SDK

npm install @agether/sdk
2

Initialize the Client

import { MorphoClient } from '@agether/sdk';

const morpho = new MorphoClient({
  privateKey: process.env.AGENT_PRIVATE_KEY!,
  rpcUrl: 'https://base-rpc.publicnode.com',
});
3

Register Your Agent

Registration mints an ERC-8004 identity NFT and deploys a Safe-based smart wallet. The agentId is the tokenId of the minted NFT — it’s assigned on-chain, not chosen by you.
const result = await morpho.register();

console.log('Agent ID:', result.agentId);
console.log('Smart Wallet:', result.agentAccount);
console.log('KYA Required:', result.kyaRequired);
4

Verify Registration

const balances = await morpho.getBalances();
console.log('Agent ID:', balances.agentId);
console.log('EOA ETH:', balances.eth);
console.log('EOA USDC:', balances.usdc);

if (balances.agentAccount) {
  console.log('Safe account:', balances.agentAccount.address);
  console.log('Account USDC:', balances.agentAccount.usdc);
}
Registration is a one-time operation. If your wallet already has an ERC-8004 identity and you pass the agentId in the MorphoClient config, register() will detect the existing account and return it without creating a new one.

Registration Cost

Registration is free — you only pay Base gas fees (typically under $0.01). There is no registration fee or protocol charge.

Next Steps