Switchboard V3 and Functions on CoreDAO

Switchboard
3 min readAug 16, 2023

--

Switchboard Functions

Switchboard Functions is built to offer developers full control and flexibility of what oracles execute off-chain with added verifiability to its computation. With the ever-evolving developmental fronts of the blockchain space, this is especially prevalent to enable developers to tap into much more possibilities.

Switchboard V3

Evolution of traditional oracle models and what makes Switchboard V3 stands apart

Functions runs on Switchboard V3, a combination of the stake-weighted multiparty oracle system with TEE capabilities — which allows for verifiability of the oracles’ software and its execution of any code.

  • Verifiable code execution: Requires a lower stake based operational cost for oracles.
  • Alignment of incentives: If an oracle operator acts maliciously and attempts to change the operation of the approved code, the quote verification will fail.
  • Read more: https://docs.switchboard.xyz/about

Switchboard oracles are now verifiable and has an aligned incentive, this allows the oracles to operate beyond quantitative value reporting, such as functions — running off-chain custom and confidential computations.

Use Cases

With Switchboard Functions, developers are able to run any code they would like through an oracle and verify it on chain. Essentially, it enables smart contracts to access off-chain computations where it can be executed based on a scheduled cron job or on-demand.

Versatile Function use cases such as dynamic risk engines, Volume-Weighted Average Price data feeds, etc

This opens up so much possibilities for smart contracts. Before Functions, developers are limited to some amount of customization for data feeds and are not able to access off-chain computations securely. Hence, with Functions, developers can perform much more intricate smart contracts that utilizes Functions to offload/perform complex code.

DeFi Examples

Protocols can now create Functions that represents complex off-chain risk engines that takes in multiple data points from any source and calculate risk/liquidity scores which helps safeguard end users. In addition, with how fragmented crypto’s liquidity and volume is, Functions can be built to represent dynamic data feeds such as Volume-Weighted Average Price (VWAP) to allow for more “precise” price data for DeFi.

Other Examples

  • Secrets: Developers can also leverage on the ability to utilize API/private keys to access gated data as the TEE capabilities allow for tamperproof and verifiable computations.
  • Randomness: Functions can generate randomness within the enclave. While this is not a true Verifiable Randomness Function, it is verifiable because the code being run within the enclave can be verified.

How to deploy a Function?

User workflow for deploying Functions
  1. Write Function
  2. Build Docker image and upload to a Docker/IPFS repository
  3. Generate MRENCLAVE measurement
  4. Create an on-chain FunctionAccount at app.switchboard.xyz/build/function
  5. Fund lease and integrate

Try out Switchboard Functions today using this SDK: https://github.com/switchboard-xyz/evm-sdk

Build with Switchboard Functions today

Stay plugged in with Switchboard as we roll out more examples and share how protocols are using Functions.

Looking to integrate with Switchboard Functions, discuss TEEs or partner with us? Fill up our contact form, follow our socials to stay plugged in and check out our documentation to learn more!

Contact us: https://switchboard.xyz/contact

Twitter: https://twitter.com/switchboardxyz

Discord: https://discord.gg/switchboardxyz

Github: https://github.com/switchboard-xyz

Docs: https://docs.switchboard.xyz

More links: https://linktr.ee/switchboardxyz

--

--

Switchboard
Switchboard

Written by Switchboard

Plug into the On-chain Economy

No responses yet