Sander van Grieken
|
65fb739584
|
segwit_addr: bech32 decode without checksum option
|
2026-04-01 09:07:36 +02:00 |
|
SomberNight
|
cf2ed509b4
|
dependencies: remove bitstring
- `bitstring` started depending on `bitarray` in version 4.1 [0]
- that would mean one additional dependency for us (from yet another maintainer), which is not even pure python
- we only use bitstring for bolt11-parsing
- hence this PR rewrites the bolt11-parsing and removes `bitstring` as dependency
- note: I benchmarked lndecode using [1], and the new code performs better,
taking around 80% time needed for old code (when using bitstring 3.1.9, pure python).
Though the variance is quite large in both cases.
[0]: https://github.com/scott-griffiths/bitstring/blob/95ee533ee4040b4480da1ead548eab2459e8e573/release_notes.txt#L108
[1]: https://github.com/spesmilo/electrum/commit/d7597d96d0c336838adb32e3e175d3ea6f9763e8
|
2024-04-24 14:14:31 +00:00 |
|
SomberNight
|
001ca775a9
|
descriptor.py: speed-up DescriptorChecksum a bit
|
2023-03-01 17:53:41 +00:00 |
|
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:
https://github.com/bitcoin/bips/blob/cd3885c0fb9d140b111ff729294400ff5dcfc8e3/bip-0350.mediawiki
https://github.com/bitcoin/bitcoin/pull/20861
|
2021-03-17 18:11:55 +01:00 |
|
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}")
```
|
2021-02-28 18:32:48 +01:00 |
|
SomberNight
|
b83f7159a9
|
bech32: around 5% speedup for bech32_decode
useful for lnaddr.lndecode
|
2021-02-28 16:53:21 +01:00 |
|
SomberNight
|
bafe8a2fff
|
integrate PSBT support natively. WIP
|
2019-11-04 22:24:36 +01:00 |
|
Janus Troelsen
|
b86b3ec1d1
|
segwit_addr: Use normal comparison for tuple literal (#5712)
|
2019-10-16 23:50:17 +00:00 |
|
Janus
|
5b1a5e8786
|
avoid duplicating bech32 module
|
2019-08-20 09:03:09 +02:00 |
|
Janus
|
097ac144d9
|
file reorganization with top-level module
|
2018-07-13 14:01:37 +02:00 |
|