Latest news about Bitcoin and all cryptocurrencies. Your daily crypto news habit.
Just recently news.Bitcoin.com wrote about a trustless betting protocol designed by Jonald Fyookball called Chainbet, a protocol that enables simple coin flip wagers using the Bitcoin Cash (BCH) blockchain. Since then the Openbazaar developer Chris Pacia performed the first atomic bet utilizing the BCH networkâs re-enabled OP_Codes and Fyookballâs Chainbet concept.
Also read:Â Chainbet Protocol Proposes a Trustless Bitcoin Cash Betting Mechanism
The First Trustless Atomic Wager Utilizes Bitcoin Cash OP_Codes
This weekend the Openbazaar developer Chris Pacia has performed the first atomic bet using the BCH networkâs OP_Codes in order to demonstrate a trustless wager. Pacia said he tried the idea using bitcoin cash after seeing Fyookballâs new protocol concept, and notes that this method of trustless betting is not possible using the Bitcoin Core (BTC) network. The reason for this is due to the re-enabled OP_Codes added to the BCH protocol this past May.
â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,â explainâs Paciaâs demonstration post. â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.â
256-bit Random Numbers Converted to 32-bit Integers Using the New OP_SPLIT and OP_BIN2NUM Codes.
Pacia details the challenge of this operation is doing it securely, and adds that Bitcoin arithmetic operations only accept signed 32-bit integers. This means that the process wouldnât work if Alice and Bob commit to 32-bit random numbers. Paciaâs 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. The Openbazaar developer notes that the OP_MOD directive is used to determine odd and even.
Chris Paciaâs trustless bet demo.
â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.Â
BCH Supporters Thrilled to See the Trustless Scheme in Action, and Some Are Quite Amused the Procedure Canât be Done Using BTC Â Â
Many bitcoin cash supporters were thrilled to see that Pacia accomplished this procedure and shared his demonstration. BCH supporters believe this method of trustless wagers could further advance betting sites like Satoshi Dice. The creator of Chainbet, Jonald Fyookball, thanked Pacia for bringing his skills and adding life to his concept.Â
âLooking forward to working with you and others to create a usable implementation soon,â Fyookball notes. âThatâs pretty amusing that this scheme canât be done on BTC.â
What do you think about the trustless betting demo performed by Chris Pacia? Let us know what you think in the comment section below.
Images via Shutterstock, Twitter, Pixabay, and Yours.org. Â
Express yourself freely at Bitcoin.comâs user forums. We donât censor on political grounds. Check forum.Bitcoin.com.
Disclaimer
The views and opinions expressed in this article are solely those of the authors and do not reflect the views of Bitcoin Insider. Every investment and trading move involves risk - this is especially true for cryptocurrencies given their volatility. We strongly advise our readers to conduct their own research when making a decision.