Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: OmegaStarScream on November 02, 2017, 07:10:27 AM



Title: Difference between SegWit addresses
Post by: OmegaStarScream on November 02, 2017, 07:10:27 AM
Electrum 3.0 is out and the addresses are starting with bc1 apparently. I have a hardware wallet in the other hand where SegWit is supported too but the addresses are starting with 3 instead. What are the differences and are they compatible between each other (including the old addresses). Could I receive/send without having to worry?


Title: Re: Difference between SegWit addresses
Post by: bitcoinveda on November 02, 2017, 10:01:17 AM
segwit addresses fees are low compared to BTC address and they are  identical in cryptographic format


Title: Re: Difference between SegWit addresses
Post by: Carlton Banks on November 02, 2017, 11:23:29 AM
Electrum 3.0 is out and the addresses are starting with bc1 apparently. I have a hardware wallet in the other hand where SegWit is supported too but the addresses are starting with 3 instead. What are the differences and are they compatible between each other (including the old addresses). Could I receive/send without having to worry?


The addresses starting with 3 (nested Segwit in a P2SH type) are definitely backwards compatible: older (non-Segwit) wallet software can receive BTC from your P2SH addresses, and they can send to them too.

The addresses starting bc1 (bech32 P2WPKH type) are a new Segwit only type to make addresses easier to use. They essentially make addresess case-insensitive, e.g. BC1MYNEWBITCOINADDRESSISBECH32 is the exact same address as bc1mynewbitcoinaddressisbech32

I'm sure bc1 (bech32 P2WPKH) are backwards compatible at the blockchain level, because they'd need a hard fork to implement them if not, but that doesn't mean that old wallet software will allow you to send BTC to them. Receiving from them using old wallet software may also be a problem, depending on how that specific wallet software is written. But old wallet software may be able to send or receive, to reiterate, it entirely depends on how the software was written.


It's maybe best to think of the 3 (P2SH) addresses as transitional, and the bc1 (bech32 P2WPKH) addresses as better for a post-Segwit situation (i.e. once non-Segwit addresses become atypical for users and businesses)


Title: Re: Difference between SegWit addresses
Post by: BillyBobZorton on November 02, 2017, 01:27:02 PM
Just an interesting bit of information to have on mind when it comes to long term cold storage with segwit addresses: if you want to claim one of these dumb non-segwit forks like BCash that may happen in the future, you will not receive the coins. In other words, if there is a hardfork that does not support segwit, you will get no coins. So if there is ever another one of these with enough relevance to get some free money, remember that you must move your coins back to a legacy format address (the ones that start with 1.....). I think most people don't know that. Not that I expect anyone to make more non-segwit hardforks, but just in case, have that on mind. Im personally not moving my cold storage from the legacy format, I don't see the need.


Title: Re: Difference between SegWit addresses
Post by: monkeydominicorobin on November 03, 2017, 08:10:03 AM
Electrum 3.0 is out and the addresses are starting with bc1 apparently. I have a hardware wallet in the other hand where SegWit is supported too but the addresses are starting with 3 instead. What are the differences and are they compatible between each other (including the old addresses). Could I receive/send without having to worry?

Of course they are compatible. The original developers of Bitcoin created segwit. But you should not confuse it with segwit2x which is a disgrace.


Title: Re: Difference between SegWit addresses
Post by: Thekool1s on November 03, 2017, 10:11:36 AM
Electrum 3.0 is out and the addresses are starting with bc1 apparently. I have a hardware wallet in the other hand where SegWit is supported too but the addresses are starting with 3 instead. What are the differences and are they compatible between each other (including the old addresses). Could I receive/send without having to worry?


The addresses starting with 3 (nested Segwit in a P2SH type) are definitely backwards compatible: older (non-Segwit) wallet software can receive BTC from your P2SH addresses, and they can send to them too.

The addresses starting bc1 (bech32 P2WPKH type) are a new Segwit only type to make addresses easier to use. They essentially make addresess case-insensitive, e.g. BC1MYNEWBITCOINADDRESSISBECH32 is the exact same address as bc1mynewbitcoinaddressisbech32

I'm sure bc1 (bech32 P2WPKH) are backwards compatible at the blockchain level, because they'd need a hard fork to implement them if not, but that doesn't mean that old wallet software will allow you to send BTC to them. Receiving from them using old wallet software may also be a problem, depending on how that specific wallet software is written. But old wallet software may be able to send or receive, to reiterate, it entirely depends on how the software was written.


It's maybe best to think of the 3 (P2SH) addresses as transitional, and the bc1 (bech32 P2WPKH) addresses as better for a post-Segwit situation (i.e. once non-Segwit addresses become atypical for users and businesses)

Hey Carlton Banks, can you explain this in simple english kindly? I am not a technical guy, don't understand the terms like P2SH etc. I have few questions, that i would like to ask.

1) What are these Segwit Addresses?
2) How are these different from normal Addresses?
3) How are the fees low compared to other addresses?
4) If i upgrade from 2.9.3 to 3.0 will i have old addresses or it will swipe them?



Title: Re: Difference between SegWit addresses
Post by: The One on November 03, 2017, 11:17:56 AM
The addresses starting bc1 (bech32 P2WPKH type) are a new Segwit only type to make addresses easier to use. They essentially make addresess case-insensitive, e.g. BC1MYNEWBITCOINADDRESSISBECH32 is the exact same address as bc1mynewbitcoinaddressisbech32


So the number of possible addresses is reduced using bech32? Isn't that a disadvantage.


Title: Re: Difference between SegWit addresses
Post by: Carlton Banks on November 03, 2017, 11:44:16 AM
1) What are these Segwit Addresses?
  • There are 2 different Segwit address formats. They are P2SH (starting with a "3") and bech32 (starting "bc1")
  • P2SH can be sent to by people using older Bitcoin software with no Segwit support. This supports backwards compatibility
  • People sending from newer Bitcoin software that has Segwit and bech32 can send to the new address type that starts "bc1"
  • People sending from older Bitcoin software that has no Segwit probably cannot send to the new address type that starts "bc1"

So, if people send you BTC from old software, give them the Segwit addresses that start with "3". If people send you BTC using new Segwit Bitcoin software, give them the Segwit addresses that start with "bc1".

If you don't know if someone has the newer bech32 software or not, there's no need to worry, their software will simply refuse to send the transaction, so no harm can be done.


2) How are these different from normal Addresses?

  • You won't get the Segwit fee reduction unless you spend from one of these addresses
  • The addresses starting "3" are normal addresses. They already exist in the Bitcoin blockchain now. The difference is that the Bitcoin script permits a wide variety of options, in this case, using Segwit in a way that old Bitcoin software can handle (obviously old software has no clue what Segwit is, it didn't exist back then, this method works around that)
  • The addresses starting "bc1" are not normal addresses. They are brand new, and only work with Segwit
  • With addresses starting "bc1", it doesn't matter if you USE UPPER CASE. or if you use lower case. bc1bech32segwitaddressescanbeupperorlowercase is the same address as BC1BECH32SEGWITADDRESSESCANBEUPPERORLOWERCASE, neither your wallet software or the blockchain will care


3) How are the fees low compared to other addresses?

There are no guarantees. Bitcoin isn't like going to Walmart (where a price is the only price you can get), it's like going to an auction house. The miners control whose transactions they include in blocks, and they can do it any way they like, even totally crazy ways that lose them money.

But, you could expect to pay fees of ~50% less than non-Segwit transactions, for a regular transaction where you pay from just one address to one address (with one change address). Why? Sort of complicated, but I can explain if you like.


4) If i upgrade from 2.9.3 to 3.0 will i have old addresses or it will swipe them?

No. Old addresses can exist alongside Segwit addresses in the same wallet.

If you're nervous about this, just use a new wallet for all Segwit transactions. But Electrum's approach to wallet specs is flexible enough to allow it, and also the standard way of doing it, it has alot of fail safety built into the design. It should be fine (Disclaimer: I don't use Electrum wallet)


Title: Re: Difference between SegWit addresses
Post by: DannyHamilton on November 03, 2017, 01:19:20 PM
So the number of possible addresses is reduced using bech32?

No.

The old P2PKH addresses that started with a 1 were typically 34 characters long.

The new bech32 addresses are typically 42 characters long.

Also...

The first character of the old addresses indicated the address type, and the last 6 characters were part of the checksum, leaving approximately 27 characters of base58 key hash data. This leaves enough room for more than:
1.46 × 1048 possible addresses


With a bech32 P2WPKH address, the first 3 characters indicate the address type, and the last 6 characters are the checksum, leaving 33 characters of base32 key hash data.  This leaves enough room for more than:
1.46 × 1048 possible addresses

Since the public key hash is only a 160 bit value, there are only 1.46 × 1048 possible addresses.  Therefore, BOTH address formats have enough room for ALL possible currently valid addresses.


Title: Re: Difference between SegWit addresses
Post by: Carlton Banks on November 03, 2017, 01:37:45 PM
The public key hash for a bech32 address can also be a 256 bit value, but only for P2WSH addresses. These will have a larger number of possible addresses.


Title: Re: Difference between SegWit addresses
Post by: DannyHamilton on November 03, 2017, 01:42:34 PM
The public key hash for a bech32 address can also be a 256 bit value, but only for P2WSH addresses. These will have a larger number of possible addresses.

Correct.  bech32 P2WSH addresses are about 20 characters longer than bech32 P2WPKH addresses.


Title: Re: Difference between SegWit addresses
Post by: The One on November 03, 2017, 01:48:41 PM
So the number of possible addresses is reduced using bech32?

No.

The old P2PKH addresses that started with a 1 were typically 34 characters long.

The new bech32 addresses are typically 42 characters long.

Also...

The first character of the old addresses indicated the address type, and the last 6 characters were part of the checksum, leaving approximately 27 characters of base58 key hash data. This leaves enough room for more than:
1.46 × 1048 possible addresses


With a bech32 P2WPKH address, the first 3 characters indicate the address type, and the last 6 characters are the checksum, leaving 33 characters of base32 key hash data.  This leaves enough room for more than:
1.46 × 1048 possible addresses

Since the public key hash is only a 160 bit value, there are only 1.46 × 1048 possible addresses.  Therefore, BOTH address formats have enough room for ALL possible currently valid addresses.

Cheers.

Is the sensitivity of case really important? I'm sure most people use their mouse to copy and paste the address.


Title: Re: Difference between SegWit addresses
Post by: Carlton Banks on November 03, 2017, 02:08:45 PM
Is the sensitivity of case really important? I'm sure most people use their mouse to copy and paste the address.

In situations where people don't copy and paste, it helps to reduce the chance of errors.


Title: Re: Difference between SegWit addresses
Post by: DannyHamilton on November 03, 2017, 02:34:28 PM
Is the sensitivity of case really important? I'm sure most people use their mouse to copy and paste the address.
In situations where people don't copy and paste, it helps to reduce the chance of errors.

base32 was chosen for improved error checking possibilities.  The fact that base32 can be represented with single case characters is just an added benefit for those situations where the user might need to write it down or tell it to someone else.  Another added benefit is that it also makes it possible to use smaller QR Codes (or the same size QR Code with increased redundancy).


Title: Re: Difference between SegWit addresses
Post by: achow101 on November 03, 2017, 02:36:46 PM
Is the sensitivity of case really important? I'm sure most people use their mouse to copy and paste the address.

In situations where people don't copy and paste, it helps to reduce the chance of errors.
Not only that, but the bech32 addresses use BCH codes (well BCH-like codes) which are an error correcting code. Bech32 addresses can detect up to 4 errors when entering the address and tell you where those errors are. They can also correct up to 2 errors (IIRC) but no wallet will actually do error correction for you because that is a good way to accidentally send money elsewhere.


Title: Re: Difference between SegWit addresses
Post by: Stedsm on November 03, 2017, 03:10:28 PM
Electrum 3.0 is out and the addresses are starting with bc1 apparently. I have a hardware wallet in the other hand where SegWit is supported too but the addresses are starting with 3 instead. What are the differences and are they compatible between each other (including the old addresses). Could I receive/send without having to worry?

Didn't try but I could say that there are many persons in my contact who are using the same type of addresses that start with 3.
Initially, I thought that they are multisig addresses and I asked them whether it is or not, but they didn't tell me anything except that they are using the same address for every transaction and not facing any problems using the same and it's not including mixed transactions just like we see in exchange addresses. Even I would like to know if such addresses are multisig or not?


Title: Re: Difference between SegWit addresses
Post by: jnano on November 03, 2017, 03:19:50 PM
When is Core expected to add GUI support for these?


Title: Re: Difference between SegWit addresses
Post by: Spendulus on November 03, 2017, 03:52:40 PM
Electrum 3.0 is out and the addresses are starting with bc1 apparently. I have a hardware wallet in the other hand where SegWit is supported too but the addresses are starting with 3 instead. What are the differences and are they compatible between each other (including the old addresses). Could I receive/send without having to worry?

Didn't try but I could say that there are many persons in my contact who are using the same type of addresses that start with 3.
Initially, I thought that they are multisig addresses and I asked them whether it is or not, but they didn't tell me anything except that they are using the same address for every transaction and not facing any problems using the same and it's not including mixed transactions just like we see in exchange addresses. Even I would like to know if such addresses are multisig or not?

https://en.bitcoin.it/wiki/List_of_address_prefixes

"3" is a script hash prefix. If I recall correctly encrypted paper wallets address must start with a "3" in addition to the multisig starting with a "3".


Title: Re: Difference between SegWit addresses
Post by: Carlton Banks on November 03, 2017, 04:14:03 PM
Is the sensitivity of case really important? I'm sure most people use their mouse to copy and paste the address.

In situations where people don't copy and paste, it helps to reduce the chance of errors.
Not only that, but the bech32 addresses use BCH codes (well BCH-like codes) which are an error correcting code. Bech32 addresses can detect up to 4 errors when entering the address and tell you where those errors are. They can also correct up to 2 errors (IIRC) but no wallet will actually do error correction for you because that is a good way to accidentally send money elsewhere.

Ah, interesting. Sounds familiar, I read the BIP173 text pretty quickly ;D

So there is no error correction whatsoever in Satoshi-era types like P2PKH and P2SH? (or even the original type P2PK?)


When is Core expected to add GUI support for these?


Upcoming 0.15.1 (which may or may not include waiting for 0.15.0.2 first, achow101 might tell us more)

Edit: Segwit GUI in Bitcoin Core will now be in 0.15.2, 0.15.1 will be bugfixes and backports

02/12/2018 Edit: Segwit wallets will be in the Bitcoin Core 0.16.0 release, very soon


Title: Re: Difference between SegWit addresses
Post by: DannyHamilton on November 03, 2017, 04:27:27 PM
So there is no error correction whatsoever in Satoshi-era types like P2PKH and P2SH? (or even the original type P2PK?)

It was possible to detect with reasonable reliability if the address was invalid (one or more errors).

However, it was not possible to easily identify the specific character or characters that were erroneous, nor was it possible to correct those errors for the user.


Title: Re: Difference between SegWit addresses
Post by: Thekool1s on November 03, 2017, 04:28:57 PM
Thank you Carlton for the detailed answer, i will look into it further. :)


Title: Re: Difference between SegWit addresses
Post by: jnano on November 05, 2017, 02:49:25 AM
Upcoming 0.15.1 (which may or may not include waiting for 0.15.0.2 first, achow101 might tell us more)

Edit: Segwit GUI in Bitcoin Core will now be in 0.15.2, 0.15.1 will be bugfixes and backports
Thanks. How do you find this sort of info?




Title: Re: Difference between SegWit addresses
Post by: cpfreeplz on November 05, 2017, 02:53:34 AM
The public key hash for a bech32 address can also be a 256 bit value, but only for P2WSH addresses. These will have a larger number of possible addresses.

Correct.  bech32 P2WSH addresses are about 20 characters longer than bech32 P2WPKH addresses.

That's actually pretty great! I have been trying to read up on this but it's pretty confusing for us non technical folks. I'll wrap my head around it one of these days. Once I do I'll start to try and use the bech32 addresses just to get used to them and go from there.


Title: Re: Difference between SegWit addresses
Post by: TheLive1 on November 16, 2017, 08:25:25 AM
No. Old addresses can exist alongside Segwit addresses in the same wallet.
dard way of doing it, it has alot of fail safety built into the design. It should be fine (Disclaimer: I don't use Electrum wallet)

Thanks for all the info. Very informative.
I installed electrum 3, and have now moved some to a new Bech32 (bc1?) address, how can I generate new address in the same electrum 3 wallet but w/ the old standard format? I want to send some over to the same wallet but can't because unsupported by it.
I've sort of looked around and dont see it.

Edit---
Just thought of it, would this be just sweeping private keys from wallet?


Title: Re: Difference between SegWit addresses
Post by: Boussac on November 17, 2017, 06:48:19 AM
For those interested in creating segwit outputs, I just posted a ruby script for building a P2SH-P2WPKH address and spending from it, as a gist:
https://gist.github.com/pierrenoizat/f082d62d49e49f81978b97ad5900789a (https://gist.github.com/pierrenoizat/f082d62d49e49f81978b97ad5900789a)


Title: Re: Difference between SegWit addresses
Post by: OmegaStarScream on November 17, 2017, 09:40:28 AM
For those interested in creating segwit outputs, I just posted a ruby script for building a P2SH-P2WPKH address and spending from it, as a gist:
https://gist.github.com/pierrenoizat/f082d62d49e49f81978b97ad5900789a (https://gist.github.com/pierrenoizat/f082d62d49e49f81978b97ad5900789a)

I'm not really familiar with Ruby but is it that easy to modify this to get the ability to generate SegWit vanity addresses?


Title: Re: Difference between SegWit addresses
Post by: Boussac on November 17, 2017, 09:40:33 PM
For those interested in creating segwit outputs, I just posted a ruby script for building a P2SH-P2WPKH address and spending from it, as a gist:
https://gist.github.com/pierrenoizat/f082d62d49e49f81978b97ad5900789a (https://gist.github.com/pierrenoizat/f082d62d49e49f81978b97ad5900789a)

I'm not really familiar with Ruby but is it that easy to modify this to get the ability to generate SegWit vanity addresses?


It's easy to loop through the calculation of the address until you match some vanity string but bear in mind it's only a BIP16 P2SH -looking address.
Only the creator of the address would know it's a segwit output until it is spent.

You may want to create a native BIP173 P2WPKH segwit address to make it obvious it's a segwit output from the start.
However BIP173 is only a draft afaik even if it is already supported by Electrum.


Title: Re: Difference between SegWit addresses
Post by: UGADawg on December 30, 2017, 06:17:02 AM
so I created a new Segwit wallet with Electrum and the address start with "bc1"... since it's not widespread yet, can anyone recommend a Windows desktop (or Android) wallet who's addresses start with a "3" (since its kinda backward compatible?)


Title: Re: Difference between SegWit addresses
Post by: OmegaStarScream on December 30, 2017, 12:59:04 PM
so I created a new Segwit wallet with Electrum and the address start with "bc1"... since it's not widespread yet, can anyone recommend a Windows desktop (or Android) wallet who's addresses start with a "3" (since its kinda backward compatible?)

Samourai wallet is the best option to go. You can generate both normal and SegWit (with '3') addresses for receiving and you can also send to Bech32 addresses (bc1) or, you have Trezor too (If you want to invest in a hardware wallet).


Title: Re: Difference between SegWit addresses
Post by: jnano on December 30, 2017, 03:39:19 PM
Apparently, Electrum on purpose doesn't want to support 3-prefix P2SH SegWit addresses:
https://github.com/spesmilo/electrum/issues/3460


Title: Re: Difference between SegWit addresses
Post by: lionelho on December 31, 2017, 03:30:55 AM
1) What are these Segwit Addresses?
  • There are 2 different Segwit address formats. They are P2SH (starting with a "3") and bech32 (starting "bc1")
  • P2SH can be sent to by people using older Bitcoin software with no Segwit support. This supports backwards compatibility
  • People sending from newer Bitcoin software that have Segwit and bech32 can send to the new address type that starts "bc1"
  • People sending from newer Bitcoin software that have no Segwit probably cannot send to the new address type that starts "bc1"

