Free 30-min Web3 Consultation
Book Now
Smart Contract Security Audits
Learn More
Custom DeFi Protocol Development
Explore
Full-Stack Web3 dApp Development
View Services
Free 30-min Web3 Consultation
Book Now
Smart Contract Security Audits
Learn More
Custom DeFi Protocol Development
Explore
Full-Stack Web3 dApp Development
View Services
Free 30-min Web3 Consultation
Book Now
Smart Contract Security Audits
Learn More
Custom DeFi Protocol Development
Explore
Full-Stack Web3 dApp Development
View Services
Free 30-min Web3 Consultation
Book Now
Smart Contract Security Audits
Learn More
Custom DeFi Protocol Development
Explore
Full-Stack Web3 dApp Development
View Services
LABS
Glossary

Yao's Protocol

Yao's Protocol is a foundational cryptographic technique for secure multi-party computation (MPC), enabling two parties to jointly compute a function while keeping their respective inputs private.
Chainscore © 2026
definition
CRYPTOGRAPHIC FOUNDATION

What is Yao's Protocol?

Yao's Protocol, also known as Yao's Garbled Circuits, is a foundational cryptographic technique for secure multi-party computation (MPC).

Yao's Protocol is a cryptographic method that enables two mutually distrustful parties to jointly compute a function over their private inputs without revealing those inputs to each other. Proposed by computer scientist Andrew Yao in the 1980s, it is a cornerstone of secure multi-party computation (MPC). The core idea is for one party, the garbler, to encrypt or "garble" a Boolean circuit representing the function, and for the other party, the evaluator, to compute the garbled circuit using encrypted inputs, learning only the final output.

The protocol's security relies on oblivious transfer (OT), a sub-protocol that allows the evaluator to obtain the correct encrypted input labels from the garbler without the garbler learning which specific inputs were selected. The garbler creates a garbled table for each logic gate in the circuit, which contains encrypted versions of the gate's output for every possible combination of encrypted inputs. This process ensures the evaluator can traverse the entire circuit, gate-by-gate, computing encrypted outputs without ever decrypting intermediate values or learning the underlying plaintext inputs.

In blockchain and Web3 contexts, Yao's Protocol enables privacy-preserving smart contracts and decentralized applications. It allows for computations on sensitive data—such as private financial bids, medical records, or proprietary algorithms—without exposing the raw data on-chain. This is critical for implementing confidential decentralized finance (DeFi) strategies, private voting mechanisms, and secure data marketplaces where participants require strong cryptographic guarantees of input privacy beyond simple transaction anonymity.

While revolutionary, classic Yao's Protocol has practical limitations, including significant communication overhead and computational cost, which scale with the complexity of the function being computed. Modern implementations often use optimizations like the Free XOR technique and combined with other MPC frameworks (e.g., SPDZ) or zero-knowledge proofs to improve efficiency for specific use cases. Its conceptual framework remains essential for understanding the theoretical limits and practical designs of cryptographic systems that prioritize data confidentiality in collaborative environments.

etymology
THE NAMESAKE

Etymology and Origin

The term 'Yao's Protocol' is named after its creator, the pioneering computer scientist Andrew Chi-Chih Yao, who formalized the concept of secure two-party computation in 1982.

Yao's Protocol, also known as Yao's Garbled Circuits, is a foundational cryptographic protocol for secure two-party computation (2PC). It was introduced in Andrew Yao's seminal 1982 paper, "Protocols for Secure Computations." The protocol allows two mutually distrusting parties, each holding a private input, to jointly compute a function over those inputs without revealing anything beyond the final result. This is achieved by having one party (the garbler) encrypt or "garble" a Boolean circuit representing the function, and the other party (the evaluator) computing the garbled circuit using oblivious transfer to obtain the output.

The core innovation lies in the garbling scheme. The garbler assigns two random cryptographic keys (labels) to each wire in the circuit—one representing logical 0 and one for logical 1. For each logic gate (e.g., AND, OR), the garbler creates a garbled truth table, which is an encrypted version of the gate's function. Each entry is the encryption of the output wire key, using the corresponding pair of input wire keys as the encryption key. The evaluator, who receives only one key per input wire (representing their specific input bit), can decrypt only one row per garbled gate, proceeding through the circuit without learning the meaning of the intermediate wire labels.

Yao's Protocol is a cornerstone of secure multi-party computation (MPC) and has profound implications for privacy-preserving technologies. Its conceptual framework enables use cases like private auctions, genomic analysis, and blockchain-based zero-knowledge proofs where computations must be verified without exposing underlying data. While the original protocol is a theoretical blueprint, it has inspired decades of optimization, leading to practical implementations with improved efficiency and active security against malicious adversaries, forming the bedrock for modern privacy-enhancing cryptographic systems.

how-it-works
CRYPTOGRAPHIC FOUNDATION

How Yao's Protocol Works

Yao's Protocol, also known as Yao's Garbled Circuits, is a foundational cryptographic technique for secure multi-party computation (MPC) that enables two mutually distrustful parties to jointly compute a function on their private inputs without revealing those inputs to each other.

The protocol operates by having one party, the garbler, transform the logic of the target function (e.g., a comparison or arithmetic operation) into an encrypted representation called a garbled circuit. This circuit consists of encrypted truth tables for each logic gate, where the input and output values are replaced with cryptographic keys. The garbler sends this encrypted circuit, along with the keys corresponding to its own private input, to the second party, the evaluator.

The evaluator then obtains the keys for its own private inputs through a 1-out-2 oblivious transfer protocol, a sub-protocol that allows it to receive the correct key for its input bit without revealing to the garbler which bit it was. With all necessary input keys in hand, the evaluator can then locally evaluate the garbled circuit gate-by-gate. For each gate, it uses the encrypted truth table to decrypt the single corresponding output key, propagating these keys through the circuit until it obtains the final output keys.

Finally, the evaluator maps these final output keys back to plaintext result bits using a translation table provided by the garbler, and shares the result with the garbler. The security guarantee stems from the fact that the evaluator sees only random-looking keys during computation and learns nothing about intermediate values or the garbler's input, provided the underlying cryptographic primitives (like encryption and oblivious transfer) are secure.

While conceptually elegant for any boolean circuit, the classic two-party Yao's Protocol has practical limitations, including significant communication overhead for sending the entire garbled circuit and computational cost for encryption. Modern optimizations like the Free XOR technique, which allows XOR gates to be processed without cryptographic cost, and half-gates construction have dramatically improved its efficiency, making it viable for real-world privacy-preserving applications.

key-features
TECHNICAL MECHANICS

Key Features of Yao's Protocol

Yao's Protocol, also known as Yao's Garbled Circuits, is a foundational cryptographic technique for secure multi-party computation (MPC). It enables two mutually distrustful parties to jointly compute a function over their private inputs without revealing those inputs to each other.

01

Garbled Circuits

The core mechanism where one party (the garbler) encrypts a Boolean circuit representing the function to be computed. The circuit is 'garbled' so that evaluating it reveals only the output, not the intermediate logic or the other party's input. This is achieved by encrypting the truth table for each logic gate using symmetric keys.

02

Two-Party Computation

The protocol is designed for a specific two-party setting with a semi-honest (passive) adversarial model, meaning parties follow the protocol but may try to learn extra information. It involves two distinct roles:

  • Garbler: Creates the garbled circuit and encodes their input.
  • Evaluator: Receives the garbled circuit and, via oblivious transfer, obtains keys corresponding to their own input to evaluate the circuit.
03

Oblivious Transfer (OT)

A critical cryptographic primitive used within Yao's Protocol. It allows the Evaluator to obtain the correct encryption keys for their private input bits from the Garbler without the Garbler learning which specific keys (and therefore which input bits) were chosen. This ensures input privacy for both parties during the computation phase.

04

Output & Privacy

The protocol guarantees correctness (the output is computed as defined by the function) and privacy (inputs remain hidden except for what can be inferred from the output). The final output is typically revealed only to one party (the Evaluator), who may then share it with the Garbler. The security proof relies on the indistinguishability of the garbled values.

05

Computational Overhead

The primary trade-off for its strong security guarantees. Overhead includes:

  • Circuit Size: The function must be expressed as a Boolean circuit, which can be large for complex operations.
  • Communication: The garbled circuit and OT protocols require significant data transfer between parties.
  • Asymmetric Cost: The Garbler's workload (creating the circuit) is typically heavier than the Evaluator's (evaluating it).
visual-explainer
YAO'S PROTOCOL

Visual Explainer: The Garbled Circuit

A conceptual walkthrough of the cryptographic technique that enables two parties to compute a function on their private inputs without revealing those inputs to each other.

Yao's Garbled Circuit is a foundational cryptographic protocol for secure two-party computation (2PC). It allows two mutually distrustful parties, often called Alice and Bob, to jointly compute the output of any function—represented as a Boolean circuit—while keeping their respective inputs private. The core innovation is that one party (the garbler) encrypts or "garbles" the circuit's logic gates into a scrambled lookup table, while the other party (the evaluator) can compute the final output using these tables without learning any intermediate values. This process ensures that nothing is revealed except the agreed-upon result.

