DEV Community

Sire Adell
Sire Adell

Posted on

PayCheck Sui: a check AI agents run before paying a Sui address, with a memory they all share

One agent gets burned. Every other agent is warned.

Live app: https://paycheck-sui-app.onrender.com · Code: https://github.com/Sireadell/paycheck-sui · Video: https://youtu.be/UqQCxyq-ac4

The problem

Picture two AI agents. Agent A pays a Sui address for something and the money is gone. Agent A now knows that address is bad.

A day later Agent B is about to pay a different address. The same person controls it. Agent B has no idea, because what Agent A learned stayed with Agent A.

That's how most agent safety works today. Each agent learns on its own, so the same trick works on the next one, and the one after that.

I built PayCheck Sui so that one agent's bad payment protects every agent that checks after it.

How it works

  1. Before paying, the agent asks PayCheck about the address.
  2. PayCheck reads the address's history on Sui through Tatum. It looks for two things: which wallet sent it its first SUI, and which wallet paid its network fees.
  3. It asks Ankr the same questions, as a second opinion.
  4. It looks in Walrus Memory for a report of a bad payment, either to this address or to any wallet tied to it by one of those two links.
  5. It answers pay, caution or do not pay. Every reason is labelled FACT (read on the chain), GUESS (a rule of thumb) or REPORT (a memory another agent wrote), and every report comes with its memory id and who wrote it.
  6. After paying, the agent can report "went fine" or "went bad". That report goes into Walrus Memory, and every other agent reads it on its next check.

So when Agent B asks about its address, PayCheck sees that one wallet sent the first SUI to both addresses (or paid the fees for both), finds Agent A's report through that link, and says do not pay. Agent B never saw Agent A's address. It didn't have to.

The one rule that keeps it honest

Being linked isn't the same as being unsafe. An exchange sends the first SUI to thousands of honest wallets. A payroll wallet pays fees for its whole team.

So a link on its own never gives a red answer. With no report anywhere in the group, the answer is "pay, linked, no bad history", and the links are just shown. Red needs a stored report of a bad payment that reaches the address through a real link. The full rules table is in docs/VERDICT_RULES.md.

That's also why memory matters here. Turn memory off and the checker still finds the links, but it can't say no. The report is what turns the answer red.

There are four cases where I'd rather say caution than pay:

Case Why it's caution
Walrus Memory can't be reached A missing warning isn't the same as no warning, so it never quietly says pay. The page offers a retry
The address has no history at all There's nothing on the chain to judge yet
The address is a package or an object, not a wallet Money sent there is usually gone. Tatum tells me what kind of address it is
The bad report reaches it only through a busy funder More on this below

Why Sui, Walrus Memory and Tatum

Sui records who paid the fee. On Sui a transaction can have its network fee paid by a different wallet from the one sending the money. That fee payer (a "gas sponsor") is written into the transaction. Two wallets whose money came from different places can still share one fee payer, and that ties them to one operator. Most chains don't record this at all.

Walrus Memory is where the warning lives. Without it, Agent A's report sits inside Agent A's own process and dies when that process stops. In Walrus Memory it's shared, it's still there after a restart, and every agent reads it without anyone passing it along. Every check asks Walrus Memory for reports, so any agent running PayCheck against the same memory space sees the same warnings.

Tatum serves every chain read. History, single transactions, who sent the first SUI, fee payers, balances, the latest checkpoint and whether an address is a wallet at all come from Tatum's Sui GraphQL endpoint. On the live page, every check also shows what Tatum was asked: how many calls, which kind, how long they took. Next to that it shows what the wallet and its funder hold, the network fee right now, and who funded the funder, which costs at most two extra calls. None of that extra changes a verdict. It's there so you can see what the answer stands on. The client stays at 2.5 requests a second, under the free plan's 3.

AI agents can call it as an MCP tool, check_payee(address) (MCP is the plug-in format assistants like Claude and Cursor use to call outside tools). There's a hosted address, so an agent can add https://paycheck-sui-app.onrender.com/mcp with no keys and nothing to install. Setup is in docs/MCP.md.

Does it find real groups?

I didn't want a test set I'd built to be easy. So the main test uses real Sui mainnet wallets, picked by a fixed rule from about 100 days of chain history, with no input from what PayCheck would say about them.

The real set has 20 groups (8 tied by a shared fee payer, 12 by a shared first funder), 70 wallets inside those groups, and 20 ordinary wallets with no link I could find. Every proof transaction, 90 of them, was verified by script against two providers (Tatum and Ankr). Both agreed on the sender, the fee payer and whether it succeeded, for all 90.

With memory off (so this measures link finding only):

What Result
Groups found 18 of 20 (fee payer 7 of 8, first funder 11 of 12)
Wallets inside those groups tied back to their group 57 of 70
Ordinary wallets wrongly told "do not pay" 0 of 20
Ordinary wallets told "caution" 3 of 20, all wallets that sent money straight back to the wallet that funded them

Does memory actually change anything?

To test the memory, I held back one wallet per group and told memory that a payment to a different wallet in that group went bad. Then I checked the held-back wallet. Ordinary wallets were split the same way, with "went fine" reports.

This tests whether a warning spreads, not how well PayCheck finds bad wallets. The real set has no recorded losses, so the bad reports are ones I put in.

I also wanted to know whether a plain AI could do the same job. So there are four columns, all reading the same saved chain data. The AI is gemini-3.1-flash-lite, a small model, at temperature 0, one run per case. 30 held-back cases: 20 group wallets and 10 ordinary wallets.

Plain AI Plain AI + report Checker Checker + memory
Group wallets answered "do not pay" 5 of 20 18 of 20 0 of 20 18 of 20
Group wallets where the right link was named 17 of 20 8 of 20 18 of 20 18 of 20
Ordinary wallets wrongly told "do not pay" 3 of 10 3 of 10 0 of 10 0 of 10
Ordinary wallets told "do not pay" or "caution" 4 of 10 5 of 10 1 of 10 1 of 10

Memory changed the answer on 18 of the 30 cases, every one of them a group wallet going from pay or caution to do not pay.

The second column surprised me. When I pasted the same report into the AI's prompt, it stopped 18 of 20 too. So memory doesn't win on smarter reasoning. The AI only had that report because I put it there by hand. A real agent needs something to carry the report to it, and that's the job Walrus Memory does. The AI did tell 3 of 10 ordinary wallets not to pay, where the checker told none.

A stronger model might beat these numbers. The stronger models on my key were over quota or capped at 20 calls a day, so I couldn't run them across all the cases. The benchmark takes --model=<name> if you want to try one.

Where it lost

Four held-back cases went badly, and I'd rather show them than have you find them:

Case What happened
rs-15 No link found, answer "pay". The shared transactions aren't in the oldest 50 the checker reads. At 200 transactions it still misses them
rs-20 The AI said "do not pay". The checker found the shared fee payer and said "pay". The wallet reported as bad has a different fee payer in the checker's reading, so the report was saved under another address and memory found nothing for this wallet
rc-12 An ordinary wallet that sent money back to its funder. The checker said "caution", the AI said "pay"
rs-19 The AI named the wallet that funded this group and the checker didn't, though memory still stopped the payment. Reading 200 transactions instead of 50 fixes it

Reading 200 transactions per wallet instead of 50 finds 19 of 20 groups instead of 18, and still tells no ordinary wallet "do not pay". It costs more: 5.79 Tatum calls per check on average instead of 4.10. The live default is still 50.

What went wrong, and what I changed

The pick rule for the real set changed before I kept any picks. My first versions sampled too thinly and found almost nothing. One found no groups and a single ordinary wallet, because most senders on Sui are busy bots and plain payments are rare. I widened the sample and the kind of wallet it looks at, three times. Every pick from an earlier version was thrown away.

