3

What does the transaction version byte mean and what would happen if it was 02 instead of 01?

Example:

0200000001e45241797d5251bd0ed4bc085465998bd22df57d96fd4d72e0bfa509d2e6b55001000000754c5ac1a0faa5878bb47f881fb5449a7ad8d8b0b983e1ed85c0b86ba7c294fed0ba8db60453bb741096df85cca17746dfbfda46916be1fd2ad6c2c2d6dec6c6c624b7b7b7b78c4715bc6802aa22a801555400001800015628a00fffd918a914a13173eaf749408ea09f91cbc2f3ddf9433d118a8851ffffffff0122020000000000001976a914a9e39afc50fb08221811eb1351d060aed6f7224f88ac00000000
Murch
  • 71,155
  • 33
  • 180
  • 600
John
  • 383
  • 2
  • 10

1 Answers1

3

Firstly, the version number is actually 4 bytes. It is a 32 bit little endian integer.

The version number is used to signal specific support for some technologies. Specifically, a transaction must be version 2 in order to use OP_CHECKSEQUENCEVERIFY. Otherwise the transaction is exactly the same as a version 1 transaction. Only transaction versions 1 and 2 are considered standard.

Andrew Chow
  • 67,209
  • 5
  • 76
  • 149
  • So what is the difference between a version1 and 2 transaction? – John Mar 21 '18 at 17:27
  • 1
    None, unless your script uses `OP_CHECKSEQUENCEVERIFY`. If you try using that particular opcode in a v1 tx, it will not be accepted. Anything after 2 is reserved for future use – Raghav Sood Mar 21 '18 at 17:34
  • In the wiki it says OP_CHECKSEQUENCEVERIFY is 0xb2 but i don't see it in this transaction. Transaction:0200000001e45241797d5251bd0ed4bc085465998bd22df57d96fd4d72e0bfa509d2e6b55001000000754c5ac1a0faa5878bb47f881fb5449a7ad8d8b0b983e1ed85c0b86ba7c294fed0ba8db60453bb741096df85cca17746dfbfda46916be1fd2ad6c2c2d6dec6c6c624b7b7b7b78c4715bc6802aa22a801555400001800015628a00fffd918a914a13173eaf749408ea09f91cbc2f3ddf9433d118a8851ffffffff0122020000000000001976a914a9e39afc50fb08221811eb1351d060aed6f7224f88ac00000000 – John Mar 21 '18 at 18:05
  • @John Yes, it is not in the transaction. A transaction does not need to have OP_CHECKSEQUENCEVERIFY in order to be version 2. If it does have OP_CHECKSEQUENCEVERIFY, it must be version 2. – Andrew Chow Mar 21 '18 at 18:14