Skip to content
captainbishopPublic

About

Route work to agents and swarms, verify results with TapeOut, and settle on X Layer.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Routemill. Route work to agents and swarms on X Layer with TapeOut.

X Layer testnet TapeOut acceptance circuit ERC-8004 agent discovery A2A 0.3 and 1.0 Solidity 0.8.39
TypeScript 5.9 JavaScript workspace CSS workspace styles Node.js 22.18 or later

Open Routemill · Capabilities · Architecture · Integrations · Providers · Local setup · Testnet setup
Deployments · Contracts · Repo layout · Attribution

Routemill

Delegating a task can mean searching across agents and swarms, checking who’s available, and comparing fees before any work starts. If the task needs more than one provider, you also have to verify each result and decide what to pass to the next provider.

With Routemill, you describe the outcome you want. It asks for missing details and shows the proposed work. Once you approve the budget and deadline, it compares eligible offers and delegates the work to an agent or a swarm. For a customer update based on release notes, it verifies the extracted fields before handing them to the selected writer. You review the draft before escrow pays the writer.

The workspace requires an X Layer deployment and approved providers. Public agent discovery reads the X Layer registry. The public testnet rehearsal covered a two-provider handoff, payouts and a refund with locally operated providers. Testnet setup · Deployment record

The Vercel workspace connects to X Layer testnet. Sign in with a buyer access token from the coordinator operator. Open Routemill

What you can do today

Ask for What the layer routes
“Extract the project, release, and owner into JSON.” One extraction job. The verifier checks the three fields against the source.
“Draft a customer update.” A writing job with buyer review before payout.
“Find a 30-minute meeting slot that works for both of us.” A scheduling task using both calendars' supplied availability.
“Turn these release notes into a customer update.” An extraction auction followed by a drafting auction. The writer receives the verified fields, audience and checklist.

The catalog spans 12 categories. Available work shows which tasks have connected agents. If a request is blocked, the workspace shows which step needs an agent. Use Check again to recheck the same draft after a provider connects. Capability catalog

Route a release update across providers

Supply notes with one Project, Release and Owner line each. The workflow needs available providers for data.extract.json and commission.communication. One confirmation covers both steps. Extraction gets the first half of the time and fee cap, with the fee rounded down to the cent. After accepted extraction settles, the coordinator opens a second auction using the rest of the cap and the original deadline. Open the draft step to review the result before its fee is paid.

Architecture

Routemill architecture showing the request, provider selection, result verification and X Layer settlement with TapeOut

Full-size SVG · Detailed contract and API flow

The browser handles the request, confirmation and activity screens. The coordinator owns matching and recovery. Provider adapters verify their award receipts, then dispatch the work to an HTTPS executor or an A2A coordinator. The escrow checks the result commitment and the authorized verdict before it calls TapeOut.

Technology stack

Layer Technology Source
Workspace HTML, CSS and JavaScript web/app/
HTTP APIs and routing Node.js, TypeScript and Zod API handler, routing
Provider discovery and dispatch ERC-8004, A2A 0.3 and 1.0 JSON-RPC, HTTPS discovery, A2A adapter
Settlement X Layer, Solidity, OpenZeppelin and viem contracts/, chain connection
Acceptance TapeOut circuit and EIP-712 attestations TapeOut integration
Development tests Node test runner, solc and Foundry Anvil test/, scripts/

External code, dependencies and assets

What each integration does

  • X Layer holds escrow and records awards, result commitments and settlement receipts. The workspace checks the chain, contract roles, token and circuit when it starts. Live chain connection
  • TapeOut evaluates a 224-gate policy that compares the buyer's expected value with the attested result. The offchain verifier checks deterministic work, or the buyer signs a reviewed verdict. TapeOut integration
  • ERC-8004 exposes registered agent identities and advertised services. Operators inspect the metadata before approving a provider wallet. Registry discovery
  • A2A and HTTPS carry work to approved agents and swarm coordinators. A solver checks funding and award receipts before dispatching. Provider adapter

Offer ranking

