This article was translated from Japanese with AI. Read the original (日本語) · Report a translation issue

Whenever you send or receive bitcoin, you'll run into a "Bitcoin address." It's usually shown as a long string of letters and numbers or as a QR code, and until you get used to them, it's easy to be left wondering "What's the difference?" and "Which one should I use?"

Bitcoin addresses actually come in several formats, and their features and formats have changed over time, from Bitcoin's launch in 2009 to today. Each type has different characteristics and also looks different, so you can classify them by their prefix (the first few characters).

In this article, we'll go through the main types of Bitcoin address and explain the features of each and how to tell them apart.

We hope it helps you choose Bitcoin addresses more efficiently as you use your wallets going forward.

We also explain this in a video, so feel free to watch it.

Comparison of Bitcoin Address Types

Bitcoin address formats fall roughly into the following four categories.

  • Early addresses
  • Legacy addresses
  • SegWit
  • Taproot

We've summarized their characteristics in the table below.

Category Type Introduced Prefix Encoding Length
Early P2PK January 3, 2009 04 - -
Legacy P2PKH January 16, 2009 1 Base58Check 26-34
Legacy P2SH April 1, 2012 3 Base58Check 34
SegWit P2WPKH August 23, 2017 bc1q Bech32 42
SegWit P2WSH August 23, 2017 bc1q Bech32 62
Taproot P2TR November 13, 2021 bc1p Bech32m 62

