project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4
project screenshot 5

Vanna Blockchain

The Vanna Blockchain is a layer 2 rollup on Ethereum that supports direct, native, and verified AI and ML model inferences directly made from smart contracts.

Vanna Blockchain

Created At

Superhack

Winner of

🖖 Optimism — Best OP Stack Fork

Project Description

The Vanna Blockchain is an EVM-compatible rollup built using the OP stack architecture that allows for smart contracts to directly run AI/ML models on-chain.

From the user’s standpoint it’s an OP superchain layer 2 blockchain that has the ability to have dApps built on it that leverage verified AI and ML efficiently. From the dApp developer’s standpoint, it’s blockchain infrastructure that makes it ridiculously easy to inference trained AI/ML models directly from their smart contract like it’s a function call. From the blockchain architect’s standpoint it’s a modular blockchain rollup that includes a new type of validator node (we’re calling theme engine nodes) to compute and secure AI model inferences through transaction-level consensus, and a new EVM-compatible virtual machine as well as solidity compiler that allows for native AI inference.

How it's Made

Breaking this down into a twofold response: what we did and how we did it. What we did:

This project includes changes on two major fronts: the blockchain architecture front and the virtual machine front.

With regards to the former, we made additions to Optimism’s blockchain architecture to add a new type of validator engine node that’s designed specifically to service AI/ML model inferences. When these engine nodes compute AI inferences in a valid fashion they will be rewarded; on the contrary, if consensus cannot be achieved for their inference the transaction will be flagged and these nodes could potentially be slashed. This makes consensus more modular, there is block-based consensus like in any blockchain and also there is consensus on the transaction level that secures the integrity of AI inference. This is important because AI inference can often be a black box.

On the virtual machine front, we made changes to Optimism’s EVM to include native op-codes that perform these inferences natively. This design allows dApp developers to, super seamlessly in their solidity smart contract, use function-call-esque syntax to directly leverage the power of AI and ML directly in their smart contracts. This involved deep-dives into the EVM code as well as making changes to the EVM interpreter as well as the solidity compiler to add new support for the opcodes we added. Our AI-enabled virtual machine is still completely EVM-compatible.

Lastly, to showcase the power of our tech, we’ve also developed a simple time-series BTC volatility forecasting model using gradient-boosted trees (XGBoost) that we’ve pre-loaded onto our engine nodes for us to inference via our blockchain directly from a solidity smart contract.

How we did it: For the new engine nodes we used gRPC technology to communicate between the sequencer and the validator engine nodes. I used C# .NET grpc to set up the engine nodes, and hosted a couple nodes on AWS EC2.

For attestation of the inferences we used the Ethereum Attestation Service (EAS) where the validator engine nodes can use their private keys to sign attestations to the computed inference result. This attestation is used to reach transaction-level consensus in order to secure the inference computation.

For native support of inference within the blockchain, we modified the go-ethereum library in GoLang, and made corresponding changes to the solidity compiler which involved C++/JS. We also used Remix (Ethereum IDE) and injected our solidity compiler into Remix for testing and showcasing purposes.

For our volatility forecasting model, I used an open-source gradient-boosted trees library (XGBoost) to construct the model. I also converted the model using ONNX-Runtime to make it cross-platform friendly and to include native hardware-acceleration features in ONNX.

background image mobile

Join the mailing list

Get the latest news and updates