Series: Zero to Zero Knowledge
A Trusted Execution Environment (TEE) is a protected area of a processor where code can run on data that the rest of the machine, including its owner and operating system, cannot read. Some blockchains use TEEs to get privacy. Zcash does not: it relies on zero-knowledge proofs. This page explains how TEEs work, where blockchains use them, and what the trade-offs are.
The two technologies have opposite strengths:
| Blockchain | TEE | |
|---|---|---|
| Availability and state persistence | Yes | No: an enclave keeps no state of its own |
| Public verification of the whole state | Yes | No |
| Private, intensive computation | Limited | Yes |
A design that combines them can run private computation inside enclaves while the chain keeps the state and the public record.
Secret Network is a Cosmos SDK chain whose validators run Intel SGX enclaves. Transactions are processed inside enclaves and data is decrypted only there, so contracts can work on encrypted inputs, outputs and state. A consensus encryption seed is held inside each validator's TEE, and contracts use unique encryption keys.
Oasis Network offers confidential smart contracts through its Sapphire ParaTime. Encrypted data enters the TEE with the contract, is decrypted and processed there, and is re-encrypted before it leaves.
Proof-of-stake validators must keep their signing keys secret, stay online, and avoid signing conflicting messages, which can lead to slashing. A TEE can hold and use those keys without exposing them in plaintext, which is one reason TEEs appear in proof-of-stake designs.
Privacy that depends on a TEE depends on trusting the chip vendor and the hardware. That trust has been tested:
| TEE-based privacy | Zcash shielded pools | |
|---|---|---|
| Where privacy comes from | Hardware isolation | Zero-knowledge proofs |
| What you must trust | The chip vendor, attestation and physical security of the nodes | The cryptography and the protocol implementation |
| Data visible to validators | Decrypted inside enclaves | Not available: validators check proofs only |
| If the hardware is broken | Data can be exposed | Not applicable |
In Zcash, shielded transactions are broadcast and checked publicly, and the proof reveals nothing beyond validity. Zcash Shielded Assets follow the same model.
Zcash research on proof of stake has produced , a proposed hybrid protocol that adds a proof-of-stake finality layer to Zcash's proof-of-work chain. See that page for the design and its status.