Binonce

Binonce: stopping the EIP-7702 "one blind signature" wallet drain with on-chain policy vaults.

Binonce

Created At

ETHGlobal Mumbai

Project Description

A stolen signature should not cost you everything you hold. Today it does.

EIP-7702 quietly changed the rules for every hot wallet in crypto. One authorization, the kind phished or leaked every day, now hands an entire account to an attacker. No second approval, no window to react. The signer who was supposed to move funds becomes the one who loses them. This is the shape of the Binance-class loss, and any exchange, custodian, or treasury running an operator key is standing on the same ground.

Binonce closes that gap. Put your funds behind it and a compromised key stops being a catastrophe. A payout only goes through if it is the right actor, the right operation, the right approvers, and inside the limit you set, checked on-chain the instant before money moves. The moment a key is hijacked, the payout simply refuses. Your money stays put while you rotate the key, with nothing drained in between.

We prove it with real money under real attack. The same break that empties an unprotected wallet runs straight into Binonce and stops cold. Even a 2-of-3 setup, with two honest owners both signing, holds the line the second one of them is compromised.

The promise is one sentence: holding a key is no longer a license to drain the account.

How it's Made

Built on top of Chainwall. Chainwall is a policy-enforced smart-vault stack: a Registry that holds the catalog (tokens, interactions, policies, membership), an Interact contract that checks an operation and its approvals, and a managed vault (an OKAccount, or a guarded Safe) that executes the approved action by running MiniScript bytecode against that catalog. Nothing moves unless an operation satisfies its approval policy and its interaction script. Our project leans on exactly this: the vault only ever pays out by executing a signed, policy-bound interaction, so an attacker who steals a key still can't make the vault act.

Architecture. The frontend drives two Chainwall tenants off a single chain registry (chainConfig(chainId)), one per network, with identical UI and only addresses and RPC differing. Wallet signing runs through Privy over wagmi and viem; viem handles EIP-712 typed data for payouts and the EIP-7702 type-4 transactions the attack uses. The Whitechain path is pure viem against the OKAccount. The Sepolia path adds a 2-of-3 guarded Safe and is driven server-side through the chainwall CLI plus Foundry cast against a keystore, with live run traces streamed to the UI over SSE.

Contracts, per chain.

Whitechain testnet (1874):

  • Registry 0x7c04a72db4f422fab4d1c94067b6a8cdac6bbb74
  • Interact 0xE389bE2d72c618290E1AdFF7B8BbEE39eC356e45
  • OKAccount vault 0x371B4E49A510Ee007d7879783B309128975CC1A1
  • TestUSDC (6dp) 0x1d9F8351F788278D3E181908cEE14c7F5766157F
  • Attack sweeper 0xb17f589b3dd10a05d4ef4ed1bdbe4cee8ec2da25

Ethereum Sepolia (11155111):

  • Registry 0xb42df5308d6cb6a6351973fcfa06b691c8bc9a05
  • Interact 0x807630c5ad0e8029eb9CFAF9357093221864b218
  • OKAccount vault 0x66340dE9fbB1795Ed1C425fdf5d464bd35B2a4FB
  • TestUSDC (6dp) 0x52425F27aD08BcA15008F5CD81Cb244821401164
  • SafeFactory 0x2C6D2BC01f02aa4b59cF202539e2C19F9f897D57
  • Guarded Safe (the vault) 0x01A7c4101F0665e7B86e4dDB5b9EFb8Dd21B2e1a
  • Attack sweeper 0x4d018751A9BB3786788132E9fB25d99B007A0e41

Both tenants share the same operation-approval policy id 0x16c6cdf01674895064373cb0d719b21d67853b8f64a24a73d7c419b6e0817772, the transfer interaction id 0xc918a5f1cb2670f14afa8bb1928f6a298e37fe1eb914df1b4ec7da9e9f38222a (Whitechain) / Safe-bound interaction 0x954bd171dd7ddebe33f76700c135a325f9ae50d21564d3ab3e6c0a04983cc44f (Sepolia), and the payout recipient 0xcBAee4793486f3Df37dbb584F5a3610ff581A614. Policy and interaction ids are 32-byte catalog ids, not addresses.

How the script interaction works and why it helps. An "interaction" is an on-chain MiniScript program, referenced by id, that defines the one action an operation is allowed to perform. It does two jobs at once: it validates the operation's arguments and it produces the exact calldata the vault will run. So a payout isn't "call transfer with whatever the caller passed," it's "run interaction 0xc918…222a, which is the only shape of transfer this vault will ever execute." Because the action is fixed in the catalog and bound by id, the attack surface collapses to what the script permits. The approval policy (a separate catalog entry, also by id) sits in front of it and bounds who must sign and how much can move, independent of the interaction itself.

How the Lambdascript works here. We author the interactions and policies in Lambdascript, a small assertion language where a program is a block of $require(...) predicates that must all hold, with no comment syntax (the files are pure code). We compile each to MiniScript bytecode with the chainwall CLI and set it on-chain; the vault's VM runs it at execute time. The transfer interaction reads:

{ $require($subjectVault == 0x371B4E49A510Ee007d7879783B309128975CC1A1), $require($subjectNativeValue == 0), $require($subjectArgCount == 2), $require($arg0 != 0), $require($arg1 > 0), $require(@token(demo/usdc).transfer($arg0 :: address, $arg1 :: uint256)) }

It asserts the operation targets our vault, sends no native value, carries exactly two arguments (recipient, amount), a non-zero recipient and positive amount, and then the last line is the payload: @token(demo/usdc) resolves the USDC token from the Registry catalog and emits the actual transfer(address,uint256) call. The spending-cap policy is a separate Lambdascript program that binds the operation to a specific policy id, vault, and interaction id, requires zero native value and two args, and clamps the amount with $subjectArg(1) > 0 && $subjectArg(1) <= 1000000000000, which is the 1,000,000 USDC ceiling at 6 decimals. Validation (who/how-much) and execution (what calldata) live in auditable, on-chain scripts rather than in frontend code.

The point it proves. Chainwall carries no EIP-7702 or 0xef0100 handling anywhere. When a payout runs through directExecuteFromAccount, SignatureChecker.isValidSignatureNow notices the operator account now holds code (because it was 7702-delegated by the attacker), routes the check to ERC-1271 on the delegate (the sweeper), which can't validate an operator signature, and the call reverts with InvalidActorSignature. The hijacked key still signs; the vault just refuses. The defense is an emergent property of standard signature checking, not a patch for 7702.

background image mobile

Join the mailing list

Get the latest news and updates

Binonce | ETHGlobal