So, if people send you BTC from old software, give them the Segwit addresses that start with "3". If people send you BTC using new Segwit Bitcoin software, give them the Segwit addresses that start with "bc1".

If you don't know if someone has the newer bech32 software or not, there's no need to worry, their software will simply refuse to send the transaction, so no harm can be done.


2) How are these different from normal Addresses?

  • You won't get the Segwit fee reduction unless you spend from one of these addresses
  • The addresses starting "3" are normal addresses. They already exist in the Bitcoin blockchain now. The difference is that the Bitcoin script permits a wide variety of options, in this case, using Segwit in a way that old Bitcoin software can handle (obviously old software has no clue what Segwit is, it didn't exist back then, this method works around that)
  • The addresses starting "bc1" are not normal addresses. They are brand new, and only work with Segwit
  • With addresses starting "bc1", it doesn't matter if you USE UPPER CASE. or if you use lower case. bc1bech32segwitaddressescanbeupperorlowercase is the same address as BC1BECH32SEGWITADDRESSESCANBEUPPERORLOWERCASE, neither your wallet software or the blockchain will care


3) How are the fees low compared to other addresses?

There are no guarantees. Bitcoin isn't like going to Walmart (where a price is the only price you can get), it's like going to an auction house. The miners control whose transactions they include in blocks, and they can do it any way they like, even totally crazy ways that lose them money.

But, you could expect to pay fees of ~50% less than non-Segwit transactions, for a regular transaction where you pay from just one address to one address (with one change address). Why? Sort of complicated, but I can explain if you like.


4) If i upgrade from 2.9.3 to 3.0 will i have old addresses or it will swipe them?

No. Old addresses can exist alongside Segwit addresses in the same wallet.

