Author

Topic: How to tell if one of my transaction is Segwit or not... (Read 204 times)

legendary
Activity: 3374
Merit: 3095
Playbet.io - Crypto Casino and Sportsbook
Why not use a verifier tool or decoder to check if it is a Segwit transaction or not?

There are some tools that I know you can check the raw/hex of the transaction and it will show you if it is a Segwit transaction or not.

Like this tool below.
- https://coinb.in/#verify


I think you can download this page and run it on offline mode

Or use this decoder below as an alternative
- https://live.blockcypher.com/btc/decodetx/
legendary
Activity: 3472
Merit: 10611
the issues i can think of is if you had a transaction with different types of inputs (eg. for consolidating) and at least one of them were a SegWit input. the old version would fail trying to read the raw unsigned transaction.

Would an example of this be an attempt to import or sweep a segwit private key?  Would that only apply to the older versions that allowed you to import private keys into a mnemonic wallet?

not necessarily. you can still create a wallet with all imported keys. i have done it in the past when i wanted to consolidate my old outputs from my old legacy address with some new payments i received in a bech32 address. the resulting transaction had both witnesses and legacy signatures in scriptsig such transaction can not be parsed by older versions.
copper member
Activity: 2338
Merit: 4543
Join the world-leading crypto sportsbook NOW!
the issues i can think of is if you had a transaction with different types of inputs (eg. for consolidating) and at least one of them were a SegWit input. the old version would fail trying to read the raw unsigned transaction.

Would an example of this be an attempt to import or sweep a segwit private key?  Would that only apply to the older versions that allowed you to import private keys into a mnemonic wallet?
legendary
Activity: 3472
Merit: 10611
Why is it that in the release notes (for version 3.2.0 - June 30 2018)  it says to upgrade both the online and offline versions because there will be compatibility issues. Something about the partial transaction format has been changed.

not sure. you have to test it to see if the old versions still recognize the raw tx created by a new version.
i think this has something to do with the new version bytes (45505446ff00) that are added to the beginning of the transaction that is the encoding of EPTF in hex (Electrum Partial Transaction Format) and the version byte (00).
legendary
Activity: 3808
Merit: 1723
I'm curious, do you still have a link to that old version cold-storage issue?
It's better if everyone can read and analyse that issue so people here can give you more accurate answers.

For now, if it's not an Electrum Bug, then there will be no problem even if you have a different version of Electrum as long as all of your wallet's addresses are legacy '1'.
Lastly, the most relevant old offline signing-related bug that I've heard was: 2951: Cannot sign transactions while offline - for versions < 2.7.9

Thanks for the reply. I checked my version and it was after 2.7.9 so its not affected by this bug.



So you are saying that even if I receive a segwit transaction I can still get it spent with this version since it will send it as a legacy transaction? I am a bit confused here.

yes, because whatever existed before (currently known as legacy transactions like P2PKH addresses) are still valid and the process is exactly the same as before. so when your new wallet version creates a raw unsigned transaction to be signed by the offline machine it is creating the same exact object as before.

keep in mind that you are not spending a transaction. instead you are spending an output, that is a pubkey script; which is why the type of transaction that sent you the coin doesn't matter because your cold storage only sees and cares about the output.

Why is it that in the release notes (for version 3.2.0 - June 30 2018)  it says to upgrade both the online and offline versions because there will be compatibility issues. Something about the partial transaction format has been changed.

I actually checked my transaction history and back in Jan 2018, I actually was sent a Segwit transaction. It was when I had to upgrade my online version because I couldn't get it to sync properly. Looking at the raw transaction details it has the 0x0001 bits and it contains witness data according to the block explorer. This input I also resent in the past without any issues. So it seems that even with the old version I can still receive Segwit and send those inputs without issues.
legendary
Activity: 3472
Merit: 10611
I'm curious, do you still have a link to that old version cold-storage issue?

