Keplr, Explained: "Coin Type 118"

Keplr, Explained: "Coin Type 118"

This blog post was originally published on Keplr's Medium blog on December 16, 2021.

Introducing a new blog series expounding on IBC and how we're shaping it as a community.

Introduction

It's exciting to be part of a community that grows exponentially, and when it comes to building the world's leading IBC wallet, nothing is more important than making sure we're inclusive to all the great projects that users love and support.

We're launching the Keplr, Explained blog series to break down some of the intricacies of the IBC development process that cause things to take time, resources, and/or a lot more collaboration than you'd expect. We invite the community to learn more about the technology behind these great projects with us.

In today's post, we'll cover BIP44 coin types, why it matters in the interchain universe, how it affects interchain UX, and what the implications are for now and down the road.

From Mnemonic Phrase to Address: Why 'Coin Types' Matter 📝

Crypto addresses are always derived deterministically. In simple terms, determinism means that as long as all the variables are the same, the same mnemonic will always generate the same address.

Most blockchains follow the BIP44 standard, which defines a 'coin type' as one of the variables. Cosmos addresses are also generated using this same BIP44 standard. Satoshi Labs' SLIP-44 registry lists the coin types for various blockchains as the current industry standard. For example, Bitcoin (BTC) is coin type 0 and Atom (ATOM) is coin type 118.

Two main reasons for coin types to exist:

  • To prevent a 'replay attack,' where a signed transaction submitted on one chain is submitted to another blockchain that treats it as valid.
  • To prevent privacy issues where knowing someone's Bitcoin address also reveals their Litecoin address.

By designating one coin type per blockchain, the same mnemonic will create the same address on a per-blockchain basis but not across different blockchains. Another important point: the SLIP-44 registry is enforced by social consensus.

The Thing about Social Consensus 🤝

Social consensus is one of the most challenging yet crucial mechanisms in crypto. In crypto, wallets are the primary 'enforcement agency' of address derivation paths. For example, Ledger enforces the BIP44 coin type by requiring each blockchain's Ledger app to have a designated coin type.

Currently, Keplr only supports the Cosmos Ledger app (coin type 118), but various coin types for mnemonics are stored locally on the user's devices.

Here Comes the Interchain ⛓️

Cosmos is built around the ethos of 'sovereign, interoperable, application-specific blockchains.' The BIP44 standard was created at a time where cross-chain interactions didn't exist. Today's interchain looks more like a forest where the flora of its ecosystem are intertwined, rather than the potted plant garden we expected. Interactions across blockchains, and therefore coin types, are now common.

So, How Does Keplr Deal with Coin Types? 🧐

When considering IBC and interoperability, coin types can get tricky. Currently, Keplr derives all addresses via directly creating/importing a mnemonic phrase in the defined SLIP44 coin type (i.e., Cosmos Hub 118, Terra 330, Starname 234, etc.).

However, as Keplr only supports the Cosmos Ledger app, addresses imported via Ledger are always derived using Cosmos Hub's coin type 118. We do not have a plan to support other Ledger apps. We believe that in most cases, there are enough commonalities across Cosmos SDK chains where a separate Ledger app is not a necessity.

Furthermore, considering Ledger Nano S can only fit about 3 Ledger apps, interchain UX will become unsustainable if each Cosmos chain required its own Ledger app in a world of hundreds of blockchains.

Coin Types in the Future 🔮

Applying standardization will always be complex when considering the sovereignty of Cosmos — it's a balancing act between providing the best UX and being as interoperable as possible. Like any standard, everything has its pros and cons, and the sovereignty that Cosmos guarantees means each chain gets to choose how they want to handle coin types.

While Keplr recommends chains use the 118 coin type, how that should be enforced has no clear right answer. We're seeing IBC grow at an exponential rate and these considerations will only become more critical over time. The decisions we make today will shape how we get there.

Keplr, Explained is a blog series published by the Chainapsis team to equip the Cosmos community with more understanding about IBC technology, its development, and the teams behind them.