Bijective Mnemonic Phrases

Mnemonic phrases for cryptographic keys, addresses etc.

View the Project on GitHub osolmaz/bijective-mnemonics

Abstract

This document describes a method of representing public cryptographic keys, addresses etc. with human readable mnemonic phrases. The method makes it easier to convey addresses over the phone or write them down. It works by partitioning the address into bits which encode an index in a list of words.

Motivation

BIP39 is a scheme that achieves a similar feat: representing entropy used in generating private keys with mnemonic phrases. In BIP39, a binary seed is generated from the mnemonic, which in turn is used to generate private keys as described in BIP32 called Hierarchical Deterministic Wallets. In a way, the mnemonic represents the private keys; but the relation is not bijective and its inverse is not computable.

Here, we describe a similar scheme that maps addresses to mnemonics and is computable both ways. Encoding an Ethereum address requires 160 bits of entropy which corresponds to 15 words with a list of 2048 words. For increased efficiency, we introduce a list of 4096 words which can do the same with 14 words.

Word lists

The words should be selected smartly, similar words should be avoided, and the list should be sorted alphabetically as stated in BIP39.

Generating the Mnemonic

  1. The given address is converted into a byte array and its SHA256 hash is computed.
  2. First 8 bits of the hash is appended to the end of the byte array which results in 168 bits.
  3. The concatenated bits are split into 14 groups of 12 bits, each encoding a number from 0-4095, serving as an index to the word list.
  4. The words are retrieved through the indices and joined to obtain the mnemonic phrase.

Below are interactive boxes that convert addresses to mnemonic phrases, and vice versa.

Address to Mnemonic

Enter Address:

Corresponding Mnemonic Phrase:

Mnemonic to Address

Enter Mnemonic Phrase:

Corresponding Address:

Notes