Skip to content

Feature Proposal: Lean 4 proof export backend for hevm #1049

@MavenRain

Description

@MavenRain

Summary

I'd like to propose adding a Lean 4 proof export backend to hevm that translates symbolic execution traces into machine-checkable proof obligations. I have a pending EF ESP grant for this work and wanted to gauge maintainer interest before proceeding.

Motivation

When hevm's SMT solver returns "unsatisfiable" for a property, the result is ephemeral. There is no persistent, auditable artifact that a third party can independently check. For high-value contracts, this gap matters.

A proof export backend would:

  1. Translate symbolic execution paths into Lean 4 theorem statements
  2. Automatically generate Lean 4 proofs for properties hevm fully verifies
  3. Produce partial proof skeletons (with explicit sorry gaps) for properties that exceed hevm's bounds

Scope

The proposed work is designed as a modular addition to minimize maintenance burden:

  • Trace extraction module: A new module exporting symbolic execution traces (path conditions, storage transitions, branch metadata) as a structured IR (JSON or S-expressions). This is the only part that touches hevm's Haskell codebase.
  • External translation tool: A standalone tool converting the IR to Lean 4 proof obligations. Lives outside hevm's repo.
  • Lean 4 libraries: EVM semantics library and tactic library for automated proof generation. Also external.

Questions for maintainers

  1. Is this a direction you'd be open to seeing for hevm?
  2. Would you be willing to review/merge a trace export module PR, assuming it's well-scoped and doesn't affect existing functionality?
  3. Are there any architectural preferences for how trace export should hook into hevm's internals?
  4. Are there other efforts in this direction I should be aware of?

Full proposal available on request. Thanks for your time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions