Popcorn is developer tooling for EIP-8141 frame transactions and the ERC-8421 alternative mempool. With frames, a contract decides for itself which transactions are valid and pays for them. Validation is code, not a signature. That means anyone can send a transaction to the contract, even from a wallet holding no ETH, and if the contract's condition is false the transaction is invalid and costs nothing. ERC-4337 does something similar off-protocol, with bundlers and an EntryPoint contract. EIP-7702 gives an EOA code, but a key still has to sign. Frames make it native to the protocol.
That power opens up a new kind of product, but it is hard to build safely. Validation can't use certain opcodes, may not read other contracts' storage without stake, has a gas budget per mempool, and uses nonce keys that decide how many transactions anyone can make you pay for. When something is refused, the only feedback is a code like 0x22.
Popcorn turns this into Lego-like blocks, each with one job, its own storage and its own tests:
- Conditions answer YES, NO or UNKNOWN: Compare, Percent Change, Code Hash Changed, Signature, K-of-N Attestation, Exploit Proof (ZK), Membership Proof (ZK). Anything that fails to read counts as UNKNOWN, and UNKNOWN never fires.
- Logic operators: AND, OR, NOT/NOR, K-of-N, EXACTLY ONE, IF/ELSE.
- Actions: Call, Pause, Reward Pool, Anonymous Vote, Key Rotation (timelocked), Withdraw All, Post-Quantum Mode, Repay.
- Gas payers: Self-Paying (the contract pays), Caller Pays (the caller earns a reward), and a Paymaster whose policy is public on-chain code.
- Post-quantum signers: WOTS+, XMSS, FORS, SPHINCS+ and Falcon-512.
Every build follows the same pattern: a gas payer, conditions combined with logic operators, and actions. You use the blocks in Solidity by inheriting them, or with no Solidity at all through the SDK's blocks functions, which deploy on a shared, reviewed rule-set engine.
Six example projects are built only from blocks and recorded on a devnet, covering four kinds of product that frames make possible:
- Privacy: Private Payroll, with salaries paid to ML-KEM stealth addresses and a privacy pool whose withdrawals pay their own gas, with no relayer.
- Post-quantum: Quantum-Ready Treasury. If ECDSA breaks, only a committed post-quantum backup key can move the funds.
- Censorship resistance: Open Gas Network, with anonymous one-account-per-member gas sponsorship, and Walkaway Exit, where a contested guardian takeover sends funds to the owner's pre-committed address.
- Security: Proof-of-Exploit Bounty, where a whitehat proves a bug in zero knowledge from a key with no ETH and, in one transaction, gets paid while the vault pauses.
The flagship, Sovereign Account, combines them.
Every transaction explains itself. Paste any transaction hash into the explorer, whether it was included or refused, and Popcorn draws the build's flow block by block: green for YES, red for NO, grey for not reached. You see exactly where and why it failed, in plain English, using only chain and mempool data.
Tooling:
- a viem-based SDK: deploy, check whether a trigger would pass, trigger, simulate, watch, inspect any transaction, and sign with every scheme the contracts verify
- a simulator that says which mempool will accept a transaction, why, and how to fix it
- a hardened Core account written in Yul
- a hosted, read-only MCP server
- agent skills that turn a plain-language problem into a working build for any AI agent (Claude Code, Codex, Gemini CLI, OpenCode)
- a one-command local devnet
- a developer site with the block catalog, examples and explorer
Everything runs on the public frame-transaction devnet, and the site and MCP server are live.
Core (Yul). Every Popcorn contract sits on a small account written in Yul. In the validation (VERIFY) frame it delegatecalls the developer's logic: __nonceKey, then __condition with a fixed gas budget. In the action (SENDER) frame it calls __action. Core enforces one frame layout, fee caps, once-per-event nonce keys (EIP-8250 keyed nonces), a re-entry lock, a validation gas floor so conditions can't be starved into failing open, and a hybrid ECDSA + WOTS+ owner. Each contract's settings are 101 immutable bytes appended to Core's code. RuleFactory pins Core's creation hash, so only the reviewed build can be deployed.
Contracts (Solidity 0.8.33, Foundry).
- Blocks are abstract contracts with their own namespaced storage (ERC-7201), combined by inheritance. Because a block's state lives in the contract's own storage, validation can read it freely and still be admitted by the public mempool.
- Conditions return three values (YES / NO / UNKNOWN) and fail closed.
- The no-Solidity rule-set engine stores each configuration as contract code at a CREATE2 address and reads it with EXTCODECOPY. It has per-leaf gas caps and the same three-valued logic as the Solidity blocks.
- The SDK's TypeScript encoder and the Solidity builders must agree byte for byte on a shared set of test vectors, so the off-chain and on-chain engines can't drift apart.
- Post-quantum signers: WOTS+, FORS, XMSS-style and SPHINCS+-style are our own implementations; Falcon-512 uses ZKNox's ETHFALCON verifier, vendored.
- Privacy: Groth16 circuits written in circom and proven with snarkjs (membership, withdraw, stealth, exploit), Poseidon trees, and ML-KEM-768 stealth announcements via @noble/post-quantum.
SDK and tooling (TypeScript, Bun, viem, vitest). The SDK builds frame transactions, simulates them exactly with ethrex's ethrex_simulateFrameTransaction, chooses nonce keys, sizes gas, and tracks inclusion. The simulator package turns every Core error code and mempool rule into a plain-English cause and fix. The MCP server uses the official MCP TypeScript SDK over stdio, and over Streamable HTTP when hosted. The agent skills are plain SKILL.md files, so any agent can use them. The site uses React, Vite, Tailwind, framer-motion and shiki.
Infrastructure. We run on the ERC-8421 alternative-mempool devnet stack: ethrex on its EIP-8141 tracer branch, plus the workshop's skandha-based sidecar. Our one-command local devnet (Docker, ethrex + Lighthouse) applies our own patch to the sidecar, giving each sender its own validation gas budget. The site and the MCP server are deployed on Vercel.
Hacky but notable:
- Testing without EIP-8141. CoreHarness reproduces Core's exact calls so ordinary Foundry tests can run every contract.
- Explaining any transaction, with no indexer. The chain only records "condition false (0x22)". So each build has a popcornExplain view that re-runs its blocks in the same order as its condition. The test suites send every condition check (including the 1,000-run invariant fuzz) through this view and require both to agree.
- Squeezing the explain view under the gas cap. Returning a list of structs made the Sovereign Account too large to deploy under the 2^24 per-transaction gas cap, since storing code here costs about 1,000 gas per byte and a new storage slot about 98,000. So the flow is returned as a compact kind|block|label|inputs string plus one byte per node, and parsed off chain.
- Reading refused transactions back. The inspector reads them from the sidecar's own explorer API, which keeps the frames and every admission check. The node keeps state for the latest block only, so for an included transaction the node colours are derived from what inclusion proves rather than re-evaluated on today's state.
- What we learned on the public devnet. Block builders silently ignore frame transactions with a tip under about 1 gwei, even though the node suggests 1 wei. The gateway answers health checks but drops frame transactions. The SDK's network table now encodes both.
- Keeping the ZK keys valid. We moved the vault's pause state into its own block but kept its storage words where the exploit circuit reads them, so the existing Groth16 keys and fixtures stayed valid with no new trusted setup.
- Real refused hashes. The recorder deliberately submits each example's failing transaction to the sidecar, so every recorded refusal is a real transaction you can inspect.
- Same hash, refused then included. A rule-pays trigger has no signature, so a trigger refused early and the same trigger later included can be byte-for-byte identical, with the same hash.
- Bundled deploys on Vercel. The site and the MCP function are built locally and uploaded prebuilt, because both read the catalog and examples from the repo root. The MCP server is a 1.2 MB single-file function with that data bundled in.
Partner technology. The alternative-mempool devnet (ethrex tracer, sidecar, devnet explorer) is what made real frame transactions possible at all. Vercel hosts the site and the MCP server. ZKNox's ETHFALCON gave us an on-chain Falcon-512 verifier.