2

The Bitcoin Wiki page for Bech32 addresses explains how one can create a bech32 address from a public key. In step 6 it says-

Compute the checksum by using the data from step 5 and the H.R.P (bc for MainNet and tb for TestNet)

I went through the bip 173 wiki page which explains the checksum process. However I do not know python and cannot understand most of it.

How does one compute the checksum? Is there some library I can use? I mainly develop in Java/Kotlin/C++. Either an explanation of the python code on the bip173 page or libraries/code snippets in the languages I develop in will be greatly appreciated.

1 Answer 1

4

You may want to look at the reference implementation section: https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki#reference-implementations

It lists implementations for various languages, including C, C++, and JavaScript

1
  • Just to add to this answer, this pr on the github page has the java example.
    – Nissim R
    Commented Oct 29, 2021 at 4:00

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.