Differences Between Transaction Versions

6 replies 329 views
v4ult2017Member
Posts: 2 · Reputation: 68
#1Jun 2, 2017, 05:16 PM
What are the differences between transaction version 1 and version 2?
6 Reply Quote Share
pixel2014Hero Member
Posts: 857 · Reputation: 4132
#2Jun 4, 2017, 02:08 AM
Try and explain yourself clearly. Did you mean segwit version 0 and segwit version 1? That is what I think of that is very similar to what you might be referring to version 1 and 2.
1 Reply Quote Share
v4ult2017Member
Posts: 2 · Reputation: 68
#3Jun 4, 2017, 07:47 AM
A years ago I have written blockchain analyzer for Bitcoin,Litecoin Dash and Bitcoin Cash. Now I download 150 GB Litecoin blocks (above 500 for Bitcoin is too much for me) and run analyzing. In block LTC 2398213 my program crash on last transaction. I don't know, transaction is bad, or I not handle this format. Transaction is version = 2, s segwit, Processing inputs and outputs but I get huge sizes of witness blocks. Transaction 9e919a5cc9a38f79d687cb84f0005a452589adbb33a5c092837137df19549dcb This is Litecoin topic, but I think, the same transaction extension have Bitcoin (?)
1 Reply Quote Share
im_apeHero Member
Posts: 629 · Reputation: 3824
#4Jun 4, 2017, 09:08 AM
It's the weird MWEB protocol they introduced into Litecoin. It sets the SegWit flag to 8 (0x0008 instead of 0x0001 we have in Bitcoin and by extension in Litecoin) and apparently it also lets you break a bunch of consensus rules such as spending coins without providing any witness (signature or anything like that) such as the transaction you posted here. https://github.com/litecoin-project/litecoin/blob/cd1660afaf5b31a80e797668b12b5b3933844842/src/primitives/transaction.h#L310 Your code could be breaking in at least 3 different places: (1) the flag being undefined (2) lack of witness while it is expected (3) while trying to verify the tx It has nothing to do with the transaction version being 2 by the way.
1 Reply Quote Share
HumbleBullFull Member
Posts: 54 · Reputation: 378
#5Jun 4, 2017, 10:58 AM
I think the problem here is with the kind of address... As you can see some block explorers have problems with that transaction too, let me show you: Explorers with errors: https://www.oklink.com/ltc/tx/9e919a5cc9a38f79d687cb84f0005a452589adbb33a5c092837137df19549dcb https://blockexplorer.one/litecoin/mainnet/tx/9e919a5cc9a38f79d687cb84f0005a452589adbb33a5c092837137df19549dcb https://live.blockcypher.com/ltc/tx/9e919a5cc9a38f79d687cb84f0005a452589adbb33a5c092837137df19549dcb/ Explorers without errors: https://chainz.cryptoid.info/ltc/tx.dws?9e919a5cc9a38f79d687cb84f0005a452589adbb33a5c092837137df19549dcb.htm https://blockchair.com/litecoin/transaction/9e919a5cc9a38f79d687cb84f0005a452589adbb33a5c092837137df19549dcb Since your code is old, maybe you should update it to allow SegWit addresses (the ones that start with ltc1). That should do the magic and let your code work fine.
2 Reply Quote Share
LuckyCoinLegendary
Posts: 832 · Reputation: 4795
#6Jun 4, 2017, 03:21 PM
Transactions with a version number of 2 support locktime. There is technically already a field for locktime (then called nsequence) for the version 1 transactions but its functionality was disabled (by Satoshi?) a few years before locktime was introduced. Basically it works like this:
0 Reply Quote Share
im_apeHero Member
Posts: 629 · Reputation: 3824
#7Jun 6, 2017, 08:34 PM
Do you have a reference for this? Because I think you are confusing locktime (the last 4 bytes of each tx) with OP_CHECKSEQUENCEVERIFY. As far as I know locktime is enforced for all transactions regardless of their version and the only case where tx version is checked is for OP_CHECKSEQUENCEVERIFY and if it is less than 2 the interpreter returns false. Tx version is not used anywhere else I know of.
4 Reply Quote Share

Related topics