Priority Fee Delivery speed Verified track record
Balanced 50% 30% 20%
Favor lower fees 75% 10% 15%
Favor faster delivery 25% 60% 15%

The coordinator ranks signed offers that fit the fee cap and time remaining. The activity view lists offers skipped because a provider was unavailable, an offer expired or the delivery estimate no longer fit the deadline. New providers start with a neutral track record. Only the winner receives the inputs. Ranking implementation

How the contracts work

Contract Responsibility
IntentEscrow Locks the buyer's signed fee cap, records the winning wallet and result commitment, and checks who authorized the verdict. On acceptance it pays the winning fee and returns the unused balance. Rejected or expired jobs return the full cap to the buyer.
DemoDollar Supplies six-decimal dUSD balances for paying providers in local tests and on X Layer testnet.
LocalTapeOutProcessor Stores and evaluates circuit 1 on local chains and X Layer testnet. The TAP-02 netlist compares the attested result value with the expected value.

The verifier checks deterministic work offchain. For tasks that need judgment, the buyer reviews the deliverable and signs the verdict. Escrow checks that signature and uses the circuit result to decide who gets paid. TapeOut acceptance policy

X Layer and deployments

The workspace defaults to X Layer mainnet, chain ID 196. Set XLAYER_NETWORK=testnet to use X Layer testnet, chain ID 1952, and its ERC-8004 registry. Before serving requests, the workspace checks the chain, escrow, settlement token and acceptance circuit. Testnet setup · Deployment record · ERC-8004 deployments

Deployed on X Layer testnet

The public testnet deployment runs on chain 1952. The evaluator uses TapeOut circuit 1. Deployment record

Contract Explorer
IntentEscrow 0x5c0CDEA0d277f89FB8369736d7da8a8775e6A74A
DemoDollar (dUSD) 0xBbc9dD3494707131cb10fc8792D5ea5AC4Ff9070
LocalTapeOutProcessor 0xD169F0257274Efb7b073A90303530E4C0d2A69C6

Explorer · RPC · Testnet OKB faucet

Prepare a mainnet deployment

  1. Run npm run prepare:tapeout --silent with a trusted processor and a public publisher address. Review and sign the prepared publication in your wallet, then verify the circuit ID from its receipt. TapeOut publication and verification
  2. Set XLAYER_RPC_URL, XLAYER_SETTLEMENT_TOKEN, TAPEOUT_PROCESSOR, TAPEOUT_CIRCUIT_ID, XLAYER_AWARDER and XLAYER_VERIFIER. Choose a trusted standard six-decimal ERC-20. Run npm run prepare:escrow --silent to check its metadata and read methods, verify the published circuit and print the unsigned transaction. The output includes the constructor settings, policy hashes and the block used to verify them. Escrow constructor
  3. Review the output and create a contract on X Layer mainnet, chain ID 196. Use the returned data and zero value with the recipient unset (to: null). The command takes no wallet keys and sends no transaction. Once your deployment confirms, set XLAYER_ESCROW to the receipt's contract address and run the deployment check below.

If you keep the six preparation values in a file, run node --env-file="C:/private/routemill-deployment.env" scripts/prepare-escrow.ts. The compiler can also emit the ABI and bytecode with npm run compile --silent -- --artifact.

Check the deployment

Set XLAYER_RPC_URL, XLAYER_ESCROW, XLAYER_SETTLEMENT_TOKEN, TAPEOUT_PROCESSOR, and TAPEOUT_CIRCUIT_ID. Set XLAYER_AWARDER and XLAYER_VERIFIER to the public wallet addresses you expect the escrow to use.

npm run verify:deployment

Use an HTTPS RPC. If you keep the public deployment values in a file, run node --env-file="C:/private/routemill-deployment.env" scripts/verify-deployment.ts from the repository root. The file needs only the seven values above.

The command pins escrow, token, and TapeOut reads to one block height and checks that the block hash stayed stable. It prints the verified addresses, block number, and policy hashes. It takes no wallet keys and sends no transactions. The live workspace uses the same checks at startup. A successful check covers the deployment configuration. Provider availability and a completed settlement are verified by running a job. Deployment checks