If you're nervous about this, just use a new wallet for all Segwit transactions. But Electrum's approach to wallet specs is flexible enough to allow it, and also the standard way of doing it, it has alot of fail safety built into the design. It should be fine (Disclaimer: I don't use Electrum wallet)
That's really clear and helpful. Your explanation is awesome.


Title: Re: Difference between SegWit addresses
Post by: tubainaman on February 10, 2018, 06:23:27 PM
Can I send bitcoins from a standard wallet (starting with 1, i.e: 1dr4Jindendl....) to a SegWith address starting with bc1?

If yes, can I do it on electrum?


Title: Re: Difference between SegWit addresses
Post by: achow101 on February 10, 2018, 07:03:15 PM
Can I send bitcoins from a standard wallet (starting with 1, i.e: 1dr4Jindendl....) to a SegWith address starting with bc1?
Yes.

If yes, can I do it on electrum?
Yes.


Title: Re: Difference between SegWit addresses
Post by: tubainaman on February 10, 2018, 07:28:31 PM
Can I send bitcoins from a standard wallet (starting with 1, i.e: 1dr4Jindendl....) to a SegWith address starting with bc1?
Yes.

If yes, can I do it on electrum?
Yes.

Thanks.


Title: Re: Difference between SegWit addresses
Post by: FrueGreads on February 11, 2018, 12:43:56 PM
I also have a question regrading segwit. Although I keep my "old" wallet with non segwit address, I've also created a new one that has native segwit addresses (the bech32 P2WPKH type, so addresses starting with bc1). I was aware that I would probably not be able to send or receive from non segwit addresses, but I decided to go for this option anyway, since I heard they are more efficient, so I preferred them over the "transitional" P2SH addresses.

My question is, will I be able to send/receive coins between my bech32 P2WPKH, and the P2SH addresses?

The thing is that segwit adoption is taking a lot of time, so I'm afraid that the "transitional" P2SH addresses get more "popular", and it will take a while for me to be able to really use my bech32 P2WPKH addresses.


Title: Re: Difference between SegWit addresses
Post by: bob123 on February 11, 2018, 01:46:57 PM
I was aware that I would probably not be able to send or receive from non segwit addresses, but I decided to go for this option anyway, since I heard they are more efficient, so I preferred them over the "transitional" P2SH addresses.

My question is, will I be able to send/receive coins between my bech32 P2WPKH, and the P2SH addresses?
The thing is that segwit adoption is taking a lot of time, so I'm afraid that the "transitional" P2SH addresses get more "popular", and it will take a while for me to be able to really use my bech32 P2WPKH addresses.

Bech32-type addresses are more efficient, yes.
But you don't have any problems with sending/receiving to/from any address.
You can send/receive to/from any address you wish. Everything will work as before.

The problem with the slow adoption is that some wallets/exchanges/service provider won't allow you to enter a BTC address starting with bc1..
simply because they have a check-function to make sure you enter a "valid" btc address.
And as soon they check your address is neither starting with 1.. nor with 3.. they will give you an "wrong format" error.

This is just a problem of the exchanges/wallets/...
This has nothing to do with bitcoin/segwit itself.




Title: Re: Difference between SegWit addresses
Post by: FrueGreads on February 11, 2018, 03:02:07 PM
Bech32-type addresses are more efficient, yes.
But you don't have any problems with sending/receiving to/from any address.
You can send/receive to/from any address you wish. Everything will work as before.

The problem with the slow adoption is that some wallets/exchanges/service provider won't allow you to enter a BTC address starting with bc1..
simply because they have a check-function to make sure you enter a "valid" btc address.
And as soon they check your address is neither starting with 1.. nor with 3.. they will give you an "wrong format" error.

This is just a problem of the exchanges/wallets/...
This has nothing to do with bitcoin/segwit itself.

Ok, I got it. I thought that was strange as well, since segwit came out of a soft fork, so I actually expected that the "old addresses" would still be compatible with the segwit ones, but I then heard things about those compatibility issues, and I wasn't fully understanding them. So it's all software related, so we just need to wait for wallets to be updated. I heard that the new version of Bitcoin Core wallet due to complete by May 1, should help solving these "problems".


Title: Re: Difference between SegWit addresses
Post by: Carlton Banks on February 11, 2018, 04:02:28 PM
Ok, I got it. I thought that was strange as well, since segwit came out of a soft fork, so I actually expected that the "old addresses" would still be compatible with the segwit ones, but I then heard things about those compatibility issues, and I wasn't fully understanding them.

Nested Segwit (starting 3) will work anywhere, all wallet software understands it. It's only the bc1 addresses that won't work backwards compatibly, and that's kind of irrelevant seeing as there aren't many wallets that use bc1 addresses. So it's all software related, so we just need to wait for wallets to be updated.

Best advice is to use nested 3-starting addresses for Segwit now, because they're completely backwards compatible for all services and wallets. So there's no need to wait for others to wait to update, you can use Segwit now backwards compatibly.


I heard that the new version of Bitcoin Core wallet due to complete by May 1, should help solving these "problems".

No, Bitcoin Core 0.16 will be available something like next week, I would guess. It's the Segwit wallet release, and has been expedited a little.


Title: Re: Difference between SegWit addresses
Post by: bob123 on February 11, 2018, 06:57:19 PM
It's only the bc1 addresses that won't work backwards compatibly, and that's kind of irrelevant seeing as there aren't many wallets that use bc1 addresses.

Best advice is to use nested 3-starting addresses for Segwit now, because they're completely backwards compatible for all services and wallets. So there's no need to wait for others to wait to update, you can use Segwit now backwards compatibly.

You seem to confuse the meaning of backwards compatibility.
Bech32 addresses are backwards compatible.
This means:
- Transactions between legacy and bech32 addresses are compatible.
- "Old" nodes do "understand" those transactions from/to bech32 addresses
- There aren't any (network-)problems with bech32.

Wallets/Exchanges/Online service provider not accepting bech32 yet is due to not upgraded software (non-network related).
This has nothing to do with backwards compatibility. They just didn't update the software to accept those addresses.




Title: Re: Difference between SegWit addresses
Post by: patt0 on February 11, 2018, 08:55:22 PM

Wallets/Exchanges/Online service provider not accepting bech32 yet is due to not upgraded software (non-network related).
This has nothing to do with backwards compatibility. They just didn't update the software to accept those addresses.


Are there any known reasons for the time it's taking for wallets to update their software in order prevent all these problems and confusions related to segwit? I was considering updating to segwit as well, but I'm delaying this step because I would like to use electrum, and from what I've read they use the bech32 addresses, but they seem to be the only ones doing it (maybe there are more, but definitely not the majority).

I heard that coinbase, an exchange that I use when I need to cash out some coins, is finally going to update to segwit. I have no idea what type of addresses they will be using. But since they are updating to segwit, does this mean that even if they use the P2SH I will be able to make transfer to them if I use the bech32 addresses from electrum?


Title: Re: Difference between SegWit addresses
Post by: Carlton Banks on February 11, 2018, 09:35:42 PM
It's only the bc1 addresses that won't work backwards compatibly, and that's kind of irrelevant seeing as there aren't many wallets that use bc1 addresses.

Best advice is to use nested 3-starting addresses for Segwit now, because they're completely backwards compatible for all services and wallets. So there's no need to wait for others to wait to update, you can use Segwit now backwards compatibly.

You seem to confuse the meaning of backwards compatibility.
Bech32 addresses are backwards compatible.
This means:
- Transactions between legacy and bech32 addresses are compatible.
- "Old" nodes do "understand" those transactions from/to bech32 addresses
- There aren't any (network-)problems with bech32.

Wallets/Exchanges/Online service provider not accepting bech32 yet is due to not upgraded software (non-network related).
This has nothing to do with backwards compatibility. They just didn't update the software to accept those addresses.

Older software will refuse to send to bc1 addresses, as a basic error-checking measure.


I heard that coinbase, an exchange that I use when I need to cash out some coins, is finally going to update to segwit. I have no idea what type of addresses they will be using. But since they are updating to segwit, does this mean that even if they use the P2SH I will be able to make transfer to them if I use the bech32 addresses from electrum?

You can send from P2SH segwit or bech32/bc1 addresses now. It's sending to segwit addresses from non-upgraded exchanges that's the issue.


Title: Re: Difference between SegWit addresses
Post by: bob123 on February 12, 2018, 07:22:39 PM
You can send from P2SH segwit or bech32/bc1 addresses now. It's sending to segwit addresses from non-upgraded exchanges that's the issue.

Thats basically exactly what i've said.



But since they are updating to segwit, does this mean that even if they use the P2SH I will be able to make transfer to them if I use the bech32 addresses from electrum?

You will always be able to send to any address from your bech32-type-address.
You will also always be able to receive funds to your bech32 address.

There only a problem occurs when you have to enter your btc-address anywhere to receive funds. Most websites/wallets hasn't been updated to regard bc1.. addresses as bitcoin addresses.
Network-wise everything is fine. Its just the websites/wallets software which needs an update.


Title: Re: Difference between SegWit addresses
Post by: utdrmac on February 21, 2018, 04:22:14 AM
I keep seeing things like "SegWit addresses are lower tx fees". Can someone explain why/how that is? Why does sending BTC to address A (old style) vs address B (SegWit style) incur higher tx fees? Aren't both transactions going on to the same blockchain and being processed by the same miners to be added to the same block?


Title: Re: Difference between SegWit addresses
Post by: Xynerise on February 21, 2018, 05:33:19 AM
I keep seeing things like "SegWit addresses are lower tx fees". Can someone explain why/how that is?
For you to understand that you need to understand how bitcoin transactions and fees work.
Bitcoin transactions are just inputs and outputs. Whenever you make a bitcoin transaction you reference old unspent outputs which form your inputs and create new outputs for the recepient to spend.
Bitcoin transaction fees are denominated in satoshis per byte, which is the size of the transaction in bytes.
In a transaction inputs make up most of the transaction: in a standard transaction with one input and 2 outputs inputs take up about 65% of the transaction, and in the input the signature takes up 60% of the space.
So to recap so far in a bitcoin transaction we have inputs and outputs: inputs reference where the bitcoin is coming from, and outputs state where they're going to.
Inputs have ~70% of a transaction, and signatures in inputs take up ~60% of the input.
Signatures are only needed for validation yet they take up most of the space and you can't remove signatures because they are needed to prove said person has permission to move the bitcoin, but you can move them elsewhere, which is what segwit does.
It moves the signature to "witness" portion which doesn't count in transaction size so the transaction size becomes smaller and thus the fees are smaller.


 
Quote
Why does sending BTC to address A (old style) vs address B (SegWit style) incur higher tx fees?
Sending TO a segwit (P2PWKH-P2SH or Bech32) address or a legacy address (P2PKH or P2SH) has nothing to do with transaction fees.
Like I said above its the inputs that dictate the size of the transaction so no matter the type of address you're sending TO, it won't affect the size of the transaction and hence the fees.

However sending "FROM" a segwit address incurs less fees because transactions are smaller.



Title: Re: Difference between SegWit addresses
Post by: utdrmac on February 21, 2018, 03:11:01 PM
Awesome answer! Thanks! Had no idea inputs & signatures took up 70% of the transaction.


Title: Re: Difference between SegWit addresses
Post by: bitmover on February 21, 2018, 06:33:46 PM
Recently I discovered that you cannot sign messages in SegWit address...
Technically you can sign, but it cannot be verified.

Some wallets, like ledger, let you sign. But they will sign with a Legacy address, even if you are using a SegWit wallet. Really weird.

I even started a discussion about this
https://bitcointalk.org/index.php?topic=2885058

For me this is a serious matter because I will lose many airdrops =/


Title: Re: Difference between SegWit addresses
Post by: Xynerise on February 21, 2018, 06:37:35 PM
Recently I discovered that you cannot sign messages in SegWit address...
Technically you can sign, but it cannot be verified.

I even started a discussion about this
https://bitcointalk.org/index.php?topic=2885058

For me this is a serious matter because I will lose many airdrops =/
They are working on it.
There is already a draft BIP foto a standard for message signing
 - https://github.com/brianddk/bips/blob/legacysignverify/bip-0xyz.mediawiki


Title: Re: Difference between SegWit addresses
Post by: bitmover on February 21, 2018, 06:47:08 PM
They are working on it.
There is already a draft BIP foto a standard for message signing
 - https://github.com/brianddk/bips/blob/legacysignverify/bip-0xyz.mediawiki

Yeah, I learned about that, so I decided to keep my segwit wallet... i hope they solve this soon!
Anyway, it´s important that people know about this limitation before creating a segwit wallet and transfer their funds.


Title: Re: Difference between SegWit addresses
Post by: Rath_ on February 21, 2018, 06:49:15 PM
Recently I discovered that you cannot sign messages in SegWit address...
Technically you can sign, but it cannot be verified.

Some wallets, like ledger, let you sign. But they will sign with a Legacy address, even if you are using a SegWit wallet. Really weird.

I even started a discussion about this
https://bitcointalk.org/index.php?topic=2885058

For me this is a serious matter because I will lose many airdrops =/

As far as I know, the only wallets that support signing messages with a SegWit address are Trezor (beta wallet) and Electrum. I have already tried many websites which were supposed to verify the message and unfortunately, all failed. I only managed to verify messages signed with a SegWit address using Electrum but I don't have my Trezor yet to test whether or not there are any problems or differences between them. It looks like many people will be confused while verifying messages unless someone creates a standard which could be implemented everywhere.


Title: Re: Difference between SegWit addresses
Post by: classicsucks on March 07, 2018, 01:43:24 AM
Recently I discovered that you cannot sign messages in SegWit address...
Technically you can sign, but it cannot be verified.

Some wallets, like ledger, let you sign. But they will sign with a Legacy address, even if you are using a SegWit wallet. Really weird.

I even started a discussion about this
https://bitcointalk.org/index.php?topic=2885058

For me this is a serious matter because I will lose many airdrops =/

Jesus. Just another reason to stay off of Segwit.

If this is correct, 25% of all BTC that has circulated since the Segwit fork don't exist on the new BTC forks. Honestly, I suppose this would increase the scarcity and thus the value or forked coins. But anyone using Segwit is screwed out of their shares!



Title: Re: Difference between SegWit addresses
Post by: HCP on March 07, 2018, 04:58:37 AM
Jesus. Just another reason to stay off of Segwit.

If this is correct, 25% of all BTC that has circulated since the Segwit fork don't exist on the new BTC forks. Honestly, I suppose this would increase the scarcity and thus the value or forked coins. But anyone using Segwit is screwed out of their shares!
Oh no... screwed out of $10 worth of ShitCoin™ that I can't even sell because no reputable exchange has it listed... ::)

In any case, if the fork happens to support SegWit (which several have)... you are not in any danger of missing out... The post that you quoted was referring to "airdrops" that require you to sign messages from a bitcoin address.


As far as I know, the only wallets that support signing messages with a SegWit address are Trezor (beta wallet) and Electrum. I have already tried many websites which were supposed to verify the message and unfortunately, all failed. I only managed to verify messages signed with a SegWit address using Electrum but I don't have my Trezor yet to test whether or not there are any problems or differences between them. It looks like many people will be confused while verifying messages unless someone creates a standard which could be implemented everywhere.
I just tried to sign a test message with both Electrum and with Trezor (same address, same message)... Electrum generated a signature as:
Quote
IGUjYV7hZ6ZZeKrW/glIUKTeFOpCYnKmMTXjXG38oROWIlbCaoam/o8OzDlzoHuddj4UDvSjfYllDVE0KQ4i8Hk=

However, Trezor generated the signature as:
Quote
JGUjYV7hZ6ZZeKrW/glIUKTeFOpCYnKmMTXjXG38oROWIlbCaoam/o8OzDlzoHuddj4UDvSjfYllDVE0KQ4i8Hk=

1 letter different... otherwise, the signatures were identical!!?! ???  Obviously, the two wallets are unable to properly verify the message from the other due to the difference in the signatures.

This issue on the Electrum github (https://github.com/spesmilo/electrum/issues/3861) shows the current state of affairs... basically, no consensus... but it is being worked on.


Title: Re: Difference between SegWit addresses
Post by: Kakmakr on March 07, 2018, 06:34:57 AM
Recently I discovered that you cannot sign messages in SegWit address...
Technically you can sign, but it cannot be verified.

Some wallets, like ledger, let you sign. But they will sign with a Legacy address, even if you are using a SegWit wallet. Really weird.

I even started a discussion about this
https://bitcointalk.org/index.php?topic=2885058

For me this is a serious matter because I will lose many airdrops =/

Jesus. Just another reason to stay off of Segwit.

If this is correct, 25% of all BTC that has circulated since the Segwit fork don't exist on the new BTC forks. Honestly, I suppose this would increase the scarcity and thus the value or forked coins. But anyone using Segwit is screwed out of their shares!



This is wrong. SegWit addresses can be signed. The problem come in with different wallet providers that are using different formats of SegWit and tools to verify the signatures. Example : A few days ago, I signed an address with my Ledger and they use Nested Segwit (starting with 3).

The other person used a tool provided by Brainwallet that verify bech32 addresses (starting with bc1) and he could not verify that.

This is causing a lot of confusion and frustration, but hopefully things will sort themselves out as adoption of the technology increase and some kind of standard are chosen or more tools with more formats are developed.


Title: Re: Difference between SegWit addresses
Post by: bitmover on March 07, 2018, 10:18:46 AM
Recently I discovered that you cannot sign messages in SegWit address...
Technically you can sign, but it cannot be verified.

Some wallets, like ledger, let you sign. But they will sign with a Legacy address, even if you are using a SegWit wallet. Really weird.

I even started a discussion about this
https://bitcointalk.org/index.php?topic=2885058

For me this is a serious matter because I will lose many airdrops =/

Jesus. Just another reason to stay off of Segwit.

If this is correct, 25% of all BTC that has circulated since the Segwit fork don't exist on the new BTC forks. Honestly, I suppose this would increase the scarcity and thus the value or forked coins. But anyone using Segwit is screwed out of their shares!



This is wrong. SegWit addresses can be signed. The problem come in with different wallet providers that are using different formats of SegWit and tools to verify the signatures. Example : A few days ago, I signed an address with my Ledger and they use Nested Segwit (starting with 3).

The other person used a tool provided by Brainwallet that verify bech32 addresses (starting with bc1) and he could not verify that.

This is causing a lot of confusion and frustration, but hopefully things will sort themselves out as adoption of the technology increase and some kind of standard are chosen or more tools with more formats are developed.

Hello.
The problem is that those signatures and verifications are nonstandard. Core can't verify.

In ledger nano case if you look closely you will notice that the signature you made was done not by your segwit address, but for it's legacy counterpart.

If you look closely you will find that legacy address and that signature (made by the segwit) will be verified on brainwallet with that Legacy.

This is an known issue, and not ledger fault, but lack of standard.


Title: Re: Difference between SegWit addresses
Post by: classicsucks on March 08, 2018, 06:23:49 PM
Jesus. Just another reason to stay off of Segwit.

If this is correct, 25% of all BTC that has circulated since the Segwit fork don't exist on the new BTC forks. Honestly, I suppose this would increase the scarcity and thus the value or forked coins. But anyone using Segwit is screwed out of their shares!
Oh no... screwed out of $10 worth of ShitCoin™ that I can't even sell because no reputable exchange has it listed... ::)

In any case, if the fork happens to support SegWit (which several have)... you are not in any danger of missing out... The post that you quoted was referring to "airdrops" that require you to sign messages from a bitcoin address.


Yeah well I just sold another $250 worth of airdrop to some simp, but you should go ahead and keep pumping all of your BTC to those Segwit addresses... you're getting me a better price!


Title: Re: Difference between SegWit addresses
Post by: Xynerise on March 10, 2018, 10:46:43 AM
I keep seeing things like "SegWit addresses are lower tx fees". Can someone explain why/how that is? Why does sending BTC to address A (old style) vs address B (SegWit style) incur higher tx fees? Aren't both transactions going on to the same blockchain and being processed by the same miners to be added to the same block?
I've explained it before on this thread.
Check this link: https://bitcointalk.org/index.php?topic=2347427.msg30732685#msg30732685


Title: Re: Difference between SegWit addresses
Post by: bob123 on March 10, 2018, 11:30:09 AM
I keep seeing things like "SegWit addresses are lower tx fees". Can someone explain why/how that is?

SegWit transactions are smaller in size. SegWit basically 'removes redundant data' from the transactions.
This makes them smaller in size -> lower fees to pay (with same fee rate (sat/B)).



Why does sending BTC to address A (old style) vs address B (SegWit style) incur higher tx fees?

It doesn't.
Its sending FROM SegWit which leads transactions to be smaller in size. The output of the TX (which address type) doesn't matter.



Aren't both transactions going on to the same blockchain and being processed by the same miners to be added to the same block?

They are. Its the size which matters.
Even though the sat/B rate is the same you will pay lower fees in total because of the smaller size.


Title: Re: Difference between SegWit addresses
Post by: Carlton Banks on March 11, 2018, 02:11:38 PM
I keep seeing things like "SegWit addresses are lower tx fees". Can someone explain why/how that is?

SegWit transactions are smaller in size. SegWit basically 'removes redundant data' from the transactions.
This makes them smaller in size -> lower fees to pay (with same fee rate (sat/B)).

Not really.

Segwit transactions are either 10% smaller (native bc1 type addresses) or 15% larger (nested P2SH addresses for backward compatibility). Assuming everyone used bc1 addresess for payments, a 10% improvement in space efficiency couldn't increase blocks from 1MB max to the 2.2MB blocks that Segwit has thus far made possible.


What makes the difference is the re-structuring of transaction data within the Segwit blocks the network now uses. Signatures have been changed in a way that prevents a specific Denial of Service attack (a sighash based attack). This change was deemed by the designers of Segwit to allow blocks of up to 4MB to be safely accepted on the Bitcoin network. As part of the Segwit changes, transaction data & their signatures are priced separately, whereas they were both priced together before Segwit. Signature data is discounted, and that's why Segwit transactions are cheaper.


Title: Re: Difference between SegWit addresses
Post by: qwerty10111 on March 13, 2018, 03:11:41 AM
Hi there, recently I found this website:

https://segwitchecker.com

Hope this might be helpful for you, guys.


Title: Re: Difference between SegWit addresses
Post by: Xynerise on March 13, 2018, 05:40:05 AM
Hi there, recently I found this website:

https://segwitchecker.com

Hope this might be helpful for you, guys.
For most Bitcoin addresses their difference is cosmetic: P2PKH (addresses that start with 1) are definitely not Segwit addresses; P2PWPKH addresses (Bech 32 addresses, that start with bc1) are obviously segwit addresses.
The only confusion is in P2SH addresses (those that start with 3), they could be normal P2SH addresses (multisig, usually), or P2WPKH wrapped in P2SH (Segwit addresses).
However the only way to distinguish between them is only when the UTXO is spent, and the redeem script exposed.
Until then it is impossible to distinguish between them.


Title: Re: Difference between SegWit addresses
Post by: BanishedDemon on June 26, 2018, 08:07:11 PM
I keep seeing things like "SegWit addresses are lower tx fees". Can someone explain why/how that is? Why does sending BTC to address A (old style) vs address B (SegWit style) incur higher tx fees? Aren't both transactions going on to the same blockchain and being processed by the same miners to be added to the same block?


Allow us to do a brief contrast to see how an awful lot rate you can save through the usage of segwit pockets. For everyday bitcoin transactions, the concern depends on price/(tx length). For segwit, a brand new concept called weight become introduced, so what topics now could be fee / (digital size) .

http://i63.tinypic.com/2qx553q.jpg

The above shows the digital length of various sorts of bitcoin transaction. i have referred to usually used one entry, two output transactions for numerous types. right here are the transaction ids for reference — regular, Segwit in P2SH, native Segwit. As you may see you can get a cool 38% discount the usage of native segwit !! using segwit wallets in truth has a two effect:

   -You keep on transaction fees
   -You transaction is smaller taking less space. This allows greater transactions to get into blocks. This reduces mempool congestion and decreases the common transaction price,    because you are now competing with less unconfirmed tx to get into blocks.


Title: Re: Difference between SegWit addresses
Post by: cfbtcman on August 06, 2019, 12:16:12 AM
Hy guys,

I hope you give me some help, i was reading this posts but i still with doubts!

Im thinking about trying Segwit Addresses because we pay less fee and is suposed to be the future but im confused.

I noticed there is 2 types of Segwit addresses starting by bc1, like for example in this webpage:

https://allprivatekeys.com/bitcoin-address-format

SegWit mainnet (P2WPKH address): bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4

and

SegWit mainnet (P2WSH address): bc1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qccfmv3


What are diferences between this 2 and where can i use a online address generator for both?

I can only find for 1st example in this website:

https://segwitaddress.org/bech32/#entropyRef


Title: Re: Difference between SegWit addresses
Post by: achow101 on August 06, 2019, 02:09:48 AM
Hy guys,

I hope you give me some help, i was reading this posts but i still with doubts!

Im thinking about trying Segwit Addresses because we pay less fee and is suposed to be the future but im confused.

I noticed there is 2 types of Segwit addresses starting by bc1, like for example in this webpage:

https://allprivatekeys.com/bitcoin-address-format

SegWit mainnet (P2WPKH address): bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4

and

SegWit mainnet (P2WSH address): bc1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qccfmv3


What are diferences between this 2 and where can i use a online address generator for both?

I can only find for 1st example in this website:

https://segwitaddress.org/bech32/#entropyRef
The first one is for P2WPKH: Pay to witness pubkey hash. This is your standard address type where you have a pubkey and can spend using that pubkey. The second type, P2WSH, is Pay to witness script hash. This is for anything else where you want to have some sort of script, such as multisig.

The distinction between the two types is exactly the same as the distinction between P2PKH and P2SH addresses. P2WPKH is analogous to P2PKH and P2WSH is analogous to P2SH.

Just like traditional P2SH (ignore Segwit wrapped P2SH), you can't just generate a P2WSH address from a private key. You need to have a script which then becomes the P2WSH address.


Title: Re: Difference between SegWit addresses
Post by: baro77 on October 14, 2019, 10:05:19 PM
Hi everybody!

while studying addresses types and locking/unlocking scripts I ended up with an hand-written messy cheatsheet... I've gotten a PDF from it, hope it can helps!

https://medium.com/@baro77/btc-locking-and-unlocking-scripts-cheatsheet-ff6d515447de


Title: Re: Difference between SegWit addresses
Post by: Dabs on October 17, 2019, 02:05:48 PM
So there are only two different SegWit addresses, the first one is called Legacy Compatible, because it will work with all older software and old exchanges that have not updated and old wallets. These begin with the number 3.

As another user has said, you can't tell that it's a Segwit address or a multisig address until a transaction is spent from it, but because it begins with a 3, all older stuff will accept it.

The other address format is called Native SegWit, it uses Bech32, and it starts with bc1q or BC1Q and is not case sensitive.

QR codes with Native Segwit addresses are smaller if you encode them as ALL CAPITALS. Not all exchanges support sending to them.

All wallets don't care where inputs come from, so you can safely spend from SegWit addresses to pay to ancient format addresses that begin with a 3 or a 1.