Henri Cartier (OP)
|
I was reading about different address formats of Bitcoin and I felt many of the Newbies will not know the different address formats of Bitcoin. In fact, even I didn't know that there are multiple address formats we can choose from. There are 3 Bitcoin address formats: - P2PKH or Legacy Address Format
P2PKH Address: Is nothing but Pay-to-Pubkey hash which means pay to the hash of recipient address. If the address is starting with a number "1", for example, "1BVXXXXXXXX", then you are using a P2PKH or Legacy Address, which is the original Bitcoin address format. P2SH address format: These are the addresses which start with "3", for example, "3j9XXXXXXXXXXX". P2SH stands for Pay to script hash which has more functionality than legacy addresses. P2SH script functions are used where multiple digital signatures are required to authorize the transaction. Bech32 Address: This address is completely different from the other 2 addresses. This address starts with "bc1", example: "bc1XXXXXXXXX". It's a native segwit address which is supported by most of the wallets but it is not supported by most of the exchanges. Additional to this, Bitcoin Cash(BCH) supports both Legacy format(addr starting with '1') and Cash Address format which is based on bech32, starting with 'q' or 'bitcoincash:q'. Also, there is a converter tool( https://cashaddr.bitcoincash.org/) to switch between the address formats. It is important to know which wallet and exchanges support which address formats and choose the address which is supported by most of them. Please let me know which all wallets and exchanges support different address formats. Also, I would like to know the type of addresses you are using? Source: https://news.bitcoin.com/everything-you-should-know-about-bitcoin-address-formats/
|
|
|
|
1miau
Legendary
Offline
Activity: 2268
Merit: 7034
Currently not much available - see my websitelink
|
|
August 05, 2019, 12:40:32 PM |
|
P2SH address format: These are the addresses which start with "3", for example, "3j9XXXXXXXXXXX". P2SH stands for Pay to script hash which has more functionality than legacy addresses. P2SH script functions are used where multiple digital signatures are required to authorize the transaction.
And there are also P2SH SegWit addresses (nested SegWit). They are a little bit more expensive than bech32 but still a good choice. But it's a little bit difficult to know if a P2SH address is SegWit or not, you'll only see it when you've sent a transaction, here is a good guide: BTC addresses starting with "3" what are they ? simplified explanation.I've created a short table explaining the most often used formats, originally posted in the German section: Prefix | Name | Format | SegWit? | ________ | ___________________ | _______________________________________________________________________________ _____________________ | ________________________ | 1… | Legacy-Address | P2PKH (pay to public key hash) | no | 3… | nested SegWit-Address | P2WPKH-P2SH (pay to witness public key hash - pay to script hash) / P2WSH-P2SH (pay to witness script hash - pay to script hash) | yes | 3… | Multisignature-Address | P2SH (pay to script hash) | no | bc1q… | native Segwit-Address | P2WPKH-bech32 (pay to witness public key hash) / P2WSH-bech32 (pay to witness script hash) | yes |
I'm using more or less all of them (1.., 3..., bc1q...), but SegWit addresses have advantages because fees are cheaper.
|
|
|
|
bitmover
Legendary
Offline
Activity: 2478
Merit: 6285
bitcoindata.science
|
|
August 06, 2019, 01:39:32 AM |
|
I'm using more or less all of them (1.., 3..., bc1q...), but SegWit addresses have advantages because fees are cheaper.
I was going to ask why you use legacy. But then I remembered that I still use as well, to sign messages. They are still better for that. Only Electrum and maybe a few other software sign messages from segwit address,at least until some time ago. Do you know if bitcoin core can sign messages from segwit addresses? Any solution for this ?
|
|
|
|
pooya87
Legendary
Offline
Activity: 3626
Merit: 10994
Crypto Swap Exchange
|
|
August 06, 2019, 05:11:43 AM |
|
P2PKH Address: Is nothing but Pay-to-Pubkey hash which means pay to the hash of recipient address. ... pay to hash of recipient "public key" not address! P2SH script functions are used where multiple digital signatures are required to authorize the transaction.
P2SH is used when you want to pay to a "script", one of the scripts that we use in bitcoin is for multiple signature features. Additional to this, Bitcoin Cash(BCH) supports both Legacy format(addr starting with '1') and Cash Address format which is based on bech32, starting with 'q' or 'bitcoincash:q'.
it doesn't start with 'q' it starts with bitcoincash. basically cashaddress is the same as bech32 SegWit address encoding but instead of using `bc` as the human readable part (HRP) they use `bitcoincash` and instead of using `1` as separator they are using `:`! "q" is the product of initial byte being 0 (witness version 0). if you change it that letter will also change. the reason why you can convert between the two formats is because BCH doesn't have SegWit they are just using the encoding so the "scripts" are the same, otherwise this conversion is possible in bitcoin too but it doesn't make sense since the "scripts" are different for the the two address type.
|
|
|
|
|
gentlemand
Legendary
Offline
Activity: 2590
Merit: 3014
Welt Am Draht
|
|
August 06, 2019, 10:42:07 AM |
|
I was going to ask why you use legacy. But then I remembered that I still use as well, to sign messages. They are still better for that.
My spendy stuff is in a segwit address but I'm still legacy for the funds that have no plans to move. There may be another shitfork season and people trying to claim them had a lot of problems with segwitted keys. I've never used a Bech32 address and I've never seen any service I use offering one either.
|
|
|
|
bitmover
Legendary
Offline
Activity: 2478
Merit: 6285
bitcoindata.science
|
|
August 06, 2019, 12:31:39 PM |
|
I've never used a Bech32 address and I've never seen any service I use offering one either.
I have used bech32 addresses a few times in coinomi wallet. It has a feature that automatically send change to a bech32 address to reduce fees. Personally I didn't like it very much as really many services didn't recognize it and I had a few problems with compatibility.
|
|
|
|
Kakmakr
Legendary
Offline
Activity: 3542
Merit: 1965
Leading Crypto Sports Betting & Casino Platform
|
|
August 06, 2019, 12:37:58 PM Last edit: August 07, 2019, 08:18:24 AM by Kakmakr |
|
OP, thank you for posting this, because as you said... a lot of newbies does not even know that there are different types of implementations. I am also glad that you added BCash, because BCash was deliberately introduced to confuse people into buying the wrong token. I still think there should only be 1 SegWit address format, because it further confuse people and adds additional problems when services needs to decide what they are going to support. I gave you 1+ Merit for this post, because it helps the newbies. P2PKH which begin with the number 1, eg: 1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2. P2SH type starting with the number 3, eg: 3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy. Bech32 type starting with bc1, eg: bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq
|
..Stake.com.. | | | ▄████████████████████████████████████▄ ██ ▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄ ██ ▄████▄ ██ ▀▀▀▀▀▀▀▀▀▀ ██████████ ▀▀▀▀▀▀▀▀▀▀ ██ ██████ ██ ██████████ ██ ██ ██████████ ██ ▀██▀ ██ ██ ██ ██████ ██ ██ ██ ██ ██ ██ ██████ ██ █████ ███ ██████ ██ ████▄ ██ ██ █████ ███ ████ ████ █████ ███ ████████ ██ ████ ████ ██████████ ████ ████ ████▀ ██ ██████████ ▄▄▄▄▄▄▄▄▄▄ ██████████ ██ ██ ▀▀▀▀▀▀▀▀▀▀ ██ ▀█████████▀ ▄████████████▄ ▀█████████▀ ▄▄▄▄▄▄▄▄▄▄▄▄███ ██ ██ ███▄▄▄▄▄▄▄▄▄▄▄▄ ██████████████████████████████████████████ | | | | | | ▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄ █ ▄▀▄ █▀▀█▀▄▄ █ █▀█ █ ▐ ▐▌ █ ▄██▄ █ ▌ █ █ ▄██████▄ █ ▌ ▐▌ █ ██████████ █ ▐ █ █ ▐██████████▌ █ ▐ ▐▌ █ ▀▀██████▀▀ █ ▌ █ █ ▄▄▄██▄▄▄ █ ▌▐▌ █ █▐ █ █ █▐▐▌ █ █▐█ ▀▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▀█ | | | | | | ▄▄█████████▄▄ ▄██▀▀▀▀█████▀▀▀▀██▄ ▄█▀ ▐█▌ ▀█▄ ██ ▐█▌ ██ ████▄ ▄█████▄ ▄████ ████████▄███████████▄████████ ███▀ █████████████ ▀███ ██ ███████████ ██ ▀█▄ █████████ ▄█▀ ▀█▄ ▄██▀▀▀▀▀▀▀██▄ ▄▄▄█▀ ▀███████ ███████▀ ▀█████▄ ▄█████▀ ▀▀▀███▄▄▄███▀▀▀ | | | ..PLAY NOW.. |
|
|
|
bob123
Legendary
Offline
Activity: 1624
Merit: 2481
|
|
August 06, 2019, 12:49:21 PM |
|
I still think there should only be 1 SegWit address format, because it further confuse people and adds additional problems when services needs to decide what they are going to support. They just need to support bech32. P2SH was introduced more than 7 years ago, in 2012. If a service didn't yet implement support for P2SH, you can consider them worthless. P2WPKH nested into P2SH doesn't play a difference here. Most (if not all) do support P2SH. They should just finally update their software to accept bech32 type addresses. They got introduced ~ 1.5 years ago. That's not that new anymore.
|
|
|
|
Rose_btc
Member
Offline
Activity: 96
Merit: 22
|
|
August 06, 2019, 01:55:21 PM |
|
Why do we have so many formats of address. Why can not one type of address be sufficient? It is so difficult first figure out which exchange or wallet uses what and then act. Anyways the fund you sent will be the same irrespective of the address.
|
|
|
|
o_e_l_e_o
In memoriam
Legendary
Offline
Activity: 2268
Merit: 18726
|
|
August 06, 2019, 03:32:29 PM |
|
Why do we have so many formats of address. Because new developments are made. We can't just force disable all legacy addresses, and we similarly can't force exchanges and other online services to start using bech32, even though it is strong encouraged to do so. It is so difficult first figure out which exchange or wallet uses what and then act. If you are confused about which type of address to pick, the safest option is to pick a "nested SegWit" address (which you will sometimes see written as P2WPKH-P2SH, P2SH(P2WPKH), P2WPKH-in-P2SH, or a similar combination). These addresses always start with a 3, although there are other types of address which also start with a 3. These address give you some of the benefits of SegWit (somewhat cheaper fees), but maintain full compatibility with all online exchanges and services. I've never used a Bech32 address and I've never seen any service I use offering one either. I am almost exclusively using bech32 addresses. Occasionally I still have to use a nested SegWit address for a service which won't let me withdraw to a native SegWit address, but as soon as I spend those coins, I redirect all the change to a bech32 address. No reason not to take advantage of cheaper fees.
|
|
|
|
BrewMaster
Legendary
Offline
Activity: 2114
Merit: 1293
There is trouble abrewing
|
|
August 06, 2019, 03:44:01 PM |
|
And then there are also
P2PK addresses.
the correct term here is "outputs" because they are not addresses anymore. address is a concept we created after we started hashing the public key and using P2PKH outputs instead. not to mention that technically an address is human readable encoding of the hash using base58check or bech32 encoding.
|
There is a FOMO brewing...
|
|
|
1miau
Legendary
Offline
Activity: 2268
Merit: 7034
Currently not much available - see my websitelink
|
|
August 06, 2019, 11:58:05 PM |
|
I'm using more or less all of them (1.., 3..., bc1q...), but SegWit addresses have advantages because fees are cheaper.
I was going to ask why you use legacy. But then I remembered that I still use as well, to sign messages. They are still better for that. Yes, because of that and I've still some Vanity addresses. I know, there's also VanitySearch where it's possible to create SegWit addresses (P2SH and bech32) but I like the original version from samr7 and I've still some 1miau addresses (1miau is not possible in SegWit, so sad ). 1miau7e4tFSAGR4TkAJ8n32UMm2yLB9EHAnd if I don't send often because I'm using these wallets for HODLing, a legacy address is not a bad choice. Of course I won't use it when I have to send money more often or if it generates too much inputs and I have to pay huge fees when I'll spend the Bitcoins a few years later. Do you know if bitcoin core can sign messages from segwit addresses? Any solution for this ?
I don't know, never tried so I can't say for sure. But if Bitcoin Core does it's likely that such signed addresses via Bitcoin Core are only verifiable in Bitcoin Core itself. As far as I know bech32 signed messages via Electrum are also only possible to verify in Electrum because there's no standard yet.
|
|
|
|
pooya87
Legendary
Offline
Activity: 3626
Merit: 10994
Crypto Swap Exchange
|
|
August 07, 2019, 04:35:26 AM |
|
Do you know if bitcoin core can sign messages from segwit addresses? Any solution for this ?
I don't know, never tried so I can't say for sure. But if Bitcoin Core does it's likely that such signed addresses via Bitcoin Core are only verifiable in Bitcoin Core itself. As far as I know bech32 signed messages via Electrum are also only possible to verify in Electrum because there's no standard yet. there has never been any standard for singing messages in general either. but since the first time message signing came along was a very long time ago, everyone does it the same since they copy that method. but nobody updated it for new address types. all it takes is addition of a new condition for RecId. it can be as easy as adding 1 to it when using bech32 addresses (27 + RecId + 4 + 1) the underlying cryptography steps are the same as signing a transaction so the code is already there for all the wallets.
|
|
|
|
Henri Cartier (OP)
|
|
August 07, 2019, 04:46:20 AM |
|
OP, thank you for posting this, because as you said... a lot of newbies does not even know that there are different types of implementations. I am also glad that you added BCash, because BCash was deliberately introduced to confuse people into buying the wrong token. I still think there should only be 1 SegWit address format, because it further confuse people and adds additional problems when services needs to decide what they are going to support. I gave you 1+ Merit for this post, because it helps the newbies. Thank you. Will keep posting to learn and help Newbies
|
|
|
|
Thirdspace
|
|
August 07, 2019, 06:41:48 AM |
|
Why do we have so many formats of address. Why can not one type of address be sufficient?
they are the result of bitcoin development over the years, for certain uses and in the effort to reduce data usage using segwit addresses reduce tx size and allow more transactions to be included in a block and for back compatibility reason, the bitcoin network system must support all formats but it is encouraged to use the latest and most cost efficient bech32 type, or at least segwit P2SH
|
|
|
|
Rose_btc
Member
Offline
Activity: 96
Merit: 22
|
|
August 07, 2019, 11:00:33 AM |
|
Why do we have so many formats of address. Why can not one type of address be sufficient?
they are the result of bitcoin development over the years, for certain uses and in the effort to reduce data usage using segwit addresses reduce tx size and allow more transactions to be included in a block and for back compatibility reason, the bitcoin network system must support all formats but it is encouraged to use the latest and most cost efficient bech32 type, or at least segwit P2SH Thanks for the reply. I would love to understand it more deeply. Will read more about it.
|
|
|
|
ABCbits
Legendary
Offline
Activity: 3052
Merit: 8022
Crypto Swap Exchange
|
Prefix | Name | Format | SegWit? | bc1q… | native Segwit-Address | P2WPKH-bech32 (pay to witness public key hash) / P2WSH-bech32 (pay to witness script hash) | yes |
Actually Bech32/Native SegWit have bc1... prefix, not bc1q... q refers to witness version & in future (when other improvement such as Schnorr & Taproot added) we will be other prefix such as bc1p & bc1z See https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki#bech32 for detailed info
|
|
|
|
|