Fair BitCoin Toss

Toss a Bitcoin
  1. Alice and Bob each locks X bitcoins in a smart contract shown below.
  2. They both reveal their secret number, which are XOR’d to determine if the coins lands on head or tail. Alice wins if it is head, otherwise Bob wins. Whoever wins takes all 2X bitcoins.
Coin Toss Contract

Practical Consideration

Additional measures have to be taken in case one party decides to abort when he/she finds out he/she loses, by refusing to reveal their secret number. For example, instead of letting winner taking all, we could have the loser take 0.5X bitcoins and thus incentivise him to proceed even though he will lose.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


sCrypt (https://scrypt.io) is a company with a mission to provide integrated on-chain smart contracting solutions on Bitcoin SV