Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: mirek92 on March 28, 2022, 03:04:37 PM



Title: Could it be that if I send BTC from one type of wallet to another, transax fail?
Post by: mirek92 on March 28, 2022, 03:04:37 PM
Hello
I know Bitcoin has multiple versions of wallets (SegWit, Taproot, Legacy-Segwit and Legacy) I have this list in Trezor Suite program.
If I sent it from SegWit, for example, but the end wallet would be a different type, such as Legacy, can happen that an error occurre and BTC transaction fail, or is it a completely unnecessary worry...?
Thank you for answer


Title: Re: Could it be that if I send BTC from one type of wallet to another, transax fail?
Post by: hosseinimr93 on March 28, 2022, 03:08:28 PM
You can send bitcoin from any type of address to any type of address.
Note that segwit and taproot were soft forks and no new chains were created. All bitcoin transactions are made in a single blockchain.

Below is a random transaction I picked from the blockchain.
As you see, the transaction has been made from a legacy address to a segwit address.


https://i.imgur.com/Xm3r4ZT.jpg
blockchain.com (https://www.blockchain.com/btc/tx/1552cec0426a4edab7ff6a57e2392c4c7c2f9b3c9821e7b3b159026878cc0ba8)


Title: Re: Could it be that if I send BTC from one type of wallet to another, transax fail?
Post by: jackg on March 28, 2022, 03:38:41 PM
The type of address you select only changes the size of the transaction you're sending (which changes the fee and how long the transaction will take to confirm).

You can send from different address types to others but it's recommended you use native segwit (addresses beginning bc1 - since it'll give you fees).


Title: Re: Could it be that if I send BTC from one type of wallet to another, transax fail?
Post by: BlackHatCoiner on March 28, 2022, 03:42:59 PM
Different types exist to accomplish transaction in a different manner. For example, P2PKH[1] (AKA Legacy) means that you're locking funds to the hash of a public key; those are the addresses that start with 1. P2SH[2] means that you're locking funds to a hash of a script, such as multi-sig; those that start with 3. Then, it's the SegWit[3].

You should use the latter to minimize transaction expenses in fees.

[1] https://learnmeabitcoin.com/technical/p2pkh
[2] https://learnmeabitcoin.com/technical/p2sh
[3] https://en.bitcoin.it/wiki/Segregated_Witness


Title: Re: Could it be that if I send BTC from one type of wallet to another, transax fail?
Post by: hosseinimr93 on March 28, 2022, 03:56:09 PM
The type of address you select only changes the size of the transaction you're sending (which changes the fee and how long the transaction will take to confirm).
A small correction:
With using segwit addresses, you don't decrease transaction size.
The segwit fork changed the way the transaction fee is calculated and now you pay lower fee when using segwit addresses, because your transaction has a smaller weight, not because its size has been decreased.


Title: Re: Could it be that if I send BTC from one type of wallet to another, transax fail?
Post by: Charles-Tim on March 28, 2022, 06:56:16 PM
If I sent it from SegWit, for example, but the end wallet would be a different type, such as Legacy, can happen that an error occurre and BTC transaction fail, or is it a completely unnecessary worry...?
You do not have to bother if sending from legacy, nested segwit, native segwit or pay-to-taproot, you can send from one to another irrespective of the address type.

But best to use segwit to take advantage of low fee. If seeing from segwit address to segwit address, the fee will be 42% reduced with 1 input and 1 output if compared to sending from legacy address to legacy address with 1 input and 1 output. With 10 inputs comparison, there would be 50% fee reduction.

The type of address you select only changes the size of the transaction you're sending (which changes the fee and how long the transaction will take to confirm).
I believe you know this though, probably a mistake. As  hosseinimr93 commented, lower fee is paid because of reduction in transaction weight or virtual byte/size.


