Bitcoin Forum
May 26, 2024, 10:31:20 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 [2] 3 4 5 6 »  All
  Print  
Author Topic: What the "average user" needs to know about Transaction Mutability  (Read 38865 times)
eldentyrell
Donator
Legendary
*
Offline Offline

Activity: 980
Merit: 1004


felonious vagrancy, personified


View Profile WWW
February 12, 2014, 12:55:24 AM
 #21

Wouldn't there be some way to discourage miners from solving a block with malleated (or should I say mallified :-) ) transactions?

No, it is not possible.  Some forms of transaction mutation, like the ECSDA sign-inversion mutation, can't be distinguished from the original even if you have both of them side-by-side.

There are other forms of mutation involving alterations to the script.  There have been proposals to prohibit obviously-mutated scripts (like scripts with a bunch of no-ops stuck on the end), but going beyond the obviously-mutated scripts risks accidentally banning useful scripts or future uses of the script system not currently foreseen.

A middle ground is to come up with rules for preferred transactions (ECDSA sig has the preferred sign, DER encoding, only very basic scripts) and hold any non-preferred transactions until the next block to see if a preferred spend of the same outputs shows up.  But you can't force miners to do this and it's slightly contrary to their interests since they'd have to forego the transaction fee and essentially give it to whoever finds the next block instead of taking it for themselves.  Cooking up new rules also isn't the sort of thing you want to do in a crisis like the current situation.

The printing press heralded the end of the Dark Ages and made the Enlightenment possible, but it took another three centuries before any country managed to put freedom of the press beyond the reach of legislators.  So it may take a while before cryptocurrencies are free of the AML-NSA-KYC surveillance plague.
Barek
Full Member
***
Offline Offline

Activity: 168
Merit: 100


View Profile
February 12, 2014, 12:58:57 AM
 #22

This changes nothing on the usual practice that once a transaction is part of the blockchain it is safe to trust it. A 51% attack actually rewrites the blockchain.

NO it actualy doesn't: https://en.bitcoin.it/wiki/Attacks#Attacker_has_a_lot_of_computing_power

Sorry for the tangent, second time that 51% BS was creeping in, and thank you DandT.

Uhm, yes, it does? With enough time and >50% you can start at any point in the blockchain and eventually overtake the current one.

That is why there is the 6 confirmations thing. The more confirmations there are the harder it is to create a malicious fork. With >50%, all bets are off.
FeedbackLoop
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500



View Profile
February 12, 2014, 01:07:23 AM
 #23

This changes nothing on the usual practice that once a transaction is part of the blockchain it is safe to trust it. A 51% attack actually rewrites the blockchain.

NO it actualy doesn't: https://en.bitcoin.it/wiki/Attacks#Attacker_has_a_lot_of_computing_power

Sorry for the tangent, second time that 51% BS was creeping in, and thank you DandT.

Uhm, yes, it does? With enough time and >50% you can start at any point in the blockchain and eventually overtake the current one.

That is why there is the 6 confirmations thing. The more confirmations there are the harder it is to create a malicious fork. With >50%, all bets are off.

You made it sound both as if the attacker could re-write past blocks (before he managed to compute a lot of blocks in a row) and that he could do whatever he wanted with the blocks he wrote and both are not true. I felt I should shortly dispel that idea in this thread due to the potential readership. But please lets not derail this. I will stop responding to this off-topic. Thanks again DT.
dorobotsdream
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
February 12, 2014, 01:09:24 AM
 #24

Wouldn't there be some way to discourage miners from solving a block with malleated (or should I say mallified :-) ) transactions?

No, it is not possible.  Some forms of transaction mutation, like the ECSDA sign-inversion mutation, can't be distinguished from the original even if you have both of them side-by-side.

There are other forms of mutation involving alterations to the script.  There have been proposals to prohibit obviously-mutated scripts (like scripts with a bunch of no-ops stuck on the end), but going beyond the obviously-mutated scripts risks accidentally banning useful scripts or future uses of the script system not currently foreseen.

