
{"id":257475,"date":"2026-11-30T06:53:53","date_gmt":"2026-11-30T06:53:53","guid":{"rendered":"https:\/\/mycryptomania.com\/?p=257475"},"modified":"2026-11-30T06:53:53","modified_gmt":"2026-11-30T06:53:53","slug":"the-keys-couldnt-withdraw-the-money-left-anyway","status":"publish","type":"post","link":"https:\/\/mycryptomania.com\/?p=257475","title":{"rendered":"The Keys Couldn\u2019t Withdraw. The Money Left Anyway."},"content":{"rendered":"<p>Trade-only keys on two perp DEXs still moved millions in November. What a trading key can do, and my checks before an AI agent gets\u00a0one.<\/p>\n<p>Photo by <a href=\"https:\/\/unsplash.com\/@flyd2069?utm_source=medium&amp;utm_medium=referral\">FlyD<\/a> on\u00a0<a href=\"https:\/\/unsplash.com\/?utm_source=medium&amp;utm_medium=referral\">Unsplash<\/a><\/p>\n<p>At 10:11 UTC on Monday, November 16, a wallet pulled <a href=\"https:\/\/unchainedcrypto.com\/lighter-pins-drain-on-traders-leaked-api-key-says-contracts-were-not-hit\/\">$10.39 million in USDC<\/a> out of Lighter, a perpetual futures exchange that settles on Ethereum. Lighter\u2019s first public post about it came at 11:02 UTC, when it paused all withdrawals.<\/p>\n<p>Lighter\u2019s smart contracts held up fine. The attacker used one trader\u2019s API key, and that key had no permission to withdraw to anyone else\u2019s wallet. Lighter says so plainly in its <a href=\"https:\/\/x.com\/Lighter_xyz\/status\/2122394446343946717\">post-mortem<\/a>: \u201cWithdrawals only ever go to the account owner\u2019s own\u00a0wallet.\u201d<\/p>\n<p>A few days earlier, on November 13 (Beijing time), a trader on Aster, another perp DEX, says they watched <a href=\"https:\/\/crypto.news\/aster-api-wallet-private-key-leak-security-response\/\">4,564,675.50 USDT leave their account in seven transfers over 44 minutes<\/a>. The transfers were signed by a browser-generated agent key that, by the trader\u2019s account, had no withdrawal permission either. Aster\u2019s CEO confirmed on November 17 that the user\u2019s \u201cAPI Wallet private key was compromised.\u201d<\/p>\n<p>I\u2019ve written before that withdrawals stay off on any bot key, always. I still think that. What these two weeks taught me is how much a key can do with withdrawals off, and I\u2019d rather work that out now, because trading keys like these are exactly what we are starting to hand to AI\u00a0agents.<\/p>\n<h3>Why this matters for AI\u00a0agents<\/h3>\n<p>Look at who these keys are being built for. Lighter\u2019s post-mortem has a line addressed to people who \u201ctrade programmatically or run agents on Lighter,\u201d and its list of official SDKs includes an Agent Kit. On November 11, Coinbase <a href=\"https:\/\/www.coinbase.com\/blog\/agent-controls\">rolled out Agent Controls<\/a> for Coinbase for Agents, its MCP server for trading through your own AI agent. On November 23, Anchorage Digital <a href=\"https:\/\/www.anchorage.com\/insights\/anchorage-digital-and-pakt-pilot-verifiable-guardrails-for-ai-agents\">announced a pilot<\/a> in which an AI agent pays for market data over x402 and trades BTC perpetual futures on Hyperliquid from a self-custody wallet.<\/p>\n<p>On a venue like Hyperliquid, the usual way to let software trade for you is an API wallet, also called an agent wallet. The <a href=\"https:\/\/hyperliquid.gitbook.io\/hyperliquid-docs\/for-developers\/api\/nonces-and-api-wallets\">docs describe it simply<\/a>: a master account approves an API wallet \u201cto sign on behalf of the master account or any of the sub-accounts.\u201d Your main key doesn\u2019t have to sign every order. The agent key does the routine\u00a0signing.<\/p>\n<p>That\u2019s a sensible design, and the November incidents don\u2019t break it. They show where its edges are. A wallet company, imToken, put it this way in a <a href=\"https:\/\/x.com\/imTokenOfficial\/status\/2126262364945432731\">long post on November 27<\/a>: risk is \u201crapidly spreading\u201d into the systems around on-chain assets, \u201cincluding browser front ends, software supply chains, delegated API credentials, and AI Agent authorization layers.\u201d<\/p>\n<h3>Door one: \u201cyour own\u201d\u00a0accounts<\/h3>\n<p>Here is how Lighter says the money left, step by step, from its <a href=\"https:\/\/x.com\/Lighter_xyz\/status\/2122394446343946717\">post-mortem<\/a>.<\/p>\n<p>An API key on Lighter can send funds to its own account\u2019s sub-accounts. A public pool that the account creates counts as one of those. A public pool is a vault where other people can buy shares while the account\u2019s operator trades. So the attacker, holding the stolen\u00a0key:<\/p>\n<p>created a public pool from the victim\u2019s\u00a0account,minted pool shares from a separate account the attacker controlled,transferred the victim\u2019s funds into the pool, which raised the pool\u2019s value without creating new\u00a0shares,redeemed the attacker\u2019s shares and withdrew.<\/p>\n<p>Each step was something the key was allowed to do. The stolen key never had to sign a withdrawal; the attacker withdrew from its own account. <a href=\"https:\/\/thedefiant.io\/newsletter\/defi-daily\/most-of-the-weekends-crypto-losses-used-granted-access\">The Defiant<\/a> summed up the mechanism well: the attacker\u2019s pool \u201ccounted as the trader\u2019s own sub-account, so the stolen key could fill\u00a0it.\u201d<\/p>\n<p>Lighter\u2019s Guardian safeguard paused withdrawals and its Security Council returned about 5 million USDC to the trader. Withdrawals were back to normal later that day, <a href=\"https:\/\/unchainedcrypto.com\/lighter-reopens-withdrawals-hands-5-million-usdc-back-to-drained-trader\/\">according to Unchained<\/a> and <a href=\"https:\/\/thedefiant.io\/newsletter\/defi-daily\/most-of-the-weekends-crypto-losses-used-granted-access\">The Defiant<\/a>. Lighter never published a total loss. An on-chain researcher, 0xTria, put it at about $15.5 million across two market-maker accounts, a figure Lighter <a href=\"https:\/\/unchainedcrypto.com\/lighter-pins-drain-on-traders-leaked-api-key-says-contracts-were-not-hit\/\">has not confirmed<\/a>.<\/p>\n<p>The lesson I take from this one is about vocabulary. Permission screens are written in the exchange\u2019s terms: trade, transfer, withdraw. An attacker thinks in terms of where the money can end up. Any internal action that can route value toward an account someone else can touch is, for practical purposes, a withdrawal.<\/p>\n<h3>Door two: trading against\u00a0you<\/h3>\n<p>The Lighter post-mortem has a short section I\u2019d print out for anyone running a bot. It\u2019s titled \u201cWhat else a leaked key could be used for,\u201d and the first item is \u201cTrading against you\u201d: someone holding your key places orders from your account \u201cthat trade against their own orders at bad prices, moving value from you to them.\u201d It \u201cworks best in thinly traded markets.\u201d The second is opening large or highly leveraged positions, \u201cexposing it to heavy losses or liquidation.\u201d<\/p>\n<p>No exotic route is needed for this. A key that can trade can lose your money by\u00a0trading.<\/p>\n<p>The HyprEarn case on Hyperliquid fits here. On November 14, HyprEarn <a href=\"https:\/\/x.com\/HyprEarn\/status\/2121673806704243178\">posted a security notice<\/a> about \u201cunauthorized trades on a small number of Hyperliquid accounts\u201d that had approved its agent wallet. It wrote: \u201cAgent wallets can\u2019t withdraw or send funds to another address. They can place trades, which is why revoking matters.\u201d It hasn\u2019t said how many accounts were hit or how much they lost, and neither will\u00a0I.<\/p>\n<p>The Aster case may belong here too, or somewhere worse. Before the transfers, according to the trader, <a href=\"https:\/\/crypto.news\/aster-api-wallet-private-key-leak-security-response\/\">33 BTC were moved between futures and spot nine times and sold through 17 market orders<\/a>. The trader also says their privacy settings blocked internal transfers to other users, yet the USDT went to a newly registered account. As of Pakt\u2019s <a href=\"https:\/\/usepakt.ai\/learn\/lighter-aster-api-key-incidents\">November 23 write-up<\/a>, how the key leaked, and how it could fund a stranger\u2019s account, was not public. I\u2019d treat the Aster details as one user\u2019s account until Aster publishes its\u00a0own.<\/p>\n<h3>Door three: the field nobody\u00a0checked<\/h3>\n<p>The same Monday, a Safe smart-account wallet lost about $6.4 million through its Zodiac Roles module, which lets bots and service providers make preset calls on a Safe\u2019s behalf. <a href=\"https:\/\/thedefiant.io\/newsletter\/defi-daily\/most-of-the-weekends-crypto-losses-used-granted-access\">The Defiant<\/a> cites analyst disco_trooper: the role checked who received a trade\u2019s output but left the executor field unchecked, and the attacker put its own wallet\u00a0there.<\/p>\n<p>That\u2019s the same idea at the smart-contract level. A permission that looks narrow (\u201cthis bot may only swap\u201d) has many fields, and any field that can point at an address is a place money can leave from. By The Defiant\u2019s count, about $16.8 million of the roughly $20.5 million taken in four incidents that weekend went out through access the owners had granted to software.<\/p>\n<h3>The word \u201cnonce\u201d means two opposite\u00a0things<\/h3>\n<p>This is the part that worries me most for people who write their own trading code, or ask an AI assistant to write it for\u00a0them.<\/p>\n<p>Lighter\u2019s keys leaked because the trader\u2019s own signing code, written outside Lighter\u2019s official SDKs, reused signing nonces. In Lighter\u2019s words, each signature uses \u201ca one-off random value called a nonce, which must be unique and unpredictable every time.\u201d Signatures are public, so \u201cif the same nonce is used with the same key to sign two different transactions, anyone can calculate the private key.\u201d Lighter notes the same is true of Bitcoin and Ethereum signatures. Its advice is to never derive this nonce \u201cfrom a timestamp, a counter, a weakly seeded random number generator, the transaction\u2019s contents or a cached\u00a0value.\u201d<\/p>\n<p>Now open Hyperliquid\u2019s API docs. There, \u201cnonce\u201d means something else: a replay-protection number attached to each action. For that one, the <a href=\"https:\/\/hyperliquid.gitbook.io\/hyperliquid-docs\/for-developers\/api\/nonces-and-api-wallets\">docs recommend<\/a> \u201can atomic counter,\u201d and the <a href=\"https:\/\/hyperliquid.gitbook.io\/hyperliquid-docs\/for-developers\/api\/exchange-endpoint\">approve-agent request<\/a> asks for the \u201ccurrent timestamp in milliseconds.\u201d<\/p>\n<p>Both docs are correct about their own nonce. But one says to use a timestamp or counter, and the other says a timestamp or counter is exactly what you must never use. A developer skimming both, or a coding assistant asked to \u201cjust write a signer,\u201d can easily blur them. I don\u2019t know who or what wrote the Lighter trader\u2019s signing code, and nobody has said. I do know I wouldn\u2019t let any model write a signer for me from scratch. The official SDKs exist for this, and Lighter says its own \u201cgenerate every nonce with a cryptographically secure random number generator.\u201d<\/p>\n<h3>An app-side revoke leaves the on-chain\u00a0approval<\/h3>\n<p>One line from HyprEarn\u2019s notice deserves more attention than it got: \u201cThe old agent stays approved on your Hyperliquid account until you remove\u00a0it.\u201d<\/p>\n<p>HyprEarn had revoked its old agent wallets on its side. That didn\u2019t remove the approval stored on the user\u2019s Hyperliquid account. Users had to go and revoke it themselves. If you have ever clicked \u201cEnable Trading\u201d on a third-party front end, that approval may still be sitting\u00a0there.<\/p>\n<p>Hyperliquid\u2019s <a href=\"https:\/\/hyperliquid.gitbook.io\/hyperliquid-docs\/for-developers\/api\/exchange-endpoint\">exchange docs<\/a> show the limits: an account can have one unnamed API wallet and up to three named ones, plus two more named agents per sub-account, and a named agent can carry an expiry of at most 180 days. That\u2019s a small enough list to audit by hand, and an expiry you can actually\u00a0set.<\/p>\n<h3>Where the limit has to\u00a0live<\/h3>\n<p>Every fix I\u2019ve cited here moves the limit out of the bot and into something the bot can\u2019t\u00a0edit.<\/p>\n<p>Lighter now <a href=\"https:\/\/x.com\/Lighter_xyz\/status\/2122394446343946717\">requires a wallet signature<\/a> to transfer funds into a public pool and has made API key signatures non-public. It says IP allowlists, per-key limits on actions and markets, and monitoring for nonce reuse are\u00a0coming.<\/p>\n<p>Coinbase\u2019s Agent Controls run, <a href=\"https:\/\/www.coinbase.com\/blog\/agent-controls\">in its words<\/a>, \u201con Coinbase\u2019s servers, not inside your agent, so your agent can\u2019t bypass them.\u201d They cover a maximum trade size, a 24-hour volume cap and an auto-stop when the portfolio falls by a set percentage. Those map neatly onto \u201ctrading against you\u201d and \u201crisky positions.\u201d With Coinbase\u2019s own example settings, $100 per trade and $1,000 a day, a thief holding your key can\u2019t do\u00a0much.<\/p>\n<p>A separate Coinbase post on November 19 makes the underlying point better than I can: on a blockchain the network only checks for a valid signature, and <a href=\"https:\/\/www.coinbase.com\/blog\/coinbase-security-proof-of-work-a-valid-signature-isnt-the-whole-story\">\u201cthe network doesn\u2019t check whether the transfer is what the customer\u00a0meant.\u201d<\/a><\/p>\n<p>Pakt, the company in the Anchorage pilot, argues for putting the policy check at the moment of signing. In its <a href=\"https:\/\/usepakt.ai\/learn\/lighter-aster-api-key-incidents\">November 23 write-up<\/a> of the Lighter and Aster cases, it says \u201ca permission flag answers \u2018can this key call withdraw?\u2019\u201d while a policy asks whether the key can \u201cmove the whole account to an address I have never seen.\u201d Pakt sells that kind of signer, so read its claim that it could have prevented both thefts as a pitch. The distinction itself holds up, and it\u2019s the most useful sentence I read on these incidents.<\/p>\n<h3>What I\u2019d check before an agent gets a trading\u00a0key<\/h3>\n<p>This is my own list, built from the incidents above. It sits on top of the basics (withdrawals off, IP lock, one key per bot), not in place of\u00a0them.<\/p>\n<p><strong>List every action the key can sign, not just the ones you plan to use.<\/strong> Internal transfers, sub-account funding, vault or pool creation, leverage changes. For each one, ask where the money could end\u00a0up.<strong>Assume a leaked trading key will be used to trade against you.<\/strong> Keep agent funds in their own sub-account sized to what you can lose, and avoid letting an agent hold keys on thin markets you don\u2019t\u00a0need.<strong>Put size, volume and loss limits where the agent can\u2019t reach them,<\/strong> on the venue\u2019s side if it offers them, or in a signer the agent can\u2019t\u00a0modify.<strong>Never hand-roll signing code.<\/strong> Use the venue\u2019s official SDK. If you or an assistant ever wrote your own signer, rotate the\u00a0keys.<strong>Audit and revoke approvals on the venue itself,<\/strong> not only in the app that created them. Set expiries where the venue allows\u00a0it.<strong>Watch for the first odd action, not the last withdrawal.<\/strong> In Lighter\u2019s case, nearly an hour passed between the withdrawal and the first public notice. A pool you didn\u2019t create or a transfer to a sub-account you don\u2019t recognize is the\u00a0alarm.<\/p>\n<p>None of this makes an agent safe. It makes a leaked key smaller, and that\u2019s the part of the problem you actually\u00a0control.<\/p>\n<h3>Sources (all opened November 28,\u00a02026)<\/h3>\n<p>Lighter (@Lighter_xyz), \u201cSigning Safely on Lighter: Lessons from November 16,\u201d X article posted November 16, 2026, 18:20 UTC. <a href=\"https:\/\/x.com\/Lighter_xyz\/status\/2122394446343946717\">https:\/\/x.com\/Lighter_xyz\/status\/2122394446343946717<\/a><\/p>\n<p>Unchained (David Okoya, ed.), \u201cLighter Pins Drain on Trader\u2019s Leaked API Key as Sleuths Say $15M Lost,\u201d published November 16, 2026. <a href=\"https:\/\/unchainedcrypto.com\/lighter-pins-drain-on-traders-leaked-api-key-says-contracts-were-not-hit\/\">https:\/\/unchainedcrypto.com\/lighter-pins-drain-on-traders-leaked-api-key-says-contracts-were-not-hit\/<\/a><\/p>\n<p>Unchained, \u201cLighter Reopens Withdrawals, Hands 5 Million USDC Back to Drained Trader,\u201d published November 17, 2026. <a href=\"https:\/\/unchainedcrypto.com\/lighter-reopens-withdrawals-hands-5-million-usdc-back-to-drained-trader\/\">https:\/\/unchainedcrypto.com\/lighter-reopens-withdrawals-hands-5-million-usdc-back-to-drained-trader\/<\/a><\/p>\n<p>The Defiant (Camila Russo), \u201cLighter and a Safe Wallet Lose $16.8M Through Granted Access,\u201d newsletter of November 16, 2026. <a href=\"https:\/\/thedefiant.io\/newsletter\/defi-daily\/most-of-the-weekends-crypto-losses-used-granted-access\">https:\/\/thedefiant.io\/newsletter\/defi-daily\/most-of-the-weekends-crypto-losses-used-granted-access<\/a><\/p>\n<p>crypto.news (Olivia Stephanie), \u201cAster strengthens security after API Wallet leak and reported $4.56M loss,\u201d published November 17, 2026. <a href=\"https:\/\/crypto.news\/aster-api-wallet-private-key-leak-security-response\/\">https:\/\/crypto.news\/aster-api-wallet-private-key-leak-security-response\/<\/a><\/p>\n<p>HyprEarn (@HyprEarn), security notice on X, posted November 14, 2026. <a href=\"https:\/\/x.com\/HyprEarn\/status\/2121673806704243178\">https:\/\/x.com\/HyprEarn\/status\/2121673806704243178<\/a><\/p>\n<p>Hyperliquid documentation, \u201cNonces and API wallets.\u201d <a href=\"https:\/\/hyperliquid.gitbook.io\/hyperliquid-docs\/for-developers\/api\/nonces-and-api-wallets\">https:\/\/hyperliquid.gitbook.io\/hyperliquid-docs\/for-developers\/api\/nonces-and-api-wallets<\/a><\/p>\n<p>Hyperliquid documentation, \u201cExchange endpoint\u201d (Approve an API wallet). <a href=\"https:\/\/hyperliquid.gitbook.io\/hyperliquid-docs\/for-developers\/api\/exchange-endpoint\">https:\/\/hyperliquid.gitbook.io\/hyperliquid-docs\/for-developers\/api\/exchange-endpoint<\/a><\/p>\n<p>Coinbase, \u201cCoinbase for Agents introduces new Agent Controls,\u201d published November 11, 2026. <a href=\"https:\/\/www.coinbase.com\/blog\/agent-controls\">https:\/\/www.coinbase.com\/blog\/agent-controls<\/a><\/p>\n<p>Coinbase, \u201cCoinbase Security Proof of Work: A valid signature isn\u2019t the whole story,\u201d published November 19, 2026. <a href=\"https:\/\/www.coinbase.com\/blog\/coinbase-security-proof-of-work-a-valid-signature-isnt-the-whole-story\">https:\/\/www.coinbase.com\/blog\/coinbase-security-proof-of-work-a-valid-signature-isnt-the-whole-story<\/a><\/p>\n<p>Anchorage Digital, \u201cAnchorage Digital and Pakt Pilot Verifiable Guardrails for AI Agents,\u201d published November 23, 2026. <a href=\"https:\/\/www.anchorage.com\/insights\/anchorage-digital-and-pakt-pilot-verifiable-guardrails-for-ai-agents\">https:\/\/www.anchorage.com\/insights\/anchorage-digital-and-pakt-pilot-verifiable-guardrails-for-ai-agents<\/a><\/p>\n<p>Pakt (Nick Campion), \u201cLighter and Aster: Trade-Only API Keys Still Emptied Two Accounts,\u201d published November 23, 2026 (vendor analysis). <a href=\"https:\/\/usepakt.ai\/learn\/lighter-aster-api-key-incidents\">https:\/\/usepakt.ai\/learn\/lighter-aster-api-key-incidents<\/a><\/p>\n<p>imToken (@imTokenOfficial), X article on crypto\u2019s shifting attack surface, posted November 27, 2026. <a href=\"https:\/\/x.com\/imTokenOfficial\/status\/2126262364945432731\">https:\/\/x.com\/imTokenOfficial\/status\/2126262364945432731<\/a><\/p>\n<p>I\u2019m Mojtaba. I write about AI and how it\u2019s changing the way people work, invest and trade. Nothing here is investment, legal or financial advice. Every figure above links to its source; if you spot an error, tell me and I\u2019ll fix\u00a0it.<\/p>\n<p>Research and drafting were assisted by AI tools. All sources were checked and the views are my\u00a0own.<\/p>\n<p><a href=\"https:\/\/medium.com\/coinmonks\/the-keys-couldnt-withdraw-the-money-left-anyway-37f061e9a772\">The Keys Couldn\u2019t Withdraw. The Money Left Anyway.<\/a> was originally published in <a href=\"https:\/\/medium.com\/coinmonks\">Coinmonks<\/a> on Medium, where people are continuing the conversation by highlighting and responding to this story.<\/p>","protected":false},"excerpt":{"rendered":"<p>Trade-only keys on two perp DEXs still moved millions in November. What a trading key can do, and my checks before an AI agent gets\u00a0one. Photo by FlyD on\u00a0Unsplash At 10:11 UTC on Monday, November 16, a wallet pulled $10.39 million in USDC out of Lighter, a perpetual futures exchange that settles on Ethereum. Lighter\u2019s [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":257476,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-257475","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-interesting"],"_links":{"self":[{"href":"https:\/\/mycryptomania.com\/index.php?rest_route=\/wp\/v2\/posts\/257475"}],"collection":[{"href":"https:\/\/mycryptomania.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mycryptomania.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/mycryptomania.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=257475"}],"version-history":[{"count":0,"href":"https:\/\/mycryptomania.com\/index.php?rest_route=\/wp\/v2\/posts\/257475\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mycryptomania.com\/index.php?rest_route=\/wp\/v2\/media\/257476"}],"wp:attachment":[{"href":"https:\/\/mycryptomania.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=257475"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mycryptomania.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=257475"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mycryptomania.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=257475"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}