User1 bet the hash of Block 999,000 that hash(block(999,000) = even

user2 bet the hash of Block 999,000 that hash(block(999,000) = odd

Both users pay/sign 1 BTC in a CoinJoin for that bet to a P2SH. The winner will win 1.99BTC and 0.01 BTC is the tx fee.

How to make the scripts that can perform such action?

  1. Script1 that perform the betting section.(that specify the criteria for redemption).

  2. Script2. Redeem script (based on the output of block 999,000) that transfers the fund to the winner new PubKey Hash.

Article First Published here