Switchboard Documentation
  • Switchboard On Demand
  • Understanding Switchboard
    • Introduction
      • Why Switchboard Oracles?
      • Vision & mission
      • Brief History and Key Achievements to Date
      • Switchboard’s Architecture, Tech Stack and Security
        • Trusted Execution Environments (TEEs)
        • Oracle Queues
        • Node Architecture
  • Product Documentation
    • Data Feeds
      • Getting Started with Switchboard Data Feeds
      • Solana / SVM
        • Part 1: Designing and Simulating Your Feed
          • Option 1: Drag-and-Drop Feed Builder
          • Option 2: Designing a Feed in Typescript
        • Part 2: Deploying your Feed On-Chain
        • Part 3: Integrating your Feed
          • Integrating your Feed On-Chain
          • Integrating into Frontends
        • Costs
        • Integrating on Eclipse
      • EVM
        • Part 1: Prerequisites and Quick Start Guide
        • Part 2: Designing and Creating Your Feed
          • Option 1: Drag-and-Drop Feed Builder
          • Option 2: Designing a Feed in Typescript
        • Part 3: Integrating your Feed
          • Integrating your Feed On-Chain
          • Integrating your Feed with Typescript
          • Integrating into Frontends (EVM)
      • Aptos
      • Sui
      • Movement
      • Starknet
      • Optional Features
        • Switchboard Secrets
    • Aggregator
      • How to use the Switchboard Oracle Aggregator
    • Randomness
      • Why Randomness is important?
      • Switchboard's Approach to Verifiable Randomness
      • Tutorials
        • Solana / SVM
        • EVM
  • Tooling and Resources
    • Crossbar
      • Run Crossbar with Docker Compose
    • Switchboard Command Line Interface
    • Technical Resources and Documentation
      • SDKs and Documentation
      • Solana Accounts
      • EVM Identifiers
      • Code Examples (Github)
  • Switchboard Protocol
    • (Re)staking
      • What is (re)staking?
      • What are Node Consensus Networks (NCNs)?
      • What are Vault Receipt Tokens (VRTs)?
      • The Node Partner Program
      • The Switchboard NCN
    • Running a Switchboard Oracle
      • Prerequisites
        • Knowledge about Linux, containers and Self-Hosting
        • Hardware Requirements and AMD SEV SNP
        • Software Requirements
        • Network Requirements
      • Hardware: tested providers and setup
        • OVH
      • Platform: Kubernetes + AMD SEV SNP
        • Bare Metal with Kubernetes (K3s)
      • The Git Repo: Clone Our Code
        • Repo Structure
      • Configuration: Tweaking Configurations
        • cfg/00-common-vars.cfg
        • cfg/00-devnet-vars.cfg and cfg/00-mainnet-vars.cfg
      • Installation: Setup Via Scripts
        • Bare Metal with Kubernetes (K3s) + AMD SEV SNP
  • Frequently Asked Questions and Glossary
    • FAQ
    • Glossary
Powered by GitBook
On this page
  • Here’s the process:
  • Why this is secure:
  1. Product Documentation
  2. Randomness

Switchboard's Approach to Verifiable Randomness

So, how does Switchboard bring truly random and secure numbers to your app? The challenge is stopping anyone from cheating – whether that’s a validator, an oracle operator, or even a bad actor with inside knowledge.

Switchboard tackles this with a clever combination of technologies:

  • Trusted Execution Environments (TEEs): Think of these as super-secure black boxes where code can run without anyone peeking inside or tampering with it.

  • On-Demand Oracles: Switchboard uses its network of oracles to fetch and process information, but the key thing is they do it inside those secure TEE black boxes.

Here’s the process:

  1. Locking in the Slot Hash: First, the system takes a “snapshot” of a recent block on the Solana blockchain. This snapshot is called the “slot hash”. It's essential to lock in this value because that makes one single moment in time where the slot hash can't be tampered with.

  2. Requesting Randomness: Once that snapshot is locked, a user can say “Hey, Switchboard, I want a random number based on this slot hash snapshot!”

  3. TEE Magic: The Switchboard oracle receives the request, but it does all the work inside the secure TEE environment. This means no one outside of the TEE can see what's going on or mess with the result.

  4. Randomness Delivered: The TEE generates a truly random number based on that securely locked snapshot and delivers it back to the user.

Why this is secure:

  • Validators Can't Cheat: Because we are “snapshotting” a short window of time when the slot hash is finalised, it's tough for a malicious validator to manipulate randomness, since the finality of the chain is constantly being checked, providing true random numbers. A single validator would require an enormous amount of control to the chain's consensus to change that number. We have a higher certainty about our randomness.

  • Oracle Operators Can't Cheat: The TEE makes sure that even the Switchboard oracle operator can't see the random number being generated until it's already locked in.

  • No One Can Peak: The oracle will never reveal randomness seeded with the latest slot hash to prevent adversaries from “peaking.”

Important Points:

  • Timing Matters: There are time limits involved. You need to be timely about it, or we might not be able to generate that randomness from the slot hash.

  • Oracle Key Rotation: Like any security measure, our system does periodic rotations of the TEE code to maintain the system's security. Because of this, we restrict request generation in the hour before rotation.

In short, Switchboard handles the difficult work involved with providing verifiable randomness for you. Our system is secured, and we offer this on Solana Devnet today. Please contact the Switchboard team for additional information.

PreviousWhy Randomness is important?NextTutorials

Last updated 2 months ago