core: allow serialization of SyncResponse
Description
The rationale behind this is to allow a separate instance of the same wallet be updated on a device that's not necessarily connected. Like a hardware wallet.
A connected device gets the response, serializes it with serde and passes the Update to the air-gapped one
Checklists
All Submissions:
- [x] I've signed all my commits
- [x] I followed the contribution guidelines
- [x] I ran
cargo fmtandcargo clippybefore committing
@icota have you considered using ChangeSets instead? Serializing CheckPoints is a bit odd since it is a linked list and the resultant serialization would be super nested.
Also updates may have repeated elements, whereas ChangeSets only include what is changed.
@icota have you considered using
ChangeSets instead?
No, I have not. Are you suggesting I use staged after apply_update to get the ChangeSet? How do I apply that on the other side?
@icota Yes. That is a good point about applying it on the other side. I forgot that bdk_wallet::Wallet does not have an apply_changeset method (whereas the core structures from bdk_chain do).
Just made a draft PR to add Wallet::apply_changeset: https://github.com/bitcoindevkit/bdk_wallet/pull/231