Bitcoin Forum
May 11, 2024, 09:39:33 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to tell if one of my transaction is Segwit or not...  (Read 204 times)
adaseb (OP)
Legendary
*
Offline Offline

Activity: 3752
Merit: 1710



View Profile
April 20, 2020, 05:38:33 AM
Merited by o_e_l_e_o (2), BitMaxz (1), hugeblack (1)
 #1

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?




.BEST..CHANGE.███████████████
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
███████████████
..BUY/ SELL CRYPTO..
"This isn't the kind of software where we can leave so many unresolved bugs that we need a tracker for them." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715463573
Hero Member
*
Offline Offline

Posts: 1715463573

View Profile Personal Message (Offline)

Ignore
1715463573
Reply with quote  #2

1715463573
Report to moderator
1715463573
Hero Member
*
Offline Offline

Posts: 1715463573

View Profile Personal Message (Offline)

Ignore
1715463573
Reply with quote  #2

1715463573
Report to moderator
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10558



View Profile
April 20, 2020, 06:08:04 AM
Merited by joniboini (5), adaseb (2), hugeblack (2), o_e_l_e_o (2), nc50lc (1), DireWolfM14 (1)
 #2

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.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
adaseb (OP)
Legendary
*
Offline Offline

Activity: 3752
Merit: 1710



View Profile
April 22, 2020, 05:05:15 AM
 #3

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.

.BEST..CHANGE.███████████████
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
███████████████
..BUY/ SELL CRYPTO..
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10558



View Profile
April 22, 2020, 06:37:15 AM
 #4

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.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
nc50lc
Legendary
*
Offline Offline

Activity: 2408
Merit: 5597


Self-proclaimed Genius


View Profile
April 22, 2020, 06:38:38 AM
 #5

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

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10558



View Profile
April 22, 2020, 07:09:17 AM
 #6

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,...)

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
adaseb (OP)
Legendary
*
Offline Offline

Activity: 3752
Merit: 1710



View Profile
April 23, 2020, 05:56:49 AM
 #7

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.

.BEST..CHANGE.███████████████
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
███████████████
..BUY/ SELL CRYPTO..
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10558



View Profile
April 23, 2020, 06:49:11 AM
 #8

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).

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
DireWolfM14
Copper Member
Legendary
*
Offline Offline

Activity: 2184
Merit: 4238


Join the world-leading crypto sportsbook NOW!


View Profile WWW
April 23, 2020, 12:37:06 PM
 #9

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?

  ▄▄███████▄███████▄▄▄
 █████████████
▀▀▀▀▀▀████▄▄
███████████████
       ▀▀███▄
███████████████
          ▀███
 █████████████
             ███
███████████▀▀               ███
███                         ███
███                         ███
 ███                       ███
  ███▄                   ▄███
   ▀███▄▄             ▄▄███▀
     ▀▀████▄▄▄▄▄▄▄▄▄████▀▀
         ▀▀▀███████▀▀▀
░░░████▄▄▄▄
░▄▄░
▄▄███████▄▀█████▄▄
██▄████▌▐█▌█████▄██
████▀▄▄▄▌███░▄▄▄▀████
██████▄▄▄█▄▄▄██████
█░███████░▐█▌░███████░█
▀▀██▀░██░▐█▌░██░▀██▀▀
▄▄▄░█▀░█░██░▐█▌░██░█░▀█░▄▄▄
██▀░░░░▀██░▐█▌░██▀░░░░▀██
▀██
█████▄███▀▀██▀▀███▄███████▀
▀███████████████████████▀
▀▀▀▀███████████▀▀▀▀
▄▄██████▄▄
▀█▀
█  █▀█▀
  ▄█  ██  █▄  ▄
█ ▄█ █▀█▄▄█▀█ █▄ █
▀▄█ █ ███▄▄▄▄███ █ █▄▀
▀▀ █    ▄▄▄▄    █ ▀▀
   ██████   █
█     ▀▀     █
▀▄▀▄▀▄▀▄▀▄▀▄
▄ ██████▀▀██████ ▄
▄████████ ██ ████████▄
▀▀███████▄▄███████▀▀
▀▀▀████████▀▀▀
█████████████LEADING CRYPTO SPORTSBOOK & CASINO█████████████
MULTI
CURRENCY
1500+
CASINO GAMES
CRYPTO EXCLUSIVE
CLUBHOUSE
FAST & SECURE
PAYMENTS
.
..PLAY NOW!..
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10558



View Profile
April 23, 2020, 12:42:39 PM
 #10

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.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
BitMaxz
Legendary
*
Offline Offline

Activity: 3248
Merit: 2971


Block halving is coming.


View Profile WWW
April 23, 2020, 10:26:51 PM
 #11

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/

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!