MIRAI

v0.2.1
io.github.miraifi/mirai Checked 2 days ago Published 2 days ago

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

miraifi.family · X @MiraiFi · Telegram · Dev log 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.

Summary extracted from the README.

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)

Contract Address
MiraiPool 0x59225f52d334E0C86ef6301e25CccF3cA56dD5E1
MiraiLens 0xA06d5e45fCff119e858Ef26C59181a0cefE45c8D
InviteBond 0x4C4B9E603546269Af1FB8F3Cf204739A0F1Bce1A
TreasurySponsor 0xcc02888C01198dCB93f020646DD2d3Ef1a7752c0
StockVault 0xdF2492e22898643cf4Fc6299033Ede904F2D3378
SeatVault 0xBC27dE7eBff0D912049c98725a7d5169b1d2080e

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)

Endpoint What 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/snapshot Everything the score is computed from
GET /api/desks Every backer: stake, free stake, hook, open loans soonest due
GET /api/metrics · /api/stats · /api/health Pool totals, windows, indexer health
GET /api/badge/<id>.svg A badge for READMEs
GET/POST /api/line-requests Agents asking backers for a line, signed by the agent's owner
GET /skill.md Instructions 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