Bitcoin Forum
August 22, 2019, 07:37:29 PM *
News: Latest Bitcoin Core release: 0.18.0 [Torrent] (New!)
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Different Bitcoin Address Formats  (Read 215 times)
Henri Cartier
Jr. Member
*
Offline Offline

Activity: 62
Merit: 4


View Profile
August 05, 2019, 11:53:04 AM
Merited by bones261 (2), OgNasty (1), Kakmakr (1)
 #1

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
  • P2SH addresses
  • Bech32 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/
1566502649
Hero Member
*
Offline Offline

Posts: 1566502649

View Profile Personal Message (Offline)

Ignore
1566502649
Reply with quote  #2

1566502649
Report to moderator
1566502649
Hero Member
*
Offline Offline

Posts: 1566502649

View Profile Personal Message (Offline)

Ignore
1566502649
Reply with quote  #2

1566502649
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1566502649
Hero Member
*
Offline Offline

Posts: 1566502649

View Profile Personal Message (Offline)

Ignore
1566502649
Reply with quote  #2

1566502649
Report to moderator
1566502649
Hero Member
*
Offline Offline

Posts: 1566502649

View Profile Personal Message (Offline)

Ignore
1566502649
Reply with quote  #2

1566502649
Report to moderator
1miau
Sr. Member
****
Offline Offline

Activity: 462
Merit: 1276


ChipMixer Miau


View Profile WWW
August 05, 2019, 12:40:32 PM
 #2

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:

PrefixNameFormatSegWit?
__________________________________________________________________________________________________________ _____________________________________________
1…Legacy-AddressP2PKH (pay to public key hash)no
3…nested SegWit-AddressP2WPKH-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-AddressP2SH (pay to script hash)no
bc1q…native Segwit-AddressP2WPKH-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
Hero Member
*****
Offline Offline

Activity: 574
Merit: 977



View Profile
August 06, 2019, 01:39:32 AM
 #3

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 Offline

Activity: 1736
Merit: 1817



View Profile
August 06, 2019, 05:11:43 AM
 #4

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!

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

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

aplistir
Full Member
***
Offline Offline

Activity: 346
Merit: 160



View Profile
August 06, 2019, 10:17:48 AM
 #5

And then there are also

P2PK addresses.

As far as I know (almost) no-one creates new P2PK addresses any longer, but there are lots of them still in the blockchain.

Here is a link to a page that shows how it is still possible to create P2PK addresses even though no wallet support this feature any more.
https://medium.com/@dreynoldslogic/creating-and-spending-p2pk-utxos-using-bitcoin-core-and-a-little-python-292291fae65d

My Address: 121f7zb2U4g9iM4MiJTDhEzqeZGHzq5wLh
gentlemand
Legendary
*
Offline Offline

Activity: 2100
Merit: 1915


Your dearest bum chum


View Profile
August 06, 2019, 10:42:07 AM
 #6

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
Hero Member
*****
Offline Offline

Activity: 574
Merit: 977



View Profile
August 06, 2019, 12:31:39 PM
 #7

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 Offline

Activity: 1750
Merit: 1340

★ ChipMixer | Bitcoin mixing service ★


View Profile
August 06, 2019, 12:37:58 PM
Last edit: August 07, 2019, 08:18:24 AM by Kakmakr
 #8

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

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

I gave you 1+ Merit for this post, because it helps the newbies.  Grin

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

bob123
Legendary
*
Offline Offline

Activity: 994
Merit: 1414



View Profile WWW
August 06, 2019, 12:49:21 PM
 #9

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

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
Jr. Member
*
Offline Offline

Activity: 32
Merit: 4


View Profile
August 06, 2019, 01:55:21 PM
 #10

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
Hero Member
*****
Offline Offline

Activity: 658
Merit: 2552



View Profile
August 06, 2019, 03:32:29 PM
Merited by bob123 (1)
 #11

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
Hero Member
*****
Offline Offline

Activity: 1274
Merit: 775


There is trouble abrewing


View Profile
August 06, 2019, 03:44:01 PM
 #12

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.

1miau
Sr. Member
****
Offline Offline

Activity: 462
Merit: 1276


ChipMixer Miau


View Profile WWW
August 06, 2019, 11:58:05 PM
 #13

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

1miau7e4tFSAGR4TkAJ8n32UMm2yLB9EH

And 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 Offline

Activity: 1736
Merit: 1817



View Profile
August 07, 2019, 04:35:26 AM
 #14

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
Jr. Member
*
Offline Offline

Activity: 62
Merit: 4


View Profile
August 07, 2019, 04:46:20 AM
 #15

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

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

I gave you 1+ Merit for this post, because it helps the newbies.  Grin


Thank you. Will keep posting to learn and help Newbies Smiley
Thirdspace
Hero Member
*****
Offline Offline

Activity: 1078
Merit: 709


Mixing reinvented for your privacy | chipmixer.com


View Profile
August 07, 2019, 06:41:48 AM
 #16

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
Jr. Member
*
Offline Offline

Activity: 32
Merit: 4


View Profile
August 07, 2019, 11:00:33 AM
 #17

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.
ETFbitcoin
Legendary
*
Offline Offline

Activity: 1736
Merit: 1980

Use SegWit and enjoy lower fees.


View Profile WWW
August 07, 2019, 04:42:35 PM
Merited by TryNinja (1), bob123 (1)
 #18

PrefixNameFormatSegWit?
bc1q…native Segwit-AddressP2WPKH-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

Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!