Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: kaykurokawa on December 27, 2014, 04:59:15 AM



Title: Smart Contracts and Transaction Malleability
Post by: kaykurokawa on December 27, 2014, 04:59:15 AM
I have been researching various projects/proposals regarding smart contracts, specifically ones that facilitate trustless exchange of crypto-coins and goods.

Examples include atomic cross chain trading  ( https://en.bitcoin.it/wiki/Atomic_cross-chain_trading ) which was mentioned on the side-chain paper, Coinffeine ( https://github.com/Coinffeine/coinffeine/wiki ) , and BitHalo/BlackHalo ( http://blackhalo.info/wp-content/uploads/2014/06/whitepaper_twosided.pdf).

The above three projects/proposals uses a mechanism that relies on creating a future transaction that spends the outputs of a secret and unpublished transaction. Unfortunately, transaction malleability makes it so that there is no guarantee that any unpublished transaction will make it into the blockchain without being mutated. I’m not aware of any easy ways to work around this problem, and it seems like all the above projects will not work with Bitcoin in its current form.

The only solution to this I have come across is the SwapBill Project which creates its own blockchain with a unique op code   (explained in very nice detail in this link http://upcoder.com/11/atomic-cross-chain-exchange/ ). Its a very elegant solution, but unfortunately requires its own blockchain to work.

So I guess my question is 1) is my analysis correct in that the above mentioned projects cannot be implemented with Bitcoin in its current state due to transaction malleability ? and 2) what are potential solution to this. (I am not very up to date about what various crypto 2.0  developers, for example ethereum and mastercoin, are doing regarding this , but I’m sure they have thought about this.)



Title: Re: Smart Contracts and Transaction Malleability
Post by: readerbtc on December 27, 2014, 03:02:57 PM
1) is my analysis correct in that the above mentioned projects cannot be implemented with Bitcoin in its current state due to transaction malleability ?
As far I understood, they can be implemented with Bitcoin in its current state . If nobody trolls you, submitting an alternative transaction. We don't actually know how much of this will happen.




Title: Re: Smart Contracts and Transaction Malleability
Post by: sumantso on December 27, 2014, 08:07:57 PM
There is no reason to implement them itself in Bitcoin. Its better to build something on top and use it, like Counterparty which absorbs any risks and potential protocol breaking bugs.


Title: Re: Smart Contracts and Transaction Malleability
Post by: gmaxwell on December 28, 2014, 12:57:11 AM
"Counterparty" cannot actually implement a smart contract system for Bitcoin. It can only do so for its own altcoins, and only at the expense of being incompatible with SPV and being subject to blocking by miners (who might suffer loss of value of their bitcoin income should the counterparty altcoin manage to displace bitcoin to any great extent).