AgentIdentity plugin attached. @leash/registry-utils ships a thin wrapper around mintAndSubmitAgent that does both in one transaction via the hosted Metaplex API, so you don’t have to sequence two instructions yourself.
When to use this vs. BYO
| Flow | What you get | Use when |
|---|---|---|
createAgent | Core asset + Agent Identity + off-chain agentMetadata stored by api.metaplex.com — one signed tx | You’re starting from scratch and want the simplest path |
registerAgentIdentity (BYO) | Attaches an Agent Identity to an MPL Core asset you already own; you host the registration JSON yourself | You already minted the asset, or you need full custody of the registration document (Arweave, IPFS gateway, your own HTTPS host) |
AgentIdentityV1 PDA derived from the asset’s pubkey, with Listen lifecycle hooks on Transfer, Update, and Execute. The only difference is who hosts the registration JSON.
Pick who signs
createAgent doesn’t care how umi.identity is set up — only that it can sign. There are three common choices, all wire-compatible with the rest of the SDK:
| Signer | Where it lives | Use when |
|---|---|---|
| Privy embedded wallet | The user’s browser, recoverable via email / OAuth | You’re building a browser-first agent with a human user (the playground default) |
| BYO local keypair | A solana-keygen JSON file you back up yourself | Headless scripts, CI, long-lived agents whose owner key shouldn’t depend on a third party |
Server env var (LEASH_DEV_PAYER_SECRET_KEY) | Process memory on a Node server | Cron, internal tools, the playground’s headless POST /api/agents/create route |
mpl-core::Execute against the asset (withdraw, set delegation, set agent token, etc.). For the full mental model — owner vs. executive vs. operator — see Identities. For the non-Privy paths in detail, see Bring your own keypair.
SDK call
{ assetAddress, signature, network }. The signature is base58-encoded.
The wallet supplied via umi.identity pays for the transaction and becomes the agent owner. Match the Umi RPC to the network you pass.
Two-step (manual signing)
When you need priority fees, a hardware wallet, or a custom retry loop:@leash/registry-utils (setSpendDelegation, withdrawTreasury, delegateExecution, …) ships a matching prepare* function that returns an unsigned TransactionBuilder plus echo fields, so the same pattern works end-to-end. See Prepare/Send split for the full surface.
After minting
Once the transaction confirms, use the read helpers from the same package to verify the result:treasury field is the Asset Signer PDA — the agent’s built-in wallet. Anyone can derive it from the asset address; only the asset itself can sign for it via Core’s Execute instruction.
Run the agent
To let an off-chain executive signExecute instructions on the agent’s behalf you need two more on-chain calls:
Fund the agent (treasury delegation)
For real x402 calls the executive needs a capped SPL delegation on the agent treasury — that’s how funds debit from the agent (not from your personal wallet) on every settled call. One call:What “Supported trust” means
supportedTrust is the MIP-104 / ERC-8004 field where an agent declares which trust mechanisms back its claims. It’s an open string[], but the four common values are:
| Value | Meaning |
|---|---|
reputation | Community feedback / on-chain reputation. Trust by track record. |
crypto-economic | Bonded stake / slashing — misbehaviour costs the operator money. |
tee | Runs inside a Trusted Execution Environment with verifiable attestation. |
zk-proof | Publishes zero-knowledge proofs of correct execution. |
audit-firm-x, proof-of-humanity) when your trust story doesn’t fit the presets.
In the playground
The Next.js playground (apps/web) wraps all of this in a UI signed by your connected Privy wallet — there is no shared hot key:
/agents/new— Create Agent form, two tabs: 1 · Identity & metadata then 2 · Services & session.- Tab 1. Name, description, network, and a publicly fetchable JSON URL for the on-chain Core metadata URI (HTTPS, IPFS gateway, Arweave, etc.) — you host that JSON yourself.
- Tab 2. Service endpoints, supported trust models (checkboxes plus custom values — see “What ‘Supported trust’ means” above), optional behaviour rules, then Create agent. Minting runs
createAgentvia your Privy wallet; devnet/mainnet flows may also callprovisionTreasuryAtas. Executive registration, delegation, and spend caps happen on the agent profile — see Fund an agent.
/agents/[mint]→ Identity tab — resolves the on-chain registration URI from the AgentIdentity plugin./agents/[mint]→ Execute tab —registerExecutiveV1+delegateExecutionV1, same Privy wallet./agents/[mint]→ Token (Genesis) tab — paste the token image URL Metaplex accepts, then launch (see Launch an agent token).
NEXT_PUBLIC_PRIVY_APP_ID in apps/web/.env.local, log in via the wallet button (top-right), and fund your embedded wallet on devnet (solana airdrop 1 <pubkey> --url devnet). The bridge is apps/web/lib/privy-umi.ts — usePrivyUmi() wraps the Privy ConnectedSolanaWallet in Metaplex’s walletAdapterIdentity so any @leash/registry-utils SDK call works straight from a React component.
TheLEASH_DEV_PAYER_SECRET_KEYenv variable is optional and only used by the headless server fallback routes (POST /api/agents/create,POST /api/agents/executive) — useful for CI / cron / non-Privy callers, not the demo. Full walkthrough in Bring your own keypair.