A middle ground is to come up with rules for preferred transactions (ECDSA sig has the preferred sign, DER encoding, only very basic scripts) and hold any non-preferred transactions until the next block to see if a preferred spend of the same outputs shows up.  But you can't force miners to do this and it's slightly contrary to their interests since they'd have to forego the transaction fee.  Cooking up new rules also isn't the sort of thing you want to do in a crisis like the current situation.

I was under the impression that the Sign conversion / Modulo change of the signature was immediately obvious, because the default client would only choose positive R and S and there is only one other solution in the available length.

Maybe the majority of miners could cooperate to block the spending of matured coins from a coinbase of a block that contains more then the usual share of malleated transactions by not accepting it in a block for mining. Then the original miners would have to spend a double effort to spend their coin.
agath
Full Member
***
Offline Offline

Activity: 164
Merit: 100


View Profile
February 12, 2014, 01:09:35 AM
 #25

Did I understand wrong, or in the example TX.A the user spends 0.6 and not 0.4?
DeathAndTaxes (OP)
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
February 12, 2014, 01:10:47 AM
 #26

Did I understand wrong, or in the example TX.A the user spends 0.6 and not 0.4?

Oops typo.  Good catch.  Should be fixed now.  He spends 0.6 BYC, receives 0.4 BTC back as change.
rebel24
Member
**
Offline Offline

Activity: 114
Merit: 10


View Profile
February 12, 2014, 01:17:50 AM
 #27

Can some of you guys please respond to my post on the first page.

I think I understand and have made it pretty clear and easy to understand, but I want to be sure.



