You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Electrum protocol v1.6 was just merged. See the docs for changes in the new version:
Changes
Breaking change for the version negotiation: we now mandate that the server.version() message must be the first message sent. That is, version negotiation must happen before any other messages.
Also for server.version(), the server must tolerate and ignore extraneous arguments, to allow for extensions in future protocol versions.
The status of a scripthash has its definition tightened in a backwards-compatible way: mempool txs now have a canonical ordering defined for the calculation (previously their order was undefined).
blockchain.scripthash.get_mempool() previously did not define an order for mempool transactions. We now mandate a specific ordering.
Optional mode argument added to blockchain.estimatefee().
blockchain.block.headers() now returns headers as a list, instead of a single concatenated hex string.
New methods
blockchain.transaction.broadcast_package() to broadcast a package of transactions (submitpackage).
mempool.get_info() to get more detailed and general relayfee info.
Removed methods
blockchain.relayfee() is removed. The minrelaytxfee field of the new mempool.get_info() RPC is a direct replacement.
It would be great if electrs could support the new features very soon. For us (LDK), support for the new blockchain.transaction.broadcast_package is particularly important, as we want to lean on TRUC/v3 transaction relay via Electrum ASAP.
The next version of RewindBitcoin would also greatly benefit from adding support for broadcast_package. In the meantime, we are using Esplora's txs/package endpoint as a workaround.
The next version of RewindBitcoin would also greatly benefit from adding support for broadcast_package. In the meantime, we are using Esplora's txs/package endpoint as a workaround.
Note that it is already available in the original romanz/electrs: romanz#1242. So if you don't need Esplora you could just switch to the original electrs.
Opened #227, which adds blockchain.transaction.broadcast_package to the Esplora/Blockstream electrs Electrum server — directly addressing the package-relay need raised here (TRUC/v3 for LDK, and RewindBitcoin's current txs/package REST workaround).
It's ported from @romanz's implementation (romanz#1242) but built on the submitpackage plumbing already present here from the POST /txs/package REST endpoint (5e36b93), so the same code path now backs both REST and Electrum. The PR also fixes a related issue where accepted package txs weren't added to electrs' local mempool, so scripthash subscription/history updates now reflect them immediately (this fix applies to the existing REST endpoint too).
This only covers the broadcast_package item from the 1.6 list. The remaining v1.6 work is still open and would need separate changes:
Hi guys, thanks for adding broadcast_package support. I tried implementing electrum support in bark, typically we use core RPC or the REST API in this version of electrs. Unfortunately it looks like you've broken RBF'ing a TRUC package. It worked for a long time via the REST API but I updated to master so I can enable electrum support but both protocols are broken. I had Claude investigate it and it thinks the issue started when #227 was merged. Here is the summary it wrote up for additional context:
Affected:new-index branch since 7fed8f41 ("feat(electrum): add blockchain.transaction.broadcast_package", merged 2026-07-02 via #227). Reproduced at HEAD 4b348320. Both interfaces are affected — REST POST /txs/package and electrum blockchain.transaction.broadcast_package — since both go through Query::submit_package.
Symptom: the main thread panics and the daemon dies:
thread 'main' panicked at src/new_index/mempool.rs:519:17:
missing mempool edge for outpoint <O> (tx <C>)
Mechanism:Query::submit_package now calls Mempool::add_by_txids for the accepted txids immediately after bitcoind's submitpackage (src/new_index/query.rs, ~line 96–114). This bypasses the invariant the poll-based Mempool::update maintains — evicted txs are always removed before new ones are added, so two conflicting spenders of one outpoint never coexist in the view:
Tx A spending outpoint O is indexed via the normal poll.
A package containing tx C that RBF-replaces A (also spends O) is submitted; bitcoind evicts A, accepts C.
add_by_txids inserts C while A is still indexed → edges[O] is overwritten with C's entry.
Next poll evicts A → remove(A) deletes edges[O] (actually C's entry).
When C is later confirmed or evicted, remove(C) finds no edge for O → the assert! at mempool.rs:519 panics.
Repro: deterministic within seconds on regtest: index a spend of some outpoint, then submit a package containing a replacement of that spend between two mempool polls, then let both removals happen (mine a block). We hit it from wallet integration tests doing anchor/CPFP package broadcasts after an RBF bump.
Suggested direction: before add_by_txids, evict from the local view any indexed tx (plus descendants) that conflicts with an incoming package tx's prevouts — mirroring what the poll's remove-before-add ordering guarantees. For reference, mempool/electrs is unaffected because its submit_package proxies to bitcoind without touching the local view.
Hi guys, thanks for adding broadcast_package support. I tried implementing electrum support in bark, typically we use core RPC or the REST API in this version of electrs. Unfortunately it looks like you've broken RBF'ing a TRUC package. It worked for a long time via the REST API but I updated to master so I can enable electrum support but both protocols are broken. I had Claude investigate it and it thinks the issue started when #227 was merged. Here is the summary it wrote up for additional context:
Affected:new-index branch since 7fed8f41 ("feat(electrum): add blockchain.transaction.broadcast_package", merged 2026-07-02 via #227). Reproduced at HEAD 4b348320. Both interfaces are affected — REST POST /txs/package and electrum blockchain.transaction.broadcast_package — since both go through Query::submit_package.
Symptom: the main thread panics and the daemon dies:
thread 'main' panicked at src/new_index/mempool.rs:519:17:
missing mempool edge for outpoint <O> (tx <C>)
Mechanism:Query::submit_package now calls Mempool::add_by_txids for the accepted txids immediately after bitcoind's submitpackage (src/new_index/query.rs, ~line 96–114). This bypasses the invariant the poll-based Mempool::update maintains — evicted txs are always removed before new ones are added, so two conflicting spenders of one outpoint never coexist in the view:
Tx A spending outpoint O is indexed via the normal poll.
A package containing tx C that RBF-replaces A (also spends O) is submitted; bitcoind evicts A, accepts C.
add_by_txids inserts C while A is still indexed → edges[O] is overwritten with C's entry.
Next poll evicts A → remove(A) deletes edges[O] (actually C's entry).
When C is later confirmed or evicted, remove(C) finds no edge for O → the assert! at mempool.rs:519 panics.
Repro: deterministic within seconds on regtest: index a spend of some outpoint, then submit a package containing a replacement of that spend between two mempool polls, then let both removals happen (mine a block). We hit it from wallet integration tests doing anchor/CPFP package broadcasts after an RBF bump.
Suggested direction: before add_by_txids, evict from the local view any indexed tx (plus descendants) that conflicts with an incoming package tx's prevouts — mirroring what the poll's remove-before-add ordering guarantees. For reference, mempool/electrs is unaffected because its submit_package proxies to bitcoind without touching the local view.
#234 should resolve this (or at least make it work like broadcast_raw and not panic). #236 (comment)
Activity
landabaso commentedon Jan 8, 2026
The next version of RewindBitcoin would also greatly benefit from adding support for
broadcast_package. In the meantime, we are using Esplora'stxs/packageendpoint as a workaround.tnull commentedon Jan 9, 2026
Note that it is already available in the original
romanz/electrs: romanz#1242. So if you don't need Esplora you could just switch to the originalelectrs.EddieHouston commentedon Jun 17, 2026
Opened #227, which adds
blockchain.transaction.broadcast_packageto the Esplora/BlockstreamelectrsElectrum server — directly addressing the package-relay need raised here (TRUC/v3 for LDK, and RewindBitcoin's currenttxs/packageREST workaround).It's ported from @romanz's implementation (romanz#1242) but built on the
submitpackageplumbing already present here from thePOST /txs/packageREST endpoint (5e36b93), so the same code path now backs both REST and Electrum. The PR also fixes a related issue where accepted package txs weren't added to electrs' local mempool, so scripthash subscription/history updates now reflect them immediately (this fix applies to the existing REST endpoint too).This only covers the
broadcast_packageitem from the 1.6 list. The remaining v1.6 work is still open and would need separate changes:blockchain.transaction.broadcast_package(feat(electrum): add blockchain.transaction.broadcast_package #227)mempool.get_infoblockchain.relayfee(replaced bymempool.get_info)blockchain.scripthash.get_mempoolcanonical ordering (+ aligning the scripthash status-hash ordering)blockchain.block.headersreturning a list instead of concatenated hexmodearg onblockchain.estimatefeeserver.versionmust be first message / tolerate extra argsPROTOCOL_VERSIONto1.6once the above land(Note:
blockchain.scripthash.get_mempoolitself was recently added in #226, just without the 1.6 canonical sort yet.)EddieHouston commentedon Jul 2, 2026
@tnull @landabaso broadcast_package --> #227
PeteClubSeven commentedon Jul 10, 2026
Hi guys, thanks for adding
broadcast_packagesupport. I tried implementing electrum support in bark, typically we use core RPC or the REST API in this version of electrs. Unfortunately it looks like you've broken RBF'ing a TRUC package. It worked for a long time via the REST API but I updated to master so I can enable electrum support but both protocols are broken. I had Claude investigate it and it thinks the issue started when #227 was merged. Here is the summary it wrote up for additional context:Affected:
new-indexbranch since7fed8f41("feat(electrum): add blockchain.transaction.broadcast_package", merged 2026-07-02 via #227). Reproduced at HEAD4b348320. Both interfaces are affected — RESTPOST /txs/packageand electrumblockchain.transaction.broadcast_package— since both go throughQuery::submit_package.Symptom: the main thread panics and the daemon dies:
Mechanism:
Query::submit_packagenow callsMempool::add_by_txidsfor the accepted txids immediately after bitcoind'ssubmitpackage(src/new_index/query.rs, ~line 96–114). This bypasses the invariant the poll-basedMempool::updatemaintains — evicted txs are always removed before new ones are added, so two conflicting spenders of one outpoint never coexist in the view:Aspending outpointOis indexed via the normal poll.Cthat RBF-replacesA(also spendsO) is submitted; bitcoind evictsA, acceptsC.add_by_txidsinsertsCwhileAis still indexed →edges[O]is overwritten withC's entry.A→remove(A)deletesedges[O](actuallyC's entry).Cis later confirmed or evicted,remove(C)finds no edge forO→ theassert!at mempool.rs:519 panics.Repro: deterministic within seconds on regtest: index a spend of some outpoint, then submit a package containing a replacement of that spend between two mempool polls, then let both removals happen (mine a block). We hit it from wallet integration tests doing anchor/CPFP package broadcasts after an RBF bump.
Suggested direction: before
add_by_txids, evict from the local view any indexed tx (plus descendants) that conflicts with an incoming package tx's prevouts — mirroring what the poll's remove-before-add ordering guarantees. For reference, mempool/electrs is unaffected because itssubmit_packageproxies to bitcoind without touching the local view.EddieHouston commentedon Jul 16, 2026
#234 should resolve this (or at least make it work like broadcast_raw and not panic). #236 (comment)
PeteClubSeven commentedon Jul 16, 2026
I can confirm it fixes the issue
Randy808 commentedon Jul 16, 2026
Thanks for reporting and testing the issue @PeteClubSeven!