bitcoindevkit / bdk-kyoto

BDK blockchain backend using P2P light client Kyoto
Other
9 stars 7 forks source link

Could bdk-kyoto wrap the entire kyoto client? #5

Closed thunderbiscuit closed 2 months ago

thunderbiscuit commented 5 months ago

Under this model the user of bdk_kyoto would not create a Kyoto Node themselves or handle any of the messages directly. bdk_kyoto would be in charge of running a Kyoto node in the background and updating the tx_graph of the wallet and everything that comes with it. You'd basically give it either a FullScanRequest or SyncRequest and it would add those spks to the list of spks it keeps track of for you.

A few questions come to mind for this:

  1. How should the client let the user know that an event has happened and they can request new balance/transactions from their wallet?
  2. Are there calls that the bdk_kyoto client would have to do on the wallet that return a changeset that would need to be persisted? If so can the client handle that itself? Does it even make sense to have this responsibility lie with the bdk_kyoto client? (probably not?)
rustaceanrob commented 5 months ago

As we consider changes like this it is also important to consider that bdk_kyoto may be a piece of a bigger system where the node events are also relayed to LDK APIs. It may be worthwhile to determine what the scope of bdk_kyoto is. If we assume BDK is the only consumer of the events, I think it is a lot easier to do what is described here

rustaceanrob commented 2 months ago

I would consider this completed with LightClientBuilder and the bdk_kyoto Client<K> which returns a FullScanResult when calling update. any other thoughts on this?

cc @ValuedMammal @thunderbiscuit

thunderbiscuit commented 2 months ago

Yes I think this issue can be closed.

To answer your question more directly, nothing too clear in my mind yet. I have been writing some thoughts on my "Dream Kyoto API" in a side document this week, and trying to see how it compares/relates to what it currently is (tradeoffs, understandings/misunderstandings on my part, requirements for fitting with BDK architecture, etc.)

I'll try (ok I'm committing publicly to this right now!) to post this on this repo next week.

rustaceanrob commented 2 months ago

no worries on timelines. that's awesome, excited for feedback

rustaceanrob commented 2 months ago

a simple example of how the API works in Rust is built out in my workshop repo, hope you can attend in ATL!