This is a resubmission from this forum post.
In the previous grant proposal responding to this RFP, we proposed to add a layer to Librustzcash that translates the main Zcash library methods, written in Rust, into four other different languages by utilising Mozilla’s UniFFI library. That work has now been finished, and the end result of having Librustzcash be usable in other languages has been accomplished. This avoids the need for double work from developers working with Ruby, Python, Swift, or Kotlin.
Most of the core functionalities needed to work with a small light client or a wallet were exposed (assuming features like synchronisation and broadcasting are already present). A solid amount of documentation is publicly available on Github in form of READMEs and wikis.
In this grant proposal, we want to take our efforts with UniFFI two steps further, by:
- increasing the integration between the UniFFI-supported library and the original library,
- creating a demonstration codebase showcasing how to use the library on Android and iOS
The librustzcash codebase is an evergrowing part of the Zcash ecosystem, and is destined to grow with it. Similarly, the uniffi-supported version of it will need to grow in tandem. To anticipate this growth, we will work on making our library as easy to upgrade and maintain as possible. We should aim at a low maintenance and development burden for the future maintainer of the, as well as making sure the maintenance work does not block or hinder the core librustzcash development and workflow. This will be very intricate, coordination-heavy work, but will save a lot of time from the future maintainers of both libraries.
Code demonstrations and tutorials are often considered purely optional when it comes to a libraries implementation, often being replaced by things like thorough static analysis and automated testing. While those are also critically important, when it comes time for developers to use the codebases, testing and static analysis are often inadequate ways to learn. This is why in the original project we included tutorials for a developer of any of the UniFFI languages to start utilising the library for their project.
Now, we would like to go a step further and include an extensive demo codebase of the most used functionalities for each major mobile ecosystem. This would allow a developer to have a “quick start” repository that they can clone and get things up and running for a Zcash-based project in just a matter of minutes.
We will split the process into two milestones of equal value. Each milestone will be submitted consecutively after completion of the previous one.
To start the integration work, we need to collaborate with the librustzcash library developers to discuss the best way of conducting a deeper integration of the UniFFI library with the main library. Some parts of this milestone may be done parallel to other tasks. Some approaches we will test are:
- CI-based: Setup the CI to react by keyword, and implement a soft block on pull requests, i.e. that warns as a standalone on the pre-push checks, warning that a feature was implemented but did not include its FFI version.
- Rust-based: implement some kind of “directive” or “trigger” during compilation that warns when a feature on one side changed and the other did not.
- Manual intervention: the developer has to check whether this breaks the UniFFI part on a case-by-case basis, so we should implement a tool to aid this process.
To demonstrate the usage of the library created in our previous endeavour, we will provide sample applications in form of codebase for both Android and iOS platforms, written in Kotlin and Swift, respectively, and with minimal UI. The demo app will have the ability to:
- Show balance at an address
- Build a transaction
- Explore a transaction, searching by the transaction id
- Broadcast a transaction after connecting to a node
- Encode and decode addresses
This codebase will provide multiple useful additions to the project such as:
- help with debugging eventual issues a developer might have on their app.
- our examples will show some exemplary values for encodings/decodings, so the developer will have a reference to “correct” constants (e.g. encoded addresses, transaction bytecode generation) for their testing.
- it will show some common design patterns that the developer would have to find otherwise on some previous app, i.e. it will show some common use cases for the library.
- it will be retroactively useful to see whether our app is truly usable - if we see that some elements of the API do not work well as design, we may change that.
It is important to remind the reader, at this step, that since Librustzcash does not include synchronisation capabilities, the UniFFI library cannot implement such features either. Thus to write, for instance, a complete wallet interacting with the mainnet and broadcasting a transaction, there has to be an additional component present taking care of the synchronisation part.
- Eloy López Peñamaría (Github) is a Cloud Software Engineer with extensive experience in Rust and Go, focusing on observability and resilience, with more than ten years of building backends for cloud environments. He likes to collaborate in blockchain-related projects and distributed high-traffic systems. Always attentive to details and documentation. He is the main member of the team who built the Zcash UniFFI library.
- Tomasz Piotrowski (GitHub, LinkedIn) is a Rust Engineer at Eiger with extensive software development experience. Since joining Eiger he has worked exclusively with Zcashd and Zebra codebases and supported Eiger’s efforts in the Zcash ecosystem.
- Luca Campobasso (GitHub, LinkedIn) is a Software Engineer at Eiger. He’s been working on research and development for several projects within the company helping in identifying new research opportunities and taking those ideas to full fledged implementations (e.g. the Zcash UniFFI library). He spends a good amount of his time reading the Zcash protocol, the details of the cryptographic operations and primitives involved, the ZIPs implemented so far and the proposed ones. Additionally, he has experience writing academic research documents.
The promise of web3 is to upgrade the very foundations of our society – from money, finance, and governance to media, gaming, and science. To deliver on that promise, decentralised technologies are to be integrated into the everyday experiences of billions of people. For engineering, this is a mountain of a challenge.
Eiger was founded to develop infrastructure for web3 mass adoption. We help technology companies improve and integrate the core technologies of web3 to meet the climbing demands for scale and performance. We currently employ 30+ senior web3 engineers across the globe and work with some of the most ambitious organisations in the industry, including Forte, Aleo, and XRP Labs, to name a few. Eiger is part of Equilibrium Group, a blockchain powerhouse founded in 2018, composed of three entities:
- Eiger – high-value add engineering services
- Equilibrium Labs – applied research, proprietary products, and investing in early-stage ventures
- Membrane Finance – infrastructure and services for EUROe, a euro-backed stablecoin
Total Funds Requested: $96 000
- Milestone 1: Librustzcash integration - 1 month, 2 engineers (8 FTEs)
- Milestone 2: UniFFI demo codebase - 1 month, 2 engineers (8 FTEs)
Total FTEs: 16 - One FTE is 40 hours.
The standard grants-work rate at Eiger for an engineer is 150 $/hr.
The above quantities result in a total budget ask of
150 $/hour x 40 hours x 16 = $ 96 000