Blockchain enthusiasts from around the world recently attended the Consensus 2017: Building Blocks Hackathon where sponsors issued hackathon challenges to competing teams. Hyperledger issued the challenge to “implement any board game as a blockchain app with one or more Hyperledger projects.”
The winning team: HyperProperty
HyperProperty by De’on Summers, Zhenting Zhou, and Kyle Tut won the Hyperledger challenge with an online property acquisition and banking game utilizing Hyperledger Fabric and deployed with IBM’s Bluemix. The project provides a fantastic example for how Hyperledger technology can facilitate transactions without a middleman.
The HyperProperty team had the perfect combination of back-end, front-end, and prototyping experience. De’on Summers built the backend and chaincode for HyperProperty. De’on is a blockchain developer from Nashville, TN at Hashed Health. Zhenting Zhou built the front-end interface for HyperProperty. Zhenting is a front-end developer from NYC that became interested in blockchain technology through cryptocurrency. The team also leveraged prototyping expertise from Kyle Tut who is the founder of Kyna, a blockchain patent exchange increasing the liquidity of global innovation. Kyle has previously spent time building IoT blockchain prototypes for logistical applications.
The team’s design goals
The HyperProperty team chose to apply blockchain technology to the propertyMonopoly because it provides a good representation of economics, properties, and financial systems. Since everyone already knows the rules, the team felt confident that they could showcase the gameplay with Hyperledger Fabric — ensuring players can’t cheat on dice rolls and tracking board moves, banking transactions, and property purchases on the ledger.
The game of HyperProperty
The architecture of HyperProperty consists of three types of objects:
- Players, which contain each property that the player owns and the player’s account balance
- The game board, which consists of all properties and each player’s position
The game demonstrates a tokenized economy because each property exists as a token on Hyperledger Fabric. When a player buys a property, the token for that property gets assigned to the player and his or her account balance goes down.
Coding the game involved taking the initial game and using Hyperledger Fabric to create a trustless, immutable environment so that players don’t have to worry about cheating or the bank paying someone under the table.
The game works by writing four types of events to the ledger:
- Game start
- Dice roll
- Buy property
At the start of a game, a new board is written to the ledger with all the initial data about properties and players. It’s a clear slate. When a player rolls the dice, a request goes to the backend for the dice to be rolled and the outcome of the dice roll is written to the ledger. This includes an update with the player’s new position. When a player buys a property or passes, the state of the board is updated again with anything that has changed such as the properties that the player owns, the player’s new account balance, and whose turn it is.
The gameplay for HyperProperty is really simple because Hyperledger Fabric acts as the banker and deed manager. The game begins when player 1 aka “MoneyDude” and player 2 aka “Doge” show up to the game. Player 1 rolls the dice. Player 1 can then decide to either buy the property or pass. Once player 1’s turn is over, player 2 rolls the dice. This process is repeated until someone goes bankrupt. Throughout the game, each player’s cash on hand is automatically tracked and written to the ledger.
Next steps for facilitating transactions with Hyperledger Fabric
Lessons from the HyperProperty project can be applied to any tokenized economy where assets are represented by tokens on a blockchain. The project shows that Hyperledger Fabric can be used to guarantee who owns what properties, which is perfect for things like land registration. When assets need to be traded, the participants in the trade can exchange value for the token and accomplish transactions without a middleman. This has the potential to facilitate more efficient and less costly transactions for a lot of things in the real world, including real estate transactions.
If you’re looking to facilitate transactions with Hyperledger Fabric, be sure to play the HyperProperty game at https://peaceful-lake-75705.herokuapp.com/ and get the code from GitHub at https://github.com/Dsummers91/HyperProperty-server and https://github.com/zhenpanda/hyperledger_property_app.