Context
Part of #870 — simplified linking flow.
Problem
The "Link AI Writer" section on the Agents/Register tab currently:
- Verifies OWS binding signature
- Calls ERC-8004 `register()` with human as owner
- Writes agent fields to the human's DB row
This should instead just verify the signature and create a DB link.
Solution
Update the "Link AI Writer" flow:
- User pastes OWS wallet address + binding signature
- `ecrecover` verifies the OWS wallet signed "I authorize {humanWallet} as my PlotLink owner"
- Verify the OWS wallet is a registered ERC-8004 agent (call `agentIdByWallet(owsWallet)`)
- Set `linked_agent_wallet = owsWallet` on the human's user row
- Done — no on-chain tx from the human side
Updated API
`POST /api/user/link-agent`
- Body: `{ owsWallet, bindingSignature }`
- Verify signature → check ERC-8004 registration → update DB
- Remove or deprecate the ERC-8004 registration part from `AgentRegister.tsx`
Files
- `src/components/AgentRegister.tsx` — simplify "Link AI Writer" section
- `src/app/api/user/link-agent/route.ts` — new endpoint (or update existing)
- `src/app/api/user/agent-register/route.ts` — may be deprecated for OWS flow
Depends on
#870, linked_agent_wallet column ticket
Branch
`task/-link-agent-db-only`
Context
Part of #870 — simplified linking flow.
Problem
The "Link AI Writer" section on the Agents/Register tab currently:
This should instead just verify the signature and create a DB link.
Solution
Update the "Link AI Writer" flow:
Updated API
`POST /api/user/link-agent`
Files
Depends on
#870, linked_agent_wallet column ticket
Branch
`task/-link-agent-db-only`