And a short cliffnote/tidbit is-
this only affects VERY RECENT transactions. ie 100 transactions down the blockchain are not at risk, only VERY recent in which the attacker is fighting against the time to get his altered transaction recorded before the original transaction got recorded (and of which he would have to have control over both the sending and receiving wallet to get his bitcoins back AND request a withdrawl from the exchange, thus getting the cash AND the coins, is this right? (please do answer that as I believe its very pertinent to the problem)
DeathAndTaxes (OP)
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
February 12, 2014, 01:25:51 AM
 #28

This only affects unconfirmed transactions.  Once confirmed tx ids are immutable (baring a re-org of the blockchain).
eldentyrell
Donator
Legendary
*
Offline Offline

Activity: 980
Merit: 1004


felonious vagrancy, personified


View Profile WWW
February 12, 2014, 01:28:56 AM
 #29

I was under the impression that the Sign conversion / Modulo change of the signature was immediately obvious, because the default client would only choose positive R and S and there is only one other solution in the available length.

Only if it's immediately obvious that every user is using OpenSSL-linked bitcoin-qt.  That's neither obvious nor true!

For example, the transactions I use to move coins in and out of cold storage are generated by a javascript client, since it can run on an "air-walled" laptop with no network connection.  A lot of people do this.  In that case the sign of the ECDSA signature depends on what javascript VM I'm using…  Standards are standards, especially for crypto -- never a good idea to start assuming people are using specific implementations.

The printing press heralded the end of the Dark Ages and made the Enlightenment possible, but it took another three centuries before any country managed to put freedom of the press beyond the reach of legislators.  So it may take a while before cryptocurrencies are free of the AML-NSA-KYC surveillance plague.
HairyMaclairy
Legendary
*
Offline Offline

Activity: 1414
Merit: 2174


Degenerate bull hatter & Bitcoin monotheist


View Profile
February 12, 2014, 01:33:42 AM
Last edit: February 12, 2014, 01:45:35 AM by HairyMaclairy
 #30

Can someone please confirm if Bitcoin QT will show the correct balance after say six blocks.

In other words the false balance only displays for unconfirmed transactions.

*edit*. Can the casual user completely avoid this issue by waiting for at least one confirmation before spending a second transaction? 
btcash
Hero Member
*****
Offline Offline

Activity: 968
Merit: 515



View Profile
February 12, 2014, 01:44:15 AM
 #31

Best statement issued so far.

Quote
The first issue is that the QT client is blissfully unaware of the fact that a transaction is a duplicate of another transaction, so it reports both txs to the user as if they are unique transactions.
1. I send a tx->Bitcoin-QT stores the TX and deducts the amount from the spendable balance (this tx can be prunned later)
2. Attacker creates a duplicate transaction
3. The malicious duplicated TX gets in a block
4. I receive the block->Bitcoin-QT stores the "new" tx and deducts the amount again
-> 2 identical TX (besides the ID) in the history and the double amount deducted

So Bitcoin-QT can not handle transaction malleability in general or under what circumstances do these duplicates appear in Bitcoin-QT? Does Bitcoin-QT continue to rebroadcast the original TX?
dorobotsdream
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
February 12, 2014, 01:46:32 AM
 #32

I was under the impression that the Sign conversion / Modulo change of the signature was immediately obvious, because the default client would only choose positive R and S and there is only one other solution in the available length.

Only if it's immediately obvious that every user is using OpenSSL-linked bitcoin-qt.  That's neither obvious nor true!

For example, the transactions I use to move coins in and out of cold storage are generated by a javascript client, since it can run on an "air-walled" laptop with no network connection.  A lot of people do this.  In that case the sign of the ECDSA signature depends on what javascript VM I'm using…  Standards are standards, especially for crypto -- never a good idea to start assuming people are using specific implementations.

Yes, but wouldn't it be beneficial to agree on a canonical signature with positive R and S that gets preferential treatment for mining? Otherwise with your change hanging on confirmations, you could get severely limited in exchanging digital coins which supposedly are the new fast thing.
DeathAndTaxes (OP)
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
February 12, 2014, 01:48:18 AM
Last edit: February 12, 2014, 03:15:49 AM by DeathAndTaxes
 #33

Best statement issued so far.

Quote
The first issue is that the QT client is blissfully unaware of the fact that a transaction is a duplicate of another transaction, so it reports both txs to the user as if they are unique transactions.
1. I send a tx->Bitcoin-QT stores the TX and deducts the amount from the spendable balance (this tx can be prunned later)
2. Attacker creates a duplicate transaction
3. The malicious duplicated TX gets in a block
4. I receive the block->Bitcoin-QT stores the "new" tx and deducts the amount again
-> 2 identical TX (besides the ID) in the history and the double amount deducted

So Bitcoin-QT can not handle transaction malleability in general or under what circumstances do these duplicates appear in Bitcoin-QT? Does Bitcoin-QT continue to rebroadcast the original TX?

The duplicates appear whenever you node learns of them.  Either when a peer relays the duplicate to your node, or when a peer relays a block containing the duplicate to your node.

It is important to understand you don't actually "pay twice".  The balance *reported* by the client may be reduced but this is a reporting issue.  It would be like if you have 100 gold bars in a vault and the auditor miscounts it as 99 or 101.  The reported balance will be incorrect, but your wealth really hasn't changed but .  The incorrect report can't change the amount of actual gold in the vault.

If the duplicates were "hidden" from display and counting (and the balance is simply counting the value of all unspent outputs) it would display correctly.
eldentyrell
Donator
Legendary
*
Offline Offline

Activity: 980
Merit: 1004


felonious vagrancy, personified


View Profile WWW
February 12, 2014, 01:55:04 AM
 #34

Yes, but wouldn't it be beneficial to agree on a canonical signature with positive R and S that gets preferential treatment for mining?

That's what I suggested:

A middle ground is to come up with rules for preferred transactions (ECDSA sig has the preferred sign, DER encoding, only very basic scripts) and hold any non-preferred transactions until the next block to see if a preferred spend of the same outputs shows up.  But you can't force miners to do this and it's slightly contrary to their interests since they'd have to forego the transaction fee and essentially give it to whoever finds the next block instead of taking it for themselves.  Cooking up new rules also isn't the sort of thing you want to do in a crisis like the current situation.

I think the point is that this wasn't done when transaction mutability was first noticed, and at the moment it can't be done quickly enough to solve the problem.

PS, like your username.  And, yes, they do -- of electric sheep.  At least the androids.

The printing press heralded the end of the Dark Ages and made the Enlightenment possible, but it took another three centuries before any country managed to put freedom of the press beyond the reach of legislators.  So it may take a while before cryptocurrencies are free of the AML-NSA-KYC surveillance plague.
dorobotsdream
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
February 12, 2014, 02:09:49 AM
 #35

PS, like your username.  And, yes, they do -- of electric sheep.  At least the androids.

Thanks. Or maybe they are counting Satoshi's.  Cheesy

Still, delaying a non canonical transaction to a later block wouldn't be a problem for miners, or would it? The original transaction should be there to mine also, unless it is a transaction which actually uses the capabilities of the script format and has a good fee. But then it wouldn't be a problem to mine it.  And in the end it is in the interest of the miners when bitcoin functions well and is valued, because it increases the value of their reward.

Also the stick could be applied to keep miners that apparently prefer non canonical transactions for no valid reason and keep them from spending matured coins unless they mine them theirselves.
eldentyrell
Donator
Legendary
*
Offline Offline

Activity: 980
Merit: 1004


felonious vagrancy, personified


View Profile WWW
February 12, 2014, 02:28:10 AM
 #36

The original transaction should be there to mine also,

Yeah, and whoever finds the next block gets the fee, instead of you.

It simply isn't in the interest of any particular miner (or pool).  The decision about transaction inclusion is made by each miner (or pool) individually; it's not some sort of thing that the miners collectively vote on "for the common good".

The printing press heralded the end of the Dark Ages and made the Enlightenment possible, but it took another three centuries before any country managed to put freedom of the press beyond the reach of legislators.  So it may take a while before cryptocurrencies are free of the AML-NSA-KYC surveillance plague.
justusranvier
Legendary
*
Offline Offline

Activity: 1400
Merit: 1009



View Profile
February 12, 2014, 02:32:29 AM
 #37

Clients should also record but flag and hide duplicate transactions (but not true double spends involving different outputs).  The client should not include these flagged/hidden transactions in the balance computations. Ultimately It doesn't matter which one of the duplicates is hidden as long as one is.  If the flagged tx is the one which is ultimately confirmed then the duplicate flag should be moved to the other copy.  The user would see no change other than the tx id would change when the duplicate is included in a block.
The more permanent fix is to identify transactions by inputs and outputs, and (correctly) treat the relationship between transactions and txids as one-to-many.

That way a client could do the right thing if multiple txids appear for the same transactions: display the duplicates seen on the network at least until the transaction is unconfirmed, and optionally discard the ones that don't make it into the blockchain.
btcash
Hero Member
*****
Offline Offline

Activity: 968
Merit: 515



View Profile
February 12, 2014, 03:26:37 AM
 #38

Quote
Either when a peer relays the duplicate to your node, or when a peer relays a block containing the duplicate to your node.
Doesn't Bitcoin-QT reject a duplicate TX that inputs are already used by another TX the node knows about? I think getting the duplicated TX in a block is the only way to create a duplicated transaction visibility. Correct me if I am wrong.
DeathAndTaxes (OP)
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
February 12, 2014, 03:27:50 AM
 #39

Quote
Either when a peer relays the duplicate to your node, or when a peer relays a block containing the duplicate to your node.
Doesn't Bitcoin-QT reject a duplicate TX that inputs are already used by another TX the node knows about? I think getting the duplicated TX in a block is the only way to create a duplicated transaction visibility. Correct me if I am wrong.

You are incorrect. Smiley 

The node will not RELAY it to other nodes but it records and shows all transactions related to your inputs or outputs that it becomes aware of.
btcash
Hero Member
*****
Offline Offline

Activity: 968
Merit: 515



View Profile
February 12, 2014, 03:45:46 AM
 #40

Quote
Either when a peer relays the duplicate to your node, or when a peer relays a block containing the duplicate to your node.
Doesn't Bitcoin-QT reject a duplicate TX that inputs are already used by another TX the node knows about? I think getting the duplicated TX in a block is the only way to create a duplicated transaction visibility. Correct me if I am wrong.

You are incorrect. Smiley 

The node will not RELAY it to other nodes but it records and shows all transactions related to your inputs or outputs that it becomes aware of.
Grin Reminds me of the satoshi spam issue. Thanks for clarification.
Pages: « 1 [2] 3 4 5 6 »  All
  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!