EIP-8105 General-purpose built-in encrypted mempool (Universal Enshrined Encrypted Mempool)
No call decision · Security & privacy · EIP status Draft · created 2025-12-17
A proposal to build an encrypted mempool into the protocol, keeping transactions encrypted until they are included in a block. It aims to prevent frontrunning and sandwich attacks and increase censorship resistance, and any encryption technology can be registered as a key provider.
Why it is needed
Today, transactions sit in the mempool in plaintext, so anyone can see their contents in advance. Builders assembling blocks, or bots watching them, can profit by jumping ahead of a user's transaction (frontrunning) or wrapping it with their own transactions on both sides (sandwich attacks). This kind of malicious reordering directly harms users, and the competition to capture that profit leads to secondary MEV side effects such as builder centralization. The fact that builders can see transaction contents in real time is also itself a basis for regulatory burden. This proposal encrypts transactions until inclusion to prevent malicious reordering and increase real-time (weak) censorship resistance. However, since transactions are ultimately revealed, the goal is not privacy improvements such as transaction confidentiality. It builds on research into the Shutterized Beacon Chain and on the protocol-external encrypted mempool implementation already running on Gnosis Chain, and is designed to fit naturally with enshrined proposer-builder separation (ePBS).
What changes
Today
- Transactions are exposed in plaintext in the mempool, so anyone can see their contents in advance
- Builders and bots can frontrun transactions or carry out sandwich attacks
- Builders can see transaction contents and filter out specific transactions in real time
After EIP-8105
- Transaction contents are encrypted and hidden until included in a block
- The decryption key is only revealed after inclusion, making reordering attacks based on content difficult
- Any method, including threshold encryption, MPC, TEEs, delay encryption, or FHE, can be registered as a key provider
- If a key provider stops functioning, plaintext transactions are still supported and chain progress is guaranteed
Who is affected
- Users: Transactions can be sent encrypted to avoid frontrunning and sandwich attacks. Existing plaintext transactions continue to work as before.
- Builder: Encrypted transaction contents are included in a block without being known. Temporarily hiding the contents reduces regulatory risk.
- Client teams: Backward-incompatible changes are introduced on both the execution layer and the consensus layer, requiring implementation of a new transaction type and new validation logic.
- Validators (PTC): EIP-7732's Payload Timeliness Committee takes on an additional role of receiving and verifying decryption keys and attesting to their presence or absence.
In depth
Key provider registry and trust graph
A system contract called the key provider registry is deployed on the execution layer. Anyone can register as a key provider and receive a unique ID; registration requires specifying a contract with a decryption function and a key verification function that take a key ID and key message as byte strings. A key provider can designate other providers as directly trusted, forming a directed graph, where a path from A to B is defined to mean A trusts B. The beacon chain replicates this registry into state in a manner similar to the deposit processing mechanism. The source code of the registry contract is still TBD. The reason for using a trust graph between providers instead of per-user trust declarations is to reduce transaction size overhead and block-building complexity, and because a small provider need only trust a large provider to be included in the same block, which mitigates monopolization.
Two new transaction types (0x05, 0x06)
Two EIP-2718-format transaction types are added. An encrypted transaction has the format 0x05 || rlp([chain_id, envelope_nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_amount, key_provider_id, key_id, encrypted_payload, envelope_signature_y_parity, envelope_signature_r, envelope_signature_s]). The fee information and key identifiers are in the plaintext envelope, and only the actual transaction content is encrypted in encrypted_payload. A decryption transaction has the format 0x06 || rlp([envelope_signer, nonce, destination, amount, data, access_list, signature_y_parity, signature_r, signature_s]), linked to the original envelope signer via the envelope_signer field.
Roles of the key provider and the PTC
Each slot, the key provider must look at the execution payload revealed by the builder, collect the key_ids of the encrypted transactions assigned to its key_provider_id, and issue either a decryption key or a key withhold notice for each one. This message references the beacon block hash to prevent reuse in future slots. The issuance can happen right after observing the payload or later in the slot. Members of EIP-7732's Payload Timeliness Committee (PTC) must receive the decryption keys referenced by every encrypted transaction in the block, verify them with the registry's validation function within a small hardcoded gas limit, and attest, per transaction, to the presence or absence of a valid key via a dedicated bitfield added to the payload attestation message.
Block structure and decryption transaction inclusion rules
In a valid block, transaction order must be decryption transactions first, encrypted transactions last, and everything else in between. If an encrypted transaction A is preceded by another encrypted transaction B, the two must either use the same key provider or B's provider must be trusted by A's provider. Each decryption transaction must preserve order and correspond one to one with an encrypted transaction from the previous block, must be the result of applying key_provider_id's decryption function to encrypted_payload, and the key used must be one attested to by the PTC in that slot. A decryption transaction is excluded if and only if one of the following holds: the key was attested as absent, decryption failed, the result is not a structurally valid transaction, envelope_signer differs from the encrypted transaction's signer, or including it would make the block invalid (e.g. nonce mismatch).
Gas and fee handling
An encrypted transaction increments the nonce of the envelope signer's account, charges a fee of gas_amount in the same manner as EIP-1559, and consumes gas_amount worth of gas. A decryption transaction executes like a normal transaction within the execution context of the block it's included in (block.slot, block.coinbase, etc.), with a gas limit equal to the corresponding encrypted transaction's gas_amount minus the cost of the encrypted transaction and the decryption cost. However, the gas consumed does not count toward the block gas limit, and no fee is charged. Fees are prepaid in the plaintext envelope to guarantee payment regardless of content, protecting both builders and the protocol, and no gas refund is given so that the fee amount is fixed at block-building time. Gas is fully consumed in the inclusion block for incentive-compatibility reasons, so that the builder of one block cannot sell the space of the next block.
Key withholding and off-protocol incentives
A key provider can withhold a decryption key according to its own conditions. This lets it enforce its own usage rules, such as whether prepayment was made, and also prevents key ID frontrunning attacks. Unjustified withholding can be used as a basis for custom slashing mechanisms or reputation metrics, since the protocol records whether a key was present. This proposal does not build a fee mechanism or penalties for key providers into the protocol. This allows a variety of incentive models, such as contracts with builders, per-user per-transaction billing, or public-goods operation, to be implemented off chain, and providers can also build their own slashing conditions for unjustified withholding to earn trust.
Security considerations
Users must trust that their key provider will neither disclose the key early (front-running risk) nor late (paying only the envelope fee while execution fails). They must also weakly trust the key providers of encrypted transactions ahead of them in the same block, since those providers can see the key for a later transaction before deciding whether to disclose it, giving them 1 bit of influence over the later transaction's pre-state, and a maliciously designed decryption scheme could make this attack much stronger. If a reorg occurs, the key for an excluded transaction may be disclosed, but because the key message includes the block hash, the verification function invalidates it, preventing payload execution and front-running. Key ID front-running, where someone copies another party's key_id to get included first, can be prevented by a namespacing strategy in which providers only accept key IDs prefixed with the envelope signer's address. Envelope hijacking attacks, where a disclosed key is used to decrypt a transaction and resubmit it in a new envelope to jump ahead, are prevented by the decryption transaction's reference to envelope_signer, and payload substitution attacks are impossible because the encrypted transaction's signature covers the payload. There is also a collusion attack where a key provider and a builder conspire to leak key information in advance, but its impact is assessed as low.
Progress status
This EIP is in Draft status, created on December 17, 2025, and its contents may still change. The source code for the key provider registry contract is also undetermined. It assumes EIP-7732 (ePBS) as a precondition and requires backwards-incompatible changes to both the execution layer and the consensus layer. The feature allowing a builder to encrypt the execution payload itself with a key provider's key has been excluded from this proposal to reduce complexity, and may be proposed separately in a future EIP.