Author

Topic: Transaction version 2 (Read 161 times)

legendary
Activity: 3472
Merit: 10611
April 01, 2024, 09:16:44 AM
#7
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.
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.
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
March 31, 2024, 09:15:24 PM
#6
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:

How does locktime work?

The locktime field is 4 bytes in size and can hold values between 0 (0x00000000) and 4294967295 (0xffffffff).

You can set a specific block height or time by using different ranges of value:

Locktime   Description
<=499999999   Transaction cannot be mined until after a specific height.
>=500000000   Transaction cannot be mined until after a specific time.
This is also known as "absolute locktime", as you're setting a specific height or time in the future. It's also possible to set a relative locktime on a transaction if you prefer.

For the locktime field to be enabled, at least one of the sequence values on the inputs must be set to 0xfffffffe or below. If all of the inputs' sequence values are set to the maximum value of 0xffffffff, the transaction is considered "final" and the locktime feature is disabled.
legendary
Activity: 3346
Merit: 3125
March 31, 2024, 01:19:26 PM
#5
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.
legendary
Activity: 3472
Merit: 10611
March 30, 2024, 11:51:55 PM
#4
Transaction 9e919a5cc9a38f79d687cb84f0005a452589adbb33a5c092837137df19549dcb
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.
member
Activity: 138
Merit: 25
March 30, 2024, 04:23:53 PM
#3
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 (?)
legendary
Activity: 1512
Merit: 4795
Leading Crypto Sports Betting & Casino Platform
March 30, 2024, 04:06:13 PM
#2
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.
member
Activity: 138
Merit: 25
March 30, 2024, 03:56:41 PM
#1
What are difference between version 1 and version 2 of transaction?
Jump to: