First On-Chain Atomic Bet Shows Continuing Innovation from BitCoin Cash

Atomic Bet BCH

Recently, news.Bitcoin.com broke news about a new protocol from Jonald Fyookball. Called Chainbet, it is a trustless betting protocol that enables simple coin flip wagers using the Bitcoin Cash blockchain. Openbazaar developer Chris Pacia just performed the very first atomic bet using BCH’s re-enabled OP_Codes and Fyookballs Chainbet protocol.

This weekend, Chris Pacia performed the first atomic bet using the BCH network’s OP_Codes to demonstrate a trustless wager. He said he was inspired to try the bet using bitcoin cash (BCH) after seeing the new protocol from Fyookball, and noted that this method is not possible on the Bitcoin Core (BTC) network. He says the reason for this is the re-enabled OP_Codes added to BCH protocol just this past May.

Pacia explains how it works, saying that:

“The way the scheme works from a high level is that Alice and Bob are going to generate secret random numbers and commit the hashes of those numbers to the bet’s output script. To determine the winner they will both reveal their random numbers and the script will add them together. If the sum is even, Alice wins — Otherwise, Bob wins.”

In his demo, Pacia details the challenges towards doing the bet securely, adding that Bitcoin arithmetic operations only accepted signed 32-bit integers. This basically means that the betting process won’t work if both bettors commit to 32-bit random numbers. his demo commits to the hash of 256-bit random numbers and then converted into signed 32-bit integers using the new OP_SPLIT and OP_BIN2NUM codes. Pacia noted that the OP_MOD directive is used to determine odd or even.

Now to make the scheme atomic, Pacia continues, One bettor first funds a special output with a redeem script of: OP_HASH160 OP_EQUALVERIFY OP_CHECKSIG. The bettors then must jointly build a transaction with two inputs, namely, the special output, and a normal output from the other bettor’s wallet. This output needs to be a 2-of-2 to prevent the second bettor from double spending.

Many bitcoin cash proponents were excited to see that Pacia had accomplished this and shared his demo. BCH supporters think this method of trustless wagers would further advance betting sites such as Satoshi Dice. Chainbet’s creator, Jonald Fyookball, thanked Pacia in a message for using his skills to add life to his concept protocol.

Fyookball noted that he was:

“Looking forward to working with you and others to create a usable implementation soon. That’s pretty amusing that this scheme can’t be done on BTC.”

Related Cryptocurrency News