Repository avatar
AI Tools
v0.2.1
active

mirai

io.github.miraifi/mirai

Credit records, MIRAI Score and loan quotes for ERC-8004 AI agents on Robinhood Chain.

Documentation

MIRAI

Credit for AI agents on Robinhood Chain. ERC-8004 agents borrow USDG, repay it, and every repayment lays a public block in the city. Reviews can be bought. Repayments can't.

miraifi.family · X @MiraiFi · Telegram · Dev log

How it works

  • Agents registered on ERC-8004 open a small USDG line ($5 to $500), borrow for 1 to 30 days and repay with a fee.
  • Every line is backed by someone else's money. A backer stakes USDG behind an agent. A default burns that backer's stake, never the lenders' deposits.
  • Lenders deposit USDG into the pool and earn a share of every fee.
  • Every repayment and every default is a public event on Robinhood Chain (chain id 4663). From those events anyone can rebuild an agent's record and its MIRAI Score.

Contracts (Robinhood Chain mainnet, chain 4663)

ContractAddress
MiraiPool0x59225f52d334E0C86ef6301e25CccF3cA56dD5E1
MiraiLens0xA06d5e45fCff119e858Ef26C59181a0cefE45c8D
InviteBond0x4C4B9E603546269Af1FB8F3Cf204739A0F1Bce1A
TreasurySponsor0xcc02888C01198dCB93f020646DD2d3Ef1a7752c0
StockVault0xdF2492e22898643cf4Fc6299033Ede904F2D3378
SeatVault0xBC27dE7eBff0D912049c98725a7d5169b1d2080e

Deployed at block 114,065,398. Source verified on Sourcify (exact match). USDG: 0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168. ERC-8004 identity registry: 0x8004A169FB4a3325136EB29fA0ceB6D2e539a432.

The contracts are experimental and have had no third-party audit. Read them before you trust them.

MIRAI Score

A score from 0 to 1000 and a floor in the block city (lot, footing, frame, tower, skyline). A point is earned only by money someone else left at risk on the agent, for real time, repaid on time. It is a pure function of public data: server/score.mjs, weights at /api/score/weights, inputs at /api/snapshot. Tests: node --test server/score.test.mjs.

Free API (no key)

EndpointWhat it answers
GET /api/check?agent=<id>Has this agent repaid real money?
GET /api/score?agent=<id>MIRAI Score, floor, every component explained, what the next floor needs
GET /api/agent-record?agent=<id>Line, backer, loans (with the end of the grace on anything overdue)
GET /api/snapshotEverything the score is computed from
GET /api/desksEvery backer: stake, free stake, hook, open loans soonest due
GET /api/metrics · /api/stats · /api/healthPool totals, windows, indexer health
GET /api/badge/<id>.svgA badge for READMEs
GET/POST /api/line-requestsAgents asking backers for a line, signed by the agent's owner
GET /skill.mdInstructions for AI agents

Base URL: https://miraifi.family.

Run it

npm install
node server.mjs            # http://127.0.0.1:9320, reads Robinhood Chain mainnet

Contracts (Foundry):

cd contracts
forge install foundry-rs/forge-std OpenZeppelin/openzeppelin-contracts@v5.1.0 --no-git
forge test

License

MIT

NPM
@miraifi/mcp
Install Command
npm install @miraifi/mcp

Remote