Quartz CosmWasm (quartz-contract-core)
Quartz CosmWasm (quartz-contract-core) is a high-level framework for building attestation-aware smart contracts on CosmWasm. It provides a robust foundation for developing secure, Intel SGX-based contracts with built-in remote attestation support.
Features
Attested<M, A>wrapper for a message and its attestation- MockAttestation type for development ease
- Session management for secure communication between contract and enclave
- Verify DCAP attestations (by calling
dcap-verifierandtcbinfocontracts) - Mock SGX support for testing environments
See also the spec.md
Installation
Add quartz-contract-core to your Cargo.toml:
[]
= { = "../packages/quartz-contract-core" }
Usage
Here's a basic example of how to use quartz-contract-core in your CosmWasm contract:
use *;
use ;
Key Components
Attested<M, A>: A wrapper struct for holding a message and its attestation.Attestation: A trait for attestation types (DCAP, Mock).HasUserData: A trait for extracting user data from attestations.RawHandler: A trait for handling raw messages.
Configuration
You can enable mock SGX support for testing by adding the mock-sgx feature to your Cargo.toml:
[]
= { = "../packages/quartz-contract-core", = ["mock-sgx"] }
Testing
To run the tests: