Posted on Jul 07, 2023Read on

Why did Cafe Cosmos choose StarkNet and Cairo?

Creator: @MsKikiUrRT

From: @AW_Research

AI Summary:

Cafe Cosmos is a Fully-Onchain Game that completed a $2.2 million seed round of funding led by Animoca Brands and Spartan Group in 2022. Players earn tokens by harvesting resources, farming, crafting, and managing their cafe. The game is deployed on StarkNet and utilizes Cairo for building smart contracts, employing the StarkPlay economic model. Currently, only the game demo has been disclosed. Cafe Cosmos focuses on the resurgence of tokenization and social gaming, featuring a cute and casual art style.

Cafe Cosmos provides its reasons for choosing STARK and Cairo. By comparing and analyzing STARK and SNARK, they believe STARK has advantages in quantum resistance, trusted setup, and proof generation. Furthermore, they highlight Cairo's significant advantages in proof construction, offering the ability to handle complex computational tasks for building smart contracts.

Embracing the StarkNet Ecosystem!

'Power to the individual, and power to the STARK!'

In May 2023, Cafe Cosmos announced their determination to go all-in on StarkNet. From a technical perspective, Cafe Cosmos believes that StarkNet is the best choice for a Fully-Onchain game with limitless possibilities.

First, let's understand what kind of game Cafe Cosmos is.

Game Overview

Cafe Cosmos is a tycoon game where players earn tokens by harvesting resources, farming, crafting, creating, and managing their own cafes. It is a Fully-Onchain game deployed on StarkNet, utilizing Cairo for smart contract development and implementing the Stark Play economic model.

Cafe Cosmos focuses on the resurgence of tokenization and social gaming, featuring a cute and casual art style. In terms of the economic model, initially, Cafe Cosmos adopted the Play-to-Earn (P2E) model. However, considering the evolution of the crypto industry and the gradual development of the GameFi sector, StarkPlay has become a better economic model for Cafe Cosmos.

Cafe Cosmos is created by MetaVision Labs and was initially launched in collaboration with Alliance, a leading Web3 accelerator and founder community.

Funding Situation

On February 4, 2022, in Toronto, Cafe Cosmos proudly announced that it had raised a $2.2 million seed round of funding led by Animoca Brands and Spartan Group, with participation from key strategic individuals.

MetaVision Labs is a game research studio that extends the concept of "games as protocols" and believes that combining on-chain actions with interoperability is a crucial factor in pushing the boundaries of game development.

MetaVision Labs has received angel support from John Lilic, Trent McConaghy, and Bruce Pon, the founders of Ocean Protocol and BigChainDB. John Lilic, a former operations executive at ConsenSys and early investor in Polygon, has joined MetaVision Labs, providing strategic support and funding. Trent McConaghy, a pioneer in token engineering, will also join as an angel investor. Trent has led numerous innovative projects and published extensive research in the fields of blockchain, artificial intelligence, and chip design. He has also pioneered the concept of Web3 sustainability loops, which have had a significant impact on redistribution mechanisms. Bruce is a technological pioneer driving the development of the data economy with his vast knowledge and strong technical background.

Found John Lilic's LinkedIn 😺

John Lilic and Nico Rodriguez's Discussion on Game Design.

Alliance member Will Robinson had already mentioned the concept of Fully-Onchain Games on Cafe Cosmos back in 2021. Will gained profound insights into on-chain gaming through his in-depth experience with Dark Forest. Despite being written at the end of 2021, the article remains relevant today.

Here is the link to the article for reference.

From June 2022 to April 2023, the game seemed to have halted its operations.

After almost a year of silence, Cafe Cosmos made new progress in May 2023 by embracing the StarkNet ecosystem and initiating a new narrative for Fully-Onchain Game.

The official release of a demo showcased some gameplay footage and mechanics of the game.


Louis Guthmann, the ecosystem lead for StarkNet, expressed his expectations for Cafe Cosmos.

Economic Model

Cafe Cosmos has its own token called StarkPlay. Since there is currently no playable version of the game, we can only gather information about gameplay and the economic model from official Twitter content.

  • Network Revenue

This refers to the amount of money the game earns. When players claim a plot of land or expand their existing land, they must make payments in StarkPlay. These funds are immediately sent to an algorithmic custodian that continuously injects the funds into the redistribution mechanism. The game and the custodian do not receive token allocations.

  • Redistribution Mechanism (R.M.)

The R.M. disperses the funds across three categories: main courses, beverages, and desserts.

Each category has its share of the total funds, distributed based on the typical price percentages seen on a menu.

Within these nodes, some redistribution occurs. Each category pools the funds and reallocates them to their respective sub-pools.

Now that the menu is filled with funds and ready, how can players make money?

  • From Farm to Table

Players need to unlock land, which is a jungle filled with valuable resources waiting to be developed.

Players can find ores, minerals, crystals, seeds, and animals within the land. They can use seeds to grow crops, ores and minerals to build electrical appliances and machinery, and animals to produce various products.

When players have the right ingredients and appropriate tools (e.g., salad and cutting boards) through crafting, cultivation, and ownership, they can place the salad on the cutting board and enter the redistribution mechanism.

  • Earning

When players place the salad on the cutting board, it automatically purchases a share in the salad pool that the player can claim within 24 hours.

Therefore, players need to be mindful that when more people start making salads, they will be part of a shared recipe pool with others.

This is why users are incentivized to seek out recipes with the least number of users.

  • Cookware

From the recipes, we learn that everyone is competing for a share in the recipe pool, depending on the available space. So, what determines the amount of share a player receives?

A simple equation: Pool Share = Number of Tables a player has * 1 / sqrt (Number of people using the player's cookware)

At this point, players can compete by seeking the rarest cookware. Cookware includes but is not limited to blenders, ovens, cutting boards, and coffee machines.

  • Inflation

Cafe Cosmos aims to create a game without inflation.

What contributes to inflation? Fruits on trees, animal by-products, and crops.

  • Elements that remove inflation


Water is introduced into the game in the form of climate. Sometimes the weather gets hot, and players need to water their plants (ensuring they have enough reserves), while other times water can persist for months until players feel it is no longer needed.

  • How does Cafe Cosmos introduce randomness?

By linking the climate system (which is also a deflation system) with the ETH price on Uniswap.

When ETH rises, it rains or even pours.

When ETH falls, it becomes arid, and as ETH continues to decline, it becomes increasingly dry, eventually reaching its peak.

Now that we understand what Cafe Cosmos is all about, let's discuss why StarkNet and Cario were chosen.

Why STARKs instead of SNARKs?

‘StarkNet is the only future for Fully-Onchain Game.’

‘STARKs are superior. More powerful, more faster, more reliable.’

Cafe Cosmos is steadfast in their decision and believes in the superiority of STARKs over SNARKs. So why did they choose STARKs over SNARKs?

Let's look at the data:


The choice of STARK over SNARK in Cafe Cosmos is based on several factors. Here are the reasons provided by Cafe Cosmos:

  • Quantum Resistance

StarkNet uses hash functions instead of elliptic curves. This decision is driven by the need for quantum resistance, as hash functions are considered more resistant to quantum attacks.

  • No Trusted Setup (Transparency)

While some SNARKs allow for public ceremonies where randomness is extracted from a crowd, they do come with their own efficiency drawbacks. STARKs, on the other hand, do not rely on public ceremonies to achieve randomness. They have a publicly available reference string, eliminating the need for relying on a public ceremony. This makes STARKs more efficient in certain aspects.

  • Scalability

STARKs have a logarithmic verifier and prover. In the context of proof generation complexity, ZK-SNARKs are a cryptographic construction used to generate and verify zero-knowledge proofs. When applied to large circuits, the time it takes to generate a proof is usually linearly related to the size of the circuit. In other words, as the circuit size increases, the time to generate the proof grows linearly. This means that at some point, they can become very heavy and slow to generate, to the extent that they cannot provide strong computational power for large-scale programs. Given that PC gaming has played a crucial role in driving advancements and competition in computer processing technology, using SNARKs would not allow users to create massive constructs like Cairo on StarkNet.

When it comes to building large-scale distributed applications, the O(N) complexity in SNARKs versus the O(log N) complexity in STARKs for dealing with proof generation complexity undoubtedly makes a difference.

While STARKs do have longer verification times and higher computational costs, this is not a concern. Many transactions can be bundled into a proof before being verified on L1. Proofs can also be recursively composed from multiple proofs.

  • Proof Generation

STARKs tend to be heavier in terms of generation volume compared to SNARKs. This is partly because the many processes involved in STARK generation typically rely on computationally intensive operations like FFT.

STARKs beat SNARKs with a lead of 20 seconds.

From music production software to biological research, FFTs are nearly everywhere. They are one of the most extensively utilized functionalities in the world. They have been heavily optimized for both software and hardware and possess high parallelism capabilities.

The computational complexity of FFT is O(N log N), but given the number of cores, P, the correct setup of this formula, not considering load balancing and other advanced operations, can bring the complexity down to O(N log N/P). Wow! That's a substantial amount.

Many of these techniques have yet to be applied to this field, but they will soon be introduced. Hardware acceleration and parallelization of FFTs will act as accelerators to Moore's Law, making StarkNet future-proof.

In summary, Cafe Cosmos chose STARKs over SNARKs due to the need for quantum resistance, the absence of a trusted setup, scalability advantages, and the potential for future advancements in hardware acceleration and parallelization of FFTs.

Why choose Dojo and Cairo?

As Cafe Cosmos migrates from Ethereum to StarkNet, Cafe Cosmos 0.3 will be built using the Cairo and Dojo engines.

@tarrenceva , the builders involved in 与@cartridge_gg , @dojostarknet, and @thedopewars explained the superiority of Dojo and Cairo in their tweets.

Firstly, Dojo is the first verifiable game engine that utilizes Cairo to ensure the integrity of game execution logic, enabling developers to easily build complex and verifiable games and autonomous worlds.

Secondly, Cairo is a Turing-complete language for creating provable programs for general computation. It is a modern, Rust-like language that provides advanced abstractions and features such as traits, impls, macros, and type safety.

Programs written in Cairo possess some amazing properties

  • Cairo's proof complexity is O(log^2 n), achieving the fundamental property of exponential scalability for on-chain computation. In contrast, on Ethereum, each computation needs to be executed and verified by every node in the network.

  • Cairo proofs can be recursive, allowing developers to prove the "verifiability of proofs." An incredible feature is that an unlimited amount of computation can be efficiently compressed into a single constant-sized proof. Developers can verify all executions in constant time.

  • Cairo supports incremental proofs, meaning that a single execution can be broken down into independent parts and proven. For example, execution can be partially proven on the client-side with inputs hidden, and then more resources can be utilized on the proof infrastructure for proving.

  • Cairo is general-purpose. It is not only suitable for contract development on StarkNet but can also be applied to other required scenarios. Programs can be verified on large servers or personal consumer devices, offering different features and trade-offs.

  • Cairo can be efficiently proven and optimized around the constraints of provable programs, rather than being compatible with existing paradigms. It may be more complex than methods that introduce greater overhead for compatibility. It embraces modern architectures, utilizing multi-representation compilation pipelines that make it easy to achieve more complex tools and optimizations with simpler representations, making things like MLIR easier. With the help of MLIR, Cairo can run natively.

  • A feature of Cairo is the use of state diffs. When a Cairo program executes a proof, it generates two types of files - execution traces and state diffs. State diffs describe the state transitions that occur due to computation. State diffs describe the "outputs" of execution and make up a significant portion of the content on the data availability layer (e.g., Ethereum). In contrast to Optimism (and some ZK approaches) where the "inputs" of execution are the content on the data availability layer.

  • Cairo supports fractal scaling, with StarkNet as the powerful, decentralized (ultimately) base; fast, domain-specific sorters on top, such as MadaraStarknet; and private computation with client proofs. Fractal scaling is at the core of bringing world computation on-chain.

Cairo 1.0 is a spaceship, and Herodotus is a time machine.

Cafe Cosmos and its technology partners - Herodotus, Giza.

In summary, with Cairo 1.0, we can create a plethora of computational programs, ranging from physics engines to artificial intelligence.

@HerodotusDev provides powerful storage capabilities.

In theory, with Herodotus, blockchain developers can surpass the temporal limitations of all blockchains and access data from any time on any blockchain. Herodotus will enable smart contract developers to retrospectively review the past from anywhere, while efficiently and verifiably processing data.


Of course, these functionalities are still theoretical.

@gizatechxyz provides AI technology to assist developer teams.

Giza is building a trustless protocol to decentralize machine learning inference computations while providing guardrails for open-source AI in an open economy.



Recommended Reading