The protocol operates in distinct phases. First, the garbler constructs the Boolean circuit for the desired function (e.g., a comparison or an auction) and then garbles it. For each wire in the circuit, two random cryptographic keys are generated, each representing the wire's possible binary value (0 or 1). Each logic gate (AND, OR, XOR) is then replaced with a garbled table. This table is an encrypted mapping that, given the keys for the gate's two input wires, outputs the correct key for the gate's output wire, but only if the input keys correspond to a valid 0 or 1. The garbler sends these scrambled tables and the keys corresponding to its own input to the evaluator.

Next, the evaluator must obtain the keys for its own private inputs without revealing them to the garbler. This is achieved via a 1-out-of-2 Oblivious Transfer (OT) protocol. In OT, the garbler offers the two keys for each of the evaluator's input wires, and the evaluator retrieves only the key corresponding to its actual input bit (0 or 1), while the garbler learns nothing about which key was chosen. With keys for all input wires in hand, the evaluator can now locally evaluate the garbled circuit. It proceeds gate-by-gate, using the garbled tables to decrypt the key for each subsequent output wire, until it obtains the keys for the final output wires.

Finally, the output keys must be translated back into meaningful bits (0 or 1). The garbler typically provides the evaluator with an output translation table that maps the final output wire keys to their plaintext values. After evaluation, the evaluator uses this table to decode the result. Crucially, because all computations are performed on random-looking keys, the evaluator learns nothing about intermediate logic or the garbler's inputs beyond what is inferable from the final output. The protocol's security relies on standard cryptographic assumptions like the existence of one-way functions and secure Oblivious Transfer.

Garbled circuits are a cornerstone of modern secure computation, enabling practical applications like private set intersection, secure auctions, and privacy-preserving machine learning. While the classic protocol is secure against a semi-honest (passive) adversary, follow-up optimizations like Free XOR and half-gates have drastically improved its performance, and frameworks like JustGarble and ObliVM have made implementation more accessible. Its visual metaphor of an encrypted, locked circuit that can only be traversed with the correct keys remains a powerful way to understand how privacy can be preserved during collaborative computation.

examples
YAO'S PROTOCOL

Examples and Use Cases

Yao's Protocol, also known as Yao's Garbled Circuits, is a foundational cryptographic technique for secure multi-party computation (MPC). These examples illustrate its practical applications in blockchain and privacy-preserving technologies.

03

Privacy-Preserving Blockchain Oracles

Oracles using Yao's Protocol can fetch and compute on sensitive off-chain data (e.g., credit scores, KYC information) without exposing it on-chain. The oracle network performs a secure MPC to deliver only the verified result (e.g., "credit score > 700") to the smart contract, maintaining user data confidentiality.

04

Decentralized Identity & Credential Verification

Enables zero-knowledge proof-like verification of credentials. A user can prove they meet specific criteria (e.g., "age > 21", "has valid license") without revealing the underlying document. The verifier provides a garbled circuit; the user computes it with their private inputs to generate a pass/fail result.

05

Secure Multi-Party Wallets & Signatures

Yao's Protocol can be used to implement threshold signatures or complex wallet authorization logic. For a 2-of-3 multisig wallet, the signing logic is garbled. Authorized parties can collaboratively compute the signature without any single party reconstructing the full private key or seeing the others' secret shares.

06

Limitations & Performance Considerations

While powerful, practical use requires acknowledging constraints:

  • Computational Overhead: Garbling and evaluating circuits is computationally intensive, scaling with circuit complexity.
  • Communication Rounds: Typically requires multiple rounds of interaction between parties, which can be a bottleneck.
  • Boolean Circuits: Operates on binary gates; representing complex functions (like floating-point arithmetic) requires large circuits. Often used in hybrid models with other MPC protocols like SPDZ for efficiency.
ecosystem-usage
YAO'S PROTOCOL

Ecosystem Usage

Yao's Protocol is a foundational cryptographic technique for secure multi-party computation (MPC), enabling multiple parties to jointly compute a function over their private inputs without revealing them. Its primary ecosystem usage is in privacy-preserving blockchain applications and cryptographic research.

02

Privacy-Preserving Smart Contracts

