palm.fi

Hack-proof vaults on Arc, compromised private key is no longer an empty treasury.

palm.fi

Created At

ETHGlobal Mumbai

Project Description

Palm fi : hack-proof USDC vaults on Arc. A compromised private key no longer means an empty treasury.

THE PROBLEM

Almost every major treasury hack ends the same way: the attacker gets valid signatures, and the money is gone before anyone notices. On Oct 29, 2026, attackers got an exchange’s own signing infrastructure to sign for them, and billions left hot wallets in under an hour. Multisigs, MPC and HSMs all protect the key. Once the key is compromised, there is nothing left to stop the outflow.

OUR APPROACH

palmfi protects the vault, not the key. We start from the assumption that the attacker already has valid signatures, and make that survivable. Unless an attacker controls more than half of an organisation’s wallets, the most they can take is a small instant budget. Everything else waits until the team has had a chance to say no.

HOW IT WORKS

Deposit: an org (e.g. “nvidia”) registers at least 3 wallets, each with one vote, and deposits USDC into its Vault on Arc. It receives a 1:1 Protected token (nvidiaUSDC). The token can only move between the org’s own whitelisted wallets and the payment pool, so there is no side door for transfers. Instant budget: small payments go out immediately, up to a rolling 24h / 7d limit. That limit is all a single stolen key can ever move right away. Delayed requests: anything above the budget becomes a request, with a 1 USDC bond. It defaults to the maximum 72h delay until it is scored. Anomaly scoring with Chainlink CRE: the Sentinel workflow reads the vault’s own onchain history (its last 32 outflows, how often each destination has been paid, business hours, wallet ages, pending config changes) and computes a “surprise score” in bits. The delay starts at 15 minutes and doubles every 2.5 bits. Routine payroll scores about 3 bits and clears in about 30 minutes. A $3M payment at 3am to a brand-new address scores about 30 bits, which triggers a FLAG: the vault freezes and the destination is blocklisted. An attacker’s unusual withdrawal never gets the fast path. The team decides: while a request waits, a majority of the org’s other wallets can veto it, or a majority of all wallets can fast-track it. Above a hard cap, at least 24h applies unless fast-tracked. Every voter gets a Telegram alert on long delays, FLAGs and settings changes, so honest wallets are present to vote. Paying other orgs: orgs pay each other by name through a single Orbital pool, Paradigm’s N-token stablecoin AMM, built as a Uniswap v4 hook. You pay in your token and the payee receives theirs. The swap counts against your instant budget, so the pool can’t be used to get around the rules. Issuers settle in USDC later. Recovery: a FLAG freezes the vault. An optional cold recovery key, which can never spend, can unfreeze it or migrate funds to a recovery vault fixed at onboarding.

WHO IT’S FOR

DAOs, exchanges, fintechs and any team holding stablecoins in hot wallets: anyone who needs payments to go out fast day to day but can’t afford one leaked key emptying the treasury.

How it's Made

We designed palmfi backwards from one assumption: the attacker already has valid signatures. So no component trusts a signer on its own. The Vault trusts its budget and its voters, the Hub trusts only Chainlink CRE reports, and the Uniswap hook trusts only the Vault’s budget check. There are three layers: Solidity contracts on Arc, two Chainlink CRE workflows, and a Next.js app.

ARC: THE VAULT THAT CAN’T BE EMPTIED IN ONE GO

Foundry contracts deployed on Arc testnet (chain 5042002). VaultFactory clones a Vault and a ProtectedToken for each org. A single Hub is the network directory, maps org names to vaults, holds the blocklist, and is the only contract that accepts CRE reports. Every vault reports its events through the Hub, so one CRE workflow can watch every org. The Vault holds USDC, tracks the rolling 24h/7d instant budget, queues requests, counts votes, and freezes on a FLAG. The ProtectedToken enforces the whitelist in its own transfer function, so funds can’t leave through a side door. Why Arc: a treasury product shouldn’t make its users hold a volatile gas token. On Arc, USDC is the gas, so an org only ever touches USDC. One wrinkle: Arc exposes USDC both natively (18 decimals) and as an ERC-20 (6 decimals). We use only the ERC-20 interface and reject msg.value, so gas amounts and token amounts can never be confused. Arc Studio: we drove it from Claude Code through the arc-studio CLI. Studio built our Foundry project, ran the full suite on an Arc fork, and ran a security review that came with runnable PoCs. All 8 PoCs reproduced against our code. We fixed 7 with regression tests (AuditFixes.t.sol), recorded the 8th as a design decision, and redeployed. Getting exploit PoCs during a hackathon is unusual; it caught real bugs.

CHAINLINK CRE: SPOTTING THE DRAIN BEFORE IT LANDS

Sentinel (log-triggered): fires on RequestQueued, ConfigChange and Outflow events from the Hub. It reads the vault’s onchain scoringContext (the last 32 outflows, destination counts, business hours, wallet ages, pending config changes) and computes a deviation score in bits. The delay starts at a 15-minute floor and doubles every 2.5 bits. A score of 28 bits or more, or a blocklisted destination, means FLAG. The Sentinel then signs a SET_DELAY or FLAG report, which reaches Hub.onReport through the Keystone forwarder. Every CRE node has to reach the same result, so scoring is pure integer math in milli-bit fixed point, with no floats anywhere. Reconciler (cron): writes a heartbeat, scores any request the Sentinel missed, checks that reserves match token supply, and checks voter wallets for unexpected EIP-7702 delegations (a sign of a compromised wallet). Alerts on DELAY and FLAG go out over Confidential HTTP to our /api/notify endpoint, which sends Telegram messages to every voter. Why CRE: anomaly detection needs offchain computation, but the result has to be trustworthy onchain. CRE gives us decentralised, deterministic scoring that writes straight back to the contracts. No single server decides whether your treasury freezes. A fixture suite simulates the failure matrix: CRE offline, malformed or stale reports, missed events. The Hub ignores bad reports, and if no score arrives, requests stay at the 72h maximum delay. When anything fails, the outcome is slower payments, never faster ones.

UNISWAP V4: CLOSING THE SIDE DOOR

Orgs pay each other through one Orbital pool (Paradigm’s N-token stablecoin AMM), built as a single v4 hook. Every two-token PoolKey is a facade over one set of shared reserves, held as ERC-6909 claims in the PoolManager. Adding an org only adds facades over the same liquidity instead of fragmenting it into new pools. beforeSwap is a NoOp custom curve. It does closed-form trades on the sphere invariant, or, when LPs provide liquidity in tight ticks, solves Paradigm’s torus invariant by bisection (OrbitalTicks.sol). Inside the swap, the hook calls the payer vault’s chargeOutflow, so a payment through the pool uses the same budget as a withdrawal. A frozen token halts trading. Issuers settle foreign inventory in USDC later (deferred settlement). We wrote our own minimal OrbitalRouter so the hook can trust msgSender() to identify the real payer. Why v4: hooks let us replace the AMM curve entirely and enforce treasury rules inside the swap itself, so payments through the pool can’t bypass them.

WEB Next.js, wagmi and viem. Dashboard, voting with a per-term breakdown of each score, an incident view, pay-by-name and onboarding. /api/notify plus a Telegram bot for voter alerts.

NOTABLY HACKY

The Vault exceeded the 24 KB EIP-170 contract size limit, so we split it into Vault + VaultModule and joined them with delegatecall. Every contract is now under 24 KB. The scoring model exists twice, in TypeScript in the Sentinel and in the UI, to explain scores. A drift test fails CI if the two copies diverge. So the full flow can run live with cre workflow simulate --broadcast, the testnet Hub trusts CRE’s simulation forwarder. In production, Hub.pinWorkflow pins the real Keystone forwarder and workflow identity. Faucet amounts are tiny, so the testnet FLAG threshold is 18 bits instead of 28. Otherwise our demo drain wouldn’t look scary enough to trigger a FLAG. For uneven pools, the Orbital pool keeps a 20× virtual concentration so it stays on the curve.

background image mobile

Join the mailing list

Get the latest news and updates