Skip to main content

Prerequisites

This tutorial assumes Ubuntu 20.04+ or macOS. If you're on a different OS, commands may need modification.

Why This Architecture?

Most oracles require trusting a centralized operator. This setup eliminates that by moving trust to a verified execution environment:

  • Verifiable code — Platform Configuration Registers (PCRs) prove exactly what code is running
  • Hardware isolation — The oracle runs inside an AWS Nitro Enclave, isolated from the host
  • Cryptographic proof — Every price update is signed with a key generated and held only within the enclave
  • On-chain verification — The Sui contract verifies signatures and enclave identity before accepting data
note

This tutorial uses a simple CoinGecko API query to fetch prices as a demonstration. The price calculation logic can be replaced with any data source or computation - the key takeaway is the enclave-based trust model, not the specific oracle implementation.

Install Dependencies

Sui CLI

Install the Sui binaries following the official guide. The main branch is recommended.

# Verify installation
sui --version

Docker

Docker is required for building enclave images. Version 29+ is recommended to ensure stable image digests after docker load.

Install Docker following the official guide.

# Verify installation
docker --version

Oyster CVM CLI

Install the oyster-cvm CLI tool by following the setup guide.

Git

Install Git following the official guide.

Sui Wallet

You'll need a Sui wallet with tokens for gas fees. This guide uses Sui testnet for deploying smart contracts - you can get testnet tokens from the Sui faucet.

For deploying the Oyster enclave, you'll also need Sui mainnet tokens and USDC on Sui mainnet to pay for enclave deployment costs.

Clone the Repository

git clone https://github.com/marlinprotocol/sui-oyster-demo.git
cd sui-oyster-demo