Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for bc1 addresses (Bech32) #12

Closed
bsubasic opened this issue Dec 30, 2020 · 4 comments
Closed

Support for bc1 addresses (Bech32) #12

bsubasic opened this issue Dec 30, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@bsubasic
Copy link

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
@graymauser
Copy link
Owner

Hello,
thanks for pointing this out. I didn't consider the bech32 addresses when writing this script. I'll look into this when I have free time.

@graymauser graymauser added the bug Something isn't working label Jan 7, 2021
@linux-mining
Copy link

This would be awesome if you can update this. I use this script a few times a year. Thanks for your efforts on this by the way.

@graymauser
Copy link
Owner

graymauser commented Jan 6, 2022 via email

@who-biz
Copy link

who-biz commented Aug 2, 2022

@bsubasic @linux-mining

I have PRed changes to support bech32 addresses here: #34, in event you are still in search of a solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants