Bacalhau simulator design doc

Luke, 2022-09-22


Bacalhau lacking incentives for SPs to run compute nodes is a major barrier to growth of the network.

A token issue for compute nodes earning money for compute jobs and consumers paying for them would solve this, however it means that the network must be running a protocol which is resilient to attacks, because now real money is at stake.

Such a protocol is proposed here, but the initial protocol is a total guess and is probably poorly specified and full of vulnerabilities.

User stories


Write a simulator which allows us to iterate rapidly on the protocol, without running real jobs.

Write visualization tools that allow the state of the simulated network to be seen on the screen to get a tactile, intuitive understanding of the network.

Add malicious clients to the network and observe their wallet balances go to zero! Rinse and repeat until the protocol is as strong as we can make it.

Technical design

Note: We’re interested in knowing what part of the protocol can live in the smart contract vs. out of band (e.g. libp2p), because there’s a cost to executing the smart contract