Bitcoin Forum
May 24, 2024, 10:47:11 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 [2]  All
  Print  
Author Topic: Semi-soft-fork to decrease the risk of tx malleability  (Read 4396 times)
Cryddit
Legendary
*
Offline Offline

Activity: 924
Merit: 1129


View Profile
April 23, 2015, 07:45:16 PM
Last edit: April 24, 2015, 04:25:21 PM by Cryddit
 #21

Forgive what may be an unusually dumb question, but how exactly does it work, that a third party can change the script but cannot change what the script does?  

EDIT:

Nevermind, I get it.  It's the spend script, not the store script.  If they change what it does then there is no transaction. 
Realpra
Hero Member
*****
Offline Offline

Activity: 815
Merit: 1000


View Profile
April 24, 2015, 10:39:17 AM
 #22

You're not correct, things are not that simple.

Malleability has big impact on any anything depending on transaction hash of unconfirmed transactions, e.g:
I had not thought of that in this context.

Well your proposed solution of having different TX types where one is flexible and the other is not or something similar seems good to me.

Cheap and sexy Bitcoin card/hardware wallet, buy here:
http://BlochsTech.com
TierNolan
Legendary
*
Offline Offline

Activity: 1232
Merit: 1083


View Profile
April 24, 2015, 11:06:36 AM
 #23

I proposed this last year:

(1) The txid will be the hash of the tx with all scriptSig removed.
(currently, txid is the hash of the tx, including all scriptSig)

An alternative is to have both hashes be valid ways to refer to previous transactions.  This means that legacy transactions still work.  This is needed to ensure that you don't invalidate transactions that were created in the past, but have a locktime after the hard-fork happens.

If you are creating a refund transactions, then you can use hash(transaction without sigscripts) to refer to the previous transaction.

It doubles the size of the transaction index though, since it means 2 keys for each transaction.

Quote
(2) The first level of merkle root will be hash of (txid-a|size-a|txid-b|size-b), where txid-a and size-a are the txid and size of tx-a respectively
(currently, the first level of merkle root is (txid-a|txid-b))

What is the benefit of this?  It only protects against length changing malleability attacks (which might cover a lot of them).

1LxbG5cKXzTwZg9mjL3gaRE835uNQEteWF
jl2012 (OP)
Legendary
*
Offline Offline

Activity: 1792
Merit: 1097


View Profile
April 24, 2015, 01:18:01 PM
 #24

I proposed this last year:

(1) The txid will be the hash of the tx with all scriptSig removed.
(currently, txid is the hash of the tx, including all scriptSig)

An alternative is to have both hashes be valid ways to refer to previous transactions.  This means that legacy transactions still work.  This is needed to ensure that you don't invalidate transactions that were created in the past, but have a locktime after the hard-fork happens.

If you are creating a refund transactions, then you can use hash(transaction without sigscripts) to refer to the previous transaction.

It doubles the size of the transaction index though, since it means 2 keys for each transaction.

You only need legacy support for those UTXOs already in the blockchain. For those after the hardfork, only the new txid format will be supported.

Quote
(2) The first level of merkle root will be hash of (txid-a|size-a|txid-b|size-b), where txid-a and size-a are the txid and size of tx-a respectively
(currently, the first level of merkle root is (txid-a|txid-b))

What is the benefit of this?  It only protects against length changing malleability attacks (which might cover a lot of them).

We need this to provide a upper bound of the block size. Otherwise it is impossible to determine whether the block size is under 1MB (or other limit)

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

Activity: 1066
Merit: 1050


Khazad ai-menu!


View Profile WWW
April 24, 2015, 03:18:39 PM
Last edit: April 24, 2015, 05:04:28 PM by funkenstein
 #25

I'm still not so sure tx malleability is a real issue.  One can always check that the receiving address received payment from the sending address.  And what else is really so important?  In the recent proposal of payment channels (lighthouse) there is also talk that malleability could cause a problem.  I haven't understood how that is the case yet.  What am I missing?  
You're correct, TX maleability is only an issue if people use the TX hashes as Ids.



You're not correct, things are not that simple.

Malleability has big impact on any anything depending on transaction hash of unconfirmed transactions, e.g:

Thanks for your reply!  And yours Cryddit.  

I see more clearly how this malleability thing can suck.  

It looks from your link like a partial solution is already proposed by GMaxwell.  An imperfect solution.  

However I see another potential solution: private TX mining.  

The trouble with malleability in the case of the refund situation is that the transaction has been broadcast publicly.  If I were to forego that and submit it privately to one of the large pools, the malleability attacks could never happen.  Sure it wouldn't be mined as quickly, but for these protocols that is probably not an issue.  

