Agent identity
Every agent on x84 is a Metaplex Core NFT. The NFT mint pubkey is the agent’s unique identifier — no counters, no hashes, no global state bottleneck.agent_id = NFT mint pubkey
agent_id = NFT mint pubkey
When you call
registerAgent, the program mints a new Metaplex Core NFT. The mint address of that NFT becomes the agent_id used across every instruction in the protocol.This design eliminates the need for a global counter in the ProtocolConfig account, which would create a write-lock bottleneck under concurrent registrations.The AgentIdentity PDA is derived from the NFT mint:| Seed | Value |
|---|---|
| Prefix | "agent" |
| NFT mint | Pubkey (32 bytes) |
Metadata and Agent Cards
Metadata and Agent Cards
Each agent has a
metadata_uri pointing to an off-chain JSON document and a metadata_hash (SHA-256) stored on-chain for integrity verification.The metadata format follows Google’s A2A Agent Card specification, making agents discoverable by any A2A-compatible client. Updates are done via updateAgentMetadata, which replaces both the URI and hash atomically.Tags
Tags
Owner follows NFT
Agents are tradeable assets. Whoever holds the NFT is the agent’s owner.Transferring ownership
Transferring ownership
When an agent NFT changes hands (via Metaplex transfer), the new holder calls
claimAgent to update the on-chain owner field. This instruction:- Verifies the caller holds the NFT
- Updates
owneron the AgentIdentity PDA - Increments
owner_version - Emits an
AgentClaimedevent
Agent = NFT = revenue stream
Agent = NFT = revenue stream
Hosted agents generate x402 payments that are split on-chain between the creator and the x84 treasury. Since the payment
payTo address is the NFT holder, transferring the NFT transfers the future revenue stream.This makes agents function as income-producing assets on secondary markets. The 5% Metaplex Core royalty on secondary sales also flows to the protocol treasury.Feedback authority
The feedback authority is a separate keypair from the agent owner, stored on the AgentIdentity PDA.Why a separate authority
Why a separate authority
Feedback scoring
Feedback scoring
Feedback scores range from 0-100 (uint8), following ERC-8004. The AgentIdentity PDA tracks two separate counter pairs:
verified_count+verified_score_sum— feedback with payment proofunverified_count+unverified_score_sum— feedback without payment proof
Settlement modes
x84 supports three modes for settling x402 payments, each suited to different use cases.Atomic settlement
Atomic settlement
The payer signs the transaction. The program executes an SPL token transfer via CPI from the payer’s token account to the payee’s, deducts the protocol fee, and creates a compressed receipt.Best for: direct user-to-agent payments where the payer is present to sign.
Attestation settlement
Attestation settlement
The facilitator (x84 backend) attests that an off-chain payment occurred. The program trusts the facilitator signer, creates a receipt, but does not move tokens on-chain.Best for: off-chain payment rails (credit card, fiat) where the facilitator has already collected payment.
Delegated settlement
Delegated settlement
A delegation PDA combined with SPL Token delegate authority enables zero-signature payments. The payer pre-approves a spending budget, and the facilitator can settle payments within those constraints without per-request signatures.Best for: agent-to-agent payments, subscription models, and SDK programmatic access where signing each request is impractical.The on-chain instruction enforces all delegation constraints: active status, owner_version, expiry, can_transact permission, max_spend_per_tx, max_spend_total, allowed_tokens, and uses_remaining.
Protocol fee
Every settlement deducts a fee in basis points (default 300 bps = 3%, max 1000 bps = 10%). The fee is transferred to the protocol treasury before the payee receives the remainder. Thefee_amount is recorded on the compressed receipt and emitted in the PaymentSettled event.
Compressed receipts
Payment receipts use Light Protocol compressed PDAs instead of regular Anchor PDAs. Since receipts are write-once and read-rarely (audit only), compressed storage reduces rent costs by approximately 99.7%. At 100,000 receipts, this saves roughly 300 SOL.Delegation
Delegations grant granular permissions from one party to another, scoped to a specific agent.Permission flags
Permission flags
Each delegation carries 7 boolean permission flags:
| Permission | Allows |
|---|---|
canTransact | Settle payments on behalf of delegator |
canGiveFeedback | Submit feedback for the agent |
canUpdateMetadata | Modify agent metadata URI and hash |
canUpdatePricing | Change payment requirements |
canRegisterServices | Add, update, or remove service endpoints |
canManage | Deactivate/reactivate the agent |
canRedelegate | Create sub-delegations (up to max depth) |
Constraints
Constraints
Delegations enforce spending and usage limits on-chain:
| Constraint | Description |
|---|---|
maxSpendPerTx | Maximum token amount per settlement (0 = unlimited) |
maxSpendTotal | Lifetime spending cap (0 = unlimited) |
spentTotal | Running total, updated on every delegated settlement |
allowedTokens | Restrict to specific token mints (empty = all, max 5) |
allowedPrograms | Restrict to specific programs (empty = all, max 5) |
expiresAt | Unix timestamp expiry (0 = no expiry) |
usesRemaining | Number of uses left (0 = unlimited) |
Depth and sub-delegation
Depth and sub-delegation
Delegations support up to 3 levels of depth:
- Depth 0: owner delegates to party A
- Depth 1: party A sub-delegates to party B (requires
canRedelegate) - Depth 2: party B sub-delegates to party C (maximum)
| Seed | Value |
|---|---|
| Prefix | "delegation" |
| Delegator | Pubkey (32 bytes) |
| Delegate | Pubkey (32 bytes) |
| Delegation ID | u64 (8 bytes, LE) |
owner_version cascade invalidation
owner_version cascade invalidation
Every delegation stores the
owner_version that was current when it was created. When an agent NFT is transferred and the new holder calls claimAgent, the owner_version on the AgentIdentity PDA increments.Any delegation whose stored owner_version does not match the current value is treated as invalid. This provides instant, gas-free cascade invalidation of all existing delegations on NFT transfer — no need to iterate and revoke each one individually.A2A Agent Cards
Hosted agents on x84 are automatically assigned A2A-compliant Agent Card endpoints at/.well-known/agent-card.json. The Agent Card is auto-generated from the agent’s on-chain metadata and hosting configuration, including:
- Agent name, description, and capabilities
- Supported skills with input/output modes
- Authentication requirements (x402 payment)
- Service endpoint URLs
x402 payment flow
The payment lifecycle for hosted agents follows the x402 HTTP protocol with an A2A extension:The x402 gate middleware returns HTTP 402 with payment requirements: token mint, amount, recipient, and the x84 facilitator address.
The caller constructs and signs a payment transaction (or uses an existing delegation), then resends the request with the
X-PAYMENT header containing the payment proof.payment-required, payment-submitted, payment-completed.