Hello everyone, I am Paul from Coinmanlabs. With the craze of last year’s inscriptions and this year’s Runes, many people are not clear about the types of BTC addresses and are very confused. Today we will use eight questions to help you understand clearly.
Q. Why are there different types of BTC addresses?
Bitcoin requires multiple address types mainly to meet different needs and technical requirements and provide better security, privacy and scalability. The main reasons are:
Compatibility and transition: As the Bitcoin network grows and technology advances, new address formats are introduced, but in order to maintain backward compatibility, the 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 addresses (Bech32 addresses) have more advanced security features, while P2SH addresses are often used for advanced transaction scripts such as multi-signatures, providing more flexibility and security.
Technical innovation: New address formats are often created to introduce new technical features and improvements. For example, Bech32 addresses introduce Segregated Witness, an important technical upgrade designed to increase transaction throughput, reduce transaction fees, and enhance the security of the network.
User experience: Different types of addresses may affect the user experience and interaction methods. For example, Bech32 addresses have higher error detection capabilities, which can reduce the risk of users entering the wrong address, thereby improving the user experience.
In summary, Bitcoin requires multiple address types to meet the needs of different users and continuously promote technological innovation and development to provide safer and more efficient blockchain solutions.
Q. How many types of BTC addresses are there now?
There are four types of BTC addresses, each with slightly different address formats and uses. Here are some common types of Bitcoin addresses:
P2PKH (Pay-to-Public-Key-Hash): This is the most common address type, starting with "1". This address type is the earliest and most widely accepted. For example: 1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2
P2SH (Pay-to-Script-Hash): Starts with "3" and is used for multi-signature and other complex transaction scripts. This address type's script is verified in the transaction. For example: 3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy
Bech32: Starting with "bc1q", it is the latest address format of Bitcoin, also known as the native segregated witness address (Segregated Witness). Bech32 addresses have higher error detection capabilities and support more advanced features such as segregated witness. For example: bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq
Taproot address: This type of address starts with "bc1p". In order to improve the efficiency of block space and improve costs, SegWit introduced some changes in the way addresses are constructed. Therefore, based on the SegWit address, the Taproot address was developed, which further reduces storage space, improves transaction efficiency, and provides better privacy.
Q. Why is it called P2PKH (Pay-to-Public-Key-Hash)?
The term P2PKH (Pay-to-Public-Key-Hash) was defined by Satoshi Nakamoto, one of the founders of Bitcoin. The term means pay to public key hash. In a P2PKH transaction, the payer sends funds to the public key hash address of the receiver, rather than directly to the receiver's public key. This improves privacy and security because the public key hash address does not directly expose the receiver's public key.
In a P2PKH transaction, the recipient's address is a hash value generated using its public key rather than the public key itself. One benefit of this is that even if the public key hash address is leaked, the recipient's actual public key will not be leaked, so security can be increased. At the same time, this also makes the transaction data in the blockchain more compact because the public key hash address is relatively short.
In summary, P2PKH is a common, simple Bitcoin transaction type designed to improve privacy and security while keeping transaction data compact.
Q. 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 rather than directly with a public key or public key hash.
This method was introduced to support more transaction types, such as multi-signature transactions and other complex transaction scripts. In a P2SH transaction, the recipient address is a script hash, not an actual public key or public key hash. This means that the sender only needs to know the hash value of a script, not the specific content of the script. Only when spending the output, the actual script that matches the script 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 improving the security and privacy of the network.
Therefore, P2SH, as a transaction output type, provides an important foundation for the development and innovation of the Bitcoin network.
Q. Why is it called Bech32?
The Bech32 address is named after the first letter "B" of the last names of its designers Pieter Wuille and Greg Maxwell, and an error detection/repair algorithm called "ech". This algorithm uses the pronunciation rules of phonetic symbols in 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 this address design, and "32" indicates that the address length is 32 characters. Therefore, the name of the Bech32 address can be said to be a descriptive name composed of the key features of its design.
Q. When using some BTC wallets, why is the wallet address different each time?
In some Bitcoin wallets, a new address is generated every time a transaction is received or sent. This is for privacy and security reasons:
Privacy protection: Using new addresses can increase user privacy. If a user uses the same address for each transaction, then these transactions can be traced back to the same address, exposing the user's transaction history and fund flow. By using new addresses, users can better protect their privacy and reduce information leakage to others.
Security enhancement: Changing addresses regularly can reduce attacks on specific addresses. If an address is tracked and attacked by a malicious party, using a new address can reduce the risk of attack. In addition, if a user's private key is exposed, only the funds on the address associated with the private key will be threatened, and the funds on other addresses will remain safe.
Follow best practices: Many security experts recommend changing your addresses regularly as a best practice to help keep your personal funds safe and private.
Although generating a new address each time may cause some inconveniences, such as the need to update the receiving address, this practice can improve the user's privacy and security level, and is therefore adopted by many Bitcoin wallets.
Q·Shouldn’t I need to change wallets for multiple addresses?
Generating new addresses is usually done by using Elliptic Curve Cryptography (ECC). The elliptic curve cryptography algorithm used in Bitcoin is secp256k1, which is a widely used encryption algorithm in the cryptocurrency field.
Specifically, the wallet uses an elliptic curve algorithm to generate a pair of keys: a public key and a private key. Then, an address is generated from the public key. Every time a new address is generated, a new public and private key pair is generated, and thus a new address is generated.
This ensures that each address is associated with a unique key pair, which enhances security and privacy. At the same time, due to the efficiency of elliptic curve cryptography, the process of generating new addresses is usually fast.
Q. Isn't that wrong? Generate multiple addresses?
Many modern Bitcoin wallets use HD Wallet (Hierarchical Deterministic Wallet) technology to manage addresses. HD Wallet can more conveniently manage a large number of addresses and provide some additional security and backup features.
HD Wallet generates a series of key pairs (public and private keys) by using 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 Restore: By backing up the seed, users can easily back up their entire wallet and conveniently restore all addresses and funds when needed.
Determinism: Since all addresses are derived from the same seed, the entire chain of addresses can be generated deterministically without having to save the private key for each address in the wallet.
Better privacy: HD Wallet can generate a new address for each transaction without exposing the previously used addresses. This can enhance the privacy of users.
Hierarchical structure: HD Wallet supports hierarchical structure, which can create multiple sub-wallets, each with its own seed. This structure helps to manage funds for multiple accounts or purposes.
Therefore, modern Bitcoin wallets usually adopt HD Wallet technology to provide better user experience, security, and privacy protection.