Author

Topic: Finally invented - Atomic cross chain options (Read 2188 times)

legendary
Activity: 1666
Merit: 1010
he who has the gold makes the rules
November 05, 2014, 10:26:19 AM
#5
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
legendary
Activity: 1666
Merit: 1010
he who has the gold makes the rules
how does one actually implement this in a decentralized manner?
newbie
Activity: 5
Merit: 0
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?
legendary
Activity: 4410
Merit: 4788
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
newbie
Activity: 5
Merit: 0
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 if (x for H(x) known and signed by B) or (signed by A & B)"
 
 A creates TX2: "Pay w BTC from TX1 to , 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 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 , 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 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



Jump to: