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
| Standard | Record | What it says |
|---|---|---|
| ENSIP-25 | agent-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-26 | agent-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-28 | accounts[...], accounts-chains | The EVM accounts the agent operates, each with an EIP-712 consent signed by that account |
| ENSIP-31 | payment-preference | How to pay it: USDC 0.0.456858 on Hedera mainnet, encoded on chain 295 |
| ENSIP-1 / 11 | addr(60), addr(0x80000000 | 295) | The agent's EVM key, and the Hedera account as a long-zero EVM address |
| Parity | parity.paused, parity.revoked | The kill-switch. Either set to true stops the desk on its next read |
| Parity | parity.maxNotionalUsd, maxSlippageBps, maxLtvBps, minRebalanceEvUsd, allowedPools | The risk limits the kernel enforces. See Risk kernel |
| Parity | parity.hederaAccount, parity.fleet, parity.role | The 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_IDis non-empty; parity.pausedandparity.revokedare nottrue;- if
ENS_REQUIRE_EAC_DELEGATION=true, the agent keyENS_AGENT_ADDRESSstill holdsROLE_SET_TEXTon everyparity.*key, so revoking the delegation also stops the agent.
| ensSource | When | Mandate |
|---|---|---|
mainnet-live | A successful read on mainnet (sepolia-live on Sepolia) | As read |
cached | The RPC failed, the last good read is under ENS_MANDATE_MAX_STALENESS_MS old (default 300000, five minutes) | The last good read |
unavailable | The RPC failed for longer, or the name or config is missing | Inactive, every limit 0 |
local-fallback | ENS_MANDATE_READ_MODE=fallback, for local development only | Active 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
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 envENSv2 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
- Register the parent name (for example
parity-vault.eth) in the ENS app with the owner wallet. ens:setupcreates thedesksubname and its own PermissionedResolver, and printsENS_RESOLVER_ADDRESS.ens:register-erc8004registers the agent URI and printsERC8004_AGENT_ID; put it in.env.ens:publishwrites the profile and mandate in onemulticall.ens:delegate granthands theparity.*keys to the agent key;ens:delegate checkconfirms.- Optional:
ens:fleetspawns subnames fromENS_FLEET_JSON. Thenens:inspectshould 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>.