RFC-007: Nexus Core Agentic Interface
| Metadata | Value |
|---|---|
| Title | Nexus Core Agentic Interface |
| Version | 1.8.0 |
| Status | Final Specification |
| Updated | 2026-04-01 |
| Protocol | Model Context Protocol (MCP) |
| Architecture | Hub (PlatON) + Spoke (MPC Ingress) + KYT Firewall |
1. Core Design Philosophy
Nexus Core operates as an MCP Server, providing two standard plugin sets to Agents in the network:
- Buyer Plugin: Guides the UA through the entire flow of "Quote -> Select Chain -> Pay -> Receive Goods".
- Seller Plugin: Helps the MA complete the closed loop of "Check Balance -> Fulfill -> Withdraw". The interaction model follows "Draft-then-Finalize": first generate a draft order for the user to select a payment method, then lock in and generate a dedicated MPC custody address.
2. Nexus Buyer Plugin (For User Agent)
This plugin grants the UA the ability to process payment intents, interact with users to select networks, and execute fund escrow.
Tool A: initialize_payment (Initialize / Pre-orchestration)
Lifecycle Stage: Discovery (when the user sees the quote card) Function: Register order intent, compute cross-chain routing, and return payment options for the user to choose from.
- Input Schema:
{
"quote_payload": {
"type": "object",
"description": "NUPS quote payload extracted from the merchant-returned UCP Checkout Session (`ucp.payment_handlers['urn:ucp:payment:nexus_v1'][0].config`)",
"required": true
}
}- Output Schema:
{
"nexus_payment_id": "NEX-UUID-001", // Draft ID
"status": "AWAITING_USER_SELECTION",
"expiry": 1760000000,
"fiat_value": { "amount": "530.00", "currency": "USD" },
// Core: option list for UI rendering
"payment_options": [
{
"option_id": "opt_base_usdc",
"chain_id": 8453,
"chain_name": "Base",
"token_symbol": "USDC",
"amount_uint256": "530000000",
"est_gas_fee_usd": "0.02",
"bridge_fee_usd": "0.50",
"tags": ["RECOMMENDED", "BEST_VALUE"]
},
{
"option_id": "opt_eth_usdc",
"chain_id": 1,
"chain_name": "Ethereum",
"est_gas_fee_usd": "5.00",
"tags": ["HIGH_GAS"]
},
{
"option_id": "opt_platon_usdc",
"chain_id": 210425,
"chain_name": "PlatON",
"bridge_fee_usd": "0.00",
"tags": ["NATIVE_SETTLEMENT"]
}
]
}Tool B: finalize_payment (Final Orchestration / Obtain Address)
Lifecycle Stage: Decision (when the user clicks the "Pay" button) Function: Lock in the user's selection, assign a dedicated MPC ephemeral custody address, and prepare to receive funds.
- Input Schema:
{
"nexus_payment_id": "NEX-UUID-001",
"selected_option_id": "opt_base_usdc", // User-selected path
"payer_wallet": "0xUserAddress..." // User's connected wallet address (for subsequent KYT association)
}- Output Schema:
{
"status": "AWAITING_DEPOSIT",
"kyc_policy": "STRICT", // Note: strict KYT will be performed after deposit
// Core: payment instruction
"payment_instruction": {
"chain_id": 8453,
"chain_name": "Base",
// MPC Custody Address (Ephemeral Address)
"target_address": "0xNexusMPC_Temp_Addr_99",
"token_address": "0xUSDC_Base_Addr",
"amount": "530000000",
// Explicitly instruct the UA to use a plain transfer, not a contract call
"method": "transfer",
"calldata": "0x"
},
"validity_window": "30 minutes"
}Tool C: sign_release (Confirm Receipt / Release Funds)
Lifecycle Stage: Verification (after the user confirms receipt of service) Function: Produce an EIP-712 signature over the order ID, authorizing the release of funds to the merchant.
- Input Schema:
{
"nexus_payment_id": "NEX-UUID-001",
"rating": 5 // (Optional) Rating
}- Output Schema:
{
"status": "RELEASE_SIGNED",
"signature": "0xUserReleaseSig...",
"message": "Signature uploaded to Core. Merchant notified."
}3. Nexus Seller Plugin (For Merchant Agent)
This plugin grants the MA seamless cross-chain collection capabilities; the MA only needs to monitor the Hub Chain (PlatON) state.
Tool A: verify_order_lock (Verify Fulfillment Conditions)
Lifecycle Stage: Fulfillment (before the MA prepares to fulfill/ship) Function: Query the Escrow contract on the Hub Chain (PlatON) to confirm whether funds are securely locked (LOCKED). Logic: This tool only returns LOCKED after Core has completed KYT and synchronized the state.
- Input Schema:
{ "merchant_order_ref": "TRIP-888" }- Output Schema:
{
"nexus_payment_id": "NEX-UUID-001",
"status": "LOCKED", // Key signal: safe to fulfill
"amount_settled": "530.00",
"currency": "USDC",
"hub_chain": "PlatON",
"kyt_result": "PASS" // Funds are compliant
}Tool B: claim_funds (Withdraw / Settle)
Lifecycle Stage: Settlement (after receiving the user's Release signature) Function: Pull the user's signature from Nexus Core and call the on-chain contract on PlatON to withdraw funds.
- Input Schema:
{ "nexus_payment_id": "NEX-UUID-001" }- Output Schema:
{
"status": "CLAIMED",
"tx_hash": "0xPlatONTxHash...",
"settled_at": "2026-01-21T12:00:00Z"
}4. Core State Machine (Order State Machine)
The single source of truth maintained by Nexus Core, exposed via MCP Resource nexus://core/orders/{id}.
| Status | Meaning | Triggering Action | UA Interface Display |
|---|---|---|---|
| DRAFT | Order intent created | initialize_payment | Selector View (Chain/Wallet) |
| AWAITING_DEPOSIT | MPC address assigned | finalize_payment | Transfer View (Target Addr) |
| DETECTING | On-chain deposit detected | Listener captures Tx | "Verifying Transaction..." |
| SYNCING | KYT passed, writing to Hub | KYT Engine | "Securing Funds..." |
| LOCKED | [Milestone] Locked on PlatON | Hub contract event | "Payment Successful" |
| RELEASE_SIGNED | User signed release | sign_release | "Order Completed" |
| CLAIMED | Merchant withdrew funds | claim_funds | (History Record) |
| RISK_REJECTED | KYT failed | KYT Engine | "Security Alert" (triggers refund) |
5. Implementation Guidance for Antigravity
Core Server (nexuspay-core)
- Routing Engine: Requires hardcoded or configured RPC endpoints for PlatON, Base, and Ethereum to fetch real-time Gas Prices and calculate
est_gas_fee_usd. - MPC Service: Integrate an MPC wallet SDK (e.g., Fireblocks, Coinbase WaaS, or custom TSS) to derive child addresses during
finalize_payment. - KYT Hook: During the
DETECTINGstate, block the flow and call the KYT API; only executecreateVirtualDepositto PlatON after passing.
UA Integration (@nexus/ua-kit)
- Step 1: Component Mount -> call
initialize_payment-> render<ChainSelector>. - Step 2: User selects Base + connects wallet -> clicks Pay -> call
finalize_payment. - Step 3: Obtain
target_address-> callwagmi.sendTransaction({ to: target_address, value: 0 })(for USDC, call ERC20 transfer instead). - Step 4: Poll Core status until
LOCKED. This specification fully satisfies all requirements for multi-chain interaction, user choice, KYT compliance, and trustless custody.
6. Implementation Status (v1.8.0 Notes)
Important: RFC-007 describes the full vision architecture of Nexus (Hub-Spoke cross-chain + MPC + KYT). The current MVP implementation only covers a subset of features.
6.1 Current Implementation vs Vision
| Feature | RFC-007 Vision | MVP Implementation | Planned Phase |
|---|---|---|---|
| Multi-chain (Hub-Spoke) | PlatON Hub + Base/ETH Spoke | PlatON single-chain | Phase 3 |
| MPC Ephemeral Addresses | Fireblocks/WaaS | No MPC (Escrow contract as substitute) | Phase 3 |
| KYT Compliance Checks | DETECTING state blocking | Not implemented | Phase 3 |
| Draft-then-Finalize | initialize -> finalize -> sign_release | Single-step orchestrate (returns 402 directly) | N/A (simplified design) |
| State Machine | 8 states (DRAFT->CLAIMED) | 13 states (CREATED->COMPLETED, RFC-005v4) | Current |
| Buyer Plugin | 3 tools (init/finalize/sign_release) | 11 MCP Tools (orchestrate, status, etc.) | Current |
| Seller Plugin | 2 tools (verify_lock/claim) | confirm_fulfillment + webhook | Current |
6.2 Current MCP Tools (In Production)
See RFC-005v4 Section 7.1 for details. The 11 MCP Tools currently deployed:
User Agent Side:
nexus_orchestrate_payment-- Orchestrate payment (replaces initialize + finalize)nexus_get_payment_status-- Query statusnexus_dispute_payment-- Open disputenexus_discover_agents-- Discover merchant Agentsnexus_get_agent_skill-- Retrieve Agent skill.mdnexus_get_merchant-- Retrieve merchant info
Merchant Agent Side:
nexus_confirm_fulfillment-- Confirm fulfillment (triggers Escrow release)nexus_release_payment-- Explicit releasenexus_cancel_payment-- Cancel individual paymentnexus_cancel_order-- Cancel entire order groupnexus_resolve_dispute-- Arbitrate dispute
6.3 AP2 Protocol Adaptation
The Buyer/Seller Plugin concepts from RFC-007 coexist with the AP2 Agent Protocol Credential model:
- AP2 environment: CartMandate -> Nexus -> PaymentMandate (VC format)
- MCP environment: Quote -> orchestrate_payment -> 402 Instruction (NUPS format)
- On-chain settlement layer is identical (NexusEscrow v4.3.0)
See RFC-002 v2.0 Section 7 (AP2 Protocol Extension) for details.