davide
d51076cb0c
feat: network-aware coin name and unit strings
...
Add COIN_SYMBOL/COIN_NAME to AbstractNet (defaults: BTC/Bitcoin).
BitcoinPurple overrides to BTCP/Bitcoin Purple; testnet inherits.
Replace module-level base_units/base_units_list in util.py with
get_base_units()/get_base_units_list() that read constants.net.COIN_SYMBOL
at runtime, producing [BTCP, mBTCP, bits, sat] on BitcoinPurple.
Update all UI touch points: Qt window title, watching-only warning,
invalid address message, testnet warning, settings unit combo + help
text, QML networkName property, and Preferences thousands-separator label
2026-04-29 15:05:33 +02:00
davide
8b8d958a45
config: default network to BitcoinPurple mainnet
...
Change get_selected_chain() fallback from BitcoinMainnet to BitcoinPurple
so the wallet starts on the BTCP network when no --<chain> flag is passed
2026-04-29 14:56:26 +02:00
davide
7b39a89d1c
docs: add BitcoinPurple section to CLAUDE.md
...
Documents BTCP-specific PoW constants, the dual-path verify_chunk logic,
POW_GENESIS_BITS rationale, retarget clamping formula, relevant file paths,
run/test commands, and LN block-scaled timeout guidance
2026-04-29 14:55:57 +02:00
davide
6db4232825
docs: add tecnichal-data.md — BitcoinPurple technical reference
...
Complete parameter reference for BTCP node operators and developers:
network identity, mainnet/testnet/signet/regtest parameters, address
encoding, HD key version bytes, genesis block, consensus & emission
schedule, 120-block difficulty adjustment algorithm, soft-fork activation,
ElectrumX coin definition and Docker patch, Electrum constants.py reference,
checkpoints format, Lightning Network chain identification (chain_hash,
BOLT11 HRP, block-time-scaled timeout parameters), and bitcoinpurple.conf
annotated configuration
2026-04-29 10:12:04 +02:00
davide
ea8f27358f
docs: add quickstart.md (English)
...
Step-by-step setup guide covering system prerequisites, venv creation,
dependency installation (test-only and test+Qt/QML variants), running from
source (Bitcoin and BitcoinPurple networks, GUI/text/daemon modes), running
tests, and a project structure quick-reference table
2026-04-29 10:10:30 +02:00
davide
88525ef510
docs: add CLAUDE.md
...
Project guidance for Claude Code covering dev commands (install, run, test,
build translations), high-level architecture (entry/routing, core module
table, GUI backends, plugin system, async model, testing conventions)
2026-04-29 10:09:56 +02:00
davide
41e4a8141f
tests: add BitcoinPurple test suite
...
46 tests across three classes:
TestBitcoinPurpleConstants — validates all BTCP network constants against
the technical specification: NET_NAME, TESTNET flags, CLI flags, address
prefixes (P2PKH 56, P2SH 55, WIF 0xb7), bech32/BOLT11 HRP, genesis hashes
and wire-order chain_hash, default ports, PoW parameters (adj_interval 120,
target_timespan 7200, MAX_TARGET, POW_GENESIS_BITS), SLIP-0132 HD key
headers, LN parameters, NETS_LIST uniqueness, and inheritance independence.
TestBitcoinPurpleDifficultyAdjustment — tests the 120-block retarget logic
using BitcoinPurple mainnet (testnet was wrong because get_target always
returns 0 on testnet). Covers: genesis index returns genesis target from
POW_GENESIS_BITS, on-time/fast/slow adjustments, lower and upper clamp, the
120-block window (not 2016), and can_connect() calling get_target with the
correct period index.
TestBitcoinPurpleAddress — tests address encoding under BitcoinPurple: P2PKH
starts with 'P', bech32 with HRP 'btcp', address_to_script produces correct
P2WPKH scriptPubKey, WIF round-trip with prefix 0xb7, Bitcoin addresses
rejected on BTCP network
2026-04-29 10:08:33 +02:00
davide
d1088c036e
blockchain: generalize difficulty adjustment for per-chain PoW constants
...
get_target(): replace hardcoded Bitcoin constants (CHUNK_SIZE, 14-day
timespan, module-level MAX_TARGET) with per-chain values from constants.net.
Handle POW_GENESIS_BITS so that chains whose genesis nBits differs from
target_to_bits(MAX_TARGET) return the correct initial difficulty for period 0.
Map checkpoint indices correctly when adj_interval != CHUNK_SIZE.
verify_chunk(): add a separate code path for chains where the retarget
interval is shorter than CHUNK_SIZE (e.g. BTCP: 120 vs 2016). In this
case multiple retargets can occur within a single chunk; because the headers
are not yet on disk during verification, reading via read_header() would
raise MissingHeader and reject the entire chunk. Fix by reading from the
in-memory data buffer via a local helper _read_hdr(), and tracking
current_target across period boundaries inline.
can_connect(), chainwork_of_header_at_height(): use adj_interval instead of
CHUNK_SIZE when computing the difficulty-period index so that BTCP's 120-block
retarget windows are respected
2026-04-29 10:08:14 +02:00
davide
e0d04af154
constants: add BitcoinPurple (BTCP) and BitcoinPurpleTestnet network classes
...
Add per-chain PoW fields to AbstractNet (DIFFICULTY_ADJUSTMENT_INTERVAL,
POW_TARGET_TIMESPAN, MAX_TARGET, MAX_ADJUSTMENT_FACTOR, POW_GENESIS_BITS)
with Bitcoin defaults so existing chains are unaffected.
Add BitcoinPurple and BitcoinPurpleTestnet as independent AbstractNet subclasses
with BTCP-specific parameters:
- 120-block retarget interval, 7200-second target timespan
- powLimit 0x1e0fffff, genesis nBits 0x1e0ffff0 (POW_GENESIS_BITS)
- P2PKH prefix 56 (0x38), P2SH 55 (0x37), WIF 0xb7, bech32 HRP "btcp"/"tbtcp"
- SLIP-0132 HD key headers identical to Bitcoin mainnet/testnet respectively
- ElectrumX default ports 50001/50002 (mainnet) and 60001/60002 (testnet)
Add chain data directories:
- electrum/chains/bitcoinpurple/{servers,checkpoints,fallback_lnnodes}.json
- electrum/chains/bitcoinpurple_testnet/{servers,checkpoints,fallback_lnnodes}.json
servers.json is populated with 5 known BTCP ElectrumX nodes (TCP 51001, SSL 51002)
2026-04-29 10:07:54 +02:00
SomberNight
bd5ac019ce
release notes: 4.7.2: add links to security disclosures
2026-04-28 17:07:00 +00:00
SomberNight
3399c20ad6
commands: export_lightning_preimage: add comment about wallet password
2026-04-28 15:16:42 +00:00
ThomasV
c964fdef6d
Merge pull request #10544 from spesmilo/lazy_trampoline
...
Lazy trampoline
2026-04-28 10:45:14 +02:00
ThomasV
b776daca36
Merge pull request #10613 from SomberNight/202604_crash_report_altcoin
...
crash_reporter: detect more altcoin-forks, don't send reports
2026-04-28 10:29:57 +02:00
ThomasV
187ea80688
lazy_trampoline: adapt unit test
2026-04-28 10:22:10 +02:00
ThomasV
f3a8dd61bb
lazy trampoline:
...
If a trampoline forwarder fails to find a path, it may return a list
of trampolines it knows how to reach, so that clients can add these
trampolines to their route.
The list of trampolines and fees is written in the error data of
the 'update_fail_htlc' message.
2026-04-28 10:22:10 +02:00
ThomasV
df5c8c4c98
create_routes_for_payment: allow trampoline forwarding without channel_db if there is a direct path
2026-04-28 10:20:57 +02:00
ThomasV
5a31bf6aa0
Merge pull request #10463 from f321x/jit_2
...
lnwallet: zeroconf/just-in-time improvements and tests
2026-04-28 10:16:34 +02:00
ghost43
044c00a449
Merge pull request #10585 from f321x/qml_eltextarea_padding
...
qml: ElTextArea default topPadding, hide placeholderText on input
2026-04-27 17:55:10 +00:00
ghost43
f60cdb0f40
Merge pull request #10614 from f321x/lnaddr_rename
...
bolt11: rename *lnaddr* -> *bolt11*
2026-04-27 15:31:30 +00:00
SomberNight
b0a5e2010c
bolt11: follow-up renames
2026-04-27 15:28:39 +00:00
SomberNight
d2700dfbca
qml: BalanceDetails: fix typo
2026-04-27 15:04:38 +00:00
f321x
560d90e8b8
qt, watchtower: cleanup imports
2026-04-27 16:28:24 +02:00
f321x
306cac192b
lnaddr: rename LnAddr -> bolt11
...
The LnAddr, lndecode and lnencode naming didn't imply that it is
bolt 11 specific, making it confusing to work with, now that there are
also bolt 12 "lnaddr".
Renaming it to *bolt11* creates a clear separation to bolt 12 things and
reduces mental load.
This commit is pure renaming (using the PyCharm IDE refactor function),
except for the removal of the `object` inheritance of LnAddr/BOLT11Addr,
this is Python 2 legacy.
2026-04-27 16:28:19 +02:00
SomberNight
3534f62b0b
crash_reporter: detect more altcoin-forks, don't send reports
...
A new crash report [0] looks to be from a fork where the altcoin has the same genesis block [1] as Bitcoin.
But ofc "branding" is important, so they updated the URLs to point to their fork -- so we could also test against that.
[0]: https://github.com/spesmilo/electrum/issues/10610
[1]: https://github.com/palladium-coin/pallectrum/blob/0df81c6af8d36f3549739576681d3df9969e32fd/electrum/constants.py#L194
2026-04-27 14:16:29 +00:00
f321x
6872637053
qml: ElTextArea: hide placeholder text on user input
...
When the user enters something into the ElTextArea the placeholder
text should be hidden so it doesn't conflict with the user input.
This affects e.g. the lnurl pay dialog.
2026-04-27 13:20:40 +02:00
f321x
9079badfdb
qml: add default topPadding to ElTextArea
...
I noticed all ElTextAreas seem to look better with some topPadding,
so it makes more sense to add it as default to ElTextArea.
Followup to https://github.com/spesmilo/electrum/pull/10579
2026-04-27 13:20:40 +02:00
ghost43
9b26c1812d
Merge pull request #10485 from accumulator/ndk28_qt610_rebase_p4a
...
p4a rebase, use ndk28 and qt6.10
2026-04-24 17:06:25 +00:00
SomberNight
96a3345ab5
setup.py: "qml_gui" extra: update pyqt version
2026-04-24 16:48:34 +00:00
ghost43
cc1874c9c9
Merge pull request #10575 from f321x/lnurlw_prefix
...
pi: handle lud-17 lnurl URIs
2026-04-24 15:00:07 +00:00
ghost43
8be4f8c8cf
Merge pull request #10606 from f321x/trampoline_route_fees
...
trampoline: handle edges with known fees during route edge fee allocation
2026-04-24 14:46:40 +00:00
SomberNight
b483e0d163
trampoline: _allocate_fee_budget_among_route: followup comment
2026-04-24 14:41:48 +00:00
f321x
06fd088992
test_lnrouter: add unittests for tramp fee allocation
...
Adds `TestAllocateFeeBudget` for trampoline route fee allocation
coverage.
Co-Authored-By: SomberNight <somber.night@protonmail.com >
2026-04-24 16:34:52 +02:00
f321x
6933faee32
trampoline: handle edges with known fees in allocation
...
Handle `TrampolineEdge` with known fees when allocating fees to
`TrampolineEdge` with `PLACEHOLDER_FEE` during trampoline route
construction.
This allows to create a mixed route from edges where we know the exact
feerates (e.g. provided through lazy trampoline) and evenly spread the
remaining budget between the edges where the fees are unknown (`PLACEHOLDER_FEE`).
Co-Authored-By: SomberNight <somber.night@protonmail.com >
2026-04-24 16:34:46 +02:00
ghost43
ca212da72a
Merge pull request #10605 from f321x/crash_reporter_start_new_window
...
qt: send start_new_window exc to reporter
2026-04-24 14:05:36 +00:00
SomberNight
5af40f435a
Merge branch '202604_pr10603_ledger'
...
adapt Ledger_Client_Legacy to work with newer ledger bitcoin app
manual merge of https://github.com/spesmilo/electrum/pull/10603
2026-04-24 13:57:23 +00:00
f321x
c8c44e354c
qt: send start_new_window exc to reporter
...
Send more types of exceptions happening during daemon.load_wallet
in `ElectrumGui.start_new_window()` to the crash reporter to catch
e.g. assertion failures instead of showing them to the user as a warning
dialog.
2026-04-24 15:54:56 +02:00
SomberNight
1096ebcd6a
build: update pinned ledger-bitcoin (partial rerun freeze_packages)
2026-04-24 13:51:07 +00:00
ghost43
b9dc6aa34c
Merge pull request #10591 from SomberNight/202604_fix_wallet_mktx_base_tx
...
wallet: make_unsigned_tx: fix base_tx for GUI simple-send batching
2026-04-24 13:01:24 +00:00
ghost43
e96b833fe7
Merge pull request #10592 from SomberNight/202604_testnet_mainnet_mixup2
...
wallet_db: put 'genesis_blockhash' in DB, detect mainnet/testnet mixup. (db upgrade)
2026-04-24 12:59:31 +00:00
ghost43
c66458e517
Merge pull request #10598 from f321x/onion_message_followup
...
onion_messages: minor simplifications, followup 10546
2026-04-24 12:58:24 +00:00
f321x
5a0c052384
onion_message: move round-robin logic in Request method
2026-04-24 14:00:16 +02:00
f321x
3ff3205b19
onion_message: use util.random_shuffled_copy instead rand sort
2026-04-24 14:00:16 +02:00
f321x
d31d1cf75e
onion_message: simplify send_onion_message_to
...
Remove the hops data encryption from the blinded path branch of
send_onion_message_to. Our hops data is already encrypted before
and the blinded paths hops data is already encrypted by the recipient,
so this is a no-op.
Also use encrypt_hops_recipient_data in create_route_to_introduction_point,
it does the same as the existing encryption step.
2026-04-24 14:00:16 +02:00
Ilya Artemov
44570bfa3b
Bump minimum required version of ledger_bitcoin (build-time and runtime)
2026-04-24 09:09:00 +02:00
ghost43
294fdd1267
Merge pull request #10604 from f321x/dedup_valid_wallet_name
...
qml: deduplicate wallet name validation
2026-04-23 14:30:13 +00:00
f321x
d34129ef5c
qml: deduplicate wallet name validation
...
Deduplicates the wallet name validation between wizard and daemon.
2026-04-23 16:11:36 +02:00
ThomasV
7c433c5645
rm 'received orphan channnel' log line (too verbose)
2026-04-23 09:29:08 +02:00
ThomasV
4b412de93c
Merge pull request #10599 from f321x/fix_fw_fail_htlc
...
regtest: make fw_fail_htlc less flaky
2026-04-23 09:07:38 +02:00
ghost43
d13c6a6a92
Merge pull request #10596 from romanz/update-patch
...
appimage: update Dockerfile dependencies
2026-04-22 17:54:03 +00:00
ghost43
230e627559
Merge pull request #10600 from SomberNight/202604_lnpeer_chan_reest
...
lnpeer: channel_reestablish: split "they_are_ahead" into ctn vs revnum
2026-04-22 16:27:10 +00:00