Dismiss Strip
Develop a game for Devcon to push people to explore the event, engage with other people, and learn how to develop a great UX for a fully decentralized app.
A game is a great tool to break the ice and start a conversation with others, to discover the surroundings, and learn something new. A game can also convey a message to make people aware about specific issues, and can be fun to play without being naive.
We propose to build a treasure hunt game for Devcon using decentralized technology only (no centralized APIs). The game requires players to solve quests in real life, explore the conference to find hints and interact with people. To submit solutions and progress with the story, players use a decentralized web application from their (mobile) browser.
By mixing different approaches like zero-knowledge proof, gas station networks, and burner wallets, the game aims to be an example of great user experience in terms of onboarding and playability.
The game is also free and open source software so other developers can learn from it.
A Treasure Hunt (or Scavenger Hunt) is a game played in a physical space like a building, a neighborhood, a city. The game is build around a story, and it is organized in levels. Each level contains:
The game is not a sequence of disconnected puzzles to solve. Participants discover the story chapter by chapter, interacting with the physical space around them.
Treasure hunt games are customized and tailored around a conference or event. A well executed treasure hunt game would be a remarkable experience for Devcon attendees because it encourages people to:
We set up Planetscape, a dystopian escape game for 36C3 based on the dreadful effects of climate change (CCC did not sponsor the game).
Planetscape is organized in 20 chapters, and requires players to solve quests in real life, explore the congress to find hints and interact with people. Planetscape had 20 levels, 254 players, 1300 transactions to the smart contract, and 7 teams finished the game and claimed their prize.
The players' feedback was heartwarming: "We were about to leave the congress but we found Planetscape, and we stayed longer to play!", "Please make another escape game for the next congress!", "This was the best thing of the congress", "Highlight of this year" (tweet).
During the game, players:
There are two aspects related to the implementation of a treasure hunt game.
Social Dist0rtion Protocol developed THC (Treasure Hunt Creator). THC is not a game itself. Instead, it is a framework to create decentralized treasure hunts. Given a story, THC generates all the components needed to play the treasure hunt:
. +---------------------+
. | |
. +------>+ IPFS: Enc levels |
+----------------+ | | |
| | | +---------------------+
| Game | |
| - Level 0 | +-------++ +---------------------+
| - Quest | | | | |
| - Puzzle +------>+ THC +------->+ ETH: Smart Contract |
| - Password | | | | |
| - Level N | +-------++ +---------------------+
| - ... | |
| | | +---------------------+
+----------------+ | | |
. +------>+ IPFS: dApp |
. | |
. +---------------------+
THC creates a user-friendly application that relies on decentralized technology only. We want to live the decentralized dream with no compromises, developing a powerful dApp that would use Ethereum under the hood without exposing any details about blockchain and IPFS to the player.
The game has instant onboarding by allowing people to play the game just by visiting a website. By now, this happens by using a "burner-wallet"-like approach (the player's wallet is created on the fly when opening the dApp for the first time). In order to make transactions players needed Ether. While the current approach is to simply transfer a small amount of (test) Ether to new players, we want to improve this by using OpenGSN.
In the context of Devcon, and if an Ethereum address is assigned to every participant, using OpenGSN would work smoothly because we can have a custom Paymaster
that only pays for the actual attendees.
As mentioned earlier, every time a correct password is found, a transaction is sent to the smart contract. Ethereum transactions are public and we don't want players to sniff passwords submitted by others. To avoid that, we implemented a cheap zero-knowledge proof scheme.
First of all we need to understand how a chapter is associated to its address. We don't want to put passwords in the smart contract, otherwise anyone would be able to read them. Instead we store the address of the chapter. To generate the address we do:
chapter_address = private_key_to_address(
private_key_from_seed(
keccak256(
chapter_password)))
The chapter_address
is then used to verify if a user found the correct password.
The smart contract stores the following information:
id
such as id ∈ [0, 2^96)
. Each id
points to:
address
, that is a uint160
). Each player is associated with the current chapter they are in.Roughly speaking, the zero-knowledge proof scheme works by having the chapter signing the player's address. The smart contract has all information to check the signature. If the signature is valid, the player can progress to the next chapter.
Given a valid chapter_password
and a player_address
, this is the interaction between the dApp and the smart contract:
chapter_seed = keccak256(chapter_password)
.chapter_private_key = private_key_from_seed(chapter_seed)
.chapter_proof = sign(player_address, chapter_private_key)
submit
method of the smart contract passing chapter_proof
.chapter_address
for player_address
in its storage.signing_address
by doing ecrecover(player_address, signature)
.signing_address == chapter_address
, then the smart contract updates the current chapter for the player, moving them to the next chapter.More information about the creation and verification of the proof can be found in the source code.
A player starts the game by visiting the game website. By opening the website, the player has access to the first chapter of the game that contains both a piece of the background story and a hint on where to find the puzzle. If solved, the puzzle reveals the password to the next chapter. By submitting the password to the website, the player will get a new piece of the story and a new puzzle to solve, and so on until the end of the game.
A game usually features twenty chapters of increasing difficulty. Like a classic escape game, both story and puzzles were integrated with the surrounding environment. In the context of Planetscape, the congress center became a futuristic planetary base surrounded by a post apocalyptic desert. Puzzles required players to move around the congress to find secret codes (geocaching), use the internal navigation map to discover specific places, find a specific WiFi access point to connect to the social network that gobbled up the free internet, lockpick a box to reveal the password, and many others.
In order to develop a similar game for Devcon, information about the conference area, rooms, theme, visual identity must be known in advance. Developing a story takes some time.
What actions are required to implement the proposal at Devcon?
devcon.org
subdomain would make the game more trustworthy.Who will be responsible for the proposal to be implemented effectively? (i.e. working on Day 0)
What other projects could this proposal be integrated with? (Bonus points for collaboration across teams :))
Additional information can be found here: