zingolabs / zingolib

An API and test-app that exposes zcash functionality for app consumption
MIT License
14 stars 21 forks source link

Migrate to `zcash_client_backend` and `zcash_client_sqlite` architecture. #1301

Open nejucomo opened 1 month ago

nejucomo commented 1 month ago

Overview

zingolib could migrate to an architecture with zcash_client_backend and zcash_client_sqlite, which are used within other shielded wallets (at least zashi).

This ticket is about considering this migration versus the status quo of zingolib architecture, gathering relevant info, and documenting the rationale for switching or keeping the current architecture (or introducing other alternatives). The actual approach of how to do such a migration is complex enough that it should probably live in future tickets so that this ticket is more focused on judiciously deciding whether or not to attempt such a thing.

In this ticket we refer to SQA to mean the "status quo (current) architecture", and ZCBA to mean "zcash_client_backend (and related crates) architecture".

If a consensus / decision to do this kind of architectural migration comes out of this ticket, a (big) next step would be to begin adding that migration to any existing plans (e.g. roadmaps, backlogs, etc…).

Note: It's very likely Zingo devs have had multiple discussions around this same topic. I didn't see anything obvious when searching the issue tracker for zcash_client_backend. I didn't search any other docs for this topic. If there's already a specific consensus that this idea is tabled indefinitely or on a someday wishlist, etc… let's summarize that here and cross-link.

Trade-offs

Here I try to enumerate the trade-offs I anticipate. Keep in mind these all assume the migration from SQA to ZCBA is complete. If ZCBA seems desirable from this analysis, a future step would be to re-examine these trade-offs for an interim migration period.

Benefits of SQA

Drawbacks of SQA

Benefits of ZCBA

Drawbacks of ZCBA

Next Steps

These are written from my perspective (without a lot of specific context of zingo's current codebase nor the zcash_client_* crates):

. Pulse check: how important does this seem to Zingo devs? Should we spend more time analyzing this idea, or table it for now?

. Quick checklist: does zcash_client_backend provide all of the functionality zingolib needs today to support the existing latest release of Zingo wallets? Yes: proceed; No: either table this with "blocked on X, Y, and Z features shipping in crates A, B, and C" or start a more complex analysis of how complex implementing the feature in zingolib-on-zcash_client-crates.

. Code impact - best-guess answers to questions like: