>
>

What Are Trusted Execution Environments (TEEs)? An Idiot’s Guide

January 30, 2025

In conclusion

Anyone who's spent even a little time in this industry knows this universal truth: when confusion swirls around a new idea, chances are — about 7 out of 10 times — that's exactly where the next cool thing lies.

This is sort of the feeling with trusted execution environments (TEEs), also known as “secure enclaves,” since it became a recurring topic sometime late last year, especially with the announcement of Unichain by the OG automated market maker (AMM) pioneer, Uniswap, on October 10, 2024. Alongside, the introduction of NVIDIA’s H100 GPUs — which enable confidential computing — also added fuel to the fire.

Unichain blog announcement

The buzz around TEEs grew even louder as the AI narrative gulped a significant portion of crypto mindshare. Yet, the confusion about what they really are and what they bring to the table remains as persistent as ever.

But this is exactly where we thrive innit? helping you break down this whole TEE thing, demystify it, and show you why it keeps sneaking into every conversation.

Before we get into more intricate details, it’s important to note that TEEs aren’t an entirely new idea. The concept has been around in the web2 world, used and applied in different ways for a while now, and has only recently found its way into the crypto arena.

What is a trusted execution environment (TEE)?

To be specific, a trusted execution environment (TEE) is a hardware-based privacy-enhancing technology (PET) that secures data in a private enclave within a processor or network, using a secret key for added protection.

TEE exists to ensure that data in use, data in transit, and data at rest are safe, secure, and private. Think of TEEs as a digital safe house within a system, granting trust to otherwise untrusted environments.

They operate as an isolated, secure bubble, completely separate from the operating system and application layer. This separation ensures that encrypted data — whether stored, in transit, or just hanging around in the network — stays shielded from prying eyes.

There are two main features of TEE.

Isolation: Data is isolated from the operational layer or rich execution environment (REE), secured by a secret key in an environment where only authorized entities can access the data. Outside of this enclave or environment, the data is encrypted.

A good example of this is our everyday use of facial recognition on our phones.

When you set up facial recognition, the device scans your face via the camera, securely captures your facial features, encrypts the data,  and sends it to the TEE to be processed.

This captured facial biometric never leaves the TEE unprotected.

Now, where the magic happens is in how the TEE processes this data (your face). It basically processes the raw data into a template, which is just a mathematical representation of your unique facial features.

After this, the template is secured safely in the TEE. This can be tagged as the isolation process.

Attestation: After data is secured or isolated in the TEE, whenever computation is performed on the said data, the TEE allows the data to be securely authenticated or attested to verify the realness, originality, accuracy, and integrity of the data — without revealing the components.

Let’s look at how this works with the above example.

First, we established that your facial features — your biometric data — are securely stored as a mathematical template within the TEE during the isolation process. That’s step one.

Step two kicks in when you want to access the data you’ve protected with your facial biometric. Essentially, your face becomes the key — if it’s you, you’re the authorized user.

Here’s how it works: when you scan your face, a fresh image is captured and sent to the TEE.

The TEE then compares this new scan against the stored template. If the two match, the TEE gives the green light to the REE (the operational layer), granting you access. Simple, secure, and very James Bond.

At the moment, most TEE chip providers are web2-based or centralized (traditional) organizations such as AWS with Nitro enclaves, the Intel SGX & TDX, and so many other mon-cypherpunk providers. Goes without saying that this has raised eyebrows (we will get into it later).

TEE x crypto crossroad

A top use case for trusted execution environments (TEEs), or secure enclaves, in  crypto, is bolstering user fund protection by enhancing the security of non-custodial wallets.

This occurs as a result of a transaction signing — the process that enables wallet operations. Typically, this process has inherent vulnerabilities that bad actors can exploit to compromise wallets.

By integrating or building wallets within a TEE, an extra layer of security is added. The user’s private keys are stored exclusively within the TEE, where they remain untouchable — not even the wallet owner can tamper with them.

This setup significantly eliminates the risk of compromise or interference, making user funds secure.

Another standout use case for trusted execution environments (TEEs) in crypto is tackling miner extractable value (MEV) attacks by enabling secure or sealed-bid auctions for transaction ordering.

An example of a product doing this is flashbots in their use of trusted execution environments (TEEs) to securely handle private transactions.

