A repository aimed at demonstrating core concepts behind Argo, a new garbled circuits scheme by Liam Eagen & Ying Tong Lai that enables thousandfold more efficient off-chain computation for BitVM-style contracts.
Problem: Traditional garbled circuits work over binary circuits (AND, XOR, and etc.) where each operation operates on individual bits. For cryptographic operations like elliptic curve point multiplication, this requires millions of binary gates.
Argo introduces arithmetic circuits using a homomorphic MAC that encodes circuit wires as Elliptic Curve points. A single arithmetic gate can represent what previously required millions of binary gates.
This proof-of-concept originally created by zak.eth as part of Crypto POC Daily aims to demonstrate three main points
- Binary 💥 Arithmetic Circuits: Side-by-side comparison showing gate count difference
- Homomorphic EC-MAC: Implementation of a MAC scheme where operations on MACs correspond to operations on the underlying values
- Simple Garbled Gate: Demonstration of garbling and evaluating gates using both approaches
Garbled circuits allow two parties to compute a function on their private inputs without revealing those inputs. One party "garbles" (encrypts) a circuit, the other "evaluates" it.
BitVM uses garbled circuits for off-chain computation with on-chain dispute resolution. The efficiency of the garbled circuit directly impacts:
- Challenge/response size in disputes
- Number of on-chain transactions needed
- Overall practicality of BitVM contracts
Argo's thousandfold improvement makes previously impractical BitVM applications feasible.
- python 3.10 and above - High-level general-purpose programming language
- uv - extremely fast Python package & project manager written in Rust
The following guide walks through setting up your local working environment using uv
as Python version manager as well as Python package manager. If you do not have uv
installed, run the following command.
Install using Homebrew (Darwin)
brew install uvInstall using standalone installer (Darwin and Linux)
curl -LsSf https://astral.sh/uv/install.sh | shOnce you have uv installed, you can install any version of Python above version 3.10 for this
project. The following commands help you set up and activate a Python virtual environment where
uv can download project dependencies from the PyPI open-sourced registry defined under
pyproject.toml file.
Set up environment and synchroniz project dependencies
uv venv --python 3.13.5
source .venv/bin/activate
uv sync --dev# Install dependencies
uv sync
# Run demo
demonstrate# Install dependencies
uv sync
# Run benchmarks
benchmarkTree structure
garbled-concept/
│
├── src/garbled-concept/
│ │
│ ├── __init__.py
│ ├── benchmark.py
│ ├── demonstrate.py
│ ├── ec_mac.py
│ ├── garbled_circuit.py
│ ├── models/
│ │ │
│ │ ├── __init__.py
│ │ ├── argo_wire.py
│ │ ├── benchmark_result.py
│ │ ├── binary_garbled_gate.py
│ │ ├── binary_label.py
│ │ ├── binary_wire.py
│ │ ├── ec_mac.py
│ │ ├── gate_type.py
│ │ └── point.py
│ │
│ └── parameters.py
│
└── tests
├── __init__.py
└── *TODO*.py
- BitVM - 📄
- Garbled Locks - Newsletter #369
- Bitcoin Optech Newsletter #390
- Glock: Garbled Locks for Bitcoin - 📄
- Argo: A Garbled Circuits Scheme for 1000x More Efficient Off-Chain Computation - 📄
- { ideal } Group - 🌐
- Liam Eagen - 𝕏, 🔫
- Ying Tong Lai - 𝕏, ✍️
This project is licensed under the terms of the MIT license.