# MPC Mode

### Introduction

The **Multi-Party Computation (MPC)** in this project is primarily used to enable secure collaboration between the **Prover** and the **Notary** for encryption and decryption operations in a TLS connection, ensuring data privacy and verifiability.

<figure><img src="https://mermaid.ink/img/pako:eNpFjUtvgzAQhP8K2jNGYGPiWFUvyTGVUKk4FHqwYHlIgCNj0gfivxfSJtnTfjOzszMUukSQUHX6s2iUsc7pNR-cdeIsNvqC5uMP0yxF01btXUiyBM3DT5wnQt5OCSHPTuz8V2zaS3y46elNJiTBDgvbXtA5tmPR6XEyeI-AC7VpS5DWTOhCj6ZXG8K8uTnYBnvMQa5riZWaOptDPizr2VkN71r3t0ujp7oBWaluXGk6l8risVW1UY8IDiWag54GCzII_WsHyBm-VoyExzhlLKQBZwGLhAvfIAkV3s73-Z5TnzLOd_toceHn-jfwwoAKETI_EjygkVh-ARcEaLo" alt=""><figcaption></figcaption></figure>

1. The Prover requests data from the Server via TLS while collaborating with the Verifier in a secure and privacy-preserving Multi-Party Computation (MPC) process.
2. The Prover selectively discloses data to the Verifier.
3. The Verifier validates the data.

<figure><img src="https://mermaid.ink/img/pako:eNpFT8tugzAQ_BVrT62Eo_BwSlCVS3JMI1SqHAo9uLCAJcDRYtImUf69Jq_6Ys_Mzsz6BLkuECIoG_2T15IMW79nHbMnTmPSe6SvK9ymWyRVqgeRpAnSv75JN9pIOtxV9sr5xzrhfMFiduX64bsiuavZW7y8dYxTC7a5RTDO2SVFHZFdnFcBu-I-z3mCDeZG7ZGtVJ83uh8I2RNhIXODBetV1dmrkEY-jxHb0QkOVKQKiAwN6ECL1MoRwmlUMzA1tphBZJ8FlnJoTAZZd7a2new-tW7vTtJDVUNUyqa3aNjZGlwpab_VPliy6yIt9dAZiNwguIRAdIJfC2fhxBee7weeK3zXn4UOHCDiXjh5mU7FXHhTzxfiZT47O3C8FLuTwPXCMPBFIObWYaU_oJKCfg" alt=""><figcaption></figcaption></figure>

The Verifier and Prover jointly compute the key for TLS communication with the Server. However, since the Verifier only holds a portion of the key, it cannot decrypt the ciphertext.

<figure><img src="https://mermaid.ink/img/pako:eNp1kcFugzAQRH_F2msJAhsT8CGX9Fa1QorUQ8XFhYUggZ06uGqK8u91IKSVUnzy7ryZkeUBCl0iCDjih0VV4GMjayO7XBF3XtE0VYNmtdlkRn-iEbcVyex72xTkCU8TOwGO3KFZIsnDFbtzT6Y_PdNiuWVOXyRfdI9k7JpRj_yGF9YgodmWLMGCZM-7_9LmjAV5fv1VBg9q05QgemPRgw5NJy8jDBdjDv0eO8xBuGuJlbRtn0Ouzs52kOpN6252Gm3rPYhKtkc32UMp-_mvbgiqEs1WW9WD4GMCiAG-QIRx4jNOGYtoyFnI4sSDE4gVTfx1EPCU04AyztdpfPbge2wN_SikSRIxHvHUOZz0AxzOsgI" alt=""><figcaption></figcaption></figure>

MPC Mode allows the Prover to selectively disclose data to the Verifier. Before sharing, the Prover can redact sensitive data to protect privacy. This capability can be combined with **Zero-Knowledge Proofs (ZKP)** (see [ZKP](/orangepass/introduction/zero-knowledge-proof.md)). Through ZKPs, the Prover can demonstrate specific attributes or properties of the redacted data without revealing the data itself. This enables the Verifier to confirm certain characteristics or conditions of the data without accessing its actual content.

Thus, selective disclosure combined with zero-knowledge proofs provides a method to ensure data usability while preserving privacy.

***

### Attestation Generation Sequence Diagram

<figure><img src="https://mermaid.ink/img/pako:eNp1VMtu2zAQ_BWCpxbwU7ISW4cAjR00QRtDsAIfCl9ocS0RlkiXpNw6Rv69S8kv2alOEnd2dnZ2qT1NFAcaUgO_S5AJTARLNSsWkuCzYdqKRGyYtCQizJBIqy3o2-DUBafKMr27Dc5dcA5arITLrQEIBuLISBSSt58xicEYoSSJLUuhxkTth4dpSJ6MZctcmIy8RuO2w46VlJBYhDeAMUhecT0zyU3G1kAmzLJDQcRgqUrHjiCAzCBRmp8KRwz7BgvafKrRMZG4XBbifzqroCVvmkmTaLGxY1XgAYpdibSBfJFJXnIgT9K5z0kNLEDa7jPDPmdMHrkPsr-DBM1QzivodQ5YBIDMlLK3WpH_m7WApjmDjplXkqe1kMdS5PwS_qj4roE4Sj1bjkcr1f0BO9M9627kxCKV5I-wGe6L2DrViG60MwNbalkBoVH_U-sjDQZr1E1UkoVMrwcQufnnKJFMhElyZUoNtZHkS-ycxXFvvzbwJ1PPI8MFV6sGCHtcCgnkhSOJsLsrxPywdpcab5uYHxZPJDeTmNckh710jjDrpM9ZLjjWa6DGGSTri3VxYzHCWLy5TaDbbWmsLtGPyN1Flp-bpC2aasFpiHFo0QJ0wdwn3TuOBbUZFLCgIb5yWLEytwu6kB-Yhvf5l1LFMVOrMs1ouGK5wa9yw9HMww_kdKrRHdBjVUpLw1FFQcM9_UvD_t2w4wee7w-8fuD3_bthi-5o2PaGnfteLxgFXs_zg-B-dPfRou9V2X5n0PeGw4EfDIIRZmDoH-uzjgg" alt=""><figcaption></figcaption></figure>

#### 1. TLS Session Stage

* The Prover (P) initiates an MPC-TLS connection request to the Notary (N).
* The Prover sends TLS handshake data to the Notary.
* The Notary verifies the handshake data and records session parameters, establishing a secure foundation for subsequent operations.

#### 2. Data Submission Stage

* The Prover submits the **TranscriptCommitConfig** configuration to the Notary, including encoded commitments or hash ranges.
* The Notary generates a **Merkle Tree Root** based on the submitted data for data integrity and consistency verification.

#### 3. Attestation Generation Stage

* The Notary constructs the **AttestationBody**, incorporating connection information, keys, and commitment data.
* The Notary signs the attestation body with its private key, generating a **signed attestation**.
* The Notary returns the signed attestation to the Prover.

#### 4. Presentation Building Stage

* The Prover selects the data range to disclose (sent/received data).
* The Prover generates a **TranscriptProof** and combines it with an **IdentityProof**.
* The Prover sends the completed **Presentation** to the Verifier.

#### 5. Verification Stage

* The Verifier validates the received presentation:
  * Verifies the signature's validity to ensure the attestation has not been tampered with.
  * Checks the consistency of the commitment to confirm data integrity.
  * Reconstructs a partial transcript (**PartialTranscript**) to complete the verification process.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.orangeprotocol.io/orangepass/introduction/mpc-mode.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
