2024-08-28 18:56:36 +00:00
# Quartz
2023-11-06 10:22:21 +00:00
2024-08-28 18:56:36 +00:00
Quartz is a flexible framework for privacy-preserving computation via Trusted Execution
Environments (TEEs) organized and secured by smart contracts.
2024-09-12 13:14:28 +00:00
_**Why?**_ Development of Quartz was motivated by the privacy needs of the [Cycles Protocol][cycles],
which adopts a TEE-based ZK execution sidecar for private smart contracts.
For background on how to think about different privacy preserving
2024-08-28 18:56:36 +00:00
technologies (FHE vs MPC vs ZKP vs TEE), see [How to win friends and TEE-fluence
people][how_to_win_friends_talk] and the associated [tweet
thread][how_to_win_friends_thread].
_**What?**_ With Quartz, data in smart contracts can be encrypted, while computation happens
2024-09-12 13:14:28 +00:00
privately off-chain via TEEs like SGX. Each contract can control what code runs in the
2024-08-28 18:56:36 +00:00
enclave, when it runs, and who is permitted to run it.
_**How?**_ At the heart of Quartz is a light-client protocol handshake between the enclave and the
smart contract which gives the smart contract control over when, how, and by who
the enclave code is run. This significantly reduces the surface area of TEEs.
See [How it Works][how_it_works].
_**Where?**_ Quartz currently targets the CosmWasm smart contract environment and the Intel SGX enclave.
Other environments and TEEs remain for future work.
_**Who?**_ Quartz is (currently) for any CosmWasm developer interested in adding privacy or secure off-chain compute to their contracts and applications.
_**When?**_ Early, non-production versions of Quartz are available now for building
example applications. Production features and requirements are in development.
See [Future Work][future_work]
2024-09-29 05:24:39 +00:00
---
WARNING: Quartz is under heavy development and is not ready for production use.
The current code contains known bugs and security vulnerabilities and APIs are still liable to change.
We are making it available for devleopers to start playing with and to gather
feedback on APIs and roadmap. It can be used today on CosmWasm testnets
(testnets only, with no real funds at risk!).
---
2024-08-28 18:56:36 +00:00
## Docs
- [Getting Started][getting_started] - Get a simple example app up and running in 5 minutes
- [How it Works][how_it_works] - How smart contracts and enclaves communicate securely
- [TEE Security][tees] - Resources on TEE security
- [Building Applications][building_apps] - How to build Quartz applications
- [Future Work][future_work] - Roadmap and future work for security, flexibility, and
more
2024-09-29 05:24:39 +00:00
p
2024-08-28 18:56:36 +00:00
## This Repo
2023-11-06 10:22:21 +00:00
2024-05-16 13:18:47 +00:00
This repository contains the following components -
2023-11-06 10:22:21 +00:00
2024-05-16 13:18:47 +00:00
### Apps
2023-11-06 10:22:21 +00:00
2024-08-28 18:56:36 +00:00
Example Quartz applications, including CosmWasm smart contracts, Gramine based sidecar enclave, and demo front end
2024-02-29 18:31:03 +00:00
2024-05-16 13:18:47 +00:00
Currently implemented apps -
2024-02-29 18:31:03 +00:00
2024-08-28 18:56:36 +00:00
* [Transfer ](apps/transfer ) - The default transfer app which allows private transfer of assets
2024-05-16 13:18:47 +00:00
### Core
The Quartz core implementation including -
2024-08-28 18:56:36 +00:00
* light-client-proofs: Light client and merkle proofs for CosmWasm storage
* quartz-proto: protobuf message types for quartz handshake between enclave and
contract
* quartz: Intel SGX remote attestation (RA) primitives and quartz handshake logic
2024-05-16 13:18:47 +00:00
### CosmWasm packages
CosmWasm packages for the core Quartz framework and remote attestation verification.
### Utils
Utilities for supporting Quartz development and -
* [cw-prover ](utils/cw-prover ) - Retrieve a merkle-proof for CosmWasm state
* [cycles-sync ](utils/cycles-sync ) - Sync obligations and setoffs
with [Obligato ](https://github.com/informalsystems/obligato )
* [tm-prover ](utils/tm-prover ) - Generate light client and merkle proofs for CosmWasm storage in a format that Quartz
understands
## Contributing
If you're interested in contributing, please comment on a relevant issue (if there is one) or open a new one!
See [CONTRIBUTING.md ](CONTRIBUTING.md ).
## License
TBD
2024-08-28 18:56:36 +00:00
[cycles]: https://cycles.money
2024-09-29 04:55:04 +00:00
[getting_started]: /docs/getting_started.md
[how_it_works]: /docs/how_it_works.md
[building_apps]: /docs/building_apps.md
[tees]: /docs/tees.md
[future_work]: /docs/roadmap.md
2024-08-28 18:56:36 +00:00
[how_to_win_friends_talk]: https://www.youtube.com/watch?v=XwKIt5XYyqw
[how_to_win_friends_thread]: https://x.com/buchmanster/status/1816084691784720887