Here's a proper worked example for you. This uses a non-standard transaction for the redeem part and gets it mined by pushing it to Eligius, which I think is cleaner and more straightforward than the alternatives, but as discussed there are non-non-standard ways to do it too.
Alice and Bob look at the realitykeys.com URL you mentioned and see that we're dealing with ID 52. Alice is going to pay in 15,000 Satoshis, Bob 30,000, and the winner takes it all (minus transaction fees). Here's how it happens:
They each grab my slightly rough-and-ready test script from here:
https://github.com/edmundedgar/realitykeys-examples/blob/master/realitykeysdemo.pyAlice creates an address:
realitykeysdemo.py makekeys
...and from the output she gets a public key:
04994740a3853613b2f364dbf3211f090854a72a99392b0d2a905520bc1eba99c660da66477048b7559eb92fac0897e4446e025d9fd22f4e4e4f9a1ca2da3be44e
...and a temporary address (made from that public key):
15dArbQ38SGzB4QLpVUc2BREeHbGD4V3DM
Bob does the same:
realitykeysdemo.py makekeys
0408a672849229b94d0ccbcb3f5a845af268ee07210c87bef2b350ac858f11f67a524b888bd27c33f87893e69fa3d51ad7b3078b3e949dfc6d6ef57f24bb3882d8
13XhvrHipiq8DxoFTkU3Gy6pPr7fGx68Mf
Alice and Bob both exchange public keys and fund their own temporary addresses with their stakes. (This is an extra step that you probably wouldn't have in an advanced implementation, but it makes things easier here.)
Alice creates a transaction, using inputs from her and Bob's temporary addresses.
realitykeysdemo.py setup 52
04994740a3853613b2f364dbf3211f090854a72a99392b0d2a905520bc1eba99c660da66477048b7559eb92fac0897e4446e025d9fd22f4e4e4f9a1ca2da3be44e 15000
0408a672849229b94d0ccbcb3f5a845af268ee07210c87bef2b350ac858f11f67a524b888bd27c33f87893e69fa3d51ad7b3078b3e949dfc6d6ef57f24bb3882d8 30000
This outputs a transaction for her to send to Bob, who runs the same command, but with the transaction tacked on the end:
Bob:
realitykeysdemo.py setup 52
04994740a3853613b2f364dbf3211f090854a72a99392b0d2a905520bc1eba99c660da66477048b7559eb92fac0897e4446e025d9fd22f4e4e4f9a1ca2da3be44e 15000
0408a672849229b94d0ccbcb3f5a845af268ee07210c87bef2b350ac858f11f67a524b888bd27c33f87893e69fa3d51ad7b3078b3e949dfc6d6ef57f24bb3882d8 30000
01000000024985ca532b791f0f88557f2106515bc96070b0324b08a50e7da98f2466569cdc010000008c493046022100d175dd038014362aa72275f7319cdc01cf3a84a075be82dd7b43f2fc325dece6022100b2e8504bced6c80296cf5917dae9687b4608d315d6fcd44f2681005de7c16068014104994740a3853613b2f364dbf3211f090854a72a99392b0d2a905520bc1eba99c660da66477048b7559eb92fac0897e4446e025d9fd22f4e4e4f9a1ca2da3be44effffffffb1e4119a810a07f4b711201b529bb2acaa661a0bccd17cbc328c03c6d431402e0000000000ffffffff01c8af00000000000017a9148a3b43e0f8635ebe49991f83e2a4f2095dccded98700000000
The script broadcasts this and it shows up on the blockchain as the following transaction, which spends Alice and Bob's inputs to a P2SH address.
https://blockchain.info/tx/bdf985c0fa0ad9f1f9b33b3091547e06deda121a20c53496c062459f71018512The blockchain won't show you how that P2SH address was made yet, but if you read the script you'll see that it was made by hashing this:
OP_IF 2 alice-pub rk-yes-pub 2 OP_CHECKMULTISIG OP_ELSE 2 bob-pub rk-no-pub 2 OP_CHECKMULTISIG OP_ENDIF
I should probably change that to the shorter equivalent:
OP_IF 2 alice-pub rk-yes-pub OP_ELSE 2 bob-pub rk-no-pub OP_ENDIF 2 OP_CHECKMULTISIG
They wait until the result is announced, then the winner (in this case it's Bob) does:
realitykeysdemo.py claim 52
04994740a3853613b2f364dbf3211f090854a72a99392b0d2a905520bc1eba99c660da66477048b7559eb92fac0897e4446e025d9fd22f4e4e4f9a1ca2da3be44e
0408a672849229b94d0ccbcb3f5a845af268ee07210c87bef2b350ac858f11f67a524b888bd27c33f87893e69fa3d51ad7b3078b3e949dfc6d6ef57f24bb3882d8
That creates a spending transaction and sends it to Eligius. You can see that here:
https://blockchain.info/tx/d105d570237d5be5476287fb1cfefb660996c054af133995ad7c7a1c2a8054b6You'll see it was spent like a normal P2SH multisig script except there's an extra "OP_FALSE" tacked on the end. (The one on the beginning is always there to work around a bug.) This tells the script to use the second path (from OP_ELSE to OP_ENDIF) instead of the first (OP_IF to OP_ELSE). If Alice had won it would have been "OP_TRUE".
OP_FALSE
3045022077885c62ac0e84e11705556df3789087b913734ceaf7ad182851cb96affb355902210094834168b8e5f9668def1c4ea51284b6fa57d83d7bb6485a6d231ae90b8d5c3601
3045022058c0e7bc775fe5ba2e2c377988434145a18c9d81ddc30470d0a583051a050062022100f11380f703695dcfd6cd559d84790ffa3a3f52cf4462f0e8be032f0688cd56c01
OP_FALSE