Imagine Ana opens her wallet to receive bitcoins. Her address starts with bc1q.
Bruno uses a different wallet, and his address starts with bc1p.
Meanwhile, a block explorer shows some addresses that start with 1 and others that start with 3....
They’re all Bitcoin addresses.
WHY ARE THEY DIFFERENT IF THEY CAN ALL BE USED TO RECEIVE BTC?
In the previous section, we learned how a wallet creates an address from cryptographic information.
Now let’s find out why there are different formats.
THEY AREN'T JUST CHANGES IN LETTERS: EACH FORMAT INDICATES HOW A BITCOIN OUTPUT MUST BE CONSTRUCTED.
WHAT DO ADDRESSES THAT BEGIN WITH 1 MEAN?
They correspond to the P2PKH (Pay to Public Key Hash) format, known as Legacy.
They represent a cryptographic fingerprint of a public key and are written using an encoding called Base58Check.
When someone sends BTC to one of these addresses, a condition is set that is usually satisfied by providing the correct public key and a valid digital signature.
WHAT ABOUT THOSE THAT BEGIN WITH 3?
They use P2SH (Pay to Script Hash)... Here's an important difference.
The address represents the hash of a script, that is, a small program that sets conditions for spending the funds.
For example, it can be used to require multiple signatures or to incorporate certain SegWit operations into a structure compatible with older software.
NOTE: BEGINNING WITH 3 DOES NOT MEAN THAT MULTIPLE SIGNATURES ARE NECESSARILY REQUIRED.
The prefix identifies the format, not all of its internal rules.
WHAT ABOUT bc1q ADDRESSES?
They are native version 0 SegWit addresses, encoded using Bech32.
In the previous section, we studied one case: P2WPKH, constructed from the HASH160 of a public key.
But there is another: P2WSH, which uses SHA-256 to hash a script.
Both begin with bc1q, although they contain different data.
P2WPKH uses a 20-byte result, while P2WSH uses a 32-byte result.
THAT'S WHY NOT ALL bc1q ADDRESSES REPRESENT EXACTLY THE SAME OUTPUT TYPE.
WHAT ABOUT THOSE THAT BEGIN WITH bc1p?
Taproot addresses, known as P2TR, use SegWit version 1 and usually begin that way.
Unlike the P2WPKH example, a Taproot address encodes a 32-byte output public key, calculated according to Taproot rules.
It also uses Bech32m, a variant of Bech32 defined for SegWit version 1 and later.
Taproot allows spending to be authorized with a signature corresponding to that public key or, when предусмотрed, through certain script conditions.
bc1q AND bc1p ARE NOT TWO WAYS OF WRITING THE SAME THING: THEY USE DIFFERENT RULES.
SO WHICH ONE SHOULD YOU USE?
It depends on compatibility and the features of each transaction.
Modern formats can be more efficient in certain cases, but the fee does not depend solely on how the address begins.
The transaction data and the fee rate used also have an impact.
In addition, the sending wallet must recognize the chosen format.
An older application might not support newer addresses, even though they are valid on Bitcoin.
AND WHAT SHOULD WE CHECK BEFORE SENDING?
That the complete address really belongs to the intended recipient, that it is for the correct network, and that our application supports that format.
The prefixes we have just studied correspond to the Bitcoin mainnet. Test networks use different identifiers.
WHAT HAVE WE LEARNED?
Addresses that begin with 1 correspond to P2PKH.
Those that begin with 3 use P2SH.
bc1q addresses represent SegWit version 0.
And typical Taproot addresses begin with bc1p.
THEY ARE NOT FOUR DIFFERENT CRYPTOCURRENCIES.... THEY ARE DIFFERENT FORMATS FOR RECEIVING THE SAME BITCOIN.
But now a new question arises...
We now know how addresses are constructed and why different formats exist.
SO, WHEN WE PRESS SEND...
HOW DOES OUR TRANSACTION ACTUALLY REACH THE BITCOIN NODES?
That's what we'll discover in the next section....

