3

One of the reason for bech32 address is: "it'easier to dictate it over the phone".

Is there an algorithm to convert a bech32 address into a list of English words that would make it even easier?

Something like BIP39 but inverted (address to words instead of words to seed).

The dictionary used in BIP39 would be enough? How many words would be necessary at best to express an address?

Probably it is better to dictate the address than 50 words but what about 25 or so?.

2 Answers 2

6

The NATO phonetic alphabet is designed for this purpose and is very widely recognized by a number of people in communication critical industries. The words are clearly recognizable even to the unfamiliar and is intended to not be able to be mistaken. Due to bech32 encoding there’s no need for communication of capital letters as you would need for p2pkh addresses.

bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq

becomes

Bravo Charlie One Quebec Alpha Romeo Zero Sierra Romeo Romeo Romeo Seven X-ray Foxtrot Kilo Victor Yankee Five Lima Six Four Three Lima Yankee Delta November Whiskey Nine Romeo Echo Five Nine Golf Tango Zulu Zulu Whiskey Foxtrot Five Mike Delta Quebec

2
  • 2
    This also has the advantage of not needing any additional software to convert between bech32 and another encoding - the alternative would hurt compatibility. Commented Apr 19, 2019 at 17:26
  • The NATO phonetic alphabet has NINER instead of NINE, FIFE instead of FIVE and so on. These alternate words for numerals are intended to reduce transcription errors. Commented Apr 20, 2019 at 12:24
2

Is there an algorithm to convert a bech32 address into a list of English words that would make it even easier? Something like BIP39 but inverted (address to words instead of words to seed).

@Anonymous answer tries to answer the question in terms of dictation, but since the question is looking for BIP 39 inversion, I have tried to answer the question keeping that in mind. The number of words to dictate decrease significantly as well in this way. However, this transmits information without the error recovery and detection, in a way that requires a custom decoder. Moreover some wallets do not follow BIP-39 standards, and such derivation path may lead to potential loss of funds. BIP39 is also not designed for verbal unambiguity

You could design a software that takes words (similar to BIP39) from users and converts it to bech32 addresses. Let me take the example of bech32 address given in the BIP 173 documentation. So we have two addresses (1) P2WPKH: bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4 and (2) P2WSH: bc1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qccfmv3.

(1) P2WPKH: This is basically base32encode of the witness version and the hash160 of the public key. Decoding the bech32 address bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4 gives us a witness version 00 and payload of 751e76e8199196d454941c45d1b3a323f1433bd6. Now, use this payload of 20 bytes as the entropy. For a 160 bit entropy, According to the BIP-39 documentation, we need to append first five bits of the checksum to the entropy that gives us total of 165 bits. Given each word of the BIP 39 mnemonic represents 11 unique bits, we can represent the P2WPKH address with 15 words. Use this tool and enter the entropy this gives the words as : insect victory ring creek bonus health false logic easy mirror trip elevator before over fossil.

(2) P2WSH: This is basically base32encode of the witness version and the SHA256 of the script. Decoding the bech32 address bc1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qccfmv3 gives us witness version of 00 and payload of 1863143c14c5166804bd19203356da136c985678cd4d27a1b8c6329604903262.Use this 32 bytes of payload as the entropy. Since payload is 32 bytes, we need to use first 8 bits of the checksum. This gives us total size of 264 bits, which can be represented in 24 words (recall, each BIP 39 mnemonic word is 11 bits). Using the payload as entropy we get the words as: blur board audit civil fabric cross base permit cage one repair chat sister clinic tobacco predict chicken assist cover gown gate elite sister flush

3
  • This manages to transmit the same information without the error recovery and detection, in a way that requires a custom decoder. I'd suggest against making something custom for this sort of task given the very real potential for loss of funds. BIP39 is also not designed for verbal unambiguity.
    – Claris
    Commented Apr 20, 2019 at 2:10
  • Thank you. This address better my question for sure but as Anonymous and Pwuille pointed out, what I was looking for has few important drawbacks. Commented Apr 22, 2019 at 8:04
  • @Anonymous very valid point. Having a custom decoder is a big pain as some wallets also do not follow the bip-39 derivation. I just wanted to provide a way as to how it can be done because of the nature of question. I'm editing my answer to reflect that this method should be used with heightened caution.
    – Ugam Kamat
    Commented Apr 22, 2019 at 8:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.