bitcoindevkit / bitcoindevkit/bdk-kyoto
Kyoto doesn't have an easy way to start wallets with no history (and therefore skip the costly recovery)
- Dominant language
- Rust
- Stars
- 20
- Forks
- 11
- Avg merge
- 6m
- Merged PRs (30d)
- 2
Description
I ran into this while cleaning up our Kyoto implementation in the Devkit Wallet.
`ScanType::Sync` derives its start point from `wallet.latest_checkpoint()`, which for a fresh wallet is genesis (bdk_wallet builds the chain via LocalChain::from_genesis_hash, and `CreateParams` exposes no way to seed it higher). So a wallet created today scans mainnet from 2009.
`ScanType::Recovery` accepts a checkpoint, but constructing one requires a height + hash pair. When the CBF node is the users's only chain source, neither field is knowable on startup The two hardcoded constructors (segwit_activation, taproot_activation) are the only escape, and both are years stale and only drift further with time. Note also that using a type called "Recovery" for a wallet that's in fact brand new is counterintuitive, and is I think why I went in circles for a bit there; I was using `ScanType::Sync` (but then it was still syncing from genesis, which again felt like not what I was looking for) and so it felt like there was no right answer in Kyoto for just "creating + syncing a new wallet".
I think it'd be a good feature to allow maybe a sort of scan type that expresses "this wallet is new" rather than "start here." The node already learns the tip during header sync; the caller shouldn't have to supply a position. Something like `ScanType::New`, which begins filter scanning at whatever the tip resolves to once headers are synced?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing ScanType::Sync and ScanType::Recovery through Kyoto's header-sync and filter-scanning flow, including how wallet.latest_checkpoint() is used. Define how a new-wallet scan uses the learned chain tip without requiring a checkpoint, then verify it avoids scanning from genesis and does not use recovery semantics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- blockchain
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100