ShutterTEE: Layered Security via Meshing Threshold Cryptography and State-Of-The-Art TEE
A Trusted Execution Environment (TEE) is a secure area within a processor that safeguards sensitive data and operations even if the main system is compromised. In blockchain applications, TEEs are increasingly used for privacy-preserving computations, decentralized oracles, secure random number generation, and mitigating Maximal Extractable Value (MEV).
Building on this foundational concept, PolyCrypt GmbH has proposed integrating Intel SGX capabilities into the Shutter protocol through a novel approach called ShutterTEE. This innovation aims to strengthen Shutter's cryptographic backbone by leveraging SGX's secure enclaves to ensure that Keypers—the nodes managing cryptographic keys—operate transparently and securely. The current threshold encryption scheme in the Shutter protocol establishes a strong foundation by requiring trust in only a subset of Keypers to act honestly. To further enhance this security and reduce trust assumptions, a "layered security" approach can be implemented by running Keypers within TEEs.
ShutterTEE's introduction marks a significant milestone, enhancing trust in the Keypers' honest operation and setting the stage for more comprehensive advancements. This includes securing the transaction sequencing process in rollups, a vital step toward realizing MEV-resistant systems. ShutterTEE exemplifies how TEEs can catalyze innovation and trust in the decentralized ecosystem by embedding such high-assurance mechanisms into blockchain protocols.
Navigating the Pitfalls of Advanced Cryptographic Techniques
Programmable cryptography is rapidly transforming the blockchain landscape, enabling innovative applications and enhancing security across decentralized systems. From discussions at Devcon to practical TEE deployments like Flashbots and Nous Research's project that allows delegating social media control, it's clear that the ecosystem is evolving. However, these advancements come with significant challenges that must be addressed to fully realize their potential.
- Heavy Reliance on TEEs: Trusted Execution Environments (TEEs), such as Intel's SGX, are widely used for sensitive computations. They provide strong guarantees for correctness and confidentiality, even on compromised systems. However, their reliance on hardware trust assumptions introduces centralization risks. Trusting hardware manufacturers creates a single point of failure, and past vulnerabilities in SGX have demonstrated the dangers of hardware-level attacks. Moreover, TEEs face limitations in securely handling inputs and outputs, which remain exposed to potentially compromised hosts.
- The Impracticality of Advanced Cryptographic Techniques: While Fully Homomorphic Encryption (FHE) and Indistinguishability Obfuscation (iO) offer theoretical solutions to many cryptographic challenges, their practicality remains out of reach. Current implementations are computationally expensive and unsuitable for real-world blockchain applications, leaving a gap in the cryptographic toolkit.
- Threshold Cryptography's Weakness: Threshold cryptography and Multi-Party Computation (MPC) are practical and widely adopted alternatives to TEEs. They distribute trust among multiple parties to protect secrets and ensure system resilience. However, these methods depend on the "threshold trust assumption," which assumes that fewer than a threshold number of participants will act maliciously. The system's security is compromised if collusion occurs among a sufficient number of parties. This has been highlighted in several high-profile attacks where key participants colluded, leading to severe breaches.
Despite the progress, the reliance on these tools exposes systems to critical vulnerabilities:
- Trust centralization in TEEs
- The impracticality of cutting-edge cryptographic techniques
- The inherent risk of collusion in threshold cryptography
We need a solution that not only bridges these gaps but also enhances security by combining these approaches' strengths while mitigating their weaknesses.
Addressing Blockchain Challenges with ShutterTEE
ShutterTEE tackles the challenges of secure computation and decentralization through a layered security approach that combines TEEs with threshold cryptography. Funded by a Shutter DAO 0x36 grant, ShutterTEE is designed to minimize centralization risks while enhancing cryptographic resilience. By distributing trust across multiple parties and running critical code inside secure enclaves, this layered security approach reduces dependence on a single hardware manufacturer while mitigating the risks associated with centralized control.
The solution leverages SGX2 (Second-Generation Intel SGX) for its ability to support dynamic memory allocation, enabling larger and more complex applications compared to the first-generation SGX. Unlike AMD SEV or Intel TDX, which isolate complete virtual machines (VMs), SGX2 focuses on protecting specific parts of an application within an enclave, resulting in lower overhead and improved efficiency for targeted workloads.
Development Highlights and Next Steps for ShutterTEE
Development on ShutterTEE is well underway, with Milestone 1 scheduled for completion in mid-December 2024. This milestone adapts the Keyper to run within an SGX enclave using edgeless systems' EGo toolkit. It aims to prevent breaches where an attacker could steal a Keyper's secret keys and use them to misbehave. This does not fundamentally change the trust model, as the Keyper already knows his secret keys and could potentially misuse them, but removes an attack vector for external attackers, making the existing security assumptions more likely to hold true.
We made an effort to keep the changes to the codebase minimal and to ensure that the upgraded software works out of the box on an existing Keyper configuration. It loads the Keyper's old configuration, but once you switch to running it in SGX, it will hardware-encrypt the on-disk secret key storage, so that even an attacker with administrator-level privileges cannot extract the keys. This involves a functionality called "sealing," which only allows cryptographically authorized programs to access certain data using a hardware encryption key.
The major tasks in this milestone were to first gain a holistic understanding of the Keyper codebase and then identify all points where secrets are stored on disk or loaded from disk. We then developed a scheme to integrate hardware sealing into the existing workflow and data formats without breaking backward compatibility. We have successfully tested and are also testing on SGX hardware to ensure that the shutter code is compatible with SGX. (there are some instances when regular programs will not run in SGX).
Milestone 2 aims to further strengthen security by verifying the blockchain's consensus and finality directly within the enclave and checking that all processed events are part of the state root, ensuring completeness and correctness of the data received from the blockchain without having to trust a blockchain node. Additionally, this allows the Keyper to rely on the blockchain as a trusted clock, cryptographically enforcing that no key shares will be published before the appointed time. Milestone 2 is targeted for delivery in February 2025 and will solidify ShutterTEE as a more secure alternative to run Keypers.
Dive Deeper into Shutter’s Advancements!
We recently published a blog post titled "Secret Sharing with Snitching: Addressing Shareholder Collusion in Threshold Cryptography." This post highlights other improvements to Keypers in the Shutter protocol. You can also find the grant proposal by Polycrypt and much more information at the Shutter Forum, including all proposals from Shutter DAO 0x36. Be sure to check those out!
Follow us on X-Twitter and join our community on Shutter Discord to learn more about how Shutter works and stay updated on our progress.