Blockchain platforms use adaptations of Yao's Protocol to enable private state and confidential transactions within smart contracts. By representing contract logic as a garbled circuit, parties can execute agreements where sensitive data (e.g., bid prices, medical records, proprietary formulas) remains encrypted throughout the computation. Key implementations and research areas include:

  • zk-SNARKs and zk-STARKs: Utilize similar circuit-based paradigms for zero-knowledge proofs.
  • Layer-2 Privacy Solutions: Protocols like Aztec use arithmetic circuits for private rollups. This moves blockchain beyond transparent, fully public execution.
03

Cryptographic Primitives & Research

Yao's Garbled Circuits are not just an application but a critical cryptographic primitive. They are a core component in the construction of more advanced protocols, serving as a building block for:

  • Oblivious Transfer (OT): A key subroutine in many MPC protocols.
  • Functional Encryption: Schemes where decryption reveals a specific function of the encrypted data.
  • Program Obfuscation: Research into hiding the logic of a program itself. Its conceptual framework of 'garbling' and 'evaluating' circuits is fundamental to modern cryptographic theory.
04

Limitations & Practical Optimizations

While theoretically universal, the classic two-party Yao Protocol has practical constraints that shape its ecosystem use:

  • High Communication Overhead: The size of the garbled circuit scales with the complexity of the function f, making it inefficient for large computations.
  • Rounds of Interaction: It typically requires multiple rounds of communication between parties. These limitations have driven significant optimizations like Free-XOR and Half-Gates techniques, which drastically reduce ciphertext size. In practice, Yao's Protocol is often combined with other MPC techniques (like Secret Sharing) in hybrid frameworks to balance security and performance for real-world blockchain applications.
security-considerations
YAO'S PROTOCOL

Security Considerations and Limitations

Yao's Protocol, a foundational secure two-party computation (2PC) scheme, introduces specific cryptographic assumptions and operational constraints that define its security guarantees and practical limitations.

01

Semi-Honest Adversary Model

Yao's Protocol is proven secure against semi-honest (passive) adversaries. This means the protocol guarantees privacy and correctness only if both parties follow the protocol steps exactly but may try to learn extra information from the messages they receive. It does not provide security against malicious (active) adversaries who can arbitrarily deviate from the protocol, requiring additional mechanisms like zero-knowledge proofs or the GMW compiler for stronger guarantees.

02

Computational vs. Information-Theoretic Security

The protocol's security is computational, relying on the assumed hardness of specific problems like the Decisional Diffie-Hellman or the existence of one-way functions. This is contrasted with information-theoretic security, which is unconditional. A breach in the underlying cryptographic primitive (e.g., factoring large integers) would compromise the entire protocol's security.

03

Non-Interactive Online Phase & Reusability

A key efficiency feature is its non-interactive online phase: after an initial setup, the actual computation requires only one message. However, the garbled circuits generated during setup are typically for a single execution. Reusing the same circuit for multiple computations with different inputs can leak information. Techniques like Free XOR and garbled circuit randomization improve efficiency but don't inherently enable secure reuse.

04

Circuit Representation Limitation

The protocol requires the function to be computed to be expressed as a Boolean or arithmetic circuit prior to execution. This presents limitations:

  • Function Complexity: Large or complex functions result in massive circuits, increasing communication and computation overhead.
  • Dynamic Control Flow: Circuits represent straight-line programs; conditional branches and loops must be unrolled at compile time, which can be highly inefficient for certain algorithms.
05

Trusted Setup and Oblivious Transfer

The protocol's security depends critically on a secure oblivious transfer (OT) subroutine for transferring the garbled input keys. While OT can be implemented efficiently, it often requires multiple rounds of interaction and is a performance bottleneck. The security of the entire 2PC collapses if the OT primitive is compromised. Using OT extension protocols is standard to mitigate this cost.

06

Practical Overhead and Scalability

Despite optimizations, Yao's Protocol incurs significant overhead:

  • Communication: The size of the garbled circuit scales with the number of gates, often requiring megabytes or gigabytes of data transfer.
  • Computation: The garbling (encrypting the circuit) and evaluating steps are computationally intensive, especially for the party creating the circuit.
  • Verifiability: Basic Yao does not allow the evaluator to verify the circuit was garbled correctly, leading to selective failure attacks in the malicious model.
COMPUTATIONAL VS. GARBLED CIRCUIT MPC

Comparison: Yao's Protocol vs. Other MPC Approaches

A technical comparison of Yao's Garbled Circuits protocol against other major secure multi-party computation paradigms.

Feature / MetricYao's Garbled Circuits (2-Party)Secret Sharing (n-Party)Homomorphic Encryption

Core Cryptographic Primitive

Symmetric Encryption (OT)

