In a previous article (🤑) I was able to reduce an Ethereum transaction costing 95 Million (MM) gas down to 4.1MM by converting arrays to byte strings. This was a big step in the process of building clovers.network but 4.1MM gas was still unacceptable. I was able to reduce it again to 1.5MM by utilizing an Oracle to offload the bulk of the work and save only the result—basically making an asynchronous call on the Ethereum Virtual Machine (EVM).

The transaction in question contains a function that plays a game of Reversi using moves supplied by the user. If the game is valid and hasn’t previously been registered, the user becomes the owner of that board and is able to sell it as a Clover (✤). Furthermore, if the board is symmetrical then the user receives a mining reward in ERC20 ClubToken (︎♣︎) relative to the rarity of the symmetry. While the game is rather simple to program on the EVM the level of complexity is still very expensive. That’s because every step in the process of checking the game is saved along with the result of that game. This is important to prove the method of validation, however there’s another way to prove validation while not having to pay for it: ask an oracle 🔮.

An oracle provides a portal to the world outside of the EVM. If you want to know the current price of Ether in USD, Euro or GBP—ask an oracle. If you want to know the weather 🌤 in Chicago , who won the Cubs 🐻 game or whether your flight ✈️ to ORD is delayed—ask an oracle. You can also do things with an oracle that aren’t possible on the EVM like generate random numbers.

There’s some debate about whether these features belong on the Ethereum Blockchain, since in theory all transactions should be verifiable and repeatable—how can a URL request at a specific moment in time be repeatable? (For more information about that debate and oracles in general look here, here and here.) Luckily for me I wanted an oracle to call a function already on the EVM. That way the method of validation is still verifiable but I don’t have to spend gas recording all the steps producing the result.