(There is also a multisig format called P2MS, but it has seen only minimal use since January 29, 2012, so we won't cover it in this article.)

Let's go through the address formats in each category one by one.

Early Addresses (P2PK)

Strictly speaking, P2PK is not an address format. But because it was the first format used when Bitcoin was born, Mastering Bitcoin introduces it as an "early address." What's more, a 2023 study found that about 9% of bitcoin receipts used P2PK.

P2PK (Pay to Public Key)

Type P2PK
Introduced January 3, 2009
Block height 0
Prefix 04
Length -
Encoding -

P2PK is the address format first used on January 3, 2009, when Bitcoin was born, and you can see it in block 0 (the genesis block).

The 50 BTC block reward in the genesis block is said to be unspendable. We explain the secret behind this in the article below, so take a look if you're interested.

「Genesis Block」サトシ・ナカモトの50BTCに隠された秘密
Genesis Blockの報酬50BTCが使えない理由を技術的に解説。Genesis Addressに関して、P2PKとP2PKHの違い、100BTC以上あると紹介される背景まで網羅します。

P2PK stands for Pay to Public Key. As the name suggests, it pays directly to a public key, so strictly speaking it isn't an address. And because it exposes the public key on the blockchain, most wallet implementations today don't support P2PK. (You can still use it if you build the transaction yourself.)

It's very long, and its prefix (first characters) starts with 04.

P2PKの例
04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f

It also has a structure based on the public key data, as shown below.

04 | X座標 (32 bytes) | Y座標 (32 bytes)

Because a Bitcoin public key represents a point on an elliptic curve, it has an X coordinate and a Y coordinate. You can see a mathematical concept showing up directly in the implementation.

💡
A public key is fundamentally "X coordinate + Y coordinate," but because of the properties of the elliptic curve, once X is fixed, Y can only be one of two values.
So a public key can be compressed into X (32 bytes) plus a marker indicating which Y it is (02 = Y is even, 03 = Y is odd).

02/03 | X coordinate (32 bytes)

Legacy Addresses (P2PKH, P2SH): Base58Check

The term "legacy address" generally refers to Bitcoin addresses in the Base58Check format that were in use before newer formats such as SegWit. That said, what it covers can vary with context, and sometimes only P2PKH (1...) is called legacy.

In this article, we treat P2PKH (1...) and P2SH (3...) together as legacy addresses, since both are represented in Base58Check.

Base58Check is an encoding scheme for turning Bitcoin addresses into strings that are easy for humans to read. It also includes a checksum (data used for verification), which makes it easier to catch typos and other errors.

P2PKH (Pay to Public Key Hash)

Type P2PKH
Introduced January 16, 2009
Block height 728
Prefix 1
Length 33 or 34
Encoding Base58Check

P2PKH is an address format first seen on the blockchain on January 16, 2009, just two weeks after Bitcoin was born (January 3, 2009).

Because public keys are very long and unwieldy, P2PKH is a format whose Bitcoin address uses a value converted to a fixed length with a hash function. Hence the name, short for Pay to Public Key Hash: paying to the hash of a public key.

P2PKHの例
12higDjoCCNXSA95xZMWUdPvXNmkAduhWv

P2PKH addresses start with 1 and are 33 or 34 characters long. (In theory, they can be as short as 26 characters.)

P2PKH isn't widely used today, but because it has been around for so long, it has the advantage of being supported by many wallet implementations and exchanges. However, it has the drawback of higher fees, so if you're starting to use a wallet now, there's no need to go out of your way to use it.

P2SH (Pay to Script Hash)

Type P2SH
Introduced April 1, 2012
Block height 170,052
Prefix 3
Length 34
Encoding Base58Check

P2SH was born through a soft fork on April 1, 2012, and was first seen in use at block 174,717. Before the soft fork, however, developers were already experimenting with the address type, and you can see the P2SH format being used at block 170,052.

Behind the birth of P2SH was a deep conflict among developers after Satoshi Nakamoto's departure over "which proposal to adopt and how to carry out the soft fork." It is said to have been the first war, one that shaped Bitcoin's development culture.

P2SH can simplify complex conditions. It seems to be used often for things like multisig. Multisig is a setup that requires signatures from a certain number out of several keys.

💡
"m-of-n" multisig
• m = the number of signatures the multisig requires
• n = the total number of registered public keys
This is called m-of-n multisig.

1-of-2: a signature from one of the two keys is enough
2-of-3: unlocked when two of the three keys sign (commonly used)
3-of-3: can't be spent unless all three keys sign

With the earlier P2PKH, setting up complex conditions such as multisig meant writing out lengthy locking conditions, which increased the amount of data and drove up fees.

P2SH solves this by hashing the locking conditions to shorten them and using the result, which hides the conditions themselves, as the address. That's why P2SH stands for Pay to Script Hash.

P2SHの例
37paP4uTjmA4Pi85LG6CF9huift3Dw1kFT

P2SH addresses start with 3 and are 34 characters long.

The locking conditions are normally hidden and are revealed only when the coins are spent.

bitbank deposit screen

Incidentally, deposit addresses at the cryptocurrency exchange bitbank start with 3, so they are presumably using P2SH multisig.

SegWit (P2WPKH, P2WSH): Bech32

The two formats classified as SegWit (P2WPKH and P2WSH) are versions of the P2PKH and P2SH formats described above adapted for SegWit, and they are called Native SegWit.

Put simply, SegWit is "a mechanism that separates the signature data in a Bitcoin transaction from the main body and stores it in a separate section." This reduces the amount of data per transaction, so fees tend to be lower.

Bech32, the encoding scheme that became mainstream after SegWit, is defined in BIP173. Compared with the older Base58Check, Bech32 is more resistant to typos and easier for machines to handle, and it was adopted to reduce the risk of sending funds to the wrong destination.

💡
Features of Bech32
• Uses only digits and lowercase letters
(digits and uppercase letters also work, but using lowercase only is recommended)
• Can not only detect errors but also correct them
‣ It is mathematically guaranteed to detect any error of four characters or fewer
‣ But only when the entered address is the same length as the original

P2WPKH (Pay to Witness Public Key Hash)

Type P2WPKH
Introduced August 23, 2017
Block height 481,824
Prefix bc1q
Length 42
Encoding Bech32

P2WPKH is the SegWit version of P2PKH, introduced by the soft fork in August 2017. It was first seen in use at block 481,824.

For a long time, the amount of data that could fit in a single Bitcoin block was limited to about 1 MB. As usage grew, this led to problems such as rising fees and slower confirmations.

SegWit (a mechanism that separates out signature data to use block space more efficiently) was introduced to solve this problem, and P2WPKH is one of the main address formats used with SegWit.

At the time, opinions were divided over how to expand block data, and some split off as Bitcoin Cash (BCH).

P2WPKHの例
bc1q34aq5drpuwy3wgl9lhup9892qp6svr8ldzyy7c

The prefix is bc1q, and the address is 42 characters long.

P2WPKH tends to have lower fees and is now used as the default in many wallets (BlueWallet, Green Wallet, Nunchuk, and others).

P2WSH (Pay to Witness Script Hash)

Type P2WSH
Introduced August 23, 2017
Block height 481,824
Prefix bc1q
Length 62
Encoding Bech32

Like P2WPKH above, P2WSH is a SegWit version, in this case of P2SH. It appeared on August 23, 2017, and was first seen in use at block 481,824.

P2WSHの例
bc1qeklep85ntjz4605drds6aww9u0qr46qzrv5xswd35uhjuj8ahfcqgf6hak

P2WSH addresses have the prefix bc1q and are 62 characters long.

Since P2WPKH also has the prefix bc1q, you can tell them apart by the number of characters in the address: 42 characters means P2WPKH, and 62 means P2WSH.

P2WPKH is used for ordinary transactions, whereas P2WSH is often used for scripts with complex conditions such as multisig, timelocks, and "if/else" structures. Because SegWit reduces fees, it is cheaper than P2SH for the same conditions.

Taproot (P2TR): Bech32m

Taproot uses Schnorr signatures and a mechanism called MAST to make transactions with complex conditions look like ordinary transactions, which can lower fees.

To support Taproot, the encoding scheme adopted is Bech32m (Bech32 modified), which fixes problems in Bech32, as described in BIP350.

We also explain Taproot in a separate article, so feel free to check that out as well.

Taprootとは?Schnorr署名・MAST・P2TRで実現するプライバシーと効率性の向上
2021年6月12日にロックインされ11月にアクティベートされたビットコインのTaprootを徹底解説。Schnorr署名・MAST・Tapscriptの3つの改善点と、2種類のアンロック方法を持つP2TRアドレスの仕組みをわかりやすく紹介します。

P2TR (Pay to Taproot)

Type P2TR
Introduced November 13, 2021
Block height 706,632
Prefix bc1p
Length 62
Encoding Bech32m

P2TR appeared on November 13, 2021, as the address type for Taproot, and was first seen in use at block 706,632.

P2TRの例
bc1pxwww0ct9ue7e8tdnlmug5m2tamfn7q06sahstg39ys4c9f3340qqxrdu9k

P2TR addresses have the prefix bc1p and are 62 characters long.

Adoption is still low, and some older wallets and services can't send to it yet, but if privacy matters to you, we recommend using this address type.

One common example of P2TR in use is Boltz, a service for swapping between on-chain bitcoin and the Lightning Network (submarine swaps). We explain how Boltz and submarine swaps work in this article, so be sure to check it out.

Boltzは本当にトラストレスなのか?Submarine Swapの仕組みから解説
BoltzはSubmarine Swapを用いて、オンチェーンBTCとLightning残高をアトミックに交換できるサービスです。本記事では、その仕組みとWeb appの役割から、Boltzがどこまでトラストレスと言えるのかを技術的観点で解説します。

Summary: You Can Tell a Bitcoin Address's Type by Its First Characters

At first glance, a Bitcoin address looks like nothing more than a jumble of letters and numbers, but there are actually several formats, and you can identify the type by the prefix (the first characters). Since its birth, Bitcoin has been improved repeatedly through soft forks, and address formats have evolved along with it, from legacy to SegWit and then Taproot.

The main legacy addresses are P2PKH, which starts with 1, and P2SH, which starts with 3, and both are encoded in Base58Check. Because they have been around for a long time, they are highly compatible, but transaction data tends to be larger, which tends to put them at a disadvantage on fees. P2SH in particular readily supports payments with complex conditions such as multisig, and it is often used for exchange deposit addresses.

SegWit addresses start with bc1q and are encoded in Bech32. By separating out signature data, SegWit makes transactions more efficient and helps keep fees down, making it the most common choice for on-chain payments today. Among bc1q addresses, around 42 characters means P2WPKH and around 62 characters means P2WSH, so it's handy that you can determine the type just by looking at the length.

Taproot addresses start with bc1p and are encoded in Bech32m. Because they can handle transactions with complex conditions in a form close to ordinary transactions, they are drawing attention as a new format with advantages in privacy and efficiency. However, compatibility can be an issue in some environments, so it's important to choose the right one for your use case.

As you use your wallets going forward, understanding address formats and being able to choose between them will help you use Bitcoin more efficiently and securely.