Latep — ZK Prisoner's Dilemma on Stellar

Latep is an interactive game theory sandbox and zero-knowledge multiplayer Prisoner's Dilemma built on the Stellar blockchain. Inspired by Nicky Case's "The Evolution of Trust", it transforms theoretical game theory into experiential learning with real economic consequences and cryptographic fairness.

Three Game Modes

Tutorial (vs AI): Play iterated Prisoner's Dilemma against 9 stateful AI strategies. Each strategy remembers your past moves and adapts. Watch the trust altitude grow with mutual cooperation, experiment with noise ("the wind caught you"), and change the payoff matrix to see how different games produce different dynamics.

Tournament Mode: Watch trust evolve over generations. All 9 strategies compete in a round-robin tournament. The weak are eliminated, the strong reproduce. Add noise and watch forgiving strategies (Tit-for-Two-Tat, Generous TFT) outcompete strict Tit-for-Tat.

ZK Multiplayer: Play against other humans with real XLM stakes. Moves are committed via zero-knowledge proofs — the contract verifies your commitment is to a valid move without learning which move, ensuring truly simultaneous strategy selection on a transparent blockchain.

The 9 AI Strategies

Tit-for-Tat (TFT)Cooperates first, then copies your last move. Nice, provokable, forgiving.
Tit-for-Two-Tat (TF2T)Forgives one betrayal, retaliates after two. More forgiving than TFT.
GrudgeCooperates until you betray once, then defects forever. No forgiveness.
PavlovWin-stay, lose-shift. Keeps doing what worked, switches when it didn't.
ProberTests you with C-D-C-C, then exploits or plays TFT based on your response.
Generous TFTLike TFT but forgives 10% of defections. Thrives in noisy environments.
Always CooperateUnconditional trust. Gets exploited by defectors.
Always DefectZero trust. Can never be exploited but can never cooperate.
Random50/50 coin flip every round. No memory, no strategy.

Why Zero-Knowledge Proofs Matter

The Prisoner's Dilemma requires simultaneous commitment — neither player should know the opponent's move before committing their own. On a transparent public ledger like Stellar, this is fundamentally broken: if Player 1 submits "Cooperate" as plaintext, Player 2 can read it and defect.

A hash-based commit-reveal scheme doesn't fully solve this: a player could commit to garbage, observe the opponent's reveal, then "reveal" a winning move. The ZK proof cryptographically guarantees the commitment is to a legitimate move (0 or 1) with a known nonce and the correct game ID — before the opponent commits. This makes the commitment binding at commit time.

The proof is a 14,592-byte UltraHonk proof generated client-side in the browser using Noir and bb.js (WASM), and verified on-chain by the ultrahonk_soroban_verifier using BN254 host functions.

Configurable Payoff Matrix

The payoff matrix (P/S/R/T values) is fully configurable in both Tutorial and Tournament modes. Five presets are included:

Noise Simulation — "The Wind Caught You"

In the real world, mistakes happen. The wind catches you. Latep simulates this with a noise parameter (0-50%) that randomly flips moves. This reveals a key insight: strategies that can't forgive mistakes (like strict Tit-for-Tat and Grudge) die out in noisy environments, while forgiving strategies (Tit-for-Two-Tat, Generous TFT) thrive.

Built On

← Back to Latep