I'm sure if there were a demand large pools and/or consortiums of pools would publish pubic keys and accept TXs delivered encrypted.  After all, this means more fees for them even before they charge anything extra.  

In fact I'm a bit surprised nobody is doing that yet.  
  


"Give me control over a coin's checkpoints and I care not who mines its blocks."
http://vtscc.org  http://woodcoin.info
TierNolan
Legendary
*
Offline Offline

Activity: 1232
Merit: 1083


View Profile
April 24, 2015, 06:37:13 PM
 #26

You only need legacy support for those UTXOs already in the blockchain. For those after the hardfork, only the new txid format will be supported.

It depends on how much effort is put into maintaining backwards compatibility.

Someone could have a string of transactions starting with one with a long locktime.  You couldn't spend that if after the hard fork.

The easiest is probably just to have a version number update.  The txid for transactions with version > <some value> ignores the sigScripts.

Quote
We need this to provide a upper bound of the block size. Otherwise it is impossible to determine whether the block size is under 1MB (or other limit)

Ahh ok, thought it was related to malleability.  I agree, if there is a hard fork, that should be added.  I would also add the fee sum as a 2nd piece of meta-data.  That protects against inflation.

1LxbG5cKXzTwZg9mjL3gaRE835uNQEteWF
TierNolan
Legendary
*
Offline Offline

Activity: 1232
Merit: 1083


View Profile
April 28, 2015, 04:10:37 PM
 #27

We'll be moving on 62 once 66 is actually deployed (one flaw in the the legacy softfork deployment mechanism is that only one change can be in flight at a time)

Is the plan BIP-66 then BIP-62 and then OP_CHECKLOCKTIMEVERIFY?

1LxbG5cKXzTwZg9mjL3gaRE835uNQEteWF
jl2012 (OP)
Legendary
*
Offline Offline

Activity: 1792
Merit: 1097


View Profile
April 28, 2015, 05:48:26 PM
 #28

We'll be moving on 62 once 66 is actually deployed (one flaw in the the legacy softfork deployment mechanism is that only one change can be in flight at a time)

Is the plan BIP-66 then BIP-62 and then OP_CHECKLOCKTIMEVERIFY?

Is there any consensus that CHECKLOCKTIMEVERIFY will be implemented??

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

Activity: 4186
Merit: 8424



View Profile WWW
April 29, 2015, 05:06:43 AM
 #29

Is there any consensus that CHECKLOCKTIMEVERIFY will be implemented??
Everyone who has commented has spoken up in favor of it, and plenty of people have. So I think so.

Is the plan BIP-66 then BIP-62 and then OP_CHECKLOCKTIMEVERIFY?
66 is in flight and must finish before another softfork can be undertaken.  I'd like further softforks to switch to the new softforking system that doesn't require serializing things.

If you'd like to see faster progress; please go nag miners to upgrade to 0.10.1.
TierNolan
Legendary
*
Offline Offline

Activity: 1232
Merit: 1083


View Profile
April 29, 2015, 08:41:03 PM
 #30

I'd like further softforks to switch to the new softforking system that doesn't require serializing things.

Is there a github branch and/or description of exactly what is proposed for that (or is the plan to just manually set what BIP each bit refers to)?

1LxbG5cKXzTwZg9mjL3gaRE835uNQEteWF
Cryddit
Legendary
*
Offline Offline

Activity: 924
Merit: 1129


View Profile
April 30, 2015, 09:59:20 PM
 #31

Is there any consensus that CHECKLOCKTIMEVERIFY will be implemented??

Everyone who has commented has spoken up in favor of it, and plenty of people have. So I think so.


OP_CHECKLOCKTIMEVERIFY makes it possible to make txouts that cannot be spent until after some block height.

One thing that's particularly beneficial about that is that it makes it much safer for a future BIP to create nLastTime - (by analogy with nLockTime) transactions that cannot be entered into a block AFTER a given block height.  This would be the "fill-or-kill" trade that a lot of people have asked for. 

If a tx that is not valid until after block X produces only outputs that are not spendable until block x+50, then any subsequent transactions invalidated by the tx becoming invalid in a reorg are transactions that would not be valid until 50 blocks later anyway - which removes the primary problem with nLastTime.

So If nLastTime transactions are required to produce no outputs spendable within 50 blocks after their last valid block, it's "safe" insofar as not invalidating subsequent transactions, barring a 50-block reorg.

doug_armory
Sr. Member
****
Offline Offline

Activity: 255
Merit: 250

Senior Developer - Armory


