Post
Topic
Board Development & Technical Discussion
Re: Making 0-conf TXs relatively safe "again"
by
tholenst
on 18/05/2013, 20:01:58 UTC
OK, I'll try.

Buyer B wants to buy an item with value 0.1 BTC from Merchant M. B has 20.4 BTC in total. These are stored in two transactions outputs B0, B1, both of the buyer.

B0: Transaction Output with 0.4 BTC, private key known to B
B1: Transaction Output with 20 BTC, private key known to B

Now, to buy the item, the buyer sends two transactions Tx2 and Tx3 to the merchant.  The merchant has address

Tx2:
  Input B0
  Outputs
    1: 0.1 BTC to
    2: 0.3 BTC to (another address of B)

Tx3:
  Input B1
  Outputs:
    1: 0.1 BTC to
    2: 9.9 BTC to
       *only valid with two spends of B0*
 
the transaction Tx3 is special (this would need an extension of the scripting language). In order to use it, one needs to provide two *different* spendings of B0.

The merchant M gets both these transactions, waits 10 seconds, and then gives the item to B. If later another transaction of B0 shows up before transaction Tx2 is in a block, he can broadcast Tx3; and it will be worthwile for a miner to use it (note that it has 10BTC fee included).