# Trust Execution Environment (TEE) with blockchain TEEs and blockchains started gaining traction around a decade ago with early work by Ian Miller on anchoring TEE states to a blockchain ledger (eprint.iacr.org/2017/201.pdf). This was followed by Ekiden, which provided a more cohesive approach closer to real modular applications (arxiv.org/pdf/1804.05141). Ekiden showcased a framework where, unlike integrated blockchain designs such as Secret Network or Phala Network, which use TEE-powered validators, a coprocessing framework can extend the privacy use case on an existing ledger. The differences in these designs are further explored in the research work of a Systematization of Knowledge (SoK) paper (arxiv.org/pdf/2203.08548). The authors make distinctions based on how TEEs function with blockchain validators. They propose a Layer 1 and Layer 2 framework (not to be confused with Rollup Layer 2 terminology), where in Layer 1, TEEs are an integral part of the validator client. In contrast, in Layer 2, TEEs act more like in Ekiden, participating as coprocessing units. The research concludes that the coprocessing design is more suitable and democratic than the design where becoming a validator requires having a TEE unit on board, which raises the entry barrier for node providers. This coprocessing design allows for greater inclusivity and reduces the technical and financial barriers for participants to become validators. # Current Space of TEE as Coprocessor and Blockchains The integration of Trusted Execution Environments (TEEs) as coprocessors with blockchains is still in its nascent stages, which means there is limited research and tooling available. A recent example is the [2nd price auction](https://writings.flashbots.net/suave-tee-coprocessor) for MEV, which aims to explore the use of TEEs in a market that is already worth billions of dollars. This effort highlighted several significant challenges: * **Lack of Client Software:** There is a shortage of client software that can work in conjunction with TEEs as a plugin to a blockchain ledger. This gap makes it difficult to implement TEEs effectively within existing blockchain infrastructures. * **Lack of Standardization:** There is no standardized method for integrating TEEs with various blockchains, especially Ethereum. This absence of a common standard hinders widespread adoption and interoperability. * **Client Consensus Research:** More research is needed to make TEE clients work efficiently with Proof-of-Stake (PoS) blockchains, ensuring minimal overhead and seamless integration. This research is crucial for optimizing the performance and scalability of blockchain systems that leverage TEEs. Addressing these challenges will be key to advancing the use of TEEs in blockchain applications, potentially unlocking new levels of security and privacy for decentralized systems. Similarly, very [recent work](https://youtu.be/cB5AoA4dCUMs) by Cycles.money, led by Ethan Buchman, explores supporting private transactions using TEEs. This effort is particularly significant within the Cosmos ecosystem, aiming to integrate TEE functionality as an add-on for existing Cosmos chains. The approach involves deploying a light client inside the enclave to track on-chain actions while protecting against replay attacks. Key takeaways from this work include: * **Coprocessor Functionality:** Running TEEs as coprocessors allows for different designs tailored to various chains, managed through on-chain smart contracts. This flexibility supports a range of blockchain applications. * **Light Client Integration:** Incorporating a light client within the enclave ensures the system remains stateful and secure, providing real-time tracking of blockchain activities without exposing sensitive data. * **Precompiles for Use Cases:** Implementing precompiles as needed for specific use cases can facilitate wider adoption and lower gas costs, making the system more efficient and cost-effective. * **Enhanced Security Measures:** Utilizing remote attestation and transitioning to zero-knowledge proof (ZK proof) of computation, with potential future integration of Multi-Party Computation (MPC), enhances the privacy and security guarantees provided by the TEEs. This work highlights the potential of TEEs to significantly improve the privacy and security of blockchain transactions, offering a promising path forward for integrating advanced cryptographic techniques with decentralized technologies. # Key Differences when MPC, ZK and FHE compared with TEEs To achieve a high level of privacy, technologies such as Multi-Party Computation (MPC), Zero-Knowledge Proofs (ZKPs), and Fully Homomorphic Encryption (FHE) are often employed. However, all of these technologies face a fundamental limitation: at some point, a single party must process the data, and to process the data, they need to see it. This necessitates the decryption of the original data at the end, compromising privacy for use cases such as MEV auctions, peer-to-peer chat relays, and credit score agencies. In addition to this inherent limitation, each of these technologies brings its own set of security challenges: * **MPC:** While it allows multiple parties to jointly compute a function without revealing their inputs to each other, it is complex to implement and can be vulnerable to collusion attacks. * **Zero-Knowledge Proofs:** These proofs enable one party to prove to another that a statement is true without revealing any information beyond the truth of the statement itself. However, they can be computationally intensive and difficult to scale. * **Fully Homomorphic Encryption:** This allows computations to be performed on encrypted data without decrypting it, providing strong privacy guarantees. Nevertheless, it is extremely resource-intensive and slow, making it impractical for many real-world applications. These limitations and security issues highlight the need for alternative approaches to ensure privacy in sensitive applications. Technologies like Trusted Execution Environments (TEEs) offer a potential solution by allowing data to be processed securely without exposing it to the processing entity. By addressing the inherent weaknesses in traditional privacy-preserving methods, TEEs and similar technologies can better support applications requiring high levels of data confidentiality. # Next Steps * **Standardized Ethereum Client:** Explore use cases such as MEV auctions where a standardized Ethereum client can help integrate coprocessing TEEs on Layer 1 (L1) Ethereum. This can provide enhanced security and privacy for complex blockchain transactions. * **Supplementary Services:** Investigate supplementary services such as zero-knowledge (ZK) proof of computation and key management within an enclave. These services can alleviate some security assumptions, making the system more robust and easier to manage.