View Profile WWW
May 06, 2015, 02:52:50 AM
Last edit: May 06, 2015, 03:04:01 AM by doug_armory
 #32

Pieter has a new proposal which makes major improvements: every softfork is signaled by a single bit, the when the bit crossed threshold it 'latches' and becomes available for reuse again, and there is a deadline by which if it fails to latch its aborted and becomes available for use again.

Just curious, is this proposal documented anywhere? I spent a few minutes checking the usual suspects (mailing list, Reddit, this board, IRC logs, BIPs) and couldn't find anything. Maybe I missed it somehow?

Thanks.

Senior Developer -  Armory Technologies, Inc.
jl2012 (OP)
Legendary
*
Offline Offline

Activity: 1792
Merit: 1097


View Profile
July 29, 2015, 04:04:12 AM
 #33

we have BIP66 but there are still many forms of malleability to be fixed.
BIP66 is not about malleability, really; BIP62 is.



Is this the real reason for BIP66, which you couldn't mention in April?

https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2015-July/009697.html
(Disclosure: consensus bug indirectly solved by BIP66)


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

Activity: 4186
Merit: 8424



View Profile WWW
July 29, 2015, 05:21:54 AM
 #34

we have BIP66 but there are still many forms of malleability to be fixed.
BIP66 is not about malleability, really; BIP62 is.
Is this the real reason for BIP66, which you couldn't mention in April?
https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2015-July/009697.html
(Disclosure: consensus bug indirectly solved by BIP66)
The explicitly stated goal right in the BIP62 document was a reduction in dependence on OpenSSL for consensus; which the truth and nearly the whole truth all that was missing was that the concern was less theoretical than presented.  But yes, the unstated privately known consensus vulnerability was a driving force for clearing up that ugly corner with BIP66 immediately rather than mopping it up as a side effect of BIP62. Especially due to fact that BIP62's progress has been slow-- and had grown over complicated. The fact that BIP66 accomplished one of the necessary steps will make BIP62 or its logical successor easier to move forward.

If you note from the timeline that BIP62 had already been revised to accomplish a BIP66 like goal prior to us knowing about that specific vulnerability:  We were aware of the risk class in principle before having specific knoweldge with enough concern that we thought it was worth closing off.  Knowing that it was _actually_ exposed had only an impact on timing and sequencing; and only after it was clear that BIP62 was not rapidly converging (unfortunately, in spite of much progress on BIP62 we continued to find problems with it).

It's sad, there is a vastly superior-- simpler, more comprehensive, and with secondary benefits like enabling more degrees between full and SPV-- malleability 'fix' in elements alpha but I don't have any way to get it into Bitcoin, BIP62 is disappointing by comparison (brillant ideas welcome).
sickpig
Legendary
*
Offline Offline

Activity: 1260
Merit: 1008


View Profile
July 29, 2015, 06:06:18 AM
 #35

we have BIP66 but there are still many forms of malleability to be fixed.
BIP66 is not about malleability, really; BIP62 is.
Is this the real reason for BIP66, which you couldn't mention in April?
https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2015-July/009697.html
(Disclosure: consensus bug indirectly solved by BIP66)
The explicitly stated goal right in the BIP62 document was a reduction in dependence on OpenSSL for consensus; which the truth and nearly the whole truth all that was missing was that the concern was less theoretical than presented.  But yes, the unstated privately known consensus vulnerability was a driving force for clearing up that ugly corner with BIP66 immediately rather than mopping it up as a side effect of BIP62. Especially due to fact that BIP62's progress has been slow-- and had grown over complicated. The fact that BIP66 accomplished one of the necessary steps will make BIP62 or its logical successor easier to move forward.

If you note from the timeline that BIP62 had already been revised to accomplish a BIP66 like goal prior to us knowing about that specific vulnerability:  We were aware of the risk class in principle before having specific knoweldge with enough concern that we thought it was worth closing off.  Knowing that it was _actually_ exposed had only an impact on timing and sequencing; and only after it was clear that BIP62 was not rapidly converging (unfortunately, in spite of much progress on BIP62 we continued to find problems with it).

It's sad, there is a vastly superior-- simpler, more comprehensive, and with secondary benefits like enabling more degrees between full and SPV-- malleability 'fix' in elements alpha but I don't have any way to get it into Bitcoin, BIP62 is disappointing by comparison (brillant ideas welcome).


do you care to elaborate on that better fix? especially on the reason why it cannot be "ported" to bitcoin. thanks in advance.

Bitcoin is a participatory system which ought to respect the right of self determinism of all of its users - Gregory Maxwell.
Pages: « 1 [2]  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!