the issues i can think of is if you had a transaction with different types of inputs (eg. for consolidating) and at least one of them were a SegWit input. the old version would fail trying to read the raw unsigned transaction.
other than that, the rest of the issues involve the online wallet (eg. the sync bug #3788, network crash #5195, the phishing vulnerability,...)
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
I'm curious, do you still have a link to that old version cold-storage issue?
It's better if everyone can read and analyse that issue so people here can give you more accurate answers.

For now, if it's not an Electrum Bug, then there will be no problem even if you have a different version of Electrum as long as all of your wallet's addresses are legacy '1'.
Lastly, the most relevant old offline signing-related bug that I've heard was: 2951: Cannot sign transactions while offline - for versions < 2.7.9
legendary
Activity: 3472
Merit: 10611
So you are saying that even if I receive a segwit transaction I can still get it spent with this version since it will send it as a legacy transaction? I am a bit confused here.

yes, because whatever existed before (currently known as legacy transactions like P2PKH addresses) are still valid and the process is exactly the same as before. so when your new wallet version creates a raw unsigned transaction to be signed by the offline machine it is creating the same exact object as before.

keep in mind that you are not spending a transaction. instead you are spending an output, that is a pubkey script; which is why the type of transaction that sent you the coin doesn't matter because your cold storage only sees and cares about the output.
legendary
Activity: 3808
Merit: 1723
it is actually the 5th and 6th bytes and it should be 0x0001 but yeah if you want to quickly know that a transaction contains any witnesses that is the way to do it if you have the full raw bytes. the simplir (user friendlier) way is to check a block explorer that has some sort of indication like blockchair.com that says if a transaction contains any witnesses or not.

Sometime a year ago or so, I heard that if you are using an old version of Electrum and you receive a Segwit transaction then it won't be possible to have that transaction signed on the cold storage system due to a different signature format.
if you have an old online wallet that received a transaction that contained any witnesses it will fail at parsing that transaction and break down. but if your cold storage is an old version and you were using legacy transaction, your cold wallet will not even know what type of transaction output you are spending. all it knows is these 3:
1) the transaction hash that is being spent
2) the output index you are spending
3) your corresponding script (eg P2PKH pubkey script or P2SH redeem script)

1 and 2 are in your transactions tx_in outpoint and they are not different for a SegWit transaction or a legacy one.

Thanks for the reply.

The cold storage version is 2.7.xxx or so. I remember I ran into an issue where the online wallet wouldn't sync anymore and I had to upgrade to get it to fully sync. Surprisingly using version 3.x still was able to get signed in version 2.7.xxx so I just left it as is.

So you are saying that even if I receive a segwit transaction I can still get it spent with this version since it will send it as a legacy transaction? I am a bit confused here.
legendary
Activity: 3472
Merit: 10611
it is actually the 5th and 6th bytes and it should be 0x0001 but yeah if you want to quickly know that a transaction contains any witnesses that is the way to do it if you have the full raw bytes. the simplir (user friendlier) way is to check a block explorer that has some sort of indication like blockchair.com that says if a transaction contains any witnesses or not.

Sometime a year ago or so, I heard that if you are using an old version of Electrum and you receive a Segwit transaction then it won't be possible to have that transaction signed on the cold storage system due to a different signature format.
if you have an old online wallet that received a transaction that contained any witnesses it will fail at parsing that transaction and break down. but if your cold storage is an old version and you were using legacy transaction, your cold wallet will not even know what type of transaction output you are spending. all it knows is these 3:
1) the transaction hash that is being spent
2) the output index you are spending
3) your corresponding script (eg P2PKH pubkey script or P2SH redeem script)

1 and 2 are in your transactions tx_in outpoint and they are not different for a SegWit transaction or a legacy one.
legendary
Activity: 3808
Merit: 1723
Basically I am an old timer using an old version of Electrum.

I got my Electrum fully sync'd up until my last input for all my wallets. And haven't used it since. Sometime a year ago or so, I heard that if you are using an old version of Electrum and you receive a Segwit transaction then it won't be possible to have that transaction signed on the cold storage system due to a different signature format.

I know about the phishing attacks and such but they are not an issue because I don't connect to any servers, I just got the wallet sync'd to the last block which had my last transaction so I can create a new transaction, sign it offline and broadcast it by a block explorer.

So from what I understand there are 3 ways to tell if its segwit or not.


1) Is by looking at the Sat/Byte and Sat/WU. If there is ratio of exactly 4, then its not segwit. Basically something like
4 Sats/byte and 1 Sats/WU ?

2) Is by looking on the block explorer at the inputs and if it says N/A under Witness.

3) Looking at the raw transaction and checking the 5th byte and if its 0x00 then its Segwit and if its anything else then its not segwit?



Jump to: