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
{{ message }}
Repository navigation
Wallet birthday height for seed recovery on pruned nodes #818
When restoring an ldk-node wallet from seed, the node starts syncing from the current chain tip. Any on-chain deposits made before the restore are never seen by synchronize_listeners, so the wallet balance shows zero even though funds exist on-chain.
This affects all seed restores, but pruned nodes are hit hardest: historical blocks are gone, so there is no workaround via rescan.
There is an existing TODO acknowledging this:
// TODO: Use a proper wallet birthday once BDK supports it.
(src/builder.rs:1327)
Impact
On-chain balance shows 0 after seed restore
Cannot open Lightning channels (no visible funds)
Funds are safe on-chain but inaccessible through ldk-node
Mobile wallets (where reinstalls and data loss are common) are the primary use case
What we did
We hit this building Bitcoin Pocket Node, an Android app running bitcoind + ldk-node on GrapheneOS with pruned storage.
Our workaround overrides chain_tip_opt in the Builder when a birthday height is provided. Caller flow:
User restores seed words
App uses bitcoind scantxoutset to find UTXOs and their block heights (works on pruned nodes)
Sets birthday to min(heights) - 10 as safety margin
ldk-node syncs from there, balance appears with zero transaction fees
Once BDK ships native birthday support, ldk-node can use that directly (which is what the TODO anticipates). Our fork is a pragmatic solution in the meantime.
We are also the folks working on the watchtower improvements discussed in #813.
Note this was addressed in #769 where we added a recovery_mode flag to the builder which restores the ability to resync from genesis when importing a pre-existing wallet. Otherwise the wallet birthday is set to the current block height at first run. I guess we could add the ability to specify a specific block height instead. Would you prefer that over a simple bool flag?
Thanks for the pointer to #769! The recovery_mode flag helps for full nodes, but for pruned nodes resyncing from genesis isn't possible since historical blocks are gone.
A specific block height would be ideal for our use case. The flow we use:
User restores seed
scantxoutset finds UTXOs and their block heights (works on pruned nodes)
Set birthday to min(heights) - 10
ldk-node syncs from that height forward
With just the bool flag, a pruned node would fail trying to resync blocks it doesn't have. A height parameter lets us skip straight to where the funds are.
So yes, the ability to specify a block height would be much preferred over the bool flag for this use case.
Activity
tnull commentedon Mar 6, 2026
Note this was addressed in #769 where we added a
recovery_modeflag to the builder which restores the ability to resync from genesis when importing a pre-existing wallet. Otherwise the wallet birthday is set to the current block height at first run. I guess we could add the ability to specify a specific block height instead. Would you prefer that over a simple bool flag?FreeOnlineUser commentedon Mar 7, 2026
Thanks for the pointer to #769! The
recovery_modeflag helps for full nodes, but for pruned nodes resyncing from genesis isn't possible since historical blocks are gone.A specific block height would be ideal for our use case. The flow we use:
scantxoutsetfinds UTXOs and their block heights (works on pruned nodes)min(heights) - 10With just the bool flag, a pruned node would fail trying to resync blocks it doesn't have. A height parameter lets us skip straight to where the funds are.
So yes, the ability to specify a block height would be much preferred over the bool flag for this use case.
Add wallet birthday height for seed recovery on pruned nodes
Add wallet birthday height for seed recovery on pruned nodes
tnull commentedon Mar 27, 2026
Tagging this for 0.8 so we make sure to revisit, though given the release is approaching fast I can't promise it won't end up slipping.
FreeOnlineUser commentedon Mar 27, 2026
Thanks for tagging it. PR #822 is rebased on current main whenever you're ready to look at it.
Generalize `recovery_mode` to an `Option<RecoveryMode>` struct
Add wallet birthday height for seed recovery on pruned nodes