project screenshot 1
project screenshot 2
project screenshot 3

Onchain Simulations

Tackling the problem of reproducible scientific simulations by moving the computation and storage on chain. Thus making scientific simulations completly verifyable

Onchain Simulations

Created At

ETHGlobal Brussels

Winner of

Nethermind - Large Scale Compute

Project Description

The reproducibility of scientific simulations (ie Research Group A can run and verify the results produced by Research Group B exactly) is one of the key challenges of scientific research.

The state of the art in this is when researchers try to document their version-controlled code, keep track of dependencies, hardware used etc and perhaps even set up a Docker container that runs the simulations with one click. Even these solutions are not 100% reproducible. For eg Docker relies on the underlying host kernel, High-performance computing (HPC) codes often link with kernel modules and headers which are not guaranteed to run 5 years later. Some non-deterministic simulations would not give exactly the same result on rerunning the same code on the same hardware. ( eg Montecarlo simulation )

The proposed solution is to bring the entire computation on chain. This project acts as a proof of concept. We'll be simulating the steady-state configurations of electron spins arranged in 1 dimension ( simplified 1d Ising model). Thus demonstrating how a Monte Carlo simulation can be run entirely on a blockchain. This would allow anyone to verify each step of the simulation and confirm the accuracy of the final results.

On the one hand new technologies are built to make the blockchain cheaper, on the other hand such projects imagines applications for a scenario where on chain compute becomes abundant.

How it's Made

The project is deployed on Starknet a L2 on ETH. The contracts are written in Cairo. The post-processing and plots are made using Python.

The Cairo deve tooling like starkli and scarb are used to build the contract.

Two examples are discussed, one a simple compound interest simulation and the other the final Ising model simulation The two example contracts are deployed at https://sepolia.starkscan.co/tx/0x45d19325297346b641ab03a564a3ddeae4fe3cd14721c733062e940c9c54b78#events https://sepolia.starkscan.co/tx/0x1298f9914701553db707b23e6389afbf74b9f13315413aedda7db94e8d09e97#events

background image mobile

Join the mailing list

Get the latest news and updates