The TEE  ensures that a program can run securely and produce correct results attesting to the input stored within the enclave. This requires a user to submit his/her/their transaction to a program running inside the enclave on the searcher’s machine.

The searcher provides a search algorithm and a secret key to the program. The program then creates a backrun transaction based on the user's input, signs it with the searcher’s key, and sends both the user’s transaction and the signed backrun in an encrypted format as a transaction to the builder.

Uniswap’s L2 Unichain partners with flashbots to put this to use, thereby reducing MEV losses and protecting its users.

TEE x crypto-AI crossroad

When it comes to AI, data privacy is always a top concern. If you don’t believe me, see what AIXBT has to say:

TEEs bring several positive benefits to crypto-AI, encompassing security, privacy, and integrity.

For example, when the code used to run an AI model is isolated within a TEE, the host cannot interfere with its execution. This ensures that programs run exactly as written, without external manipulation.  

In this way, TEEs bring a level of determinism and trust to processes that would otherwise be prone to inconsistency or tampering.

So, if you’ve ever wondered if an agent like AIXBT is real or 100% AI, TEEs are a unique way to find out if the codes are tamper-free.

A standout example of TEEs in crypto-AI is the TEEHEEHEE agent, which utilizes a trusted execution environment to authenticate AI-generated results. In simpler terms, TEEs help ensure that the code used to develop AI models remains intact and unaltered, safeguarding both integrity and trustworthiness.

What’s more, TEEs offer a cost-effective and high-performance alternative to other privacy solutions for running AI models.

Protocols like Marlin with the Oyster CVM and Oyster serverless are providing the infrastructure for DeFi protocols and AI agents to integrate with TEE.

TEEs and crypto-AI can enable several use cases such as the protection of AI agent-powered yield farming strategies, allowing protocols to charge premiums as their strategies are now sufficiently hidden and controlled.

Similar to yield farming, AI agents that provide trading superiority can protect their codes within a TEE, giving them additional protection.

We are also beginning to see the development of AI agent-powered DAOs utilizing agents to represent individuals and participate in governance. Integrating these agents with the TEE infrastructure will allow users to make governance decisions that aren’t exposed and are secure and private, void of any interference.

Limitations of TEEs

Trusted execution environments are, in hindsight, incredible for securing sensitive data via isolation from the REE, and ensuring data integrity via attestation. However, this doesn’t come without risks and limitations.

The fact that TEE chips are hardware-based exposes them to physical security risks. In addition to this, their attestation mechanisms are dependent on the trust of the manufacturers.

What this basically means is that for TEEs to function on-chain as opposed to other cypherpunk privacy tech, there have to be tons and tons of audits through the pipeline.

Another area where TEEs can be compromised is via platform version updates. These occasional updates can expose the TEE to attacks allowing sensitive information to be extracted from it.

Additionally, architectural flaws — like insecure secret management where there’s a lack of continuity when a TEE is swapped out for another — pave way for the loss of secrets.

These, along with other shortfalls, ought to be considered while using TEEs as a source of security and privacy for data by crypto applications.

Learn more about the limitations of trusted execution encryption from this article by Prateek, Roshan, Siddhartha and Linguine (Marlin), krane (Asula)

Conclusion

TEEs are gaining traction, with many protocols adopting them to create safer environments for data in use, as well as data at rest and in transit.

That said, they might not win over die-hard cypherpunk enthusiasts. These privacy purists often lean toward multi-party computation (MPC), fully homomorphic encryption (FHE), or zero-knowledge (ZK) privacy methods for achieving data security in crypto.

But here’s the thing: there’s no one-size-fits-all solution in this space, and TEEs have carved out their niche as a practical and effective tool.

Looking ahead, protocols are starting to push the boundaries even further. They're exploring decentralized computation chips and even eyeing multi-planetary or orbital solutions for housing TEE architectures.

In all of this, the big picture here is that privacy is becoming an increasingly important conversation, especially within crypto, even as AI agents are beginning to take over.

Other related reads

Opening MetaMask...
Confirm connection in the extension

The current connected wallet does not hold a LARP. To get access to the Meal Deal please connect a wallet which holds a LARP. Alternatively, visit Opensea to purchase one or visit Join the Meal Deal to purchase a subscription

Go to Meal Deal
Table of contents