Title: Finally invented - Atomic cross chain options Post by: GenesisBlock on August 08, 2014, 11:32:41 PM Previously, the concept of atomic cross chain currency swapping was developed:
https://en.bitcoin.it/wiki/Atomic_cross-chain_trading Today, I have invented a way to do atomic cross chain options. For example, someone wants to buy an options contract which gives him the right to exchange x bitcoins for y dogecoins before some specified date in the future. This protocol allows you to do this in a completely decentralized, p2p manner The protocol is as follows: Terminology: A is the buyer of the option, and B is the underwriter of the option. A’s public key refers to A’s altcoin public key. B’s public key refers to B’s bitcoin public key. w refers to the amount of Bitcoin A pays to B in exchange for altcoins v refers to the amount of altcoin B pays to A in exchange for bitcoins f refers to the fee A pays B in exchange for the option contract n refers to the number of hours until expiry of the contract Protocol: A picks a random number x B picks a random number y A creates TX1: "Pay w BTC to <B's public key> if (x for H(x) known and signed by B) or (signed by A & B)" A creates TX2: "Pay w BTC from TX1 to <A's public key>, locked n+48 hours in the future, signed by A" A sends TX2 to B B signs TX2 and returns to A 1) A submits TX1 to the network B creates TX3: "Pay v alt-coins to <A-public-key> if (x for H(x) known and signed by A and H(y) known and signed by A) or (signed by A & B)“ B creates TX4: "Pay v alt-coins from TX3 to <B's public key>, locked n+24 hours in the future, signed by B" B sends TX4 to A A signs TX4 and sends back to B 2) B submits TX3 to the network 3) A creates TX5: “Pay f BTC to <B’s public key> if (y for H(y) known and signed by B)” A submits TX5 to the network 4) B spends TX5 giving y 5) A spends TX3 giving x 6) B spends TX1 using x This is atomic (with timeout). If the process is halted, it can be reversed no matter when it is stopped. Before 1: Nothing public has been broadcast, so nothing happens Between 1 & 2: A can use refund transaction after n+72 hours to get his money back Between 2 & 3: B can get refund after n+24 hours. A has n+24 more hours to get his refund Between 3 and 4: If B does not spend Tx5, A can use refund transaction after n+72 hours to get his money back Between 4 and 5: A now knows both x and y, allowing him to spend TX3. B can get refund after n+24 hours. A has 24 more hours to get his refund After 5: Transaction is completed - A must spend his new coin within 24 hours or B can claim the refund and keep his coins - B must spend his new coin within 72 hours or A can claim the refund and keep his coins Title: Re: Finally invented - Atomic cross chain options Post by: franky1 on August 09, 2014, 01:59:30 AM ok that has possibilities
heres a different method aimed at a peer 2 peer stock market solution easy to achieve. i call it Double chains imagine Alice had um... Wheatcoin(coin representing stock of a farm that harvests wheat) and wanted to trade with john for USDCoin(coin backed by US Dollar) in a usual transaction you would see Quote from: Alice Vout 14MadeUpAddressBlaBlaBlah Vin 14notherMadeUpAddressBlaBlaBlah Value 100000000 (imagine the quotebox is alice signing the transaction) now imagine the wheat for dollar blockchain and the doublecoin-qt.exe program will give them Uaddresses for USD and W addresses for wheat... but there is nothing stopping them also having other addresses and the blockchain able to keep a ledger of more then two values per transaction/block. but anyways this is a simple example of how a signed transaction would look on a decentralized peer-to-peer exchange Quote from: Alice Quote from: john Quote from: Alice Vout W4MadeUpAddressBlaBlaBlah Vin Wnother4MadeUpAddressBlaBlaBlah Value 100000000 Quote from: John Vout Unother4MadeUpAddressBlaBlaBlah Vin U4MadeUpAddressBlaBlaBlah Value 100000000 so alice made her pledge and signed it. john receives it. makes his pledge then signs it. and then signs the two together. sends this to alice who signs them together also. so they both agree. then it gets sent to be mined. the new block will show the swap.. all that needs to be figured out is how to get the security-qt.exe to receive enough node connections (people) to build up a big enough list of 'offers', rather than just having a couple dozen connections that some people normally only get in bitcoin-core.exe at any one time. i proposed this ages back as a method of decentralizing exchanges Title: Re: Finally invented - Atomic cross chain options Post by: GenesisBlock on August 09, 2014, 05:45:18 PM Ah sounds interesting
Well 2 questions - is wheatcoin supposed to be something like a colorcoin or something on its own blockchain? And the swap is shown on which blockchain? Title: Re: Finally invented - Atomic cross chain options Post by: prophetx on October 09, 2014, 08:42:15 PM how does one actually implement this in a decentralized manner?
Title: Re: Finally invented - Atomic cross chain options Post by: prophetx on November 05, 2014, 03:26:19 PM hello can you evaluate if this process can be modifed for trading between XCP counterparty tokens and BTC, both reside on the bitcoin blockchain.
if you think it would be possible i would put some bounty money behind it |