Bitcoin is constantly evolving. Developers are actively working to improve the technology and make it better plus more secure for people to use.
Bitcoin address has been one such area of development that has seen quite a few changes each version improving upon the last.
Transaction fee and size have been the major topics of improvement in most versions, in addition to security, multi-sig & speed.
So what are these bitcoin address types and which one should you use?
The earliest form of bitcoin address, Legacy addresses use a function called P2PKH (Pay to PublicKeyHash), which basically hashes your public key into an address. All legacy addresses start with “1”.
Being the earliest form of bitcoin address it does come with some inherent issues:
These addresses are case sensitive making them inconvenient and prone to error when entered on devices or paper.
Additionally, they are particularly large in size which in turn increases their transaction fees when broadcasted to the blockchain network.
This is also the reason why the bitcoin block which can only hold a finite number of transactions due to its 1 MB limit started clogging up quite frequently whenever there was a surge in transactions.
Hence to fix these issues newer address types were developed by bitcoin developers.
Soon after legacy addresses came P2SH, proposed by Gavin Andersen in 2012 aimed to reduce the transaction size and hence the fee.
These types of addresses start with “3”
A typical address looks something like this:
P2SH addresses work by partly transferring some of the responsibility to the receiver. This essentially means that they are less heavy in size and hence save about 25–40% in transaction fees when compared to legacy.
Native Segwit [Bech32]
In 2017, the bitcoin network implemented segwit support, which separates the signature from the witness data from inputs and outputs, thus making the transactions more secure and further reducing their size.
With segwit came a new form of address known as native segwit or commonly called bech32.
These addresses start with “bc1”, here’s an example:
bech32 addresses are all lowercase and never contain the number “1” and the letters ‘b’, ‘i’, ‘o’ to avoid reader confusion.
In addition, it also has an error detection mechanism that prompts users of any mistakes/modifications made to the address.
However, a vulnerability was detected in bech32 error detection mechanism.
An upgraded version of bech32, bech32m fixes the error that was discovered in bech32 addresses.
When a Bech32 string ends with a “p”, adding or removing “q”s before the “p” does not invalidate it. Bech32m removes this vulnerability by changing a constant used in the encoding scheme and is thus more secure.
In addition, bech32 also supports taproot, a major upgrade brought to the bitcoin protocol. It batches multiple signatures and transactions together, making it easier and faster to verify transactions on Bitcoin’s network and also making transactions more secure.
In all other regards, bech32m and bech32 are pretty much the same.
If you wish to know more you can refer to this videoSupport
While all addresses are designed to support each other in terms of sending/receiving bitcoin, the wallets where they reside may not be the same.
Certain wallets do not allow for cross interaction with specific versions of addresses and users are advised to check the compatibility before making any transactions.
Bitcoin technology is constantly evolving with each version getting better and more strong.
What started with a simple legacy address has now evolved to a better and improved bech32m that fixes that many vulnerabilities and issues seen in the many versions before it.
It’s always better to use the latest type of bitcoin address but this does invalidate the previous versions.
While legacy type addresses are the original bitcoin address type they are more expensive and less secure for users. The same goes for segwit addresses which are less expensive [25–40% cheaper] than their predecessor but not from their successor, although they are widely supported by wallets and exchanges alike.
Even cheaper in fee than segwit, bech32 is right now one of the most commonly used/supported address types by crypto wallets but its use by exchanges is limited.
bech32m is the latest upgrade to the bitcoin address types although its adoption is minuscule compared to others.
This is a companion discussion topic for the original entry at https://insights.blockonomics.co/what-are-the-types-of-bitcoin-addresses-and-which-one-should-you-use-459cbe8ce46c/