Smart contract engineer. EVM & Solana. Stablecoin & payment infrastructure. Breaking DeFi in audit contests.

Remote
Martín. Stablecoin and payment infra on EVM and Solana. I also break DeFi protocols in audits. 18 open-source protocols shipped. 23 findings with working PoCs on a private audit. 4 in contests this year, 3 High. Site: martincasais.com Labs: labs.martincasais.com
1
5
780
x402 is turning into Stripe. Slower, worse docs. First year the homepage said no subscriptions, no prepayments, no lock-in. Second year we got session tokens, balances, refunds. Someone is shipping chargebacks on top of it as I type this. I think the honest version is that pay per request was never going to survive contact with a real agent. Looks great in a demo. Then your agent calls the same endpoint 40,000 times before lunch and you figure out what a subscription actually was, a cache for payments. So every feature since has been the protocol slowly remembering why cards work the way they do. And the one thing the pitch depended on, telling an agent apart from a cron job, still isnt in the spec. Thirty years waiting on HTTP 402 and we used it to rebuild Visa with extra steps.
71
x402 was built so an agent could pay for something without having an account. Coinbase just shipped it as a feature of your brokerage account. Read the launch post again. The agent pays a cent for a sentiment feed, then buys the stock. Same balance. Same login. Same key. 230M x402 transactions, $54M in volume. Do the math, that is 23 cents per payment. That is what the protocol was designed to protect. Now it sits next to your NVDA position, and the sandboxed equities accounts are coming soon, their words, which means today they do not exist. I build on x402 and the one rule I never broke is that the agent paying for data does not hold the key that moves real money. The entire security model is that the worst case is a lost cent. Coinbase took the thing that made agent payments safe and used it as the onboarding for agents trading your portfolio. If the agent hallucinates on a Tuesday night, it is not a 23 cent problem anymore. Half of all x402 traffic runs through Coinbase. They are not building the agent economy. They are building a brokerage where the client never sleeps and never says no.
1
86
Been staring at Kalshi's ETH perp numbers for an hour and I can't make them make sense. $538M traded yesterday. $3M open interest. Whole book flips every 8 minutes. So I pulled the trades. 59% of the volume is one $5,500 clip. Gets hit, back on the book 117ms later, hit again. 469k times in two weeks. Then it clicked. Kalshi pays market makers $110k a month to keep quotes up. Self clearing traders hit those quotes with zero fees. One side is paid to post, the other pays nothing to take, and every round trip counts as volume. It's not a bug, it's the incentive design doing exactly what it says. Kalshi's own market maker is also a self clearing member. No way to tell from the tape if it's in there. And they're raising $1B at $40B on that volume number. We clowned on offshore exchanges for years for doing this with bots. Didn't know you could do it with a CFTC license
1
3
65
El Salvador made every shop take bitcoin by law and 5 years later Bukele is quietly moving to stablecoins. Turns out even the bitcoin country would rather spend dollars
40
Built AutonomiX on EVM as a side project. Now it's the Week 6 challenge in Solana Audit Arena, ported to Solana, and researchers have 7 days to break it. First arena challenge with an off-chain component. The x402 relay is the new attack surface. Start there. Fastest way to learn agentic payments is breaking one.
Solana Audit Arena Week 6 is now live! I am helping security researchers becoming more experienced in the new era of payments "Agentic Payments" and solana blockchain, both tracks gives you 6 digits salary, so go and hack it. Solana Autonomix is an on-chain marketplace for AI agents on Solana. Agents register an identity, clients pay per request using the x402 protocol (HTTP 402 Payment Required), and every paid request can leave one rating that builds the agent's reputation. It was originally designed for EVM by @casaisdev This is the first time Solana Audit Arena challenge has an off-chain component. github.com/Frankcastleaudito…
1
81
The 21 bank stablecoin will never see mainnet. Libra had 28 members, Facebook's money, and died in a conference room. This one has 21 legal departments and a launch date in 2027. Tether owns 59% of a $308B market with a fraction of the headcount of any bank on that list. Circle took 23% by moving while banks were still scheduling calls. I wrote a stablecoin protocol on my own. Contract, oracle, liquidations. That's the easy part and everyone building in this space knows it. Distribution is the moat. Nobody gets distribution by asking 21 compliance teams for permission.
1
48
Deposit into a curated vault and the person picking your risk keeps up to half your yield and zero of your losses. I went through the MetaMorpho fee logic expecting something like a hedge fund. Curator takes a cut of interest, capped at 50%. Bad debt gets written straight to suppliers. The fee can't go below zero. There's no variable for it. November, xUSD collapsed. One curated USDC vault booked 3.6% bad debt to depositors. Curator didn't put in a cent. Kept everything earned before. Celsius at least pretended the losses were theirs. Half the upside, none of the downside, and we call it risk management.
1
40
Coinbase built the rail to get around Visa. Then handed it to a foundation. Visa took a board seat. Fourteen months. x402 did 75 million payments last month. $24 million total. About 32 cents each. Nobody at Visa gets out of bed for 32 cents. They got out of bed for the spec. The foundation's launch text now says x402 supports payment types from traditional cards to stablecoins. I run x402 endpoints on Base. Every payment they take is a signed USDC push, final the second it settles. Cards were the thing we left behind. Here's what the card networks understand that most people cheering the member list don't. The exact scheme has no refund. The FAQ says it plainly: the seller sends you a new transfer, or doesn't. So every serious buyer is going to want a dispute path, and that path is being written right now as extensions. Escrow windows. Arbiters. An open issue on the repo about attaching evidence to contest a charge. Whoever governs the dispute layer governs the payment. Visa has known this for fifty years. It's the entire business. Interchange was never the cost of moving money. It was the cost of taking it back. The rail is free and will stay free. The chargeback is where the 2% goes. And the people who invented the 2% just joined the board.
1
76
If your DeFi thesis needed users to understand DeFi, you already lost. Robinhood just pushed $500M into Morpho vaults in one month. No bridge. No DEX. One button called Earn. Most of those users are lending against Ethena collateral and have no idea. Six years of onboarding the next billion threads. Robinhood did it by never telling them. DeFi won. Degens didn't. The protocols are plumbing now, and plumbing doesn't airdrop. Which side were you building for?
1
45
The SEC just legalized Uniswap's math and banned Uniswap's users. DeFi threw a party. The order everyone is celebrating: AMMs can trade tokenized stocks for five years without registering as an exchange. Fine print nobody read: A US company runs the pool. Every wallet gets whitelisted first. The issuer can veto your token with 30 days notice. Protocols with no operator: not mentioned. Not once. That is not a DeFi exemption. That is Nasdaq with a constant product formula. UNI went up 30% on it. Uniswap can't qualify. No venue, no whitelist, nobody to send the notice to. In 2022 the SEC said permissionless AMMs are exchanges. In 2026 it says AMMs are fine as long as they aren't permissionless. Same regulator. Same answer. The only thing that changed is who cheered. You spent eight years building the thing so nobody could gate it. They kept the thing and added the gate. And your bags pumped, so you clapped.
52
Every AI agent that pays for anything now runs on one company's plumbing. Nobody voted. It took a week. Circle mints the dollar. Circle runs the facilitator that verifies the signature and broadcasts the transfer. Circle now runs the chain it settles on, blocks signed by a dozen banks. And in the docs, delivery is only guaranteed on that chain. Base and Polygon get a shrug. Issuer, courier, ledger, fine print. Same logo on all four. Visa needed fifty years to get that seat. Circle got it with an HTTP status code from 1997. The honest part is what makes it worse: the guarantee is real. Base can reorg. Twelve banks who know each other by first name can't. So the only place your agent's money is truly final is the one place Circle owns end to end. We spent eight years making sure nobody could sit in the middle of a payment. Then we built a customer with no opinion about it. Ask your agent who it banks with. It won't know. That's the design.
2
1
122
x402 exists so nothing sits between an agent and the thing it's paying for. This week Circle sat down in the middle and wrote the terms. The new Circle facilitator on Arc verifies every payment signature and submits the USDC transfer for you. Fine, someone has to. Then the docs say the quiet part: on Base and Polygon, Circle does not guarantee you receive the funds. On Arc, settlement is final. I had to read that twice. The same company issues the dollar, checks the signature, sends the transaction, and now grades the chains. Its own chain, with 12 validators who all know each other, gets the guarantee. The chain where most agent traffic actually lives gets a shrug. I run x402 endpoints on Base. My buyers sign one exact USDC authorization per call and someone else broadcasts it. Until this week I never thought about who that someone is. Now it's Circle, and Circle just told me it isn't responsible if my money doesn't arrive. Nothing here is a lie. Base can reorg. Arc, with that validator set, basically can't. That's the trick. You don't capture a payment protocol by blocking anything. You become the only one willing to stand behind the settlement, and you only stand behind it on the chain you run. Eight years of USDC being the dollar of every chain, and it ended in a disclaimer.
1
2
147
Arc runs USDC with 18 decimals for gas and 6 decimals for your wallet. Same balance, two answers. Add them up and you double count. Mix them and you're off by a trillion. Below a millionth of a dollar, one side says zero and the other says no. Every wallet, bridge and payments app on Arc has to get this right on day one, and the chain won't tell them when they don't. The first exploit here won't be a hack. It'll be a decimal.
1
162
Arc launched with 12 validators and Aave, Morpho and Uniswap were deployed on it before crypto twitter finished explaining why it doesn't count as a blockchain. The three protocols that defined permissionless finance did not wait for a forum thread on whether Visa producing blocks is acceptable. They shipped. Day one. Arc has the one thing every L2 has spent three years begging for: 74 billion dollars that already exist, and gas paid in them. I write stablecoin contracts. I built commit reveal liquidations so nobody could front run a position. On Arc the front runner would have to be BlackRock. My hardest work solves a problem the customers just decided not to have. Nobody wanted decentralization. They wanted to not get rugged. A bank with a licence and a court behind it covers that for most people, and it charges a cent. This is the part that gets me unfollowed. Ethereum is not losing to a faster chain. It is losing to a settlement network that copied its bytecode and dropped the ideology. And every Solidity dev who is allergic to that is about to watch the salaries go to the ones who aren't.
2
2
112
Circle shipped a chain today where the fee on a one cent payment is one cent. Not a jab, it's the fee doc. Arc targets a base fee of about $0.01 per transaction. The median x402 call, the thing agents actually pay for, is $0.01. Their own landing page puts the real weekly average at 4.5 cents. Gas is the whole invoice on a good week and four invoices on a normal one. I build on x402. On Base that call costs me a hundredth of a cent, priced in ETH I have to reprice every block, and I complain about it. I'd take that over a fee that is 100% of the sale and never moves. One line from the docs nobody quoted. Fees are denominated in USDC with 18 decimals. Your USDC has six. The gas unit is a USDC that isn't the one in your wallet, and the conversion is yours. Visa produces blocks on this chain. Visa takes about two percent of a swipe and gets called a tax for it. They said predictable fees. They meant a dollar per hundred calls, on the chain built for the calls.
1
2
139
The spending limit on an x402 agent is a number in its code. The key it signs with can move the whole balance. Both are true. Only one of them is enforced onchain. I build on x402. A payment on Base is a USDC transferWithAuthorization: from, to, value, a time window, a nonce. That is the entire message. No field for budget, no field for which endpoint, no field for what the agent thought it was buying. A valid signature over those six things is money. Whatever limit you set lives next to the key. Same process, same machine. Someone who gets in does not need the agent's permission and does not need x402 at all. They sign one authorization to their own address and post it to the USDC contract themselves. I read the spec twice looking for where the limit is supposed to go. It is not there. The scheme is the signature. The only real fix I know is boring exchange ops. Fund the key for a day, sweep the rest, alert on any authorization you did not produce. Nothing in the agent stack does that for you yet. Agents do not have wallets. They have servers that sign.
1
90
Your agent paid twice for one x402 call today and it doesn't know. I know because my first endpoint did exactly that, and the middleware I reviewed last week still does. The loop is short. The payment header is an EIP-3009 authorization with a nonce. Settle burns the nonce. Settle first, handler throws, the client gets a 500 and a receipt for nothing. It retries with the same header. Nonce's gone. 402. It signs a fresh one and pays again. Two settlements, one response, and the agent moves on, because there is no line in the flow where it could learn what it just bought. The spec says the opposite. Verify, run the resource, settle, respond. The TS middleware even buffers the response so nothing leaves before the money lands. Meanwhile there's third party middleware documenting verify, settle, handler, in that order, as the way to do it. People copy what runs, not what's written. Stripe fixed this in 2013 with one header. Same idempotency key on the retry, you get the original result back, no second charge, kept for 24 hours. The base x402 flow has nothing like it. The batch settlement scheme finally does, a retry of the same authorization returns the cached response and never touches the handler. Go check who's actually on that scheme. The fix is dull. Store the response keyed to payer and nonce. On a retry, hand it back. Or settle after the handler like the spec says, which is what I did, knowing a dead settle now eats my compute. On a one cent call that costs me less than a double charge costs them. Stateless is a property of the rail. It was never supposed to be a property of your customer's balance.
5
240
An x402 facilitator now charges more than a credit card. Not in dollars. In percent, on the payments the rail was built for. Your agent pays a cent for a call. The facilitator takes two. That's 200% on a penny, on a protocol whose spec says zero fees built in. I didn't go looking. The operator showed up in my replies to defend his 18% marketplace and mentioned, almost as a footnote, that his facilitator charges a flat $0.02 escrow per settlement. Flat. His own tools on Base are listed at one cent. The median x402 service price is one cent. Gas for that settlement on Base is around a hundredth of a cent. Coinbase's facilitator charges a tenth of a cent past the first thousand a month. Two cents is twenty times the next facilitator over. That's not cost. That's a minimum price, and it sits above the entire market. Now the card. Stripe is 2.9% plus 30 cents, so 33% on a dollar. Two cents flat on a six cent call is also 33%. Under six cents this thing is worse than Visa. The median call is one cent. x402 exists because of Stripe's 30 cents. Somebody rebuilt it at two and called it escrow.
1
1
189
List your endpoint on an x402 marketplace on Base and 18 cents of every dollar an agent pays you never arrives. The protocol underneath charges zero. I did not go looking for this. I had posted that x402 settles after your endpoint runs, so a dead settle eats your compute, and the operator turned up in my replies with a fix: the agent pays through his facilitator first, gets a token, then calls you. Fair enough, that does close the hole. So I opened the signup page. You keep 82%, we take 18%, and the 18 buys discovery, payment routing and a customer pipeline. RapidAPI took 20% for years and went to 25% last November. Nobody I know ever saw one of these go the other way. This one opens at 18. I build on x402. In what I run on Base the agent signs the authorization and the USDC lands in the endpoint's wallet, no percentage on the way. That one property is the entire reason I am on this rail instead of a card rail. Zero protocol fees is on x402's homepage. Put an 18% marketplace on top and the sentence is still true, it just stopped mattering. The protocol is free. The thing people build on it is the fee.
4
10
1,462