-
Notifications
You must be signed in to change notification settings - Fork 396
Description
Describe the problem
We may want to be able to iterate fast on bdk_chain
without breaking Wallet
. This means Wallet
may be of an older version of bdk_chain
. Therefore, Wallet
(currently) will have to use older versions of chain sources (since our chain sources depend on bdk_chain
).
It will be a nice property if projects that use BDK can stay put on a specific bdk_chain
version, but still use the latest chain-source crate version.
Additional context
Why would we need to break bdk_chain
?
There are a couple a breaking changes that we simply do not have enough time to include in the v1.0-beta
release.
- refactor(chain)! removed IndexedTxGraph 🗑 #1510
Get rid ofIndexedTxGraph
and just put theIndexer
inTxGraph
. This removes a bunch of overhead and is in general much cleaner. - refactor(chain)!: Remove
Anchor
trait and make anchors unique to (Txid, BlockId) #1515
Removing the anchor trait, and representing theAnchor
as a concrete type is much cleaner and a less error-prone API.
Both of these changes will break ChangeSet
.
Proposed solution
Introduce bdk_core
crate that moves structures and types from bdk_chain
that will mostly stay constant.
- Types:
BlockId
,ConfirmationBlockTime
. - Updates:
CheckPoint
, introducetx_graph::Update
(instead of usingTxGraph
to updateTxGraph
). - Spk-client types:
FullScanRequest
,FullScanResult
,SyncRequest
,SyncResult
.
Chain sources will only depend on bdk_core
. Note that we need to introduce tx_graph::Update
though.
Potential downsides
bdk_core
will still need to depend on bitcoin
. Any major version updates to bitcoin
will be a breaking change and we will need to introduce a new major version for bdk_core
. To make these suggested changes useful, we need to lock down on specific major releases of bitcoin
.
Acknowledgement
Thank you to @LLFourn for bringing up this idea.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status