James Stanley


I made a Base58 encoding/decoding tool

Sat 13 May 2017

Base58 encoding allows arbitrary data to be encoded using only alphanumeric characters. It is analogous to base64 except base58 does not map neatly on to bytes (4 base64 characters is 3 bytes), and base58 does not include any non-alphanumeric characters.

Bitcoin addresses are base58-encoded (like "1LEZsggujCJCqsbjRGLr8z3Af4by4gVrXd"), and so are IPFS content hashes (like "QmRWoZ6eCxNhNzSP72UBn9Hu4hYdxXR65Tygd9ysn6eGR2").

Bitcoin and IPFS both use the same base58 alphabet. Ripple and Flickr also use base58 but have incompatible alphabets. I have only implemented the Bitcoin/IPFS version.

You can use my base58 tool at http://incoherency.co.uk/base58/ or /ipfs/QmRWoZ6eCxNhNzSP72UBn9Hu4hYdxXR65Tygd9ysn6eGR2/. There is also a github repo.

I made this because Martin suggested that IPFS hashes could be made more legible if they were represented with words instead of arbitrary characters. I wanted to represent the hashes using BIP39 mnemonics to see what they look like, but I couldn't find any online tool to perform base58 encoding.

It turns out not to be useful to represent IPFS hashes with BIP39 mnemonics because they are far too unwieldy. Here is the BIP39 mnemonic for QmRWoZ6eCxNhNzSP72UBn9Hu4hYdxXR65Tygd9ysn6eGR2:

connect group poet short ranch you dash first strong view trumpet embrace crowd dose task brown angry napkin mention shift loyal drill eagle rich

If you want to learn more about IPFS, I recommend following the Getting Started guide. Learning about IPFS is a fascinating rabbithole to go down. I've been evangelising IPFS this week to anybody who'll listen. I promise you won't regret it.



If you like my blog, please consider subscribing to the RSS feed or the mailing list: