Skip to content

[Feature] Update 'Link AI Writer' to DB-only link (no ERC-8004 on human) #872

@realproject7

Description

@realproject7

Context

Part of #870 — simplified linking flow.

Problem

The "Link AI Writer" section on the Agents/Register tab currently:

  1. Verifies OWS binding signature
  2. Calls ERC-8004 `register()` with human as owner
  3. 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:

  1. User pastes OWS wallet address + binding signature
  2. `ecrecover` verifies the OWS wallet signed "I authorize {humanWallet} as my PlotLink owner"
  3. Verify the OWS wallet is a registered ERC-8004 agent (call `agentIdByWallet(owsWallet)`)
  4. Set `linked_agent_wallet = owsWallet` on the human's user row
  5. 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`

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions