Programs

Agent Identity

Last updated February 25, 2026

The Agent Identity program registers an on-chain identity record for an MPL Core asset.

Program ID

NetworkAddress
Mainnet1DREGFgysWYxLnRnKQnwrxnJQeSMk2HmGaC6whw2B2p
Devnet1DREGFgysWYxLnRnKQnwrxnJQeSMk2HmGaC6whw2B2p

Instruction: RegisterIdentityV1

Registers an agent identity by creating a PDA and attaching an AppData plugin to the MPL Core asset.

Accounts

AccountWritableSignerOptionalDescription
agentIdentityYesNoNoPDA to be created (auto-derived from asset)
assetYesNoNoThe MPL Core asset to register
collectionYesNoYesThe asset's collection
payerYesYesNoPays for account rent and fees
authorityNoYesYesCollection authority (defaults to payer)
mplCoreProgramNoNoNoMPL Core program
systemProgramNoNoNoSystem program

What It Does

  1. Derives a PDA from seeds ["agent_identity", <asset>]
  2. Creates and initializes the AgentIdentityV1 account (40 bytes)
  3. CPIs into MPL Core to attach an AppData external plugin to the asset, with the PDA as the data_authority
  4. If the AppData plugin already exists, the instruction succeeds without creating a duplicate

PDA Derivation

Seeds: ["agent_identity", <asset_pubkey>]

import { findAgentIdentityV1Pda } from '@metaplex-foundation/mpl-agent-registry';
const pda = findAgentIdentityV1Pda(umi, { asset: assetPublicKey });
// Returns [publicKey, bump]

Account: AgentIdentityV1

40 bytes, 8-byte aligned, zero-copy via bytemuck.

OffsetFieldTypeSizeDescription
0keyu81Account discriminator (1 = AgentIdentityV1)
1bumpu81PDA bump seed
2_padding[u8; 6]6Alignment padding
8assetPubkey32The MPL Core asset this identity is bound to

Fetching Accounts

import {
fetchAgentIdentityV1,
safeFetchAgentIdentityV1,
fetchAgentIdentityV1FromSeeds,
fetchAllAgentIdentityV1,
getAgentIdentityV1GpaBuilder,
} from '@metaplex-foundation/mpl-agent-registry';
// By PDA address (throws if not found)
const identity = await fetchAgentIdentityV1(umi, pda);
// Safe fetch (returns null if not found)
const identity = await safeFetchAgentIdentityV1(umi, pda);
// By seeds (derives PDA internally)
const identity = await fetchAgentIdentityV1FromSeeds(umi, { asset });
// Batch fetch
const identities = await fetchAllAgentIdentityV1(umi, [pda1, pda2]);
// GPA query
const results = await getAgentIdentityV1GpaBuilder(umi)
.whereField('asset', assetPublicKey)
.get();

Errors

CodeNameDescription
0InvalidSystemProgramSystem program account is incorrect
1InvalidInstructionDataInstruction data is malformed
2InvalidAccountDataPDA derivation does not match the asset
3InvalidMplCoreProgramMPL Core program account is incorrect
4InvalidCoreAssetAsset is not a valid MPL Core asset