What are the differences between transaction version 1 and version 2?
Differences Between Transaction Versions
6 replies 329 views
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.
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 (?)
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.
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.
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:
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.
Related topics
- Understanding the Difference Between Traditional and Simplified Chinese Mnemonic Words 6
- Hex data from the prenet genesis transaction 3
- Ideas for Boosting Bitcoin's Transaction Capacity 3
- Bitcoin Core displaying coins (UTXOs) in a new tab 13
- Are you in favor of BIP-110? Let's get a Bitcoin poll going. 0
- Erlay seems to have some issues here’s a better proposal for a bitcoin protocol without invites 3