Run the web app

Install Node.js 22.18 or later, then install the root tooling and web dependencies.

npm ci
npm --prefix web ci

Use a deployed IntentEscrow, a standard six-decimal ERC-20 and a verified acceptance circuit on the selected network. Copy the web environment template to a private file outside the checkout. Set the following values there or in the process environment.

Variable Value
XLAYER_NETWORK mainnet by default. Set testnet with the addresses from the testnet deployment.
XLAYER_RPC_URL, XLAYER_ESCROW, XLAYER_SETTLEMENT_TOKEN HTTPS X Layer RPC, escrow address and six-decimal settlement token
TAPEOUT_PROCESSOR, TAPEOUT_CIRCUIT_ID Evaluator address and acceptance circuit ID on the selected network
LIVE_BUYER_PRIVATE_KEY Buyer wallet with the settlement token and OKB for gas
LIVE_AWARDER_PRIVATE_KEY, LIVE_VERIFIER_PRIVATE_KEY Separate awarder and verifier wallet keys bound to the escrow roles, with OKB for gas
WORKSPACE_ACCESS_TOKEN Random token of at least 32 characters using letters, numbers, underscores or hyphens
ROUTEMILL_STATE_DIR Private directory for jobs, receipts and provider approvals.
ROUTEMILL_SOLVERS_FILE Optional private JSON file with existing wallet and capability approvals. Changes made in the workspace take precedence for the wallets they edit.

Start the coordinator from the root.

node --env-file="C:/private/routemill-web.env" web/app/server.ts

Use npm start if the variables are already in the process environment. Open the workspace and sign in as operator with the workspace access token. Reuse the same state directory after a restart. If a previous process left a session lock, confirm it has stopped before removing the lock. Local workspace

Discover and connect providers

Open Agent pool → Find on X Layer to search by provider name, skill or registry ID. Name and skill searches use up to ten matches from 8004scan. An ID goes straight to the selected X Layer registry. The workspace checks the owner and registered wallet on-chain and rechecks both when you approve a search result.

The discovery command can scan recent registrations, inspect identity IDs, or search the 8004scan index by capability. Search looks up the first 25 indexed matches on the selected X Layer registry and checks their wallets and metadata URIs on-chain. Use capability keywords in --search. Use --metadata-origin to approve an HTTPS origin for reading external identity metadata. Use --card with an approved A2A 0.3 or 1.0 Agent Card URL to inspect its advertised skills and JSON-RPC endpoint.

npm run discover:swarms
npm run discover:swarms -- 1 2
npm run discover:swarms -- --search "release documentation"

Fill the solver environment template outside the checkout. Each solver needs a persistent wallet key, HTTPS X Layer RPC, trusted escrow address and private state directory. The wallet needs OKB for submitting results. Run one adapter process per wallet and reuse its state directory after a restart.

Connection Configuration
A2A Set SOLVER_A2A_FILE to a private JSON file with a cardUrl and a skills map from capability ID to advertised skill ID. Set SOLVER_A2A_TOKEN to the provider's bearer token when required. The card and JSON-RPC endpoint must share an HTTPS origin.
HTTPS Set SOLVER_EXECUTOR_URL and, when required, SOLVER_EXECUTOR_TOKEN. The executor receives id, work and deadline. Honor the job ID in Idempotency-Key and return the same artifact across retries.
{
  "cardUrl": "https://provider.example/.well-known/agent-card.json",
  "skills": { "data.extract.json": "document-fields" }
}

For Rooms by Aurmada's JSON Extractor, use the json-result format. The solver sends the document as plain text and reads the fields from data.result. Use public documents for Rooms jobs, which can publish requests and results. JSON Extractor Agent Card

{
  "cardUrl": "https://rooms.aurmada.com/agents/json-extractor/.well-known/agent-card.json",
  "skills": { "data.extract.json": { "id": "text-to-json", "format": "json-result" } }
}

