SomberNight
001ca775a9
descriptor.py: speed-up DescriptorChecksum a bit
3 years ago
SomberNight
4315fa4371
BIP-0350: use bech32m for witness version 1+ addresses
...
We have supported sending to any witness version since Electrum 3.0, using
addresses as specified in BIP-0173 (bech32 encoding).
BIP-0350 makes a breaking change in address encoding, and recommends using
(and using only) a new encoding (bech32m) for sending to witness version 1
and later. The address encoding for currently in use witness v0 addresses
remains the same, as in BIP-0173; following the BIP-0350 spec.
closes https://github.com/spesmilo/electrum/issues/6949
related:
cd3885c0fb/bip-0350.mediawiki
https://github.com/bitcoin/bitcoin/pull/20861
5 years ago
SomberNight
e0cfb2179d
bech32: another around 10% speedup for bech32_decode
...
turns out stdlib ord() is somewhat slow;
also, only lookup data chars once
benchmarked with:
```
import time
import electrum
from electrum.segwit_addr import bech32_decode
electrum.constants.set_testnet()
inv = "lntb4m1p00zfpppp597ely08ffhk8n3emeswukt0y3qfvt3sj3ufkhnaatlrswj2xvwuqsp5vu3ezu44ka8arvgda44yalysp3k3edlvg56cjkk5lvu4e4anmdssdq2v9ekgctnvscqzynxqyz5vq9qypqsqrzjqv8shunq4nda8mw2mpxhtz8v03wlgug7sln2yvqklxym35ayz3erqxct8vqqqcqqqqqqqqlgqqqqqqgq9qrzjqdxvvgt048y4htef7r63r4ha9kctz3d6l3za0053ahe597wgrkc4gxct8cqqqfsqqqqqqqlgqqqqqqgq9qrzjqwyx8nu2hygyvgc02cwdtvuxe0lcxz06qt3lpsldzcdr46my5epmjxct8vqqqdcqqqqqqqlgqqqqqqgq9qrzjqf56jn5txtqqtepnd0ahg0qg5m5mavfajsx403rem9wgu6rue0de7xct8vqqqtgqqqqqqqlgqqqq86qq9qrzjq027z73uyyl7fy8pkrpcn7x0el82pz3fw974p2052de4uz4j5lqqxx49tuqqqwgqqqqqqqqqqqqqqqqqpurzjqfj34n62wztqjxl59w4drxekg04rrrtf08mdestwhtky84ds7ja0yxct8sqqq3qqqqqqqqlgqqqqqqgq9qrzjqd872t5c5r5a8ssmwelpkdccsyn9mrr40rpp7khad4jr3kssxj9nvx49vgqqqnqqqqqqqqlgqqqq05qqgcxwu0ervh6atmqmqv7pmenhmc207gncyj0mcxedpwm8f56y2yl3qpq6mzjak37ddmeayd9unektmffv5rq8dvlpgq00rmmdalda73yhgqep0zuz"
def f():
for _ in range(10000):
addr = bech32_decode(inv, ignore_long_length=True)
t0 = time.time()
f()
t1 = time.time()
print(f"{t1-t0:.4f}")
```
5 years ago
SomberNight
b83f7159a9
bech32: around 5% speedup for bech32_decode
...
useful for lnaddr.lndecode
5 years ago
SomberNight
bafe8a2fff
integrate PSBT support natively. WIP
6 years ago
Janus Troelsen
b86b3ec1d1
segwit_addr: Use normal comparison for tuple literal ( #5712 )
6 years ago
Janus
5b1a5e8786
avoid duplicating bech32 module
6 years ago
Janus
097ac144d9
file reorganization with top-level module
8 years ago
ThomasV
e853dde111
add segwit bech32 module
8 years ago