Running a remote SNARKer
Dark Forest is powered by ZK-Snark technology, a cryptographic technique that can be used to prove the correctness of a function without revealing the inputs or logic of the function.
Dark Forest uses this technique to verify moves within the game are valid without revealing the location of planets to folks snooping on-chain. This technique (Zk-snark Proof Generation) is computationally expensive! Let's move that computation outside of your browser instance.
First, get a copy of the code from Github.
git clone https://github.com/Bind/df-snarker
Enter the df-snarker directory.
Install code dependencies from NPM.
Start the server.
npm run start
- Add the IP address or the URL of the machine running the server into the plugin and set the concurrency to 1. (You can set the concurrency higher if you have a very powerful machine).
That is it! You should be generating your move snarks outside of your browser.
Like the remote miner, if your server doesn't have an ssl cert (it probably doesn't) then you need to enable mixed content in your browser.
Be sure to disable adblockers as they can block outbound requests from the browser to the server, causing moves to fail!
If you are running the snarking server on the same machine as your browser be sure to use
https://when connecting to it!