← Latest papers
💻 computer science

Game Hopping in Lean

This paper introduces HOPSCOTCH, a Lean 4 framework that mechanizes computationally sound, game-based cryptographic proofs using a shallow embedding and state-abstraction methodology to formally verify complex security properties like the GGM construction and IND-CCA security.

Original authors: Stefan Dziembowski, Grzegorz Fabiański, Daniele Micciancio, Rafał{} Stefański

Published 2026-08-07
📖 8 min read🧠 Deep dive

Original authors: Stefan Dziembowski, Grzegorz Fabiański, Daniele Micciancio, Rafał{} Stefański

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are a master locksmith trying to prove that your new vault is unbreakable. You don't just say, "It's strong!" You have to show a sequence of steps: "If you can't break this tiny lock, you can't break the door; if you can't break the door, you can't break the vault." This is how modern cryptography works. Experts use "games" to test security, where a hacker tries to guess a secret, and the security of a system is proven by showing that breaking it is just as hard as solving a known, impossible puzzle. But here's the catch: doing these proofs by hand is like trying to balance a house of cards in a hurricane. It's easy to make a tiny mistake, miss a subtle gap, or get lost in the complexity, and if you miss one step, the whole proof collapses. That's why scientists have been looking for a way to get a computer to check every single card, ensuring the house stands tall.

This is where the paper comes in. The authors have built a digital workshop called HOPSCOTCH (a playful name for a game of hopping) inside a powerful computer program called Lean 4. Think of HOPSCOTCH as a super-smart, robotic proof-reader that doesn't just check your math; it understands the story of the security proof. Instead of forcing cryptographers to write in a strange, limited language, HOPSCOTCH lets them write proofs using the same tools they use for all their other math. It turns the "game hopping" process—jumping from one security scenario to the next—into a clear, step-by-step object that the computer can inspect, verify, and even help automate. The authors didn't just build the tool; they used it to successfully prove the security of several famous encryption methods, including a complex construction called GGM, showing that this "robotic proof-reader" can handle real-world cryptographic challenges without getting confused.

The Big Picture: Why We Need a Proof-Reading Robot

In the world of digital security, we rely on "provable security." This means we don't just hope our codes are safe; we try to prove it. The standard way to do this is the "game-based" approach. Imagine a security guard (the system) and a burglar (the adversary). The guard has a secret, and the burglar tries to guess it. To prove the guard is safe, we don't just say "he's good." We create a series of "games" or scenarios.

  1. The Real Game: The burglar tries to break the actual system.
  2. The Hop: We imagine a slightly different game that is almost the same but easier to analyze. We prove that if the burglar can win the Real Game, they can also win this new, slightly different game.
  3. The Chain: We keep hopping from one game to another, changing the rules just a tiny bit each time, until we reach a final game that is obviously impossible to win (like guessing a coin flip correctly a million times in a row).

If we can prove that every single "hop" is safe, then the whole chain is safe. This is called a "game-hopping proof."

The problem is that humans are terrible at doing this perfectly. These proofs are long, messy, and full of tiny details. A single missed detail can make the whole proof wrong, and the system insecure. For years, researchers have tried to build special computer tools to check these proofs, but these tools often speak a different language than the mathematicians. They are like a translator who only speaks "Security" but not "Math," forcing experts to translate their ideas back and forth, which is slow and error-prone.

Enter HOPSCOTCH: The Universal Translator

The authors of this paper, Stefan Dziembowski, Grzegor Fabiański, Daniele Micciancio, and Rafał Stefański, decided to build a bridge. They created HOPSCOTCH, a framework inside Lean 4, a popular computer program used to verify mathematical proofs.

Here's the magic of HOPSCOTCH:

  • No New Language: Unlike other tools that force you to learn a new, restricted way of writing code, HOPSCOTCH lets you write proofs using standard Lean. It's like letting a chef cook with their own favorite knives instead of forcing them to use plastic ones.
  • Proofs as Objects: In HOPSCOTCH, a proof isn't just a pile of text. It's a structured object, like a Lego model. Each "hop" in the game is a specific Lego brick. You can snap them together, and the computer checks if they fit perfectly. If you try to connect two bricks that don't match, the computer says, "Nope, that doesn't work."
  • The "Abstraction" Trick: One of the hardest parts of these proofs is showing that two different-looking systems behave exactly the same. HOPSCOTCH uses a clever trick called "state abstraction." Imagine you have two robots. One has a messy internal wiring diagram, and the other has a neat one. HOPSCOTCH allows you to draw a map (an abstraction function) that shows how the messy wires correspond to the neat ones. If the map is correct, the computer knows the robots are identical in behavior, even if they look different inside.

What They Actually Did and Found

The authors didn't just build the tool; they put it to the test. They used HOPSCOTCH to formally verify the security of four major cryptographic concepts:

  1. Encrypt-then-MAC: A method to make messages both secret and tamper-proof. They proved that if the underlying encryption and the "tagging" (MAC) are safe, the whole thing is safe against even the smartest hackers.
  2. ElGamal Encryption: A famous way to send secret messages using public keys. They showed how to prove its security based on a hard math problem called the Decisional Diffie-Hellman (DDH) assumption.
  3. One-Time Secrecy to IND-CPA: They proved that if a system is safe for a single message, it can be made safe for many messages, a crucial step in building robust encryption.
  4. The GGM Construction: This is the big one. The GGM method turns a simple random number generator into a complex "pseudorandom function" (a fake random number generator that looks real). Previous computer proofs could only handle very shallow versions of this (like a 3-step tree). The authors used HOPSCOTCH to prove the security of GGM for non-constant depth, meaning it works for trees of any size. To the best of their knowledge, this is the first time a general-purpose computer proof assistant has successfully verified this specific, complex construction.

How They Did It (The "Game" Mechanics)

The paper explains that HOPSCOTCH works by breaking the proof down into specific steps, or "constructors":

  • Observational Equivalence: Proving two games look the same to an outsider.
  • Reductions: Showing that if you can break Game A, you can break Game B.
  • Hybrid Sequences: Chaining many small steps together.

The framework includes "tactics" (automated helpers) that try to solve these steps for you. For example, if you need to prove two oracles (the game systems) are the same, the computer might automatically try to find a "state abstraction" map. If it can't find one, it leaves the step for the human to solve, but it keeps the structure so the human knows exactly where they are.

The authors also proved a "computational soundness theorem." This is a fancy way of saying: "If the computer says this proof is valid, then it is actually valid in the real world." They showed that for every proof object HOPSCOTCH creates, you can mathematically calculate exactly how much "advantage" a hacker would have, based on the assumptions used in the proof. This ensures that the computer isn't just playing a game with itself; it's giving a real, concrete security guarantee.

The Bottom Line

The paper concludes that HOPSCOTCH successfully bridges the gap between the convenience of specialized security tools and the power of general-purpose math assistants. It allows cryptographers to write proofs that are easier to read, easier to check, and less prone to human error. While the authors admit that the computer doesn't yet check if the "hacker" is running fast enough (a technical detail called polynomial time), they have laid the groundwork for fully automated, trustworthy security proofs.

They also hint at the future: with these structured proof objects, it might soon be possible to use AI to help write these proofs automatically, or to extend the system to handle even more complex scenarios involving "bad events" and probability. But for now, the main achievement is clear: they have built a reliable, flexible, and powerful way to let computers help us prove that our digital secrets are safe.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →