Bringing Dispute Resolution to Crypto Gambling: A World Cup 2018 Use Case

Matej
principle
Published in
5 min readJul 26, 2018

The FIFA World Cup 2018 in Russia ended with a victory of France, sensationnel! At Principle we took this football packed month to develop and test the idea of a decentralized dApp built on top of our Principle Protocol. This is what we learned.

After completing our successful blockchain elections use case, we were already thinking about our next experiment — after politics, we wanted this to be somehow fun and since the football World Cup was getting close, we opted for a blockchain betting dApp. To spice things a bit, we decided to put $15.000 in tokens for the participants and winners.

The dApp

Since we wanted to launch fast, our Principle World Cup dApp was built in less than a week. The first version was straight simple, but we kept updating it as the championship progressed. At the end our Ethereum smart contract came up to version 3.0 as we kept adding new features and tokenizing the game.

The dApp

The main smart contact was deployed on the Ropsten network and as users registered they were given 5.000 PCIWC tokens and 0.05 ETH for gas use. The tokens were used instead of real money for betting on the platform. Each match a user could bet from 50 tokens (in group stage) to up to 2.000 tokens (in the finals). To make it more realistic, a 2% fee was implemented for bets as well.

Each match was a smart contract per-se as well. Users would place predictions and transfer the PCIWC to the match’s smart contract and based on the successfulness of the outcome, claim the reward back in their wallets. The contract used simple WIN-DRAW-LOSE options.

Over the course of the World Cup a total of 1778 txns were made by 279 wallet holders and a total of 64 smart contracts were deployed (one for each match). The match with the biggest bet pool was the semifinals between Croatia and England with a bet pool of 46.500 PCIWC!

The dApp was build on top of Angular 5 with integrated Ethereum’s web3.js library to connect with the client’s MetaMask. A cool feature our CTO, Jan, implemented was a “Login with MetaMask” option, to speed up the login process. The user signs a message with his private key with his MetaMask which is then compared to the public key saved in the database. Pretty nice!

Login with MetaMask option in the dApp

Keep Calm and Open a Dispute

The main goal of the dApp was not only about making predictions and gambling, but the ability to verify the outcome of that predictions by an independent third party, mainly building a layer of trust below that.

At Principle we are aiming to bring online dispute resolution (ODR) to the decentralized space. In centralised platforms (eBay, Uber, etc.) ODRs are at the core of the businesses, bringing a layer of trust for all the involved parties. Due to the nature of crypto, such a layer is not present in the blockchain, since all transactions are irreversible by design. We would like to change that by leveraging wisdom of the crowds when doing dispute resolution.

The task was simple: enabling the dApp users to file a dispute on all the bets they participated in for up to 3 days since the bet outcome was set. We wanted to keep it simple, so in this phase all we did was to put a “Dispute” button below the match outcome, and waited. The button would make an API call an record the dispute on our database.

Dispute in the dApp

Here’s the trick: we deliberately inputed the wrong match result for 2 of the final stages matches. After some initial confusion on our Telegram, players quickly realised that these matches can be disputed. More than 50% of people that voted on the Croatia-England and would get no reward due to wrong result opened a dispute within one day. At this point we internally made a pool of evaluators and collectively, using wisdom of the crowds, resolved the dispute and came to a correct match outcome.

Dispute resolutions will be in future resolved by an independent set of evaluators (jurors) on the Principle protocol. Online dispute resolution (ODR) will be possible for all decentralized services who will integrate the protocol in its business.

Outcome

After 1 month of football, lets not forget about the players participating in this experiment. The overall top 10 players of the competition will be rewarded with a $5.000 prize in PCI tokens. The prize distribution is as follows:

Prize distribution

You can view the current standings based on the total PCIWC tokens in their wallets on the Main smart contract on Etherscan here.

NOTE: All participating users must claim their winning in the dApp to be ranked on this leaderboard!

All participating users will receive an airdrop of PCI tokens as well. The $10.000 will be distributed based on the number of stakes for each user (1 stake for claiming the PCIWC after a match + 1 stake for each invited friend).

All rewards will be distributed after the token generation event or when the PCI token is launched on the main net!

We had a great time during this football packed month developing our experimental dApp. It was a great learning experience that brought us interesting insights for future protocol development. We would like to thank all of the participants in this experiment and congratulate France and Croatia for making it into the finals as well as the top dApp players!

Join our Telegram, to learn about future development.

/// Principle

--

--