Tech 13 June 2018

Erik Gibbs

Bitcoin Cash sees first on-chain atomic bet

In May, following the Bitcoin Cash (BCH) network upgrade, developers began testing the use of OP_Codes, which had previously been absent from the network. The results have been both interesting and fun, and have shown the advanced versatility of the Bitcoin BCH blockchain that wasn’t seen in other networks. As the innovation continues, the trustless betting protocol, Chainbet, has been used in conjunction with the OP_Codes in the first-ever “atomic bet” on the blockchain.

Chainbet, an on-chain betting protocol, was designed by developer and Electron Cash wallet founder Jonald Fyookball. Well-known OpenBazaar developer Chris Pacia combined Chainbet with the OP_Codes to successfully test a trustless wager. Pacia said he opted for the BCH network for the test after learning of Fyookball’s protocol and indicated that trustless wagers are not possible on the SegWit BTC Core (BTC) network since it does not have OP_Code capability.

In a post on Yours.org about the atomic bet capability, Pacia said, “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.”

Pacia also pointed out that the BTC network wasn’t feasible for the operation due to its size limitations. Because arithmetic operations on the BTC network are limited to 32-bit signed integers, the process doesn’t work if, using the example, Bob and Alice commit to 32-bit random numbers. Using a hash of 256-bit random numbers and converting them into signed 32-bit integers is only possible on the BCH blockchain. The operation employs the use of the newly offered OP_SPLIT and OP_BIN2NUM codes, with the OP_MOD directive being called to determine if the result is odd or even.

Pacia further explains the operation, stating, “To make the scheme atomic, Alice first funds a special output with a redeem script of: OP_HASH160 <aliceCommitment> OP_EQUALVERIFY <alicePubkey> OP_CHECKSIG,” Pacia explains. “Alice and Bob then jointly build a transaction with two inputs―Alice’s special output and a normal output from Bob’s wallet [edit: this will need to be a 2-of-2 to prevent bob from double spending].

“Bob signs the transaction first and sends his signature to Alice. Alice then signs her input and broadcasts the transaction to the blockchain. By signing the transaction Alice is revealing her secret number to Bob who can then use that number to determine if he won or lost the bet. If he won, Bob can immediately claim his winnings. If Alice won, Bob cannot do anything but Alice can claim the funds after a timelock (6 blocks) expires.”

Many BCH supporters virtually applauded Pacia’s design, and indicated that it could help advance trustless wagers on sites such as Satoshi Dice. Fyookball responded as well, saying, “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.”

Note: Tokens on the Bitcoin Core (SegWit) chain are referenced as BTC coins; tokens on the Bitcoin Cash ABC chain are referenced as BCH, BCH-ABC or BAB coins.

Bitcoin Satoshi Vision (BSV) is today the only Bitcoin project that follows the original Satoshi Nakamoto whitepaper, and that follows the original Satoshi protocol and design. BSV is the only public blockchain that maintains the original vision for Bitcoin and will massively scale to become the world’s new money and enterprise blockchain.

COMMENT

latest news

Google Play warns customers of fake cryptocurrency apps

Tech 24 May 2019

Google Play warns customers of fake cryptocurrency apps

Google has caught two apps that were pretending to be popular crypto wallets, one of which was trying to steal user funds.

Read More
Rabobank opts to close cryptocurrency account plans

Tech 24 May 2019

Rabobank opts to close cryptocurrency account plans

Rabobank have decided not to offer crypto wallets, citing regulatory uncertainty and skepticism from their customers.

Read More
Proxicoin to allow anyone to become a movie producer

Tech 24 May 2019

Proxicoin to allow anyone to become a movie producer

A big investment in Proxicoin promises that it will offer new investment opportunities to film, TV and music fans.

Read More
[data-clipboard-demo]
[data-clipboard-demo]
[data-clipboard-demo]
[data-clipboard-demo]
[data-clipboard-demo]
[data-clipboard-demo]
[data-clipboard-demo]
[data-clipboard-demo]
[data-clipboard-demo]
[data-clipboard-demo]