Polynomial Secret Sharing

Public-Key Cryptography

Primary Use Case

Secure Two-Party Computation

Collaborative n-Party Analytics

Outsourced Computation on Encrypted Data

Communication Rounds

Constant (O(1))

Proportional to Circuit Depth

Minimal (Client-Server)

Communication Overhead

High (Entire Garbled Table)

Moderate (Per-Gate Shares)

Very High (Ciphertext Operations)

Computation Overhead

High (Garble/Evaluate)

Moderate (Share Recombinations)

Extremely High (Encrypted Ops)

Active Security (Malicious)

Requires Expensive Cut-and-Choose

Achievable with Verification

Inherent (Encryption)

Typical Latency

Milliseconds for Simple Circuits

Seconds to Minutes

Minutes to Hours

Best-Suited For

One-Time, Complex Functions

Repeated, Simple Aggregations

Non-Interactive, Low-Bandwidth Scenarios

evolution
FOUNDATIONAL CONCEPT

Yao's Protocol

A foundational cryptographic protocol that established the field of secure multi-party computation, enabling two parties to jointly compute a function while keeping their respective inputs private.

Yao's Protocol, also known as Yao's Garbled Circuits, is a foundational cryptographic technique for secure two-party computation (2PC). Introduced by Andrew Yao in the 1980s, it allows two mutually distrusting parties, each holding a private input, to compute the output of a function without revealing anything about their inputs beyond what is logically implied by the output itself. The protocol works by one party (the garbler) encrypting or "garbling" a Boolean circuit representing the function, and the other party (the evaluator) computing the garbled circuit using oblivious transfer to obtain the encrypted inputs. This process ensures input privacy and correctness of the computation.

The core innovation is the construction of the garbled circuit. For each logic gate (AND, OR, XOR, etc.) in the function's circuit, the garbler creates a garbled truth table. This table encrypts the output wire labels using the corresponding input wire labels as keys. The evaluator, who receives the garbled tables and the keys for their own inputs via oblivious transfer, can decrypt only one row per gate, proceeding through the circuit to compute the final output. Crucially, the evaluator learns only the final output labels, which are then mapped back to meaningful bits by the garbler, without gaining any information about intermediate values or the other party's inputs.

Yao's Protocol has evolved significantly from its theoretical origins. Modern implementations address early limitations like high communication overhead and lack of malicious security (resistance to actively cheating parties). Key advancements include the use of Free XOR and Half-Gates optimizations, which drastically reduce the size of garbled circuits, and techniques like cut-and-choose to achieve security against malicious adversaries. These improvements have transformed it from a theoretical construct into a practical tool for privacy-preserving applications such as private set intersection, secure auctions, and privacy-preserving machine learning.

In the blockchain and Web3 context, Yao's Protocol and its variants underpin many zero-knowledge and privacy-enhancing technologies. It provides a general-purpose framework for executing smart contracts on encrypted data, enabling confidential transactions and computations. While zk-SNARKs and other succinct proofs are often more efficient for specific verification tasks, Yao's Garbled Circuits remain a versatile and actively researched primitive for generic secure computation where the function itself may be private or complex. Its legacy is the proof that any computable function can be evaluated securely, laying the groundwork for the entire field of secure multi-party computation (MPC).

YAO'S PROTOCOL

Frequently Asked Questions (FAQ)

Yao's Protocol, also known as Yao's Garbled Circuits, is a foundational cryptographic technique for secure multi-party computation (MPC). These questions address its core concepts, applications, and relevance to modern blockchain and privacy technologies.

Yao's Protocol is a foundational cryptographic technique for secure multi-party computation (MPC) that allows two mutually distrustful parties to jointly compute a function over their private inputs without revealing those inputs to each other. Proposed by Andrew Yao in the 1980s, it works by one party (the garbler) encrypting or "garbling" a Boolean circuit representing the function, and the other party (the evaluator) computing the garbled circuit to obtain the encrypted output, which is then jointly decrypted. The protocol ensures that neither party learns anything about the other's input beyond what is logically revealed by the function's output. It is a cornerstone for privacy-preserving technologies, enabling computations like private auctions, secure data analysis, and privacy-focused smart contracts.

ENQUIRY

Get In Touch
today.

Our experts will offer a free quote and a 30min call to discuss your project.

NDA Protected
24h Response
Directly to Engineering Team
10+
Protocols Shipped
$20M+
TVL Overall
NDA Protected direct pipeline
What is Yao's Protocol? | Secure Multi-Party Computation | ChainScore Glossary