Streaming/push-based chain sources: interest and coordination? #2134
Replies: 2 comments 1 reply
-
Yes, we (LDK / LDK Node) would be very interested in using an async and streaming client as we ran into quite a few issues with the current blocking/polling client. Mostly, that's due to the blocking part of it which doesn't play nicely in an otherwise async environment. That said, to be really useful, we'd probably need to also adjust/reimplement the |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for writing this up so concretely. This looks like useful work, and I think there is real value in keeping the design layered. My preference would be:
That gives downstream users an escape hatch while still making the common case easy. On A "Building Custom Chain Sources" guide also sounds worthwhile. The boundary around |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey everyone,
I've been building a streaming Electrum chain source that uses
blockchain.scripthash.subscribenotifications (push model) instead of thetraditional
full_scan()/sync()polling model. The project is at bdk-electrum-streaming-poc.I'm opening this discussion to coordinate with the community before
investing further in a standalone
bdk_electrum_streamcrate.Background: Issue #527 (2022, by @LLFourn) originally proposed real-time
streaming APIs for BDK. I'm aware of @evanlinjin's streaming experiment as well.
I'd love to understand how these relate to any current upstream plans.
What my PoC does:
over raw TLS + orchestrator that bridges them
scripthash.subscribeheaders, then constructing
Updatestructs with properConfirmationBlockTimeanchors
bdk_electrumWhat I learned building it:
Updatestruct contract (anchors/seen_ats requirement) is the keyinterface between BDK and any custom chain source, but it's undocumented
(filed as issue docs: Document TxUpdate temporal context requirements (supports Wizardsardine audit recommendation) #2133, reinforcing the Wizardsardine audit recommendation)
means this knowledge is locked inside implementations rather than exposed
as a documented API surface
independently hit the same issue before discovering it was already fixed
Questions for the community:
Is there interest in a
bdk_electrum_streamcrate as an external chainsource? If so, what API shape would be most useful — one-shot streaming
sync, continuous background sync, or low-level engine access?
How does my work relate to @evanlinjin's streaming experiment? I want to
complement, not duplicate.
Would a "Building Custom Chain Sources" guide in the Book of BDK be
welcome? I've filed a separate issue on book-of-bdk for this: docs: Add "Building a Custom Chain Source" cookbook page book-of-bdk#142.
For the
evicted_at/last_evictedtimestamps introduced in PR Introduceevicted-at/last-evictedtimestamps #1839 —should a streaming chain source also populate these? The Electrum protocol
doesn't have an explicit "transaction evicted from mempool" notification,
but absence from a
get_historyresponse could imply it.Happy to share architecture details or discuss any of these points.
Beta Was this translation helpful? Give feedback.
All reactions