<p>P2WPKH (pay-to-witness-public-key-hash) addresses are 42 characters in length and P2WSH (pay-to-witness-script-hash) addresses are 62 characters in length (see <a href="https://bitcoin.stackexchange.com/questions/100508/can-you-break-down-what-data-is-encoded-into-a-bech32-address">here</a>). <code>bc1</code> addresses also use <a href="https://github.com/bitcoin/bips/blob/e643d247c8bc086745f3031cdee0899803edea2f/bip-0173.mediawiki" rel="nofollow noreferrer">bech32</a> encoding rather than base58.</p>
<p>For an explanation of why P2WSH addresses use larger hashes (256 bits) than P2WPKH addresses (160 bits) see this <a href="https://bitcoin.stackexchange.com/questions/106140/why-are-p2wsh-addresses-larger-than-p2sh-addresses">post</a>.</p>
<p>As Pieter states:</p>
<blockquote>
<p>P2PKH, P2WPKH, and P2SH addresses have 160-bit hashes in their addresses. For P2PKH and P2WPKH this is fine, as it only supports single-party construction. However, as P2SH supports multisig and other multi-party constructions, it means an ~2<sup>80</sup> attack is possible(*). Bitcoin typically has a 2<sup>128</sup> security target for attacks, so this is insufficient. That doesn't mean such a collision attack is practical - it's just far weaker than what the rest of the system provides, and as computing performance increases it may become feasible for well-funded parties.</p>
<p>To address this, P2WSH introduced a multi-party-capable address that contains a 256-bit hash, so it has ~2<sup>128</sup> collision security.</p>
</blockquote>

CC BY-SA 4.0
2023-09-19T21:29:03.767Z
2023-09-20T10:12:16.493Z
2023-09-20T10:12:16.493Z
Michael Folkson
<p>There are as of today 3 types of native segwit outputs:</p>
<ul>
<li>P2WPKH (pay to witness public key hash), where the output (and thus address) contains a 160-bit public key hash.</li>
<li>P2WSH (pay to witness script hash), where the output (and thus address) contains a 256-bit script hash.</li>
<li>P2TR (pay to taproot), where the output (and thus address) contains a 256-bit public key (not a hash!).</li>
</ul>
<p>Addresses that contain a 256-bit value need 62 characters, while ones that contain a 160-bit value need just 42 characters, in bech32(m) encoding. Note that base58 is only used in P2PKH and P2SH addresses, which predate segwit (bc1) addresses.</p>

CC BY-SA 4.0
2023-09-20T10:10:53.030Z
2023-09-20T10:27:00.407Z
2023-09-20T10:27:00.407Z
Pieter Wuille
<p>P2WPKH addresses have 42 characters, while P2WSH addresses have 62 characters.</p>
<p>This difference is due to the fact that P2WPKH bc1 addresses include a hash of the public key that is 20 bytes long, and P2WSH bc1 addresses include a hash of, let's call it, the redeem script that is 32 bytes long.</p>

CC BY-SA 4.0
2023-09-19T21:45:14.643Z
nit: It isn't encoded in hexadecimal (0-9 and a-f). A bech32 address contains letters beyond f e.g. x, y and z
Michael Folkson
CC BY-SA 4.0
2023-09-19T21:48:03.363Z
@MichaelFolkson Totally agree. I accidentally wrote "hexadecimal characters". Thanks for the correction.
dassd
CC BY-SA 4.0
2023-09-19T21:36:15.030Z
2023-09-19T21:45:55.607Z
2023-09-19T21:45:55.607Z
dassd
<p>Those starting with bc1q are SegWit (42),
Those that start with the name bc1p are Taproot (62),
SegWit addresses are common and Taproot addresses are new</p>

CC BY-SA 4.0
2023-09-23T08:34:16.377Z
This is not entirely correct; P2WSH addresses are also 62 characters.
Pieter Wuille
CC BY-SA 4.0
2023-09-20T00:16:21.873Z
2023-09-20T00:16:21.873Z
ioxoi
<p>The length of bc1 Bitcoin addresses varies between 42 and 62 characters in Base58 encoding. What causes this difference in character count?</p>

<address><segregated-witness><bech32-address>
Why are some bc1 addresses 42 characters and others 62 characters in Base58?
rwysbotf
# Why are some bc1 addresses 42 characters and others 62 characters in Base58?

(Asked by: username_0 on 2023-09-19)

The length of bc1 Bitcoin addresses varies between 42 and 62 characters in Base58 encoding. What causes this difference in character count?

**Tags:** address, segregated-witness, bech32-address


---

## 4 answers

### Answer by username_1 on 2023-09-19. Score: 4

P2WPKH (pay-to-witness-public-key-hash) addresses are 42 characters in length and P2WSH (pay-to-witness-script-hash) addresses are 62 characters in length (see [here](https://bitcoin.stackexchange.com/questions/100508/can-you-break-down-what-data-is-encoded-into-a-bech32-address)). `bc1` addresses also use [bech32](https://github.com/bitcoin/bips/blob/e643d247c8bc086745f3031cdee0899803edea2f/bip-0173.mediawiki) encoding rather than base58.

For an explanation of why P2WSH addresses use larger hashes (256 bits) than P2WPKH addresses (160 bits) see this [post](https://bitcoin.stackexchange.com/questions/106140/why-are-p2wsh-addresses-larger-than-p2sh-addresses).

As Pieter states:

> P2PKH, P2WPKH, and P2SH addresses have 160-bit hashes in their addresses. For P2PKH and P2WPKH this is fine, as it only supports single-party construction. However, as P2SH supports multisig and other multi-party constructions, it means an ~280 attack is possible(\*). Bitcoin typically has a 2128 security target for attacks, so this is insufficient. That doesn't mean such a collision attack is practical - it's just far weaker than what the rest of the system provides, and as computing performance increases it may become feasible for well-funded parties.
>
> To address this, P2WSH introduced a multi-party-capable address that contains a 256-bit hash, so it has ~2128 collision security.


---

### Answer by username_2 on 2023-09-20. Score: 1

There are as of today 3 types of native segwit outputs:

* P2WPKH (pay to witness public key hash), where the output (and thus address) contains a 160-bit public key hash.
* P2WSH (pay to witness script hash), where the output (and thus address) contains a 256-bit script hash.
* P2TR (pay to taproot), where the output (and thus address) contains a 256-bit public key (not a hash!).

Addresses that contain a 256-bit value need 62 characters, while ones that contain a 160-bit value need just 42 characters, in bech32(m) encoding. Note that base58 is only used in P2PKH and P2SH addresses, which predate segwit (bc1) addresses.


---

### Answer by username_3 on 2023-09-19. Score: 0

P2WPKH addresses have 42 characters, while P2WSH addresses have 62 characters.

This difference is due to the fact that P2WPKH bc1 addresses include a hash of the public key that is 20 bytes long, and P2WSH bc1 addresses include a hash of, let's call it, the redeem script that is 32 bytes long.

> **Comments:**
> **username_1**: nit: It isn't encoded in hexadecimal (0-9 and a-f). A bech32 address contains letters beyond f e.g. x, y and z  
> **username_3**: @MichaelFolkson Totally agree. I accidentally wrote "hexadecimal characters". Thanks for the correction.  

---

### Answer by username_4 on 2023-09-20. Score: 0

Those starting with bc1q are SegWit (42),
Those that start with the name bc1p are Taproot (62),
SegWit addresses are common and Taproot addresses are new

> **Comments:**
> **username_2**: This is not entirely correct; P2WSH addresses are also 62 characters.  

---