Title: Re: Could it be that if I send BTC from one type of wallet to another, transax fail?
Post by: nc50lc on March 29, 2022, 04:35:17 AM
Here's a personal example to show that it will work: 25e3fd298858abc6d5a0ef71d5df49a8c2c4bb96cc21b8c0cc7e49881bbc8252 (https://www.blockchain.com/btc/tx/25e3fd298858abc6d5a0ef71d5df49a8c2c4bb96cc21b8c0cc7e49881bbc8252)
The inputs are Taproot and P2SH-SegWit, the output is Native SegWit.
(those addresses are already in my profile so there's no privacy issue sharing them)

BTW, the term "address" shouldn't be mixed with "wallet", 'wallet' is your Trezor, 'address' is what you paste/type when sending coins.


Title: Re: Could it be that if I send BTC from one type of wallet to another, transax fail?
Post by: DarkStar_ on April 02, 2022, 03:13:10 AM
The type of address you select only changes the size of the transaction you're sending (which changes the fee and how long the transaction will take to confirm).
A small correction:
With using segwit addresses, you don't decrease transaction size.
The segwit fork changed the way the transaction fee is calculated and now you pay lower fee when using segwit addresses, because your transaction has a smaller weight, not because its size has been decreased.

I think jackg might actually be referring to the size of the output itself, rather than the overall size of the transaction. There's a great post on StackExchange (https://bitcoin.stackexchange.com/questions/84004/how-do-virtual-size-stripped-size-and-raw-size-compare-between-legacy-address-f) that covers transaction sizes, and includes this table:

https://i.stack.imgur.com/1iDzo.png

It shows that sending to a legacy address takes 34 bytes, sending to a P2SH address takes 32 bytes, sending to a native segwit address takes 31 byes, and sending to a taproot address takes 43 bytes for your output. I don't believe there's any witness data specifically related to the output, so you do decrease transaction size sending to a segwit address from a legacy address.


Title: Re: Could it be that if I send BTC from one type of wallet to another, transax fail?
Post by: gagux123 on April 02, 2022, 07:17:39 AM
Hello
I know Bitcoin has multiple versions of wallets (SegWit, Taproot, Legacy-Segwit and Legacy) I have this list in Trezor Suite program.
If I sent it from SegWit, for example, but the end wallet would be a different type, such as Legacy, can happen that an error occurre and BTC transaction fail, or is it a completely unnecessary worry...?
Thank you for answer
Well, just to reiterate some things that have already been discussed here... But yes, you can send Bitcoin to any type of address. It is advisable to use native segwit, because the fees are cheaper.

A small correction:
With using segwit addresses, you don't decrease transaction size.
The segwit fork changed the way the transaction fee is calculated and now you pay lower fee when using segwit addresses, because your transaction has a smaller weight, not because its size has been decreased.
I read some comments on this topic and would like to understand better...

The reason a SegWit address transaction is faster/cheaper is because of the "weight/size" of its output being smaller (31 bytes), while a Legacy address is 34 bytes.. .is this because the SegWit fork changed the way a transaction fee is calculated?!!

Is my line of reasoning correct? Or am I wrong?


Title: Re: Could it be that if I send BTC from one type of wallet to another, transax fail?
Post by: DarkStar_ on April 02, 2022, 07:47:31 AM
A small correction:
With using segwit addresses, you don't decrease transaction size.
The segwit fork changed the way the transaction fee is calculated and now you pay lower fee when using segwit addresses, because your transaction has a smaller weight, not because its size has been decreased.
I read some comments on this topic and would like to understand better...

The reason a SegWit address transaction is faster/cheaper is because of the "weight/size" of its output being smaller (31 bytes), while a Legacy address is 34 bytes.. .is this because the SegWit fork changed the way a transaction fee is calculated?!!

Is my line of reasoning correct? Or am I wrong?

No. A legacy to segwit transaction is marginally cheaper because the raw size of a segwit address output is marginally smaller (3 bytes) and doesn't have anything to do with the segwit changes of using WU instead of raw bytes. I'd recommend reading the post I linked above (https://bitcoin.stackexchange.com/questions/84004/how-do-virtual-size-stripped-size-and-raw-size-compare-between-legacy-address-f) which breaks down the size of each transaction. The TLDR is that segwit -> any transactions are a decent amount cheaper because some of the transaction bytes are weighted as only 1 WU instead of 4 WU.


Title: Re: Could it be that if I send BTC from one type of wallet to another, transax fail?
Post by: Pmalek on April 02, 2022, 07:44:27 PM
If I sent it from SegWit, for example, but the end wallet would be a different type, such as Legacy, can happen that an error occurre and BTC transaction fail, or is it a completely unnecessary worry...?
The only issues you will sometimes come across is when you use custodial services like cryptocurrency exchanges or casinos who haven't been configured yet to recognize SegWit addresses as valid Bitcoin addresses. Sadly, that still happens even today. If you use such a platform and you tried to withdraw BTC to a Native SegWit address, you would see an error telling you it's an invalid or incorrect address. But that's only related to that particular service not using Native SegWit, nothing else. 

The reason a SegWit address transaction is faster/cheaper...
No address type is faster. A SegWit transaction won't confirm faster than a legacy transaction because of the fact it's SegWit. The fees that you pay and the incentive you give to miners to select your transaction instead of a bunch of others is what is important.