<p>A Bitcoin address prefix is a function of the locking script type for a particular transaction output.</p>

<p>Older Bitcoin Pay-to-Public Key Hash (<strong>P2PKH</strong>) scripts are associated with addresses that start with the number 1, resulting from a one byte version prefix prior to base58check-encoding being set to 0x00. </p>

<p>Newer Pay-to-Script Hash (<strong>P2SH</strong>) transactions start with the number 3, resulting from a one byte version prefix prior to base58check-encoding being set to 0x05.</p>

<p>Examples of P2SH are singe single P2SH signature addresses, multisig addresses, and nested P2SH(P2WPKH) that resulted from segwit to maintain backward compatibility with older wallets that are not explicitly segwit-enabled to wallets that are segwit-enabed. Such addresses conform to the BIP 49 hierarchical deterministic scheme.  </p>

CC BY-SA 4.0
2019-05-21T22:12:39.453Z
BIP32 is the one that outlines the HD key derivation.
JBaczuk
CC BY-SA 4.0
2019-05-23T15:31:28.240Z
BIPs 44 and 49 define conventions/schemes for how to specifically apply BIP 32 HD technology. Both BIPs 44 and 49 reference BIP32.
skaht
CC BY-SA 4.0
2019-04-21T21:23:24.893Z
2019-04-21T21:23:24.893Z
skaht
<p>Addresses starting with the number “1” use the P2PKH (pay to public key hash) whereas an address that starts with the number “3” uses P2SH (pay to script hash).</p>

<p>In the first the script only check if the signature is valid by comparing a hash of your public key (the address starting w/ 1) and the digital signature, both created by your private key.</p>

<p>For the P2SH (used by multisig transaction) its slightly more complex where different scripts need to produce the same results when executed with the right cryptographic parameters. </p>

<p>more here
<a href="https://bitcoin.stackexchange.com/questions/64733/what-is-p2pk-p2pkh-p2sh-p2wpkh-eli5">What is P2PK, P2PKH, P2SH, P2WPKH - ELI5</a></p>

CC BY-SA 4.0
2019-04-21T21:10:50.677Z
2019-04-21T21:10:50.677Z
Pedro
<p>I just wanted to confirm, is it true that for a bitcoin (public) address it should always have a '1' in front of it. For certain transactions though I see that there is a '3' in front. How is this possible, and why is it a '3'?</p>

<transactions><address><signature><p2sh>
Public Addresses: '3' vs '1' in front [Bitcoin]
TheRoadLessTaken
# Public Addresses: '3' vs '1' in front [Bitcoin]

(Asked by: username_0 on 2019-04-21)

I just wanted to confirm, is it true that for a bitcoin (public) address it should always have a '1' in front of it. For certain transactions though I see that there is a '3' in front. How is this possible, and why is it a '3'?

**Tags:** transactions, address, signature, p2sh


---

## 2 answers

### Answer by username_1 on 2019-04-21. Score: 1

A Bitcoin address prefix is a function of the locking script type for a particular transaction output.

Older Bitcoin Pay-to-Public Key Hash (**P2PKH**) scripts are associated with addresses that start with the number 1, resulting from a one byte version prefix prior to base58check-encoding being set to 0x00.

Newer Pay-to-Script Hash (**P2SH**) transactions start with the number 3, resulting from a one byte version prefix prior to base58check-encoding being set to 0x05.

Examples of P2SH are singe single P2SH signature addresses, multisig addresses, and nested P2SH(P2WPKH) that resulted from segwit to maintain backward compatibility with older wallets that are not explicitly segwit-enabled to wallets that are segwit-enabed. Such addresses conform to the BIP 49 hierarchical deterministic scheme.

> **Comments:**
> **username_2**: BIP32 is the one that outlines the HD key derivation.  
> **username_1**: BIPs 44 and 49 define conventions/schemes for how to specifically apply BIP 32 HD technology. Both BIPs 44 and 49 reference BIP32.  

---

### Answer by username_3 on 2019-04-21. Score: 0

Addresses starting with the number “1” use the P2PKH (pay to public key hash) whereas an address that starts with the number “3” uses P2SH (pay to script hash).

In the first the script only check if the signature is valid by comparing a hash of your public key (the address starting w/ 1) and the digital signature, both created by your private key.

For the P2SH (used by multisig transaction) its slightly more complex where different scripts need to produce the same results when executed with the right cryptographic parameters.

more here
[What is P2PK, P2PKH, P2SH, P2WPKH - ELI5](https://bitcoin.stackexchange.com/questions/64733/what-is-p2pk-p2pkh-p2sh-p2wpkh-eli5)


---

