RESEARCH / 04

Open-Sourced Verifiable Smart Contract.

A dice game on Ethereum whose fairness any player can verify — the proof-of-concept behind our smart contract work.

Start a Conversation
A smart contract repository open on screen beside a panel reading open-sourced, verifiable and immutable on blockchain.

WHITEPAPER · NOVEMBER 2020

Establishing trust through provably fair bets backed by an open-sourced, verifiable smart contract

By Federick Joe P. Fajardo. A proof-of-concept for a decentralized application on the Ethereum network, built to show that fairness can be verified rather than asserted.

ARPAX

The flagship for our blockchain work

ArpaX is our flagship for blockchain-based, decentralized applications and smart contract development. These projects allow businesses to utilise the potential of blockchain technology in the areas of education, gaming and finance. In November 2020 we launched our first Dapp project, ArpaGames.

ABSTRACT

Trust is an essential part of every transaction whether it is interpersonal or computational. The trust involved in interpersonal relationships allows social associations and quality interactions between people. The same principle enables computer networks to have a symbiotic connection.

There are two major factors or components that inherently build trust: fairness and equal opportunity. The goal of this paper is to formulate a method of establishing these factors in computer networks to elevate the trust between human actors and blockchain networks.

Utilizing the classic game of Dice, which is widely played in physical and online casinos, the author of this paper aims to create a proof-of-concept that will serve as a reliable working model for a decentralized application on the Ethereum network.

FEDERICK JOE P. FAJARDONovember 2020

WHAT “PROVABLY FAIR” MEANS

Verifiable, not asserted

Provably fair algorithms are algorithms which can be examined and verified on the part of the service operator. Every transaction is published — including the generation and hashing of random numbers and the corresponding seed — so fairness is something a player can check rather than something the house claims.

TRUST

Fairness and equal opportunity

Two components inherently build trust. The paper formulates a method of establishing both in computer networks, to raise trust between human actors and blockchain networks.

BGP

The Byzantine Generals Problem

Consensus, finality and immutability (Lamport, 1983) — once a decision has been executed, no single component can alter the state of its execution.

ORACLE

Provable as the oracle

Blockchains cannot reach external data, so random number generation comes from an oracle. Returned data carries an authenticity proof signifying its integrity.

LLN

The law of large numbers

The average of results from a large number of trials approaches the expected value as more trials are performed (Dekking, 2005) — which is what makes a fair dice game provably fair at scale.

THE EVIDENCE

Tested against the expected value

Bets were simulated using random numbers from random.org, based on a fair theoretical ninety-four-sided die producing one of the numbers 2 to 95 for each roll.

188

Random rolls per sample, drawn from random.org

752

Total rolls across four samples

48.5

Expected value — and the value each sample reached

PROOF OF CONCEPT

ArpaGames

An open source decentralized application designed and forked from Etheroll, an Ethereum-based dice game built entirely on top of the blockchain. A bet is placed with three parameters — bet size, roll under, and a wallet with enough balance to cover the wager and the gas. The smart contract requests an encrypted random number from the oracle, then settles the game.

function playerRollDice(uint rollUnder)
    public payable gameIsActive
    betIsValid(msg.value, rollUnder)
{
    bytes32 provable_qryId = provable_newRandomDSQuery(
        QUERY_EXECUTION_DELAY,
        NUM_RANDOM_BYTES_REQUESTED,
        GAS_FOR_PROVABLE_CALLBACK
    );
    queries[provable_qryId]          = true;
    playerNumber[provable_qryId]     = rollUnder;
    playerBetValue[provable_qryId]   = msg.value;
    playerAddress[provable_qryId]    = msg.sender;
}
The ArpaGames web interface: bet size and number sliders, a roll-under display, and a live transaction feed.
The ArpaGames decentralized application — Figure (C) in the paper.
1%

House edge

Provably fair bets using Ether, backed by an open-sourced verifiable smart contract. No sign-ups and no deposits required.

100

ARPAX tokens per win

An ERC20 reward token sent from the smart contract to the winning player’s address — the 50,000 → 49,900 movement in the table below.

ANON

Place bets anonymously

Anonymity is native to everyone who plays. There are no deposits or sign-ups, unlike regular online and physical gambling operations.

RNG

Random number generation by Provable

The smart contract runs on the Ethereum blockchain and requests an encrypted random number from the oracle to settle each game.

The playerRollDice function, as published in the paper.

WORKED EXAMPLES

Where the money goes

Bet size 0.20 ETH, roll under 50. When the player wins, the house does not take the wager; profit goes to the player’s address along with an ARPAX affiliate token, an ERC20 reward asset.

Player wins — result 47BeforeAfter
Player1.01 ETH1.20 ETH
House36.68 ETH36.47 ETH
Token50,000 ARPAX49,900 ARPAX
House wins — result 87BeforeAfter
Player1.20 ETH1.00 ETH
House36.47 ETH36.66 ETH
Token50,000 ARPAX50,000 ARPAX

READ THE PAPER

Signed edition

LET'S CONNECT

Want to know more of our solutions?

Contact us to start the conversation.

Contact Us
PROD / v3.0