Android and iOS Zecwallet Lite apps

Motivation and overview

Zecwallet's desktop lite clients have become quite popular as a way to send and receive shielded transactions for Zcash. This project aims to port the desktop app to Android and iOS apps, bringing the full lite wallet funtionality to mobile apps.

As outlined below, we will resuse a vast majority of the code from the desktop lite wallet. This means the mobile apps will have full support for Sapling and Transparent addresses, full support for memos (including multi-part memos), tx history, address book and almost every other feature supported by the desktop app.

Technical approach

Zecwallet Lite for Android and iOS will be built on the same technical foundations as the desktop app.

Frontend

The frontend will be built in React Native, reusing as much of the desktop frontend code (which is in React / Javascript) as possible. While most of the business logic and RPC connection code can be reused, the UI elements themselves differ between React desktop and React native, which will have to be re-written. I estimate this is about 20% of the desktop litewallet code which will need to be re-writtten

RPC bridge

The desktop Zecwallet Lite app works by sending RPC commands to the Zecwallet Light SDK via a Javascript -> NodeJS native -> Rust bridge. This bridge is built specifically for the desktop, and will need to be re-implemented for the mobile apps. For iOS: The RPC bridge will be built with Swift -> Rust via cargo-lipo For Android: The RPC bridge will be built via JNI -> Rust FFI

The Liteclient library

The Zecwallet Lite client library will be reused as is, just like it is with the desktop applications. It is written in rust, and can be compiled into a .so library that is loaded natively for Android and into a native library loaded via the native loader on iOS

Execution risks

The excution risk is minimal for this project, since the same architecture is already working on the desktop. However, there are some things to be aware of:

  1. Performance: Syncing the lite client downloads compact blocks and scans them. Doing this on the phone might consume CPU and network bandwidth on the phone which are somewhat scarce resources when compared to the desktop. For performance reasons, we will sync only when the app is in the foreground (i.e., no background sync), so if the user starts the app after several weeks, it might take several seconds to sync at startup to catch up to the blockchain tip.

  2. Transactions will be constructed and broadcast from the phone. While the sapling transactions can be constructed quite easily within the CPU and memory bounds, some complex transactions that have 100s of inputs or outputs might take on the order of minutes on the phone, consuming a lot of CPU.

Downsides

The main downside with this approach is that the lite client needs to download compact blocks to stay synced to the chain. This is on the order of 10s of MBs per week. Additionally, it also scales linearly with the number of sapling transactions (Since the lite client needs to scan every sapling tx), so this number is likely to keep growing in the near future. Contrast this specifically to the Zecwallet companion app, which is very light weight and needs only a few KBs to sync (The companion app, of course, has its own downsides)

Evaluation plan

The Apps will be published on the Android and iOS app stores. We will evaluate success based on the number of downloads and star ratings at the app store, and from broad community feedback overall.

Tasks and schedule

The project will take 4.5 weeks, for both the Android and iOS apps.

2 weeks: Android RPC bridge, UI components building the app 2 weeks: iOS RPC bridge, UI porting to iOS and publishing to the app store. 0.5 weeks: Testing, benchmarking and server side infra setup.

Budget and justification

The total cost of the project will be USD 33,000. This is based on the hourly rate of $187.5, which is what the previous proposals from Zecwallet are based at as well. The cost also includes the server-side infrastructure needed to operate and run the lightwalletd servers.

Tipping

Tips Received
???  
ZEC

Campaign

Started
5 months ago
Funding
$33,000 
Funded through  
iOS Lite client app
2
Android Lite client app

Android Lite client app

Estimate: June 2020
Reward: $16,500
The team was awarded $16,500 in ZEC on Jun 24th, 2020, 6:22 pm.
Android lite client app, published on the Android play store, along with a downloadable .apk package