romanz / electrs

An efficient re-implementation of Electrum Server in Rust
MIT License
1.07k stars 396 forks source link

Feature: Add support for Taproot / bech32m / P2TR / bc1p addresses to history.py #683

Closed C-Otto closed 2 years ago

C-Otto commented 2 years ago

The history.py script in contrib/ does not support taproot addresses:

./history.sh --venv bc1p5d7rjq7g6rdk2yhzks9smlaqtedr4dekq08ge8ztwac72sfr9rusxg3297
[2022-02-12 15:39:33.603812] INFO: electrum: connecting to localhost:50001
Traceback (most recent call last):
  File "/home/cotto/git/electrs/contrib/history.py", line 159, in <module>
    main()
  File "/home/cotto/git/electrs/contrib/history.py", line 56, in main
    script_hashes = [
  File "/home/cotto/git/electrs/contrib/history.py", line 57, in <listcomp>
    _script_hash(network.parse.address(addr).script())
AttributeError: 'NoneType' object has no attribute 'script'

I'd like it to parse P2TR addresses (witness version 1, bech32m) similar to existing bech32 support.

C-Otto commented 2 years ago

This seems to be fixed with https://github.com/richardkiss/pycoin/commit/5717a6bc03436356d512f62694cedbad111e7fe2, which is not part of the latest release/tag.

C-Otto commented 2 years ago

Superseded by https://github.com/richardkiss/pycoin/issues/393.