The length of bc1 Bitcoin addresses varies between 42 and 62 characters in Base58 encoding. What causes this difference in character count?
4 Answers
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). bc1
addresses also use bech32 encoding rather than base58.
For an explanation of why P2WSH addresses use larger hashes (256 bits) than P2WPKH addresses (160 bits) see this post.
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.

- 105,497
- 9
- 194
- 308

- 15,313
- 3
- 17
- 53
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.

- 105,497
- 9
- 194
- 308
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.

- 1,069
- 1
- 4
- 21
-
1nit: 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 Sep 19 '23 at 21:45
-
1@MichaelFolkson Totally agree. I accidentally wrote "hexadecimal characters". Thanks for the correction. – dassd Sep 19 '23 at 21:48
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

- 13
- 5
-
This is not entirely correct; P2WSH addresses are also 62 characters. – Pieter Wuille Sep 23 '23 at 08:34