> ## Documentation Index
> Fetch the complete documentation index at: https://docs.phala.com/llms.txt
> Use this file to discover all available pages before exploring further.

> Private Proving - Running ZK provers inside TEE to protect sensitive data during proof generation.

# Private Proving with TEE

## What is Private Proving?

**Private Proving** is a method of generating cryptographic proofs inside a Trusted Execution Environment (TEE) that ensures input data (the witness) remains completely confidential during proof generation. This means neither the verifier nor the prover can see an application's input data.

<Frame>
  <img src="https://mintcdn.com/phalanetwork-1606097b/W_CrYRGQOR7Ch9JM/images/succinct-private-proving-overview.jpeg?fit=max&auto=format&n=W_CrYRGQOR7Ch9JM&q=85&s=57d8762c4f1e99bdf7d5a9e95fa3fd14" alt="Private Proving Overview - Source: Succinct Labs" width="4096" height="1431" data-path="images/succinct-private-proving-overview.jpeg" />
</Frame>

### The Problem: Witness Data Exposure in Traditional ZK Proving

Traditional zero-knowledge proving systems verify computation correctness, but the witness data (private inputs) is exposed to the prover operator during proof generation:

* **Privacy-focused rollups**: Prover operators can see user transaction amounts, recipients, and trading strategies
* **Private DeFi protocols**: Witness data includes sensitive positions, balances, and trading logic
* **Confidential identity systems**: User credentials and personal data are exposed to prover infrastructure
* **Private payments**: Transaction amounts and sender/receiver information visible to prover

**The core issue**: Zero-knowledge proofs hide data from the verifier, but they don't protect data from the prover. The prover sees all witness data during proof generation.

### The Solution: Run ZK Provers Inside TEE

Private proving runs the proof generation process inside hardware-isolated environments, ensuring witness data never leaves the secure enclave:

```
Witness Data (Private) → TEE [zkVM Prover] → ZK Proof (Public)
```

**How it works**:

* Witness data enters the TEE and remains hardware-encrypted throughout proving
* The zkVM (like SP1) executes inside the TEE to generate the proof
* Only the final proof leaves the TEE - witness data stays protected
* TEE attestation proves the proving environment was secure

**Key benefits**:

1. **Complete Witness Privacy**: No one, including the prover operator, can see witness data
2. **Hardware-Level Security**: Data encrypted at the silicon level (Intel TDX, AMD SEV, AWS Nitro)
3. **Developer-Friendly**: Write private applications in Rust using familiar zkVM frameworks
4. **Performance**: GPU TEE (H200) provides hardware acceleration for fast proof generation
5. **Verifiable Security**: Remote attestation cryptographically proves the secure execution environment

**Impact**: Private proving transforms privacy from a specialized technical challenge into a standard feature. As Succinct states: "With Succinct, privacy will be a standard rather than an exception."

<Note type="info">
  Learn more about Private Proving from Succinct Labs' [Private Proving announcement](https://blog.succinct.xyz/private-proving/).
</Note>

## Benefits vs Traditional ZK

| Feature                  | Traditional ZK      | Private Proving (ZK in TEE)   |
| ------------------------ | ------------------- | ----------------------------- |
| **Proof Correctness**    | ✅ Cryptographic     | ✅ Cryptographic               |
| **Witness Privacy**      | ❌ Exposed to prover | ✅ Hardware encrypted          |
| **Verifiable Execution** | ❌ No guarantees     | ✅ TEE attestation             |
| **Developer Experience** | Circuit development | ✅ No code changes (Rust/zkVM) |
| **Performance**          | Fast                | Minimal overhead with GPU TEE |
| **GPU Acceleration**     | ✅ Yes               | ✅ Yes (H100/H200)             |
| **Trust Assumptions**    | Cryptography only   | Cryptography + hardware       |

## Private Proving in Production

### Phala Cloud: Hardware-Accelerated Private Proving

Phala Cloud provides production-ready infrastructure for private proving with GPU TEE:

