Web3 Learning

What Is a Trusted Execution Environment (TEE)?

By Safeheron Team

A trusted execution environment (TEE) is an isolated area protected by processor hardware, in which code and data run without unauthorized external software being able to view or tamper with them. The US National Institute of Standards and Technology (NIST), in NISTIR 8320, defines a TEE as “an area or enclave protected by a system processor”. The Confidential Computing Consortium (CCC) defines confidential computing as “the protection of data in use by performing computation in a hardware-based, attested Trusted Execution Environment”.

Traditional encryption mainly protects data at rest and data in transit, while a TEE focuses on the moment data is being computed. For digital asset custody systems that handle private keys, signing and approval logic, this stage needs protection too.

How Does a TEE Protect Data and Keys?

A TEE uses processor hardware to carve out an isolated execution space, so that the data and code inside it cannot be read or modified by external programs. In its white paper “A Technical Analysis of Confidential Computing”, the CCC states that a TEE should provide at least three guarantees: data confidentiality, meaning unauthorized entities cannot view data in use within the TEE; data integrity, meaning unauthorized entities cannot add, remove or alter that data; and code integrity, meaning unauthorized entities cannot tamper with the code running in the TEE.

Intel Software Guard Extensions (SGX) is one common TEE implementation. Intel describes it as an application isolation technology that lets developers place specified code and data from an application into hardened enclaves, protecting data in use. AMD Secure Encrypted Virtualization (SEV), by contrast, works at the virtual machine level: according to the Linux kernel documentation, when SEV is enabled, each virtual machine’s memory is transparently encrypted with a key unique to that virtual machine, and the keys are managed by firmware in the AMD Secure Processor.

For key management, this means key material and signing logic can be decrypted and computed only inside the TEE. Even if other programs on the host machine are compromised, they cannot directly read plaintext inside the TEE. That said, TEE security also rests on certain assumptions: the CCC white paper points out that a TEE’s confidentiality guarantees depend on the key assumption that there are no exploitable side channels, and that defending against side-channel attacks is a shared responsibility of TEE vendors, third-party vendors and application developers. Safeheron continuously follows public research in this field and has shared its technical analysis in From WireTap to TEE.fail: Recent Advances and Technical Analysis in TEE Security, which recommends not treating a TEE as the sole trust anchor, but distributing trust through approaches such as MPC.

What Is Remote Attestation?

Remote attestation is the mechanism that allows an external party, before handing data to a TEE, to confirm that it is a genuine TEE running the expected code. NIST SP 1800-19B describes attestation as the process of digitally signing a set of measurements securely stored in hardware, after which the requester verifies the signature and the measurements.

The CCC article “Why is Attestation Required for Confidential Computing?” calls attestation “the evidence used to decide whether to trust a confidential computing environment”. This evidence contains measurements of system components such as hardware, firmware and BIOS, and is signed by a key held only by the hardware root of trust. By comparing the signature against the manufacturer’s certificate, a verifier can confirm that the report was indeed generated by the CPU hardware.

Intel’s official SGX overview also emphasizes that remote attestation is an important security feature that can verify an enclave is genuinely an Intel SGX enclave before data is shared with it. Because of remote attestation, a TEE’s protection is not just a promise from the service provider, but evidence that can be independently verified.

What Is the Difference Between a TEE and an HSM?

A TEE is a protected area inside a processor, while an HSM is a standalone physical device. NIST SP 800-57 Part 2 Rev. 1 defines a hardware security module (HSM) as “a physical computing device that safeguards and manages cryptographic keys and provides cryptographic processing”. NIST SP 1800-16B further explains that an HSM provides tamper-evident and intrusion-resistant protection, with requirements specified by FIPS 140-2. For a fuller introduction to how HSMs are built and used, read What Is a Hardware Security Module (HSM)?

The two are therefore positioned differently. An HSM is a dedicated device designed specifically for key custody and cryptographic operations; a TEE provides isolation for any specified code and data on a general-purpose processor, can run complete business logic such as policy evaluation and signing services, and can prove its own state to outside parties through remote attestation.

With either an HSM or a TEE, if the complete private key exists in only one place, that place becomes a single point of failure. Some institutions therefore add multi-party computation on top of hardware protection, and the trade-offs of each approach are analyzed in detail in the comparison of MPC and HSM.

How Does a TEE Work With MPC to Protect Private Key Shares?

MPC ensures the complete private key never appears, while a TEE protects each share and critical business logic from being observed or tampered with at runtime, so the two complement each other. In multi-party computation, the private key is held as shares by multiple parties, and signatures are completed collaboratively. How MPC works explains this process.

Safeheron combines its proprietary MPC with Intel SGX-based hardware isolation (TEE) technology. As its official security page describes, this architecture defends against both internal and external threats and fully protects private key shares, the policy engine and customer data. The Safeheron Trust Center also lists MPC and TEE as core technologies of its institutional-grade self-custody service.

The role of the TEE goes beyond safeguarding shares. Safeheron’s policy engine runs strictly within the TEE’s secure isolated environment. Once policies are set, all transfers and approvals must follow the established rules, and no party, including Safeheron, can bypass or manipulate them. The Safeheron Help Center also states that the result of each approval round is verified in the trusted execution environment.

Transparency is also part of this architecture. Safeheron’s open-source page lists several trusted service projects based on Intel SGX, including TEE-MPC-Cosigner, TEE-Policy-Engine, TEE-TSS-RSA-Service and TEE-HMAC-Signer, as well as SSGX, a native Intel SGX development framework, allowing the MPC+TEE algorithms to be publicly verified.

Conclusion

A trusted execution environment extends protection to data in use and, through remote attestation, makes that protection independently verifiable. Combined with MPC, the private key never exists in complete form, while shares and approval logic run under hardware isolation, giving institutions multiple layers of protection for their digital assets.

Safeheron’s MPC Wallet-as-a-Service provides businesses with MPC key management and a policy engine.

Want to know how MPC and TEE work together to protect your digital assets?

Contact Safeheron’s Sales Team to Book a 1:1 Demo

Share

Looking for a secure way to manage digital assets?

Talk to our experts and find the right solution for your business.

Request a Demo