Name and Address Please!

Friends, if you want somethin’ delivered to you, yer gonna need yerself some kind of postal address so you can get yer mail. Now this is common knowledge, but when it comes to the digital Wild West, the subject of addresses becomes a little more complicated.

Fact of the matter is, there are several different address types, each of which has its own distinct advantages and disadvantages. What you pick fer yer project is entirely your choice, but you can’t just go and choose any old address type. No siree! Yer gonna need to think real long and hard about this choice and how it relates to yer unique use-case if you actually want to achieve the objectives you have in mind.

If this sounds a little daunting, have no fear! Buckley and the Bearmint gang have all the answers you seek - let’s take a little time to discuss address algorithms in a little more detail so any uncertainty you may be feelin’ dissipates in no time at all! So without further ado, let’s get to it!

Take It to the Bank!

Think of a blockchain as a bank for cryptoassets where addresses serve the same purposes as bank account identifiers (like an IBAN to let others know where they could send funds to pay you for goods and services).

To illustrate, Bitcoin addresses start with either a 13 or bc1 and typically contain between 26 and 35 alphanumeric characters - for example bc1pw508d6qejxtdg4y5r3zarvary0c5xw7kw508d6qejxtdg4y5r3zarvary0c5xw7kt5nd6y is an address that conforms to the BIP350 standard (commonly referred to as bech32m).

An address is generated from the private key, which is required to transfer assets assigned to this address to another address or addresses. In order to send cryptoassets, it’s necessary to hold and have access to the private key, which is basically a cryptographic code that functions as a kind of secret password. This in turn allows the user to sign a transaction and transfer funds to another address. Simple as that!

What’s All the Hubbub? Just Use the Most Popular One!

Well, it really isn’t that simple. When picking your address algorithm, you’ll have to take a few things into consideration:

  • Do you require interoperability with other networks like Bitcoin or Ethereum?
  • Are you concerned with the size that an address has because available storage is a major constraint for you?
  • Is readability for end-users a concern?
  • Do you worry about the possibility of catching typos for end-users?

These are just a couple of the factors you’ll need to take into account, so it’s not just a popularity contest. That said, there are definitely some contenders that are stronger than others! Now let’s spend some time checking out which address algorithms Bearmint offers out of the box and why they may prove to be useful for your specific use-case.

Algorithms

BIP13

BIP13 are close to the oldest addresses that exist today. They’re the first revision of the Bitcoin addresses that were used when it first launched back in 2009. The original addresses started with a 1 (for example, 15e15hWo6CShMgbAfo8c2Ykj4C6BLq6Not). BIP13 changed this to 3 so that addresses would look more like 35PBEaofpUeH8VnnNSorM1QZsadrZoQp4N - but we’re not going to go into the nitty gritty as to why here - check out their proposal if you want to find out more about that!

BIP173

BIP173 are bech32 addresses - you’ll probably recognize them by their bc1q prefix if you use Bitcoin regularly. For example, bc1q42lja79elem0anu8q8s3h2n687re9jax556pcc is a valid address according to BIP173.

These addresses are easy to identify owing to their unique prefix derived from the network they belong to. They also contain an error correction code that notifies users when they make mistakes while typing out an address.

BIP350

BIP350 is a revision of BIP173, and at face value, addresses are virtually identical (you wouldn’t be able to detect any kind of visual difference). However, it resolves some security concerns related to BIP173. Be sure to check the proposal if you want to know more about that.

These addresses share the same traits as BIP173 but feature improved security. This is the latest and greatest option that is available for a whole range of of use-cases.

EIP55

EIP55 addresses are exactly what you’re looking for if you interact with any Ethereum-based blockchain. These addresses are Keccak-256 hashes prefixed with 0x to indicate that the value that follows it is a hex string.

These addresses are difficult to distinguish from public and private keys and have no error correction mechanisms to catch any typos that users might make. However, they do offer the possibility of interoperability with Substrate-based networks (such as Polkadot and Kusama).

SS58

SS58 isn’t all that different from BIP13 but was designed for use on Substrate-based networks (such as Polkadot). This address format is based on base-58 encoding and is useful in that it allows you to derive multiple addresses from the same public key.

These addresses are shorter when compared with BIP173 and BIP350 but have no error correction mechanisms in place to catch any typos made by users. As with EIP55, they do offer the possibility of interoperability with Substrate-based networks.

secp256k1

These types of addresses are simply a hash of the public key that use the secp256k1 algorithm.

These are difficult to distinguish from public and private keys and and are generally only used for validator identification.

Ed25519

These types of addresses are simply a hash of the public key that use the Ed25519 algorithm.

These are difficult to distinguish from public and private keys and and, as with secp256k1, are generally only used for validator identification.

Sr25519

These types of addresses are simply a hash of the public key that use the Sr25519 algorithm.

These are difficult to distinguish from public and private keys and and, as with the previous two address types, are generally only used for validator identification.

How In the World Do I Decide, Amigo?

In all honesty, it depends entirely on your unique use-case, but if you want a jack of all trades, you can’t go wrong with BIP350 - it offers a unique prefix, making it easier to distinguish addresses between networks (plus, it’s branding!). On top of this, it also offers error corrections to help users whenever they make a typo.

However, if you’re looking to optimize your storage space and every byte counts, then you’re probably better off with more verbose (but significantly smaller) addresses like EIP55 or Ed25519.

Regardless of the scheme you decide to use, Buckley will do whatever it takes to ensure that anythin’ sent yer way will arrive in due time!

In future posts we’ll provide you with some more details on how to implement your address derivation algorithm, so keep yer ear to the ground if you want to find more about that partner!