Skip to content

RFC-007: Nexus Core Agentic Interface

MetadataValue
TitleNexus Core Agentic Interface
Version1.8.0
StatusFinal Specification
Updated2026-04-01
ProtocolModel Context Protocol (MCP)
ArchitectureHub (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:

  1. Buyer Plugin: Guides the UA through the entire flow of "Quote -> Select Chain -> Pay -> Receive Goods".
  2. 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:
json
{
"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:
json
{
"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:
json
{
"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:
json
{
"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:
json
{
"nexus_payment_id": "NEX-UUID-001",
"rating": 5 // (Optional) Rating
}
  • Output Schema:
json
{
"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:
json
{ "merchant_order_ref": "TRIP-888" }
  • Output Schema:
json
{
"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:
json
{ "nexus_payment_id": "NEX-UUID-001" }
  • Output Schema:
json
{
"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}.

StatusMeaningTriggering ActionUA Interface Display
DRAFTOrder intent createdinitialize_paymentSelector View (Chain/Wallet)
AWAITING_DEPOSITMPC address assignedfinalize_paymentTransfer View (Target Addr)
DETECTINGOn-chain deposit detectedListener captures Tx"Verifying Transaction..."
SYNCINGKYT passed, writing to HubKYT Engine"Securing Funds..."
LOCKED[Milestone] Locked on PlatONHub contract event"Payment Successful"
RELEASE_SIGNEDUser signed releasesign_release"Order Completed"
CLAIMEDMerchant withdrew fundsclaim_funds(History Record)
RISK_REJECTEDKYT failedKYT Engine"Security Alert" (triggers refund)

5. Implementation Guidance for Antigravity

Core Server (nexuspay-core)

  1. 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.
  2. MPC Service: Integrate an MPC wallet SDK (e.g., Fireblocks, Coinbase WaaS, or custom TSS) to derive child addresses during finalize_payment.
  3. KYT Hook: During the DETECTING state, block the flow and call the KYT API; only execute createVirtualDeposit to PlatON after passing.

UA Integration (@nexus/ua-kit)

  1. Step 1: Component Mount -> call initialize_payment -> render <ChainSelector>.
  2. Step 2: User selects Base + connects wallet -> clicks Pay -> call finalize_payment.
  3. Step 3: Obtain target_address -> call wagmi.sendTransaction({ to: target_address, value: 0 }) (for USDC, call ERC20 transfer instead).
  4. 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

FeatureRFC-007 VisionMVP ImplementationPlanned Phase
Multi-chain (Hub-Spoke)PlatON Hub + Base/ETH SpokePlatON single-chainPhase 3
MPC Ephemeral AddressesFireblocks/WaaSNo MPC (Escrow contract as substitute)Phase 3
KYT Compliance ChecksDETECTING state blockingNot implementedPhase 3
Draft-then-Finalizeinitialize -> finalize -> sign_releaseSingle-step orchestrate (returns 402 directly)N/A (simplified design)
State Machine8 states (DRAFT->CLAIMED)13 states (CREATED->COMPLETED, RFC-005v4)Current
Buyer Plugin3 tools (init/finalize/sign_release)11 MCP Tools (orchestrate, status, etc.)Current
Seller Plugin2 tools (verify_lock/claim)confirm_fulfillment + webhookCurrent

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 status
  • nexus_dispute_payment -- Open dispute
  • nexus_discover_agents -- Discover merchant Agents
  • nexus_get_agent_skill -- Retrieve Agent skill.md
  • nexus_get_merchant -- Retrieve merchant info

Merchant Agent Side:

  • nexus_confirm_fulfillment -- Confirm fulfillment (triggers Escrow release)
  • nexus_release_payment -- Explicit release
  • nexus_cancel_payment -- Cancel individual payment
  • nexus_cancel_order -- Cancel entire order group
  • nexus_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.