<table data-card-size="large" data-view="cards">
  <thead>
    <tr>
      <th />

      <th data-hidden data-card-cover data-type="files" />

      <th data-hidden data-card-target data-type="content-ref" />
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        <span data-gb-custom-inline data-tag="emoji" data-code="1f680">
          🚀
        </span>

        {" "}

        Phala Network: Run zk-Rollup STF (state transition function) in TEE
      </td>

      <td>
        <a href="/images/Use-Cases-Multi-Proof.png">
          Use-Cases-Multi-Proof.png
        </a>
      </td>

      <td>
        <a href="https://phala.com/posts/introducing-phala-sgxprover-a-twofactor-authentication-solution-for-zkrollups">
          Phala SGXProver
        </a>
      </td>
    </tr>

    <tr>
      <td>
        <span data-gb-custom-inline data-tag="emoji" data-code="1f512">
          🔒
        </span>

        {" "}

        Primus: Build Trustless zkTLS with TEE
      </td>

      <td>
        <a href="/images/tee_zktls.png">tee\_zktls.png</a>
      </td>

      <td>
        <a href="https://medium.com/@primuslabs/primus-x-phala-network-build-trustless-zktls-with-tee-332a26d48c83">
          Primus zkTLS
        </a>
      </td>
    </tr>

    <tr>
      <td>
        <span data-gb-custom-inline data-tag="emoji" data-code="1f4be">
          💾
        </span>

        {" "}

        Running SP1 zkVM in TEE H200 with Low Overhead
      </td>

      <td>
        <a href="/images/zkvm-sp1-in-gpu-tee.jpg">
          zkvm-sp1-in-gpu-tee.jpg
        </a>
      </td>

      <td>
        <a href="https://phala.com/posts/performance-benchmark-running-sp1-zkvm-in-tee-h200-with-low-overhead">
          SP1 zkVM in TEE
        </a>
      </td>
    </tr>
  </tbody>
</table>

## Multi-Proof Systems: Defense-in-Depth (SP1-2FA)

While private proving protects data privacy, some applications require maximum security through defense-in-depth. **Multi-proof systems** like [Succinct's SP1-2FA](https://blog.succinct.xyz/sp1-2fa/) generate both ZK and TEE proofs in parallel:

<Frame>
  <img src="https://mintcdn.com/phalanetwork-1606097b/W_CrYRGQOR7Ch9JM/images/succinct-sp1-2fa-architecture.jpg?fit=max&auto=format&n=W_CrYRGQOR7Ch9JM&q=85&s=bc5b753b528829a4f8aad63dd87482f4" alt="SP1-2FA Multi-Proof Architecture - Source: Succinct Labs" width="1600" height="984" data-path="images/succinct-sp1-2fa-architecture.jpg" />
</Frame>

**How it differs from private proving**:

* **Private Proving**: ZK prover runs *inside* TEE (focus: data privacy)
* **SP1-2FA**: ZK and TEE run in *parallel* (focus: maximum security)

**When to use SP1-2FA**:

* Critical infrastructure (blockchain consensus, bridges)
* High-value DeFi protocols (significant TVL at risk)
* Defense against undiscovered ZK circuit bugs
* Regulatory requirements for multiple independent proofs

**Trade-off**: SP1-2FA provides stronger security guarantees but doesn't specifically protect data privacy during ZK proving. For most applications requiring data privacy, private proving is the right choice.

<Note type="info">
  Learn more about SP1-2FA from [Succinct's blog post](https://blog.succinct.xyz/sp1-2fa/).
</Note>

**Resources**:

* [Getting Started Guide](/phala-cloud/getting-started/overview)
* [Performance Benchmarks](/phala-cloud/references/performance-report)
* [TEE Attestation](/phala-cloud/attestation/overview)
* [Deploy with Docker](/phala-cloud/cvm/overview)

## References and Further Reading

* **Succinct Labs**: [Private Proving Blog Post](https://blog.succinct.xyz/private-proving/) | [SP1-2FA Technical Details](https://blog.succinct.xyz/sp1-2fa/)
* **Vitalik Buterin**: [Multi-Proof Systems Presentation](https://hackmd.io/@vbuterin/zk_slides_20221010#/)
* **Justin Drake**: [2FA ZK-Rollups with SGX](https://ethresear.ch/t/2fa-zk-Rollups-using-sgx/14462)
* **Phala Network**: [SP1 zkVM Performance Benchmark](https://phala.com/posts/performance-benchmark-running-sp1-zkvm-in-tee-h200-with-low-overhead)
