Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Nicolas Dorier on July 05, 2015, 05:29:12 PM



Title: Transaction v3 (BIP 62)
Post by: Nicolas Dorier on July 05, 2015, 05:29:12 PM
BIP62 mentions that transactions that want to get malleability enforced in blocks should be in version 3.
I am puzzled, because I see nowhere in the bitcoin source code where the check against v3 is done.

Also

In transaction.h :
Quote
static const int32_t CURRENT_VERSION=1;

With
Quote
bool IsStandardTx(const CTransaction& tx, string& reason)
{
    if (tx.nVersion > CTransaction::CURRENT_VERSION || tx.nVersion < 1) {
        reason = "version";
        return false;
    }

Means that if the version of the tx is different from 1 then the transaction is not standard.
So, at the end of the day, contrary to what BIP62 announce, there is no tx version 3 right ?


Title: Re: Transaction v3 (BIP 62)
Post by: TierNolan on July 05, 2015, 06:31:43 PM
That is interesting.

It means that legacy transactions with high locktimes cannot be spent (if they have non-DER signatures).  It would need a hard-fork to reverse.

This violates promises inherent in the system.  Soft forks are not supposed to prevent people accessing their bitcoins.

This is a good candidate for a "consensus" hard fork, since it is clearly required to maintain a critical promise.  It is a terrible precedent that a soft fork can be used to permanently lock people's money.


Never mind, see below (https://bitcointalk.org/index.php?topic=1110539.msg11798483#msg11798483) and below (https://bitcointalk.org/index.php?topic=1110539.msg11799604#msg11799604)


Title: Re: Transaction v3 (BIP 62)
Post by: dexX7 on July 05, 2015, 07:19:05 PM
BIP62 mentions that transactions that want to get malleability enforced in blocks should be in version 3.
I am puzzled, because I see nowhere in the bitcoin source code where the check against v3 is done.

There are no v3 transactions currently, and this seems more like a feature for the future, as sort of stated at the bottom of BIP 62 (https://github.com/bitcoin/bips/blob/master/bip-0062.mediawiki).

It means that legacy transactions with high locktimes cannot be spent (if they have non-DER signatures).  It would need a hard-fork to reverse.

v1 transactions remain valid, and the use of v3 appears to be optional, but all v3 transactions must follow the rules of BIP 62:

Quote
- All transactions in v3 blocks are required to follow rules #1-#2.
- v3 (and higher) transactions in v3 blocks are required to follow rules #3-#7 as well.

When 95% of the past 1000 blocks are v3 or higher, v2 blocks become invalid entirely. Note however that v1 (and v2) transactions remain valid forever.

And this seems to be the relevant part of BIP 66 (https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki#compatibility):

Quote
The requirement to have signatures that comply strictly with DER has been enforced as a relay policy by the reference client since v0.8.0, and very few transactions violating it are being added to the chain as of January 2015. In addition, every non-compliant signature can trivially be converted into a compliant one, so there is no loss of functionality by this requirement. This proposal has the added benefit of reducing transaction malleability (see BIP 62).


Title: Re: Transaction v3 (BIP 62)
Post by: TierNolan on July 05, 2015, 07:25:21 PM
And this seems the relevant part of BIP 66 (https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki#compatibility):

Quote
The requirement to have signatures that comply strictly with DER has been enforced as a relay policy by the reference client since v0.8.0, and very few transactions violating it are being added to the chain as of January 2015. In addition, every non-compliant signature can trivially be converted into a compliant one, so there is no loss of functionality by this requirement. This proposal has the added benefit of reducing transaction malleability (see BIP 62).

Good point, never mind then :).


Title: Re: Transaction v3 (BIP 62)
Post by: gmaxwell on July 05, 2015, 09:48:41 PM
Means that if the version of the tx is different from 1 then the transaction is not standard.
So, at the end of the day, contrary to what BIP62 announce, there is no tx version 3 right ?
There is no BIP62 in the Bitcoin system today. It's an incomplete proposal; so there is no support for BIP62 at all.


Title: Re: Transaction v3 (BIP 62)
Post by: Nicolas Dorier on July 06, 2015, 03:34:07 AM
Thanks, good news, at the end of the day I don't need to change my code to protect against malleability attack.