What is "version" used for in Bitcoin transactions? Does it have any meaning?

2

1

Some bitcoin transaction have version 2. For example, this transaction

https://blockchain.info/tx/b7022124bc7f31af9342d2f7af98ad9f60f2fd4fa544bf1affca8a436aadda41

if you request a hex (by adding ?format=hex for example) and putting it into https://blockchain.info/decode-tx , you get "version":2.

What does this mean? There are more transactions with version 2 out in the wild, but not that many.

In zcash transactions, version 2 means that the transaction has joinsplits. But I cannot find what it means in bitcoin.

I have found examples of version 2 transactions here and here

Karel Bílek

Posted 2017-02-14T13:17:00.357

Reputation: 2 197

You can find detail information about format there: https://en.bitcoin.it/wiki/Protocol_documentation

Val Dubrava 2018-04-12T09:03:57.247

Answers

1

It seems to be related to BIP 0068.

https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki

BIP 68 deals with relative locktime and repurposes sequence number for a that purpose. Relative locktime allows the user to set locktime relative to a previous output.

As of April 2017, Shapeshift uses only v2 transactions, when exchanging from altcoins into bitcoin.

Just for interest, zcash says this about version 2 (zcash uses version 2 to mark transaction with "secret" inputs/outputs):

Note: A transaction version number of 2 does not have the same meaning as in Bitcoin, where it is associated with support for OP CHECKSEQUENCEVERIFY as specified in [BIP-68]. Zcash was forked from Bitcoin v0.11.2 and does not currently support BIP 68, or the related BIPs 9, 112 and 113.

Karel Bílek

Posted 2017-02-14T13:17:00.357

Reputation: 2 197

3BIP68 introduces relative locktime, and that feature is up to now the only one that actually uses the transaction version field. But tx versions have been in Bitcoin since day one, and may be used for more things in the futurePieter Wuille 2017-02-14T18:25:56.327

0

https://bitcoin.org/en/developer-reference#raw-transaction-format:

Transaction version number; currently version 1. Programs creating transactions using newer consensus rules may use higher version numbers.

pebwindkraft

Posted 2017-02-14T13:17:00.357

Reputation: 4 568

3That's outdated. Since BIP68, v2 transactions exist. See the answer below.Pieter Wuille 2017-04-19T08:04:23.190

There is actually a lot of v2 transactions now; shapeshift, for example, creates only v2 transactions (when exchanging into bitcoin).Karel Bílek 2017-04-19T09:19:18.287