Bitcoin Forum
May 08, 2024, 07:16:06 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Transaction malleability is actually a big problem?  (Read 1970 times)
Sarchar (OP)
Member
**
Offline Offline

Activity: 88
Merit: 10


View Profile
February 25, 2014, 06:09:24 AM
 #1

Forgive me if this has been discussed to death and back, but lately I've been working on some Contracts transactions.  The realization that malleability prevents some of these contracts from working (trustlessly and securely) is starting to sink in.  

Dependent transactions just can't be built until they're included in the blockchain...

Does tx malleability basically mean that a number of advanced contracts are essentially broken?

1. Providing a deposit - Tx2 can't depend on Tx1 txid not changing. Step 2 sends the hash of Tx1 to the "website" to sign a refund tx.
2. P2P alt-chain trading - Tx2 can't refund Tx1 until it's in the blockchain, but you shouldn't fund Tx1 until Tx2 is signed.
3. Rapidly adjusted micropayments - (Does this hurt bitcoinj's security too?) Can't create refund T2 based on hash of T1.

I'm not interested in MtGox and their usage of transaction hashes, as that's just something they can fix.  These advanced contracts, on the other hand, heavily depend on a transaction hash not changing.

No Gods or Kings. Only Bitcoin
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715195766
Hero Member
*
Offline Offline

Posts: 1715195766

View Profile Personal Message (Offline)

Ignore
1715195766
Reply with quote  #2

1715195766
Report to moderator
1715195766
Hero Member
*
Offline Offline

Posts: 1715195766

View Profile Personal Message (Offline)

Ignore
1715195766
Reply with quote  #2

1715195766
Report to moderator
1715195766
Hero Member
*
Offline Offline

Posts: 1715195766

View Profile Personal Message (Offline)

Ignore
1715195766
Reply with quote  #2

1715195766
Report to moderator
jl2012
Legendary
*
Offline Offline

Activity: 1792
Merit: 1097


View Profile
February 25, 2014, 08:59:12 AM
 #2

Forgive me if this has been discussed to death and back, but lately I've been working on some Contracts transactions.  The realization that malleability prevents some of these contracts from working (trustlessly and securely) is starting to sink in.  

Dependent transactions just can't be built until they're included in the blockchain...

Does tx malleability basically mean that a number of advanced contracts are essentially broken?

1. Providing a deposit - Tx2 can't depend on Tx1 txid not changing. Step 2 sends the hash of Tx1 to the "website" to sign a refund tx.
2. P2P alt-chain trading - Tx2 can't refund Tx1 until it's in the blockchain, but you shouldn't fund Tx1 until Tx2 is signed.
3. Rapidly adjusted micropayments - (Does this hurt bitcoinj's security too?) Can't create refund T2 based on hash of T1.

I'm not interested in MtGox and their usage of transaction hashes, as that's just something they can fix.  These advanced contracts, on the other hand, heavily depend on a transaction hash not changing.



I have pointed out the same here: https://bitcointalk.org/index.php?topic=303088.msg5078809#msg5078809

I can't see any hope to save it without fixing malleability. Anything depending on zero-confirmation tx is not safe

Donation address: 374iXxS4BuqFHsEwwxUuH3nvJ69Y7Hqur3 (Bitcoin ONLY)
LRDGENPLYrcTRssGoZrsCT1hngaH3BVkM4 (LTC)
PGP: D3CC 1772 8600 5BB8 FF67 3294 C524 2A1A B393 6517
jl2012
Legendary
*
Offline Offline

Activity: 1792
Merit: 1097


View Profile
February 25, 2014, 09:13:09 AM
 #3

Well, I just find a way to save it.

Let's have a new SIGHASH type called SIGHASH_ANYUTXO. Signing with this tag means that the signer would allow the redemption of any UTXO of the same address. So the signer don't need to specify the hash of the UTXO. The signature is valid no matter how the txid is changed. As long as the signer is not reusing the address, that would be safe.

Any comment?

Donation address: 374iXxS4BuqFHsEwwxUuH3nvJ69Y7Hqur3 (Bitcoin ONLY)
LRDGENPLYrcTRssGoZrsCT1hngaH3BVkM4 (LTC)
PGP: D3CC 1772 8600 5BB8 FF67 3294 C524 2A1A B393 6517
Peter Todd
Legendary
*
expert
Offline Offline

Activity: 1120
Merit: 1150


View Profile
February 25, 2014, 09:34:48 AM
 #4

Well, I just find a way to save it.

Let's have a new SIGHASH type called SIGHASH_ANYUTXO. Signing with this tag means that the signer would allow the redemption of any UTXO of the same address. So the signer don't need to specify the hash of the UTXO. The signature is valid no matter how the txid is changed. As long as the signer is not reusing the address, that would be safe.

Any comment?

That's what I've been saying for ages... though it'll have to be implemented as a new CHECKSIG operator due to Satoshi screwing up upgrade possibilities in CHECKSIG.

jl2012
Legendary
*
Offline Offline

Activity: 1792
Merit: 1097


View Profile
February 25, 2014, 10:30:46 AM
 #5

Well, I just find a way to save it.

Let's have a new SIGHASH type called SIGHASH_ANYUTXO. Signing with this tag means that the signer would allow the redemption of any UTXO of the same address. So the signer don't need to specify the hash of the UTXO. The signature is valid no matter how the txid is changed. As long as the signer is not reusing the address, that would be safe.

Any comment?

That's what I've been saying for ages... though it'll have to be implemented as a new CHECKSIG operator due to Satoshi screwing up upgrade possibilities in CHECKSIG.

The original CHECKSIG is too bulky and we will need to modularize it in the future. We may also want different types of hashing and public key algorithms. This will enhance the long-term security a lot.

Donation address: 374iXxS4BuqFHsEwwxUuH3nvJ69Y7Hqur3 (Bitcoin ONLY)
LRDGENPLYrcTRssGoZrsCT1hngaH3BVkM4 (LTC)
PGP: D3CC 1772 8600 5BB8 FF67 3294 C524 2A1A B393 6517
Sarchar (OP)
Member
**
Offline Offline

Activity: 88
Merit: 10


View Profile
February 25, 2014, 10:47:21 AM
 #6

Well, I just find a way to save it.

Let's have a new SIGHASH type called SIGHASH_ANYUTXO. Signing with this tag means that the signer would allow the redemption of any UTXO of the same address. So the signer don't need to specify the hash of the UTXO. The signature is valid no matter how the txid is changed. As long as the signer is not reusing the address, that would be safe.

Any comment?

That's what I've been saying for ages... though it'll have to be implemented as a new CHECKSIG operator due to Satoshi screwing up upgrade possibilities in CHECKSIG.

I've had a few thoughts along this line, as well.. Perhaps instead of ANYUTXO, which is quite specific (don't hash the prevout field), why not build CHECKSIG2, which takes a flags word indicating each of the pieces of the transaction to sign (nLockTime, Outputs (Single, All, None), Inputs (With/Without prevouts, Anyonecanpay, sequence #s), etc.)?

I would actually consider writing the patch myself, if there was at all a decent chance of it being accepted into the reference client within the next several months.
kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1025



View Profile
February 26, 2014, 12:31:55 PM
 #7

Well, I just find a way to save it.

Let's have a new SIGHASH type called SIGHASH_ANYUTXO. Signing with this tag means that the signer would allow the redemption of any UTXO of the same address. So the signer don't need to specify the hash of the UTXO. The signature is valid no matter how the txid is changed. As long as the signer is not reusing the address, that would be safe.

Any comment?

That's what I've been saying for ages... though it'll have to be implemented as a new CHECKSIG operator due to Satoshi screwing up upgrade possibilities in CHECKSIG.

I'm not sure you can really blame Satoshi for this.  Either OP_CHECKSIG is useless, or any changes to it mean a hardfork anyway.  Consider an "upgrade" that your node is unaware of.  Your node will see it as an invalid signature.  You can either accept all invalid signatures (which makes it pointless to check), or you can be forced to upgrade your software to keep up (which is what a hard fork is).

Contracts can be fixed with a softfork, bumping the block version to 3 and requiring that all signatures in version 3 blocks be in minimized form.

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
Peter Todd
Legendary
*
expert
Offline Offline

Activity: 1120
Merit: 1150


View Profile
February 27, 2014, 11:04:55 AM
 #8

I'm not sure you can really blame Satoshi for this.  Either OP_CHECKSIG is useless, or any changes to it mean a hardfork anyway.  Consider an "upgrade" that your node is unaware of.  Your node will see it as an invalid signature.  You can either accept all invalid signatures (which makes it pointless to check), or you can be forced to upgrade your software to keep up (which is what a hard fork is).

Contracts can be fixed with a softfork, bumping the block version to 3 and requiring that all signatures in version 3 blocks be in minimized form.

Nope. If Satoshi had implemented OP_CODESEPARATOR correctly, without making it automatically get inserted into the concatenated scriptSig and scriptPubKey and with the existing OP_RETURN fails the script design you could upgrade SIGHASH with new, useful, flags by having them check a signed hash against other conditions.

FWIW this is one of the things that makes me think Satoshi released bitcoin prematurely and on a deadline. I doubt he ever actually prototyped any of the things the scripting system could have been used for prior to release.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!