Have you heard the term blockchain address, but aren’t sure what it is? A blockchain address is a key concept from blockchain technology and cryptocurrency adoption. In this guide you’ll get a better understanding of what these addresses are, how they get created, as well as learning some of the differences between addresses on different types of blockchains.
Blockchain Address 101
When Bitcoin was first created it had the ability to send Bitcoin payments directly to IP addresses, such as 22.214.171.124 (the IP of unblock.net). This ability was included to make it more convenient for the average person to send Bitcoins without having to deal with public keys and long addresses. However, Bitcoin’s developers soon realized that this could be vulnerable to man-in-the-middle attacks, so they removed the feature, and it hasn’t been restored to date.
You’re probably wondering what this bit of history has to do with blockchain addresses, ad it is simply a demonstration of what an address can be. In the example I gave an address is used to describe the URL of a website, but an address can also be something like a SWIFT code, or a bank account number.
The format of an address doesn’t matter at all, what matters is that it serves its purpose of helping to locate a specific location – physical or virtual. And in the case of financial transactions it needs to ensure payments reach the proper destination. It is a unique and secure identifier that facilitates payments.
First, they are not centralized like the addresses used by banks. Secondly, every possible blockchain address already exists. It existed the moment the blockchain was created, because blockchain addresses are the result of mathematical operations.
The Public Key: The Beginning of Blockchain Address Generation
Once Bitcoin abandoned the Pay to IP idea the developers switched to the Pay To Public Key Hash (P2PKH) format that you probably recognize as the current addressing system. A standard P2PKH will have 34 alphanumeric symbols, and begins with a “1” like this: 1K31KZXjcochXpRhjH9g5MxFFTHPi2zEXb
The basic idea is that when paying with Bitcoin now you are paying to the hash of some public key. I know that probably sounds like technical mumbo-jumbo, so let’s break things down and see how a P2PKH address is created so we can have a better idea of what it is.
The first thing you should know about a P2PKH address is that every wallet is capable of creating them, or more accurately discover as many as you might want or need. It all happens in the background as basic cryptographic operations.
The whole process begins with your wallet collecting entropy, and then using that to generate an ECDSA private key. This is the key algorithm used for Bitcoin addresses. It is known as an asymmetric signature algorithm, which is a type that allows transactions to be signed with the private key, and the signature is then verified by the public key. ECDSA is a cryptographic method for proving that you are the actual creator of a transaction by digitally signing it.
Then, once the private key has been created, or discovered, the wallet uses a mathematical calculation to derive the public key. While it is possible to go from private to public key, there is no way currently known to derive the private key based on the public key. So, the public key can now be used out in the world to send and receive payments.
However, the community soon found that these public keys were quite unwieldy – consisting of 65 characters. This also made them prone to typing errors, and they are further susceptible to exposing the private key if quantum computing is ever developed so that ECDSA can be broken. This led to the development of a method for creating an address from the public key.
Creating the Bitcoin Blockchain Address
When creating an address the wallet once again uses cryptographic algorithms. In short, the wallet begins by hashing the public key with SHA-256, and it then takes the result and hashes with RIPEMD-160. Subsequently the bytes 00 are added to the string as a prefix, which is why all P2PKH addresses begin with the number 1, and it also adds four checksum bytes at the end of the string. Finally the wallet converts the whole thing into a base58 string and what comes out is the Bitcoin address you’ve come to recognize.
I know that still sounds quite complex, but to be honest you don’t need to understand the cryptography occurring in the background. The important thing to understand is that the address is actually a representation of a public key, with a checksum added to avoid typing errors. Anytime you paste an address in your Bitcoin wallet it will calculate the checksum, and if it doesn’t match it will reject the address. This avoids the problem of sending funds to an incorrect address due to a typing error.
The person who holds a private key for an address is the only one who can sign a transaction for this address, and anyone who knows the address can verify the signature from the private key, without actually discovering the private key. This simple signing and verifying a transaction is pretty much what a cryptocurrency transaction is.
It doesn’t stop there either, because Bitcoin has other, more advanced address types, such as the P2SH addresses that enable things such as multi-sig transactions. Instead of going deeper into Bitcoin however, I’m going to have a look at how other blockchains go about creating addresses.
Other Cryptocurrency Addresses
So, it isn’t only Bitcoin that uses the method outlined above to create addresses. Other coins use the same ECDSA, SHA-256 and RIPEMD160 to generate addresses. Some well known examples are Dogecoin, Dash, and Litecoin. The only difference is that the RIPEMD160 hash results in different prefixes. So, Dogecoin addresses begin with a “D”, Litecoin addresses begin with an “L”, and Dash addresses begin with an “X”.
An interesting fact that comes from this, and most people are unaware of, is that since these coinds are using the same method of address creation, they can also use the same public and private keys. You can even partially store them on the same addresses. In the case of P2SH addresses, both Litecoin and Bitcoin use an 05 prefix, meaning you could store both at the same address.
There are other methods used to generate addresses though. The privacy coin Monero is based on the Cryptonote algorithm and it uses a different cryptographic signature algorithm known as EdDSA to generate a public key. It also uses what is known as a ring signature to provide its privacy. These ring signatures don’t allow others to see which key signed a transaction. This also means Cryptonote addresses have a pair of public keys – one spend key and one view key.
Crytponote adds a byte prefix and hashes the result for a checksum, but it uses Keccak-256 rather than SHA-256 to do so. The result is then converted to base58, and gives a much longer address compared to the Bitcoin addresses. A Monero address will look like this: 43ZZViHQKd42X7cajEtc6NUoxG4AvyMu3ZqpGTBP85uhEfYoPVAuGHxJcomMHEPp3NWiKJRUMnuAJ7dfBrPTcfjYMPJzz2a
These various addresses just go to show that addresses are nothing more than a way to tell others where a payment should be sent. Because of this it makes no difference what algorithms you use, how you manipulate the public key, or what the resulting address actually looks like.
However, it is important to note that the method used to create an address can have implications on usability, privacy and security. For example, the checksum makes Bitcoin more usable since it avoids issues related to mistyping an address, while Monero’s view key is partially why it is as private as it is. Now, let’s have a look at another blockchain that will drive home this point – Ethereum.
Ethereum is quite different and unique in many ways, and its address creation is one of them. Since the beginning, users of Bitcoin were perplexed when seeing Ethereum addresses, which are long hexadecimal strings beginning with 0x, like this: 0x0eb81892540747ec60f1389ec734a2c0e5f9f735.
Really, the address creation method used by Ethereum isn’t so different from Bitcoin. It begins with the private key, which uses ECDSA to create a public key, just like Bitcoin. The public key is then hashed using Keccak-256, which gives usa 32-byte string. Ethereum drops the first 12 bytes, and the 20 bytes left over yield a 40 character hexadecimal address, to which is added a 0x prefix. And that’s it. There’s no transformation to base58, which means Ethereum addresses remain hexadecimal.
There’s another critical difference with Ethereum addresses, and that’s a lack of checksum. This is why Ethereum users are heavily encouraged to always copy/paste addresses rather than manually typing them. With Ethereum there’s no protection from typing just one character wrong and having your funds gone forever.
When you compare the Ethereum address generation method it seems like the Ethereum developers simply got lazy and left the method unfinished. This is quite strange for a cryptocurrency that has been hailed as being so incredibly innovative. It also feels dangerous and reckless, and for the second largest cryptocurrency extremely unprofessional.
There’s actually a reason the addresses feel unfinished, and it’s because they are. When Ethereum was first released, no one really cared if the addresses were unfinished. And there were plans to change the address system, so what we use today is not the final iteration. Ethereum’s developers still plan on creating a name register based on smart contracts. Once this is completed, it will bring cryptocurrencies back to Satoshi’s vision, where payment addresses are far easier to use and remember. And perhaps Ethereum hasn’t chosen to use crafted addresses like Bitcoin simply because the Ethereum developers think they can improve on the method. Remember, an address is just a way to direct others to the correct location, so it only needs the proper information to allow funds to be assigned to a private key. This can be done in many ways, some of which are more complex and/or sophisticated than the method currently used by Bitcoin.
In fact, Ethereum developers are somewhat partial to the ICAP format, which is base58 and uses checksums just like Bitcoin and other cryptocurrencies. The really potentially attractive feature of the ICAP format though is that it is compatible with another existing format – the International Bank Account Number (IBAN) system. This means all the existing banking software and systems can understand and interact with these ICAP Ethereum addresses.
The IBAN is used internationally to identify customer accounts in the banking industry. The IBAN includes the customer account number, the bank, a country code, and a checksum. ICAP includes all of the same information, and uses XE as the country identifier.
Interestingly, since ICAP doesn’t need hexadecimal addresses once we switch over to name reg contracts a human readable string could be used such as XE42ETHXREGSOMEJOHNDOE, which is in the banking format, but is also easier to remember. This means eventually Ethereum addresses could be easy to remember and compatible with the banking system.
ICAP support has been growing and many clients already support it, even though the legacy address is typically used as standard. There has also been a checksum added to Ethereum in the form of capital letters. So, any Ethereum address with a capital letter is checksum protected against typing errors.
Using a Username as Your Address
There’s one cryptocurrency that has already found a way to implement human readable addresses, and that cryptocurrency is STEEM. With STEEM, your username is also your wallet address.
STEEM was created based on the same concept as BitShares. It was initially linked to the social media platform Steemit, but has since grown to be linked to several other social media platforms with different focuses. The STEEM system uses something called proof of brain, and it is a combination of proof of work and proof of stake, where users generate coins by posting original materials that is then “upvoted” or approved of by other users. Overall the system is fairly complex, and the ability to delegate voting power, and a system of curation that also pays small mining fees. It also includes three different forms of tokens which are used in different ways to avoid inflation, provide stability, and incentivize users not to cash out of the system.
STEEM has been criticized as being too centralized, but its address concept is nonetheless very intriguing. While it may be more centralized, STEEM seems to have already accomplished what Ethereum hopes to do with smart contract name registrars. With STEEM each user receives a private key that can be used to sign transactions. Address are not derived from these private keys though, and are instead simply the usernames selected during account creation on Steemit. The usernames are connected to public keys on the STEEM blockchain, allowing signature and transaction validation, but the way this happens is unique since the public key/address connection is not algorithmically based, but is instead based on trust to the Steemit platform.
While the Steemit platform may not survive, the username based address system created for it is interesting in that it provides an almost ideal usability. Unfortunately the STEEM system lacks transparency and decentralization, and nearly every other blockchain prefers a math based solution rather than relying on platform trust.
If Ethereum can provide a decentralized, trustless cryptocurrency with the ease of the STEEM username address system we would be taking a great step forward in blockchain and cryptocurrencies.