Skip to content

Support for bc1 addresses (Bech32) #12

Description

@bsubasic

It seems that the converter doesn't support the new BTC address format that starts with bc1 and is usually longer in length.

example:

37XuVSEpWW4trkfmvWzegTHQt7BdktSKUs (older format)
bc1qgdjqv0av3q56jvd82tkdjpy7gdp9ut8tlqmgrpmv24sq90ecnvqqjwvw97 (new format)

This is the error when it tries to convert it:

Traceback (most recent call last):
  File "D:\btcposbal2csv\convert2ripemd160.py", line 41, in <module>
    process(args.csvin)
  File "D:\btcposbal2csv\convert2ripemd160.py", line 19, in process
    ripemd_bin = tocondensed(row.split(',')[0])
  File "D:\btcposbal2csv\convert2ripemd160.py", line 7, in tocondensed
    return base58.b58decode(add_or_pk)[1:-4]
  File "C:\Users\Lenovo\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\base58\__init__.py", line 96, in b58decode
    acc = b58decode_int(v, alphabet=alphabet)
  File "C:\Users\Lenovo\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\base58\__init__.py", line 79, in b58decode_int
    decimal = decimal * 58 + alphabet.index(char)
ValueError: subsection not found

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions