From ab7ebdec097d84941b65304b9d8bd003c24469d6 Mon Sep 17 00:00:00 2001
From: "Thomas Marchand (agent)"
+ EntryPoint executes a user operation exactly once, if and only if
+ that same operation successfully passed validation.
+
+ ERC-4337 adds account abstraction without changing Ethereum
+ consensus. Users submit{' '}
+
+ EntryPoint is the trusted router in that flow. For every
+ operation, it may deploy the account, call account validation,
+ call paymaster validation, account for gas, execute the account
+ call, run post-operation accounting, and compensate the bundler.
+ The security-critical question is simple to say and hard to
+ prove: did the exact operation that passed validation get
+ executed exactly once?
+
+ ERC-4337 accounts and paymasters are arbitrary contracts. A proof
+ cannot assume that they are honest, simple, or even cooperative.
+ The invariant has to hold across reverts, external calls,
+ callbacks, gas-sensitive branches, and malicious return data.
+
+ The proof tracks validation and execution as trace events for
+ each operation index in a call to{' '}
+
+ This is the main invariant engineers usually mean when they say
+ EntryPoint should call the account with{' '}
+
+ The Verity model follows the Solidity{' '}
+
+ The proof is written in Lean 4 over the Verity model. The main
+ theorem decomposes the English statement into safety, liveness,
+ exactness, and ordering lemmas, then combines them into the final
+ biconditional over execution trace counts.
+
+ The benchmark case lives in{' '}
+
+ If the build succeeds, Lean has checked every proof term.{' '}
+
+ The case proves the main EntryPoint execution invariant and
+ supporting trace properties.{' '}
+
+ The proof does not assume that accounts or paymasters are honest.
+ Their behavior is universally quantified through the external-call
+ model. The remaining assumptions are the same engineering
+ boundary any formal model needs: the audited Solidity source,
+ Verity's EVM semantics, and the mapping from Solidity events
+ of interest to trace predicates.
+
+
+
+
+
+ What is a formal proof?
+ {' '}
+ A short explanation for non-specialists.
+
- EntryPoint executes a user operation exactly once, if and only if
- that same operation successfully passed validation.
+ In the modeled handleOps control flow, EntryPoint reaches a user
+ operation's execution path if and only if that same operation
+ successfully passed validation.
+ {formal}
+
+ ))}
+
+ ERC-4337 EntryPoint Execution Invariant
+
+ UserOperations,
+ bundlers collect them, and a singleton{' '}
+
+ Why this matters
+
+ handleOps.
+
+
+ i unless
+ account validation, paymaster validation when present, nonce
+ checks, and prefund checks for that same operation succeeded.
+ i occurs only
+ after validation for operation{' '}
+ i.
+ userOp.callData{' '}
+ if and only if{' '}
+ validateUserOp{' '}
+ passed for that same{' '}
+ UserOperation.
+
+ How this was proven
+
+
+
+
+ Proof status
+
+ sorry-free.
+
+
+
+
+
+
+
+ Property
+ Meaning
+ Status
+
+
+ execution_implies_validation
+ no execution without prior validation
+ proven
+
+
+ validation_implies_execution
+ validated operations are executed
+ proven
+
+
+ exactly_once_execution
+ one indexed execution event per validated op
+ proven
+
+
+ validation_before_execution
+ execution occurs after same-op validation
+ proven
+
+
+
+ operation_isolation
+ one op cannot validate execution for another
+ proven
+
+ Assumptions
+
+
+
+
+ Learn more
+
+
+ More research
+
+
- ERC-4337 accounts and paymasters are arbitrary contracts. A proof - cannot assume that they are honest, simple, or even cooperative. - The invariant has to hold across reverts, external calls, - callbacks, gas-sensitive branches, and malicious return data. + ERC-4337 accounts and paymasters are arbitrary contracts. The + full theorem engineers want would quantify over all of that EVM + behavior. This benchmark proves a narrower, useful slice: the + two-loop EntryPoint control flow that gates the operation + execution path on successful validation.
- The proof tracks validation and execution as trace events for
- each operation index in a call to{' '}
+ The proof tracks validation outcomes and execution-path
+ attempts for each operation index in a call to{' '}
handleOps.
i unless
- account validation, paymaster validation when present, nonce
- checks, and prefund checks for that same operation succeeded.
+ validation for that same operation succeeded in the model.
i occurs only
- after validation for operation{' '}
- i.
- handleOps{' '}
+ reverts, no execution-path attempt is recorded.
- This is the main invariant engineers usually mean when they say
- EntryPoint should call the account with{' '}
- userOp.callData{' '}
- if and only if{' '}
- validateUserOp{' '}
- passed for that same{' '}
- UserOperation.
+ The model records reaching _executeUserOp,
+ not successful account execution. It intentionally elides the
+ callData.length > 0{' '}
+ branch, gas accounting, and arbitrary account/paymaster
+ internals.
- The Verity model follows the Solidity{' '}
+ The Verity model follows the selected Solidity{' '}
The proof is written in Lean 4 over the Verity model. The main theorem decomposes the English statement into safety, liveness, - exactness, and ordering lemmas, then combines them into the final - biconditional over execution trace counts. + all-validated-on-success, all-executed-on-success, and + no-execution-on-revert lemmas, then combines the first two into + the biconditional.
The benchmark case lives in{' '}
@@ -187,8 +178,8 @@ export default function ERC4337EntryPointExecutionPage() {
>
Proofs.lean
- . The required Verity features for faithful external-call and
- control-flow modeling are introduced in{' '}
+ . The required Verity features for this native-loop and low-level
+ call model are introduced in{' '}
- The case proves the main EntryPoint execution invariant and
- supporting trace properties.{' '}
+ The case proves the selected EntryPoint control-flow invariant
+ and supporting properties.{' '}
- The proof does not assume that accounts or paymasters are honest.
- Their behavior is universally quantified through the external-call
- model. The remaining assumptions are the same engineering
- boundary any formal model needs: the audited Solidity source,
- Verity's EVM semantics, and the mapping from Solidity events
- of interest to trace predicates.
+ The proof does not establish full arbitrary account/paymaster EVM
+ correctness. The remaining assumptions are explicit: the selected
+ Solidity control-flow slice, Verity's semantics for the modeled
+ constructs, and the abstraction from concrete calls and calldata
+ to per-index validation and execution-path outcomes.
From bbd305b8ae93365181bf9bbd23732259df770fc8 Mon Sep 17 00:00:00 2001
From: "Thomas Marchand (agent)"
execution_implies_validation
- no execution without prior validation
+ no execution-path attempt without validation
proven
validation_implies_execution
- validated operations are executed
+ validated operations reach the execution path
proven
-
exactly_once_execution
- one indexed execution event per validated op
+ all_validated_on_success
+ a successful modeled batch has all validations true
proven
-
validation_before_execution
- execution occurs after same-op validation
+ all_executed_on_success
+ a successful modeled batch attempts every execution path
proven
-
@@ -261,12 +252,11 @@ export default function ERC4337EntryPointExecutionPage() {
Assumptions
operation_isolation
- one op cannot validate execution for another
+ no_execution_on_revert
+ validation failure records no execution attempts
proven