09/On-chain controls

One name to find it, pay it, and stop it

ENS is Parity's control plane: every cycle the agent reads its risk mandate from its own ENS name, and trading stops unless that name proves, through an ENSIP-25 record, that it belongs to the agent registered in ERC-8004. The owner of the name can pause or revoke the desk from any ENS client with one record change. The code is contracts/ens (@parity/ens); the full reference is docs/ENS.md.

What the name carries

StandardRecordWhat it says
ENSIP-25agent-registration[<registry>][<agentId>]"1" means the name owner vouches for this ERC-8004 entry. The registry is an ERC-7930 address; on mainnet the key is agent-registration[0x000100000101148004a169fb4a3325136eb29fa0ceb6d2e539a432][id]. Missing or empty means the mandate is inactive.
ENSIP-26agent-context, agent-endpoint[web|mcp|a2a], agent-endpoint[x402|ucp]A JSON context and the endpoints other agents call. MCP and A2A appear only if PARITY_MCP_URL / PARITY_A2A_URL are set; x402 and ucp are Parity extensions the spec does not define
ENSIP-28accounts[...], accounts-chainsThe EVM accounts the agent operates, each with an EIP-712 consent signed by that account
ENSIP-31payment-preferenceHow to pay it: USDC 0.0.456858 on Hedera mainnet, encoded on chain 295
ENSIP-1 / 11addr(60), addr(0x80000000 | 295)The agent's EVM key, and the Hedera account as a long-zero EVM address
Parityparity.paused, parity.revokedThe kill-switch. Either set to true stops the desk on its next read
Parityparity.maxNotionalUsd, maxSlippageBps, maxLtvBps, minRebalanceEvUsd, allowedPoolsThe risk limits the kernel enforces. See Risk kernel
Parityparity.hederaAccount, parity.fleet, parity.roleThe native Hedera id (ENSIP-28 cannot carry it) and fleet discovery

ERC-8004 is the agent identity registry the ENSIP-25 record points at. Parity registers in the mainnet IdentityRegistry 0x8004A169FB4a3325136EB29fA0ceB6D2e539a432 by default (ERC8004_CHAIN_ID=1), with the agent URI ${X402_GATEWAY_URL}/agent.json. Chain 296 selects the Hedera testnet registry 0x8004A818BFB912233c491871b3d84c89A494BD9e, which is also the Sepolia address.

How the agent reads it

readEnsMandate in contracts/ens/src/mandate.ts runs inside every cycle. It reads the ENSIP-25 record and the parity.* records through the Universal Resolver 0xeEeEEEeE14D718C2B47D9923Deab1335E144EeEe, and in the same pass reads the ENSIP-26/28/31 profile and verifies every ENSIP-28 consent. The mandate is active only when all of these hold:

  • the ENSIP-25 record for the configured registry and ERC8004_AGENT_ID is non-empty;
  • parity.paused and parity.revoked are not true;
  • if ENS_REQUIRE_EAC_DELEGATION=true, the agent key ENS_AGENT_ADDRESS still holds ROLE_SET_TEXT on every parity.* key, so revoking the delegation also stops the agent.
ensSourceWhenMandate
mainnet-liveA successful read on mainnet (sepolia-live on Sepolia)As read
cachedThe RPC failed, the last good read is under ENS_MANDATE_MAX_STALENESS_MS old (default 300000, five minutes)The last good read
unavailableThe RPC failed for longer, or the name or config is missingInactive, every limit 0
local-fallbackENS_MANDATE_READ_MODE=fallback, for local development onlyActive with default limits, not read from ENS

The mandate also drives the Uniswap hook: the agent sends paused = true whenever the mandate is inactive or revoked, and the hook then reverts every swap. The gateway refuses clearances on an inactive mandate.

The kill-switch

contracts/ens · ens:set-mandatebash
pnpm --filter @parity/ens ens:set-mandate pause             # owner: parity.paused=true
pnpm --filter @parity/ens ens:set-mandate pause --as-agent  # the agent pausing itself through EAC
pnpm --filter @parity/ens ens:set-mandate resume            # parity.paused=false
pnpm --filter @parity/ens ens:set-mandate revoke            # parity.revoked=true, until re-activated
pnpm --filter @parity/ens ens:set-mandate activate          # ENSIP-25 "1" + limits from env

ENSv2 Enhanced Access Control (EAC) lets the owner delegate only the parity.* records to the agent's own key, so the agent can pause itself but can never rewrite its identity or payment records.

Setting up a name

  1. Register the parent name (for example parity-vault.eth) in the ENS app with the owner wallet.
  2. ens:setup creates the desk subname and its own PermissionedResolver, and prints ENS_RESOLVER_ADDRESS.
  3. ens:register-erc8004 registers the agent URI and prints ERC8004_AGENT_ID; put it in .env.
  4. ens:publish writes the profile and mandate in one multicall.
  5. ens:delegate grant hands the parity.* keys to the agent key; ens:delegate check confirms.
  6. Optional: ens:fleet spawns subnames from ENS_FLEET_JSON. Then ens:inspect should print "source": "mainnet-live" and "active": true.

Every write script accepts --dry-run (or ENS_DRY_RUN=true) to print the transactions without signing; a dry run needs only ENS_OWNER_ADDRESS. Run them as pnpm --filter @parity/ens <script>.