Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: Steve on October 24, 2011, 01:57:19 PM



Title: transaction pairs
Post by: Steve on October 24, 2011, 01:57:19 PM
Is it possible to construct a pair of transactions such that either both are accepted into the block chain or neither is accepted?  Is it possible to do it with three transactions?

Edit: meant to post this to the development section.


Title: Re: transaction pairs
Post by: genjix on October 24, 2011, 02:00:43 PM
Nope, for security reasons.

Although the question is why?


Title: Re: transaction pairs
Post by: casascius on October 24, 2011, 02:11:38 PM
The answer is yes if you are able to combine those transactions into a single one with multiple inputs and outputs.

Depending on your use case, that may or may not be possible.


Title: Re: transaction pairs
Post by: DeathAndTaxes on October 24, 2011, 02:39:19 PM
I am assumming the OP can't bundle both into a single transaction because it involves multiple parties neither of which have the other's private key to sign it as a single transaction.


Title: Re: transaction pairs
Post by: Steve on October 24, 2011, 03:45:26 PM
Nope, for security reasons.

Although the question is why?
It would actually be two different transactions in two different block chains (but asking the question in the context of just bitcoin was a simpler question to ask).  I'm trying to figure out if there is some protocol that could be devised that would allow multiple transactions in multiple block chains to be executed in a coordinated fashion.  This is crucial to the problem of creating a decentralized, p2p exchange.  A buyer would need to craft a partially completed transaction representing the bid...this would be a transaction that transfers some kind of debt-coin.  A seller would need to craft a partially completed bitcoin transaction that transfers some amount of bitcoin.  These transactions would need to be matched by a third party that can complete both transactions.  Adding ripple transfers would add more of these transactions to the process.  I'm trying to figure out if there's a way of doing this without requiring the collateral for the orders (bitcoins or debt-coins) to be transferred to a third party.


Title: Re: transaction pairs
Post by: EhVedadoOAnonimato on October 24, 2011, 03:57:00 PM
Isn't this what you want? https://en.bitcoin.it/wiki/Contracts

It's perfectly possible, on the same chain. You don't need different chains to implement p2p exchages with backed-by-fiat coins.


Title: Re: transaction pairs
Post by: DeathAndTaxes on October 24, 2011, 04:00:25 PM
fiat coin is an interesting concept that is likely the missing piece in a partially decentralized exchange (the depositing & holding of fiat funds is still centralized but most of the exchange could be decentralized).


Title: Re: transaction pairs
Post by: EhVedadoOAnonimato on October 24, 2011, 04:06:40 PM
Summarizing:

- You have a satoshi (0,01µBTC) that is backed by some issuer with 1USD. This satoshi is stored in an address A which you control.
- I offer you 3BTC for it, and you accept. These 3BTCs are stored in an address B which I control.
- You provide me a deposit address D for the 3BTC, and also inform me of which address contain the backed satoshi (A).
- I create a transaction which has both A and B as inputs, C as output for the satoshi and D as output for the 3BTC. I sign it with B. It's not yet a valid transaction, as it needs to be signed with A, which is in your control.
- I transfer you the invalid transaction, you sign it with A, making it valid, and send it to the network.

OBS: I can't pay only 0,01µBTC for your backed coin, because then the issuer can't keep track of his backed coins anymore. But such trade wouldn't make economical sense anyway.