Vajra

Your private key leaks while you sleep. You wake up with your money.

Vajra

Created At

ETHGlobal Mumbai

Project Description

VAJRA is an Ethereum smart account built for the day your key gets stolen. It runs on EIP-8141 frame transactions and the ERC-8421 alternative mempool.

Try it There's a live wallet on the public devnet, with test money: https://wallet-production-a086.up.railway.app It makes your keys on your device, and they never leave it. Use a phone if you can. It installs to the home screen.

The problem One leaked seed phrase can empty a wallet in a single transaction, and you find out after the money is gone.

How it works We gave the account the rules of a bank account and split the power between two keys.

The daily key is your normal wallet. It can only spend inside a daily limit, and new payees have a cooling-off period. Anything bigger goes into a public queue and waits there, where you can see it and cancel it.

The master key outranks it. It's a Winternitz hash-based key, so there's no elliptic curve for a quantum computer to break, and it fits inside the 100,000 gas VERIFY cap. With it you can cancel a queued payment, freeze the account, rotate keys, or escape, which moves everything to a sealed harbor address that stays secret until you use it.

So a thief with your daily key gets a day's limit and no more.

Why it needs the alternative mempool A thief with your daily key can block your escape on the public mempool just by keeping one transaction pending. The canonical mempool won't hold a keyed transaction next to a pending linear one from the same sender. The alternative mempool keeps them apart. We ran this live, offering the same signed escape to both. The canonical mempool refused it, and the alt mempool admitted and mined it. Frame transactions give us the rest: separate nonce keys, a master key that validates in a VERIFY frame, and a second sender of its own for your exit.

What else is in it The wallet app has instant and queued payments, "Not me", freeze, escape, a second way out, recovery by paper, stealth payments, the private pool, moving the hash key to a phone, and alerts by Telegram or push.

If you lose the master key, a Groth16 proof of a secret you keep on paper queues a new key tree. It waits in the same queue, so you can cancel a stolen paper.

The shielded pool holds fixed-size notes, spent with a proof and no key, and freeze and escape still control it. A public check page lets anyone search a private payment's raw chain data without a wallet.

The nominee is for when you're asleep. Someone you trust holds one transaction your hash key signed in advance. They hold no key, and it can only move your money to your own harbor. If a payment is still waiting near the end, nobody answered, so it goes.

There's also ERC-8441 stealth receiving, co-signed, with a paymaster, and a real ESP32 hardware signer for the master key. Hash key signatures are recorded on Arkiv, so a used one-time key gets skipped. The dashboard reads privately over the Nym mixnet and has an exposure scanner, and there's a browser extension.

What runs where On the public devnet, through the alt mempool: the live wallet, the core account, stealth and recovery by proof. On a local mirror of that devnet, which anyone can boot with make judge: the nominee, paymasters, notes rebuilt from one seed, a failed payment that stays claimable, the pool's meter, and every attack suite. Vanjra nominee-e2e, for example, gives 42 mined, 22 refused, 0 failures. Our newest contract fixes are in the repo and on the mirror, and reach the public devnet with the next redeploy. Every claim has a command and a recorded run in docs/evidence.

How it's Made

VAJRA is Solidity and TypeScript on top of a client and a mempool that only exist on a devnet. EIP-8141 is new enough that a lot of the work was finding out what ethrex and the sidecar really do, then building around it.

The account Solidity, built and tested with Foundry. A frame transaction splits validation from execution, and the design leans on that. The VERIFY frame decides who may act and what shape the transaction has. The SENDER frame runs the rulebook: daily limits, new-payee cooling, the public queue and freeze. The rulebook has to live in SENDER, because TIMESTAMP is banned in validation in every mempool. So a daily-key transaction that reaches a master function never becomes valid at all.

A spend over the limit becomes a queued item with a time on it. The master key can veto it, and once it matures anyone can execute it. The harbor is stored only as a commitment, keccak(address, salt), so nobody learns it until you escape.

The master key It's a Winternitz one-time signature over keccak: 67 chains at w=16, in a Merkle tree of 64 one-time keys, with the last leaf reserved for rotating to a new tree. Wots.sol verifies it in hand-unrolled assembly, against vectors from a separate TypeScript implementation. A signature is 2,144 bytes, and VERIFY costs a median of 90,009 gas. Each leaf gets its own nonce key, keccak(root, leaf), so a master transaction never waits behind anything the daily key does. It's plain keccak chains with no per-position tweak, so this is demo-grade: a real deployment should use LMS, XMSS or SPHINCS+. We also benchmarked leanSphincs-S on the mirror, a hash signature with no one-time limit, at 4,164 bytes and about 81,500 gas for a veto. It's planned as the exit's key and isn't built yet.

The second way out VajraExit is a sender of its own with its own reserve, because everything that can stop an escape is attached to the account's address: a pending transaction, a reputation ban, an empty balance. Frame transactions make that possible. The nominee's rescue is built on it too: one transaction, [VERIFY(validateExit), SENDER(escape)], signed in advance on a nonce key nothing else can touch.

The proofs Recovery and the shielded pool are two Groth16 circuits in Circom over BN254, proved with snarkjs and verified with the pairing precompiles. A note is Poseidon(secret, nullifierSeed), in a depth-20 Poseidon tree, with a ring of the last 32 roots. A recovery proof costs about 300,000 gas in VERIFY, which is why it only goes through the alt mempool. unshield must never revert once VERIFY has passed, since a mined failure is permanent, so its gas is pinned and it survives recipients that burn gas, revert with huge blobs or eat state gas. Phase 1 of the setup is PSE's perpetual powers of tau. Phase 2 has one contributor, and we say so in the docs.

The clients One TypeScript core, packages/core, runs in Node and in the browser, on viem and noble. It holds the frame encoding, the signer, the proofs' public inputs and the account reader.

The wallet is a PWA. It makes keys in the browser, seals them in one AES-GCM blob under a key stretched from your passphrase with 600,000 iterations, and proves in the browser, so a secret never leaves the device. A small service on Railway sponsors new wallets, relays announcements, finishes matured recoveries and sends alerts. It only ever sees public values, and if it goes down, every key still works straight against the public mempool.

There's also a CLI, a Next.js dashboard, a phone app with self-hosted Web Push and a passkey before "Pay, it's me", a browser extension speaking EIP-1193 and EIP-6963, and an exposure scanner that tells you whether your address has revealed its public key on chain. A failed read there says unknown, never "not exposed".

Testing We built a local mirror of the devnet: the same ethrex and sidecar commits in Docker Compose, booted with make judge. Ports shift by lane, so two mirrors can run side by side. Each attack is really sent and has to die with a named error. Playwright drives real browsers, with a virtual WebAuthn auOur last full run was 339 contract tests, 388 unit tests and 24 live suites with nofailures, and the records are in docs/evidence. Independent reviews read each new piece, and each round found something real. Partner tech The ERC-8421 alternative mempool is why this works at all. A thief with your daily key can hold one transaction pending, and the canonical mempool then refuses your keyed escape from the same sender. The alt mempool keeps the two independent. It's also the only route for our proof transactions, whand pairing precompiles. Arkiv solves a problem we couldn't solve alone. A one-time key must never sign twice, becaey are enough to forge a third, and two devices share no memory. So before signing, a signer reads Arkiv for that key tree, reserves the leaf with an entity that expires in 5 minutes, and publishes the signature afterwards, whether or not the transaction landed. Only root and leaf are indexed, and an up-to-date signer's read returns 0 rows. Each record carries the signature, so readers verave to trust who wrote it. Nym keeps reads private. The dashboard's reads go through anon-rpc over the mixnet, so theking at an account. The sidecar answers the Nym worker with HTTP 415, so sends go straightto the mempool, and the page tells you that before you send.The hacky parts You can't try a one-time signature against a node, because that reveals the key. So the client counts the hashes from the digest before it signs, and if the signature would break the 100,000 gas cap, it changea harmless gas limit by one to draw a new digest. We started with w=256 for a smaller signature. It cost 334,362 gas in VERIFY and got refus009, with a signature nearly twice the size.ethrex checks for 183,600 of execution gas on a CALL that pays a fresh address, and never look absurd on purpose.Browser encryption is asynchronous, and a used one-time key has to be recorded before its et keeps that list outside the encrypted blob, in the clear. It's not a secret: each one ispublic once used.
The sidecar has no dry run for a signed transaction, because its estimator rewrites the frames and breaks the signature. So our admission simulator replays the sidecar's own rules over ethrex's ERC-7562 trace,and the test suite holds all 66 of its verdicts against what the live sidecar then did. The sidecar as first deployed refused our proofs outright. The mirror carries one small pathe spec describes, and vajra compare still runs the same bytes through both.The mirror's block producer is a small Node script driving the Engine API.We keep old contract bytes in the repo, so an attack we fixed stays reproducible. One testembled by hand at the old and new escape. On the old bytes it halts the frame and burnsthe rescue. On the new, the money reaches the harbor.

To test a dying node, we put a small proxy between a real process and the real chain. It rld block, and answers for a sidecar that sits on a transaction.

background image mobile

Join the mailing list

Get the latest news and updates