One last change came after a full pass of 12,000 checkpoints found only 5 groups. I raised the sample to 60,000 checkpoints and let it read up to 1,500 transactions of a fee payer instead of 500. PayCheck hadn't been run on a single case at that point, so no result could steer the change. The full history is in docs/METHOD.md.

One report could turn a busy funder's wallets red. I went looking for ways to break my own rules and found one on real data. I took a real wallet that had sent the first SUI to many others and tried a single made-up bad report on one of them, in memory only, never written. 7 of the 7 wallets I checked went to do not pay. That's too much power for one report. Now, when the only path from the report runs through a funder that has paid 15 or more wallets, the answer is caution, and all 7 come back caution. A direct group link still turns red. It costs one more Tatum read per check, which is why the average went from 3.10 calls to 4.10. After the change I re-ran the real set and replayed the benchmark from its saved data, and every count stayed the same.

The shared-service numbers are my picks, not proven. A wallet that funds or pays fees for 15 or more wallets over 25 hours or more is treated as a shared service, like an exchange, and counts only as a weak link. I chose 15 and 25. On the real data the largest real group I saw touched 14 wallets and the smallest shared service touched 15 over 37 hours, so 15 sits in the gap. But the shared-service list was found with that same rule, so this doesn't prove the value. I never saw 15 wallets inside 25 hours anywhere, so the 25 is untested at the short end.

There's a weakness under that too. 84 wallets in the sample met the shared-service rule, but reading only the oldest 50 transactions, PayCheck itself recognised 18 of them. At 200 transactions it recognised 29.

Some test money got stuck. Two of my early tries at building the stress test wallets crashed halfway, and the keys for their funding wallets were only kept while the program ran. About 1.96 SUI is stuck in those wallets for good.

Memory isn't empty on day one

Before launch I ran PayCheck on 200 public Sui addresses, picked by a fixed rule (recent senders, walking back one checkpoint at a time, nothing skipped for how it looked). These are labelled pre-scan everywhere, kept apart from real use, and can never count as memory changing an answer.

All 200 were stored. I then recalled each one from Walrus by its exact address and checked it came back: 171 of 200 did. The other 29 are stored but not counted. For 23 of them, the search ran but didn't return that address's verdict, and the other 6 hit errors or timeouts.

The rest of the loop

Then I ran the whole story for real on Sui mainnet. I made three fresh wallets: one that sent the first SUI to the other two and paid their network fees. My shared test wallet (the one that sends every payment in these runs) paid 0.001 SUI to one of them, a wallet Agent A controls (transaction), and Agent A then reported that payment as bad. That part is staged. Nobody took my money, I had Agent A report it bad on purpose so there was something to warn about. Agent B, a separate program with its own key, was only given the second address. It had never seen the first one. PayCheck found that both addresses share a funder and a fee payer, followed that to Agent A's report, and said do not pay. With memory off, the same check said pay. Agent A's report is memory V6yH0O1nbbcEp5yRz34iY0dqZpVatKV1kXbScXGdL3U.

You can run Agent B's check yourself. On the live page, the "Try the wallet Agent B was about to pay" button fills in that address with memory on. Flip the memory switch off and the answer goes back to pay.

One thing to know about that run: both agents use one Walrus Memory account. It's two programs with two keys reading one shared memory space, not two strangers.

What the next agent sees

A warning is only useful if the next agent can see it. The first screen lists the last five shared warnings: who reported, when, and the memory id, so you can open the source yourself. And when an agent reports a bad payment, PayCheck also saves a short profile of that wallet next to the report: who funded it, who paid its fees, how old it is and how much history was read. The next agent gets more than a yes or no. Like the Tatum extras, none of this changes a verdict.

Next, the check inside the payment step. The agent was asked to pay an address with a bad report on it, and it refused to sign. No transaction went out. That address is a fresh wallet I made and reported bad myself, because I didn't want to call a real person's wallet bad. Then it was asked to pay an ordinary wallet from the real set, got "pay", and sent 0.001 SUI (transaction).

