Dark Forest

zkSNARK space warfare

The scoring period for Dark Forest v0.4 concluded last Monday 10/12. Nearly 600 players participated in the round, spending almost 100 billion gas on 250k+ transactions! This round was won by @jacobrosenthal and @blainebublitz, who during the week built out a powerful suite of mods, automations, and mining tools to dominate the universe. It’d be an understatement to say that we were incredibly impressed. A list of the top 50 players can be found here. Congratulations to all who participated!

Like the previous round, Dark Forest v0.4 stretched the decentralized stack to its limits. Here’s a recap of what happened this round.

ZK Upgrades to the Dark Forest Universe

One of our team’s proudest technical achievements this round was implementing the Perlin noise algorithm inside of a zkSNARK. Perlin noise is a procedural generation algorithm–it allows us to give the Dark Forest universe “texture” and to introduce DEEP SPACE and NEBULA regions. We’ll go into more detail about the Perlin SNARK in future posts.

The Perlin SNARK creates "texture" in the universe The Perlin SNARK creates “texture” in the universe

These mechanics are made possible by the incredible work being done by Jordi Baylina and iden3 on the snarkjs library. iden3 has been continually improving on the performance of in-browser SNARK proof generation: a year ago, the Perlin SNARK proofs would have taken several minutes to generate, whereas today, they take only a few seconds.

At the same time, our (painful) SNARK development process made it clear to us that there is a real need for better tooling in the applied ZK space. We’re excited to see projects like Alex Gajewski’s KnowledgeFlow toolkit - a Python library for zkSNARKs that compiles into Circom.

SNARK procedural generation unlocks a much richer and wider class of persistent blockchain games, which we look forward to exploring in the future.

Blockchain Scaling Challenges: xDAI and L2

Dark Forest v0.3 nearly broke the Ropsten test network, with only ~300 players. In order to support more players and activity, we chose to deploy the v0.4 contracts to the xDAI STAKE network, an EVM-compatible proof-of-stake chain with a “token bridge” allowing for exchange of cryptoassets with the Ethereum mainnet. From the end user’s perspective, using the xDAI STAKE network resulted in faster confirmation times, lower reorg rates, and (most importantly) substantially cheaper transaction fees. xDAI was able to support twice the number of players as our previous playtest at a much higher transaction throughput.

Once again, Dark Forest usage went far above and beyond our expectations. Following the start of the round, transaction volume on xDAI tripled, and gas usage increased more than tenfold.

Despite these improvements, we had to put a pause on sending out additional invitations midway through the week, as many users started to run into significant issues with blockchain reads and network congestion. This is primarily due to the fact that the contract size and player count increased far beyond our expectations, overloading the xDAI public RPC endpoint. In the future, we can decrease network load by being more judicious with application reads and caching.

As a temporary fix, we implemented a hotfix to allow users to connect to their own custom endpoints, and we were excited to see that many users did indeed end up running and connecting to their own personal xDAI nodes. The decentralized future is coming!

Overall, we were pleased with the performance of the xDAI network and are excited to continue using it as a staging environment for the next Dark Forest beta round, where only limited economic value is at stake. Our long-term goal is to migrate to (ZK/optimistic) rollup solutions, which provide strong decentralization and security guarantees, and interoperability with the entire Ethereum application ecosystem.

Special thanks to Igor Barinov and the xDAI team for being so responsive and for quickly scaling up a public fleet of xDAI nodes to meet the explosive demand!

BYOC (bring your own client) and Scripting

We were extremely excited to see a community of Dark Forest modders and plugin writers evolve during the playtest. Dozens of players forked and modified the Dark Forest webclient or wrote scripts to automate strategies. We’re grateful to everyone who shared their code in Telegram, and also to everyone who provided feedback on the developer experience.

Special recognition goes to Blaine Bublitz and Jacob Rosenthal for writing and open-sourcing their heavily-modified custom client, complete with an upgraded miner and many useful automations.

Our long term vision is for the blockchain gaming experience to be built and owned by players. As a result, a top priority for us is to continue to encourage and build tools for this nascent developer community. Jordan Spence collected a number of useful scripts that were floating around the community, and posted them to the Dark Forest subreddit.

Usability Tech: Bringing Crypto Mainstream

Last month, Austin Griffith taught our team about burner wallets, which we implemented in Dark Forest v0.4. These ended up being a massive usability win! Players were able to log on to the game and make their first ~100 moves without needing to install wallet software or purchase crypto. Burner wallets are essentially in-webpage crypto wallets that can hold crypto and interact with the blockchain relatively frictionlessly.

We think that usability tech like this will be extremely important in onboarding the next wave of mainstream users onto decentralized applications. First-time crypto users shouldn’t need to install software or manage keys manually to get started.

Thanks also to Alex van de Sande for tons of UIUX feedback.

Community

Watching the community develop is the most fun part of working on this project! We’re incredibly grateful to our players for welcoming newbies, answering questions, sharing tips and strategies, and more.

  • Thanks to Jordan Spence for moderating + answering questions in Telegram, for putting together the Dark Forest subreddit, and for giving tons of helpful feedback overall.
  • Shoutout to Alberto Jauregui for streaming Dark Forest gameplay!
  • We also saw some really fascinating strategy discussions on Telegram and Twitter this round - user @hideandcleanse also posted some very interesting threads.

Throughout the round, a number of players DM’d us to share interesting stories of diplomacy or politics: trading planets, forming alliances, making threats, and going to war. It’s amazing for us to see so much complexity emerge at such an early stage.

Conclusion, and What’s Next

Dark Forest v0.4 exceeded our team’s expectations, but there is still so much more to do. We believe that ZK crypto technology has the potential to unlock the first generation of MMO crypto games with mainstream appeal. Our ultimate goal with these beta rounds is to test out mechanics and crypto technologies in a timeboxed environment as we build towards a persistent ZK universe.

We’re working on the next version of Dark Forest and a few other experiments in ZK gaming, and we’ll keep you all posted!

The seed of civilization remains. It will germinate and again progress through the unpredictable world of Dark Forest. We invite you to log on in the future.