Demonstration of SUAVE oracle

Hi,
I am sharing the implementation of a Binance oracle suapp.

Design

The design is composed of an oracle contract on the SUAVE chain and a settlement contract on Goerli.

  • The oracle contract leverages MEVM to:
    • query Binance API,
    • create and sign a Goerli transaction with the price update,
    • submit tx signed tx either via public RPC or as a bundle to Flashbots builder.
  • The settlement contract receives updates coming from a designated address and stores the latest price update.

Implementation

Below is the implementation of an oracle contract.

Notice that the private key is generated, stored within MEVM and is never leaked outside the kettle; but the address associated with it is made public. This address is used on Goerli side to verify the price update is valid and is actually coming from a kettle.

The implementation of Goerli settlement contract can be found here.

To run your own implementation check out the oracle docs detailing how to deploy and run the demo.

Live demonstration

The contracts are live:


Note that this is merely POC that explores capabilities provided by SUAVE with the Rigil version and it is not intended to promote or discourage oracle design with SGX/SUAVE. I believe a lot more thought is needed to consider the risks and to arrive at appropriate design. I hope this post opens such discussion!

3 Likes

Wow, this is pretty cool, thanks for sharing!