Hello everyone, I’m Paul from Coinmanlabs. With the popularity of scripts last year and the emergence of Runes this year, many people are confused about the different types of BTC addresses. Today, we will clarify this issue with eight questions.
Q1: Why are there different types of BTC addresses?
Bitcoin has multiple address types to meet different needs and technical requirements, while providing better security, privacy, and scalability. The main reasons are as follows:
Compatibility and transition: As the Bitcoin network evolves and technology advances, new address formats are introduced. However, to maintain backward compatibility, old address formats are still supported. Therefore, Bitcoin needs to support multiple address types so that users can seamlessly migrate and interact with different addresses.
Security and privacy: Different types of addresses provide different levels of security and privacy. For example, Segregated Witness (Bech32) addresses have advanced security features, while P2SH addresses are commonly used for advanced transaction scripts such as multi-signature, providing more flexibility and security.
Technological innovation: New address formats are usually introduced to introduce new technical features and improvements. For example, Bech32 addresses introduced Segregated Witness, an important technical upgrade aimed at increasing transaction throughput, reducing transaction fees, and enhancing network security.
User experience: Different types of addresses can affect user experience and interaction. For example, Bech32 addresses have higher error detection capabilities, reducing the risk of users entering the wrong address and improving user experience.
In summary, Bitcoin needs multiple address types to meet the needs of different users and continuously drive technological innovation and development to provide a more secure and efficient blockchain solution.
Q2: How many types of BTC addresses are there now?
There are currently four types of BTC addresses, each with slightly different formats and uses. Here are some common Bitcoin address types:
P2PKH (Pay-to-Public-Key-Hash): This is the most common address type, starting with “1”. This address type is the oldest and most widely accepted. For example: 1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2
P2SH (Pay-to-Script-Hash): Starting with “3”, it is used for multi-signature and other complex transaction scripts. The script associated with this address type is verified during transactions. For example: 3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy
Bech32: Starting with “bc1q”, it is the latest address format for Bitcoin, also known as native Segregated Witness (SegWit) addresses. Bech32 addresses have higher error detection capabilities and support advanced features such as Segregated Witness. For example: bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq
Taproot addresses: These addresses start with “bc1p” and are designed to improve block space efficiency, reduce costs, and provide better privacy on top of SegWit. Taproot addresses further reduce storage space, improve transaction efficiency, and provide better privacy.
Q3: Why is it called P2PKH (Pay-to-Public-Key-Hash)?
The term P2PKH (Pay-to-Public-Key-Hash) was defined by one of Bitcoin’s founders, Satoshi Nakamoto. It means paying to the hash of a public key. In P2PKH transactions, the sender sends funds to the recipient’s public key hash address instead of directly to the recipient’s public key. This enhances privacy and security because the public key hash address does not directly expose the recipient’s actual public key.
In P2PKH transactions, the recipient’s address is generated using the hash value of their public key instead of the public key itself. One benefit of this approach is that even if the public key hash address is leaked, it does not reveal the recipient’s actual public key, thereby increasing security. Additionally, this makes transaction data on the blockchain more compact because public key hash addresses are relatively short.
In summary, P2PKH is a common and simple Bitcoin transaction type designed to improve privacy and security while maintaining compact transaction data.
Q4: Why is it called P2SH (Pay-to-Script-Hash)?
P2SH (Pay-to-Script-Hash) is a type of transaction output in Bitcoin introduced by Gavin Andresen in 2012. This type of transaction output allows payments to be associated with a script hash instead of directly with a public key or public key hash.
This introduction was made to support more transaction types, such as multi-signature transactions and other complex transaction scripts. In P2SH transactions, the receiving address is a script hash instead of an actual public key or public key hash. This means that the sender only needs to know the hash value of a script without knowing the specific content of the script. Only when spending the output, the actual script matching that hash needs to be provided.
One of the benefits of P2SH is that it increases the flexibility of the Bitcoin network. It allows complex transaction scripts to be traded without exposing the actual script content, and multiple different types of scripts can be hashed to the same address. This provides support for more complex transactions, such as multi-signature transactions, while enhancing network security and privacy.
Therefore, P2SH serves as a type of transaction output that provides an important foundation for the development and innovation of the Bitcoin network.
Q5: Why is it called Bech32?
The name Bech32 for addresses originates from the first letter “B” of the surnames of its designers, Pieter Wuille and Greg Maxwell, and a error detection/fixing algorithm called “ech”. This algorithm uses pronunciation rules from some languages to distinguish “1” from “l” and “0” from “o”, reducing the possibility of users entering the wrong address. Therefore, “Bech” represents the key innovation in the address design, and “32” represents the length of the address being 32 characters. So, the name Bech32 address can be said to be a descriptive name composed of the key features of its design.
Q6: Why does the wallet generate a new address every time it is used?
In some Bitcoin wallets, a new address is generated every time a transaction is received or sent, which is done for privacy and security reasons:
Privacy protection: Using a new address can increase user privacy. If a user uses the same address for every transaction, those transactions can be traced back to the same address, exposing the user’s transaction history and fund flow. By using a new address, users can better protect their privacy and reduce the disclosure of information to others.
Enhanced security: Regularly changing addresses can reduce the risk of attacks targeting a specific address. If an address is tracked and attacked by malicious parties, using a new address can lower the risk of being attacked. Additionally, if one of the user’s private keys is compromised, only the funds associated with that private key on the address are at risk, while funds on other addresses remain secure.
Following best practices: Many security experts recommend regularly changing addresses as a best practice to help maintain the security and privacy of personal funds.
Although generating a new address each time may cause some inconvenience, such as needing to update the receiving address, this practice can enhance user privacy and security, which is why many Bitcoin wallets adopt it.
Q7: Shouldn’t multiple addresses require changing wallets?
Indeed, generating new addresses is usually achieved by using Elliptic Curve Cryptography (ECC). The elliptic curve encryption algorithm used in Bitcoin is secp256k1, which is widely used in the cryptocurrency field.
Specifically, the wallet generates a key pair (public key and private key) using the elliptic curve algorithm. Then, an address is generated from the public key. Each time a new address is generated, a new key pair is generated, resulting in a new address.
This approach ensures that each address is associated with a unique key pair, enhancing security and privacy. Additionally, due to the efficiency of the elliptic curve encryption algorithm, the process of generating a new address is usually fast.
Q8: Isn’t it wrong to generate multiple addresses?
Many modern Bitcoin wallets use HD Wallet (Hierarchical Deterministic Wallet) technology to manage addresses. HD Wallet allows for more convenient management of a large number of addresses and provides additional security and backup features.
HD Wallet generates a series of key pairs (public key and private key) from a seed, rather than generating a new key pair for each address like traditional wallets. These key pairs are generated according to the standards defined in BIP32 (Bitcoin Improvement Proposal 32) and BIP44 (Bitcoin Improvement Proposal 44).
HD Wallet has the following advantages:
Backup and recovery: By backing up the seed, users can easily backup the entire wallet and conveniently restore all addresses and funds when needed.
Deterministic: Since all addresses are derived from the same seed, the entire address chain can be deterministically generated without needing to store the private key for each address in the wallet.
Better privacy: HD Wallet can generate a new address for each transaction without exposing previously used addresses. This enhances user privacy.
Hierarchical structure: HD Wallet supports a hierarchical structure, allowing for the creation of multiple sub-wallets, each with its own seed. This structure helps manage funds for multiple accounts or purposes.
Therefore, modern Bitcoin wallets often adopt HD Wallet technology to provide a better user experience, security, and privacy protection.