Skip to content

Argo-Style Arithmetic Garbled Circuits Proof of Concept

License

Notifications You must be signed in to change notification settings

krutt/garbled-concept

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Garbled Concept

Argo-Style Arithmetic Garbled Circuits Proof of Concept

Bitcoin-only License: MIT Fork Top Languages Size Last commit

Overview

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.

Key Innovation

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.

Mission Statement

This proof-of-concept originally created by zak.eth as part of Crypto POC Daily aims to demonstrate three main points

  1. Binary 💥 Arithmetic Circuits: Side-by-side comparison showing gate count difference
  2. Homomorphic EC-MAC: Implementation of a MAC scheme where operations on MACs correspond to operations on the underlying values
  3. Simple Garbled Gate: Demonstration of garbling and evaluating gates using both approaches

Concepts at play

Garbled Circuits (Yao's Protocol)

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.

Why Arithmetic Circuits Matter for Bitcoin

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.

Prerequisites

  • python 3.10 and above - High-level general-purpose programming language
  • uv - extremely fast Python package & project manager written in Rust

Getting Started

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 uv
Install using standalone installer (Darwin and Linux)
curl -LsSf https://astral.sh/uv/install.sh | sh

Once 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

Demonstrate Feasibility

# Install dependencies
uv sync

# Run demo
demonstrate

Run benchmarks for Argo-style Garbled Circuits against Traditional (Binary) Garbled Circuits

# Install dependencies
uv sync

# Run benchmarks
benchmark

Project structure

Tree 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

Appendix

License

This project is licensed under the terms of the MIT license.

About

Argo-Style Arithmetic Garbled Circuits Proof of Concept

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages