What is a legacy bitcoin address?
The legacy address is the standard address for the bitcoin network proposed by Satoshi Nakamoto. Otherwise, this format is called P2PKH (Pay To Public Key Hash), because it requires the recipient to sign a signature calculated from the private key and the public key. An exit transaction script using cryptographic functions compares them with a public key hash - and in case of a match, it allows you to spend money. The probability that the system will accept an incorrectly entered address is 1 in 232 degrees, that is, one case out of 4.29 billion. The legacy address can be recognized by the prefix 1 (and m or n in the test network). The main disadvantages of this address include case sensitivity when entering data, higher transaction fees, low double hash speed of the checksum, more weight in QR codes and the inconvenience of writing on a mobile device or on paper.
Example legacy address:
1BUrDeWstWetqBFn5Au8m4JFg2xJaKVN4
What parts does a legacy bitcoin address consist of?
Legacy addresses are unique, usually 26-35 characters long and are 160-bit ECDSA public key hashes of the key pair. With the advent of SegWit addresses, they began to be called old, but initially they were a fairly effective means of presenting locking scripts in a more user-friendly way and reduce the risk of sending funds to an incorrect address. The standard bitcoin address consists of the following parts:
- prefix;
- The public key generated as a result of applying the SHA256 and RIPEMD algorithms to the private key;
- check sum.
Why is there a different number of characters in bitcoin addresses?
If during the conversion of the private key, zeros appeared at the beginning of the result, they are not included in the string of bitcoin addresses in legacy format, and then it is reduced by the corresponding number of characters. Therefore, the bitcoin address may not consist of 34, but theoretically even 20 characters.
How are parts of the legacy address encrypted?
All parts of the legacy bitcoin address are encrypted with typos protection using the Base58Check encoding system. The code is based on the Latin alphabet. You will never see symbols in such a bitcoin address that can be easily confused with each other (plus and minus signs, slash, zero, uppercase letters “o” and “i”, lowercase “L”). According to Base58Check, only the following 58 characters are used in them:
123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz
What is a P2SH bitcoin address?
P2SH addresses (Pay to script hash) appeared in the proposal to improve bitcoin BIP-0016 in January 2012, thanks to the chief researcher of the Bitcoin Foundation Gavin Andresen. They have the same structure as legacy addresses, but begin with the number 3. Such addresses assume that the recipient must have a script that matches the hash script when transferring funds. This feature allows you to reduce the commission for the transfer of bitcoins by the sender, shift the commission costs to the recipient and create addresses with multi-signature.
P2SH technology can allow the use of funds by any user or, conversely, prohibit it for everyone. It is important to remember that bitcoin addresses in P2SH format support SegWit, but are not its native solution. Crypto-wallets that do not support SegWit can conduct SegWit transactions thanks to the P2WPKH-in-P2SH and P2WSH-in-P2SH mechanisms.
An example of a P2SH address:
3H28N5WuREZ93CNmhWcRcrnykWrMqkhFyWN
What is a SegWit Bitcoin Address?
In the spring of 2016, developers Peter Velle and Greg Maxwell in the BIP-0173 update proposed a new address format: Bech32 (often called a SegWit address, P2WPKH - Pay to Witness Public Key Hash). The SegWit protocol itself (Segregated Witness, “Separated Witness”) suggested reducing the block size in the bitcoin network by removing the signature from it and was activated at the end of August 2017.
SegWit addresses begin with bc1 (in the test network with tb), contain up to 90 characters (more often about 42), and are written either only in upper (for QR codes) or only in lower case (preferred). SegWit Addresses consist of:
- human-readable parts
- separator (1),
- data and checksum.
If up to four errors were made when entering the address, the checksum included in the Bech32 address will not converge. Thanks to the Bose-Chowdhury-Hockingham code (BCH code) used in the solution, errors will be automatically corrected.
When writing a Bech32 address, the following 32 characters are used:
acdefghjklmnpqrstuvwxyz234567890
Example Bech32 Address:
bc1uf5tdn87k2uz7r2kl5zrfww362ch3746lq5vse7
What are the pros and cons of using Bech32 addresses?
With new addresses, QR codes have become smaller, and error protection is higher. In addition, the use of Bitcoin addresses in Bech32 format is more profitable for users today, because the fee for sending funds from them is lower and the processing speed is higher. The main disadvantage Bech32-addresses - they do not support all cryptowallets and services.First support for such hardware addresses added cryptowallets Ledger Nano S, TREZOR and Digital Bitbox, desktop cryptowallets Electrum and Armory, mobile cryptowallets Edge, GreenAddress (for iOS- and Android- devices), as well as Samourai Wallet, Wasabi Wallet, GreenBits, and Electrum (for Android devices).
Is it possible to transfer bitcoins from a legacy address to a SegWit address?
Activating SegWit on the Bitcoin network was a soft fork - this means that the new and previous versions retained compatibility. That is, you can easily transfer funds from legacy addresses to SegWit addresses. At the blockchain level, there are no problems with the difference in the address formats. In practice, difficulties arise if the user wants to transfer funds from his legacy address, for example, created on the cryptocurrency exchange , to the bc1 address, and the marketplace has not yet technically implemented support for the new address format . In this case, it is worth using a less effective than bc1-, but still more advanced than legacy-P2SH-address.
In the opposite direction, from the bc1 address to the legacy address, funds should arrive without problems.
Which block browsers track bc1 addresses?
It is convenient to monitor the adaptation of Bitcoin addresses in Bech32 format on a special page in the Bitcoin Wiki . Today, bc1 addresses are parsed and indexed by block browsers of Blockstream.info, Apirone . com , Bitaps . com , Bitupper Explorer, Blockchair, Blockonomics, Blockpath, BTC . com , chaindex and OXT. While Blockcypher, Insight and Tradeblock do neither, blockchain.info does not support indexing.