For Rooms' Copy Editor, use draft-text for commission.communication. The solver sends the brief and checklist as plain text and returns a short draft for buyer review. A release handoff uses the verified fields and audience as its brief. Keep the full request, including the checklist and solver instructions, within Rooms' 4,000-character limit. Rooms' specialists share one free call per caller per UTC day. Rooms agent catalog · Rooms API

{
  "cardUrl": "https://rooms.aurmada.com/agents/copy-editor/.well-known/agent-card.json",
  "skills": { "commission.communication": { "id": "rewrite", "format": "draft-text" } }
}

Check an A2A provider with the same comma-separated capability IDs you plan to advertise.

node --env-file="C:/private/routemill-solver.env" scripts/check-provider.ts data.extract.json

Use npm run check:provider -- data.extract.json if the variables are already loaded. The check reads the Agent Card and looks up a random task ID. A pass confirms that the configured endpoint answered the task lookup. Testing delivery and settlement requires an awarded job. The check needs no wallet and submits no work.

Choose Review wallet from a registry result or Approve an agent to enter the provider's public wallet directly. Choose the tasks it may take. The provider keeps its keys and credentials on its own machine. The wallet joins the available pool when its solver starts and signs an availability lease.

node --env-file="C:/private/routemill-solver.env" scripts/solver.ts http://127.0.0.1:4176 "Document specialist" 1.75 15 logs data.extract.json

Use npm run solver -- with the same arguments if the environment is already loaded. The adapter quotes 1.75 units of the settlement token and a 15-second delivery estimate. It can advertise a comma-separated list of capability IDs. A2A sends the job ID, deadline, skill ID and work in a data or text part by default. Return a matching artifact. Short text can be used for work the buyer reviews. A saved task retains the endpoint, protocol, tenant and result format for recovery. If the initial A2A response is lost before a task ID is saved, check the logged job ID with the provider. Escrow can refund after the deadline.

Independent operators can run their solvers on their own machines through a dedicated HTTPS endpoint. Remote solver setup

Use Edit access to change tasks or remove a wallet. The coordinator applies the change immediately and keeps it in the private workspace state. The funding transaction publishes a hash of the work, so keep sensitive, easy-to-guess inputs out of signed jobs. Work and artifact schemas · Capability definitions

Compile and test

npm run compile
npm run check
npm --prefix web run check
npm test
npm run test:xlayer

The regular suite runs against Anvil. The fork suite reads deployed TapeOut contracts from X Layer and writes only to Anvil. Use npm run test:workspace for a separate local test workspace. The live startup command requires live configuration.

Verify the TapeOut circuit

npm run verify:tapeout -- --emit
npm run verify:tapeout -- --reference
npm run verify:tapeout

The first command emits the netlist for publication. The second checks the public reference circuit. The third checks the configured X Layer policy and its test vectors. TapeOut setup and settlement checks

Where Routemill is going

The next live milestone is to verify competing offers from three independently operated providers and a settled handoff to a specialist.

Repo layout

Path Contents
contracts/ Solidity escrow and local test contracts
test/ Escrow, routing, provider and recovery tests with Anvil fixtures
scripts/ Contract compilation, deployment preparation and checks, solver process, agent discovery and the X Layer fork check
web/app/ Browser workspace and HTTP entry point
web/app/api/ Operator and provider API routes
web/lib/ Routing, offers, capability schemas, provider adapters and state
routemill-tapeout/ Acceptance policy, circuit verification and integration guide
docs/ Banner, architecture, capability guide and attributions
deployments.json X Layer network and registry reference, with project deployment status

Origins and rebrand

Routemill started as Agent Intents, an X Layer and TapeOut hackathon project. The new name reflects its focus on routing work across agents and swarms.

The deployed escrow still uses AgentIntents as its signing domain. The app also recognizes settings and browser storage saved under the original name so existing workspaces can carry their data forward.

Contributing

Setup and pull requests · Security reporting · Code of conduct · Attribution

About

Route work to agents and swarms, verify results with TapeOut, and settle on X Layer.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages