A Solana program for registering verifiable agent identities on MPL Core assets. The identity registry allows any MPL Core NFT to carry an on-chain agent identity record via the AppData external plugin system.
The Agent Identity Registry attaches a PDA-based identity record to an MPL Core asset and writes an AppData external plugin on the asset itself. This creates a two-way link: the PDA points to the asset, and the asset carries plugin data whose authority is the PDA. Together they form a tamper-evident on-chain identity binding.
Program ID: 1DREGFgysWYxLnRnKQnwrxnJQeSMk2HmGaC6whw2B2p
- A caller submits a
RegisterIdentityV1instruction with the target MPL Core asset and its collection. - The program derives and creates an
AgentIdentityV1PDA from the seeds["agent_identity", <asset_pubkey>]. - The program CPIs into MPL Core to add an
AppDataexternal plugin on the asset, with the PDA as thedata_authority.
After registration, anyone can verify an agent's identity by:
- Deriving the PDA from the asset's public key and checking that the account exists.
- Inspecting the asset's
AppDataplugin to confirm the data authority matches the expected PDA.
| Account | Type | Seeds | Size |
|---|---|---|---|
AgentIdentityV1 |
PDA | ["agent_identity", asset_pubkey] |
40 bytes |
The AgentIdentityV1 account stores:
| Field | Type | Description |
|---|---|---|
key |
u8 |
Account discriminator (Key::AgentIdentityV1) |
bump |
u8 |
PDA bump seed |
_padding |
[u8; 6] |
Alignment padding |
asset |
Pubkey |
The MPL Core asset this identity is bound to |
| # | Account | Writable | Signer | Description |
|---|---|---|---|---|
| 0 | agentIdentity |
Yes | No | The PDA to be created (derived from asset) |
| 1 | asset |
Yes | No | The MPL Core asset to register |
| 2 | collection |
Yes | No | The asset's collection (optional) |
| 3 | payer |
Yes | Yes | Pays for account rent and transaction fees |
| 4 | authority |
No | Yes | Collection authority (optional, defaults to payer) |
| 5 | mplCoreProgram |
No | No | MPL Core program |
| 6 | systemProgram |
No | No | System program |
The JS client is built on the Umi framework.
Install:
npm install @metaplex-foundation/mpl-agent-registrySetup:
import { createUmi } from '@metaplex-foundation/umi-bundle-defaults';
import { mplAgentIdentity } from '@metaplex-foundation/mpl-agent-registry';
const umi = createUmi('https://api.mainnet-beta.solana.com')
.use(mplAgentIdentity());Register an identity:
import {
registerIdentityV1,
findAgentIdentityV1Pda,
fetchAgentIdentityV1,
} from '@metaplex-foundation/mpl-agent-registry';
// Register an agent identity for an MPL Core asset.
await registerIdentityV1(umi, {
asset: assetPublicKey,
collection: collectionPublicKey,
}).sendAndConfirm(umi);
// Fetch the identity PDA.
const pda = findAgentIdentityV1Pda(umi, { asset: assetPublicKey });
const identity = await fetchAgentIdentityV1(umi, pda);Cargo.toml:
[dependencies]
mpl-agent-identity = "0.1.0"The Rust client exposes builder-pattern instruction constructors and account deserialization generated from the on-chain IDL.
- pnpm 8.9.0
- Rust 1.83.0
- Solana CLI 2.2.1
pnpm programs:build# Program tests
pnpm programs:test
# JS client tests (builds programs and client first)
pnpm clients:js:test
# Rust client tests
pnpm clients:rust:testAfter any program changes, regenerate the IDL and client code:
pnpm generateThis runs Shank to extract the IDL from Rust annotations, then Kinobi to render typed JS and Rust clients from the IDL.
programs/mpl-agent-identity/src/
lib.rs # Program ID declaration
entrypoint.rs # Entrypoint routing
instruction.rs # Shank-annotated instruction enum (drives IDL generation)
error.rs # Custom program errors
processor/
mod.rs # Discriminant-based dispatch
register.rs # RegisterIdentityV1 logic
state/
mod.rs # Account discriminator enum
agent_identity.rs # AgentIdentityV1 PDA account
clients/js/ # TypeScript client (@metaplex-foundation/mpl-agent-registry)
clients/rust-identity/# Rust client crate (mpl-agent-identity)
configs/ # Shank and Kinobi configuration
idls/ # Generated IDL JSON
This repository also contains mpl-agent-reputation and mpl-agent-validation programs. These follow the same architectural patterns but are not yet finalized.
Metaplex NFT Open Source License - see LICENSE for details.