A check can also be bought per call, two ways, both in SUI on mainnet. The plain way: the server answers with a price, the agent sends SUI, and the server reads the payment back through Tatum before it answers. I ran one real paid check like that (transaction), sent the same payment again, and the server refused it.

The second way is x402. The ready-made Sui x402 packages I found take USDC, and my wallet holds SUI. Then I read the x402 foundation's own spec for Sui, and it lists plain SUI as an allowed asset. So I wrote the server side from the spec: the server answers 402 with the price, the agent signs a SUI transfer and sends it back, and the server checks it, settles it and answers with a receipt. There's no outside facilitator, this server settles the payment itself. Two real payments went through it on mainnet, one of them on the live server (transaction). Both were made by my own client script. I haven't tested it with anyone else's x402 client yet. docs/PAYMENTS.md has the details.

Last, a stress test on wallets I built myself on mainnet: 16 groups with 65 wallets, plus 16 ordinary wallets. I saved the answer key before running the check. It found 65 of 65 and wrongly flagged 0 of 16. Don't read much into that. I made those links, and they're easy: fresh wallets, short histories. It shows the rules do what they say, not how PayCheck does in the real world. For that, the number is the real set: 19 of 20 groups found reading 200 transactions per wallet.

What this is not

  • It's not a fraud detector or a scam list. A red answer means someone reported a bad payment that reaches this address through a real link. It doesn't mean anyone proved fraud.
  • It can't protect the first victim of a new group. Until someone reports, the answer is "pay, linked, no bad history".
  • One bad report is enough to turn a direct link red. That's how one agent warns the rest, and it's also why every answer shows who reported and the memory id.
  • It's not a guarantee. The real set has small groups (2 to 9 wallets) and young ordinary wallets. It shows the method works on real chain data, not that it works on every wallet.
  • It's not two strangers warning each other yet. My two agents have two keys but share one Walrus Memory account.
  • It can't see further back than late January 2026, which is as far as the Sui history I read through Tatum goes. For a wallet funded before then, it can't tell who funded it.
  • It's not tested with other people's x402 clients. Both x402 payments came from my own script, and no outside facilitator is involved.

Next

These are plans, not finished work.

  • Read the newest transactions of a busy wallet as well as the oldest, so links like rs-15 aren't hidden.
  • Let agents run by different people use their own Walrus Memory accounts and still read one shared space of reports, so reports come from separate identities.
  • Test the x402 route with other people's x402 clients, and add USDC next to SUI.
  • Let an agent describe a bad payment in its own words and turn that into a structured report.
  • A second real set built from a public list of known bad Sui addresses, if a trustworthy one exists.
  • Older reports slowly count for less unless someone confirms them again.
  • A third data provider as another second opinion.

Check it yourself

  • Live page: https://paycheck-sui-app.onrender.com. Press "Try the wallet Agent B was about to pay", then flip the memory switch next to it and check again. The free server can be slow to wake, so the first check may take up to a minute.
  • Code: https://github.com/Sireadell/paycheck-sui. npm test runs 230 tests with no keys needed, and npm run reproduce recounts every number in this post from the saved files. With a Tatum key, npm run reproduce -- --live checks the 40 real-set wallets again on the chain. I ran it on 10 Nov and got 18 of 20 again, with 0 differences.
  • How the real set and pre-scan were picked: docs/METHOD.md. The answer rules: docs/VERDICT_RULES.md.

The tracing rules (shared funder, round trips, shared services) started in an earlier project of mine, PulseVerify, and were ported to Sui. Reading Sui through Tatum and Ankr, the fee payer link, the Walrus Memory layer, the benchmark, the payments and the agent tool were built for this hackathon. The first version of the web page came from Tatum AI Builder, which saved it to a GitHub repo of mine. I then wired it to the server and changed it by hand.

One agent gets burned. Every other agent is warned.

Top comments (0)