What is the Sunscreen SPF?
Sunscreen’s Secure Processing Framework (SPF) is a comprehensive end-to-end platform that enables writing, deploying, and using FHE programs on-chain or off-chain. It consists of 3 major pieces:
- Core stack: Built on our Parasol offering. This includes the compiler, processor, and low-level FHE library which enables you to create your FHE program in C (in the future Rust) and get great performance, without having to be a cryptography expert.
- Control stack: The control stack helps with all auxiliary functions that are needed to actually use FHE programs in a real world setting. This includes things like data storage (since FHE-encrypted data is too large to store directly on-chain), access control (to ensure only the proper users have access to sensitive data), key management (we set up a threshold committee to respond to decryption requests), and running your program (which we handle on your behalf as a powerful machine is needed to get good performance). The control stack exposes some APIs through HTTP endpoints, usually known as SPF service, for the client to interact with.
- Data bus: This can be thought of as a pull oracle that monitors the blockchain for requests of program run, access change and decryption, forwards these requests to our SPF service for execution, and posts result back on-chain if needed. For web2 use cases, users will directly interact with the SPF service.
Why we took this approach
The main challenges we see with FHE today are that:
- Creating highly optimized FHE programs is incredibly challenging. You generally need to restructure your program and learn an eDSL to work with the tech. Importantly, there’s a very large performance gap between what you can get as an FHE expert vs non-expert, as you must know how to efficiently structure your program as FHE circuits and choose FHE scheme parameters that are secure yet performant.
- FHE is in active R&D, with the expectation that new schemes will emerge and specialized hardware may become available to greatly accelerate performance. How can developers set themselves up for success given the shifting grounds?
We address these issues by building the SPF, which enables developers to write programs directly in a mainstream programming language and get highly optimized performance automatically.
Moreover, our architecture is modular, scaling as more powerful hardware becomes available and allowing us to swap out the underlying FHE scheme. You’ll notice that nothing about the FHE programs written by developers using our SPF is scheme dependent.
Value proposition
Accordingly, our focus is on improving the developer experience so that more developers can successfully build and deploy FHE apps on any chain, along with improving the performance developers obtain as the hardware evolves.
Developer Experience:
- Write in mainstream programming languages. Using SPF, you can write FHE programs directly in C. The only changes you need to make to your code (with some caveats) are those indicating which functions should be treated as FHE programs and which inputs/outputs should be kept hidden.
- Write once, use anywhere. Developers need the freedom to deploy their program wherever they see fit, without having to rewrite complex program logic for new ecosystems. Accordingly, the SPF allows developers to create their program once and use it anywhere (on and off-chain).
Performance:
- Automatically optimized. Under the hood of our SPF is our compiler and processor that optimizes program performance on behalf of the developer using a novel homomorphic computing paradigm designed in-house. Learn more about this in our research paper.
- Built for the hardware endgame. Our computing approach seeks to maximize throughput and minimize latency by extracting parallelism and reducing the critical path in the circuit. If you’d like to learn more about this, we’d recommend this blog post.
Relationship between Parasol and SPF
Parasol is our “core stack” allowing developers to create highly optimized FHE programs using our variant of TFHE (Torus FHE) scheme. It can be used on a standalone basis. Unlike SPF, Parasol is not a service, meaning you would need to set up your own machine to run FHE programs.
Think of Parasol as a proper subset of the SPF. Parasol powers our SPF but SPF includes many more services beyond what Parasol offers (e.g. delegated computation, data storage, key management).