Zafu client development

hello folks,

we ve been working on some light client primitives for zcash for about year now to verify full orchard pool header chain in milliseconds porting ligerito from julia to rust being currently fastest implementation. ligerito.rotko.

we are launching alpha for zcli.rotko. net .zcli - agenti money and zigner.rotko. net - common mans airgapped hardware signer utilizing any androids camera and screen for signing communication over qr codes.

to enable header chain proving we implemented lightwalletd in rust

we also have browser extension as zigner companion app under work, but proving times on single threaded wasm take about 2 minutes so that is still waiting for performance improvements in proving times for wider release. we did manage to achieve parallel wasm offscreen proving for penumbra so i do still have conviction to get it working.

all the primitives can be foud now at github. com/rotkonetworks/zcli

in general its been quite plenty of work so if you find any of it useful or just want to support our contribs; all donations are welcome.

p.s. i couldnt figure out how to start a tread, is there some permission or messaging limit required?

7 Likes

Hi! Would you like to present this at light client working group? It’s every other Thursday at 17.00 UTC

1 Like

The air-gapped singer idea using just an Android camera and screen is clever. I’ll take a look at the repo, and about starting a thread, some forums require a few posts first.

test

we have now implemented same forementioned light client desing into our penumbraprax wallet fork called Zafu that is now available for willing beta test users in chrome store altho recommended path is installing via our automated build workflow in github releases to have latest patches(google seems painfully slow.

we have also multisig fully working with airgapped cold wallet signing and we are currently working on first application that utilizes multisigs as escrowd peer to peer poker(mental shuffle, each turn signed).

we have open our grant request for conducted work over the last 8 months and hope to hear your feedback on it here.

zafu remote signing + multisig: what we built over the last month

we’re in retroactive grant voting now ahead of the full release. to make it possible to evaluate the work without sideloading an APK or unpacking an extension zip, we recorded a set of short videos of the current state of remote signing and multisig management. links at the bottom.

remote signing moved to PCZT

until now, Zafu sent its cold signer (Zigner) a “simple” payload: a sighash, the per-action randomizers, and a human-readable summary string. the problem was that the summary was only a display hint and was not cryptographically bound to the sighash and as a new developer to ecosystem I only afterewards realized that there already is existing standards for what I was looking to do. brilliant!

so we migrated the entire single-signer flow to the standard Partially Created Zcash Transaction (PCZT) format. the cold device now recomputes the sighash from the PCZT contents itself, so the displayed action set and the signed bytes are derived from the same byte stream.

to rant about this a little bit; cold-signing a typical 1-spend Orchard tx round-trips ~3-4 KB both ways under zcash-pczt, about 30 frames per direction at 200 B/frame. the dominant chunk in it is the ~2.4 KB Halo 2 proof, which the signer never touches and the wallet already has locally. it’s all fine on phones where camera quality has been priority but laptop webcams are notoriously bad and in our testing the return does not reliably complete or takes at least a painful amount of time to hodl ur phone on camera. Keystone only defines one Zcash signing QR format (zcash-pczt), and the ZODL ↔ Keystone flow uses it identically in both directions: ZODL sends the unsigned PCZT, Keystone signs and sends the whole PCZT back. the proof crosses the channel twice even though the signer never touches it there either.

questions for librustzcash / ZODL / Keystone developers

is anyone already working on a redact_zkproof_for_transport pattern? the pczt crate already exposes clear_zkproof() and clear_bsk() on the orchard redactor, so it kinda looks like the design anticipated this. do you see a reason to keep the proof in transit that we are not seeing (for non-multisig cases)?

multisig management

the FROST 2-of-3 air-gapped multisig flow continues to work on the existing path and is shown in the videos. we deliberately scoped the PCZT migration to single-signer first. FROST over PCZT needs a custom round protocol because the standard PCZT signer role is single-signer only, so that will be postponed for now.

as part of ZecHub’s hackathon we’ve been working on our first FROST-utilizing application, poker with mental shuffle, that for now will use end-to-end encrypted messaging over our hosted relay but is designed to be functional as pure peer-to-peer.

videos:

happy to answer technical questions in the thread or receive feedback in general.

as you might notice from demo videos, there are still some bugs here and there which we`re trying our best to iron out to have poker playable Zafu beta version released out for the voting(maybe, Chrome store releases can take weeks for extensions with host permissions). i have slightly more hesitation to hold back on releasing zigner since once its out and in use, we are locked into maintaining backwards compatibility.

1 Like

Im glad to inform that our zafu wallet is now fully ironwood compatible supporting shielded Orchard to Ironwood migration. I have submitted once again working version to Chrome store for review which usually takes multiple weeks due to extension requiring Host functions. Until then best path to install our software is via github releases found on our website

Last months have been rough. Just when we were able to release stable version for Q2 grant review, Orchard pool vulnerability was found, new output generation disabled breaking a lot of our software so it has been a lot of work on getting the wallet back to its stable state to support Ironwood in cold and multisig signing as well as private migration from Orchard to Ironwood.

As mentioned installation of the software though still requires to be done via Github releases as .apk file(zigner) or .zip/.crx file(zafu) and imported in at chrome://extensions as developer.

Aside of working on Ironwood compatibility we have put some effort to integrating with broader ecosystem so now Zigner possible be used as “Keystone” in Vizor and Zodl wallets for sending and receiving transactions so you are not only tied to our extension if you proceed with Zigner as your cold storage. Shoutout to Vizor team for reduction in QR codes. This was true painpoint that we came across in development as well; trying to scan 10 animated QR codes back to the desktop with desktop webcams(none are close to phone cameras…), and thanks to their work its now reduced to just 1 QR code containing the actual signature(problem postponed until PQ crypto lands). Another challenge in airgapped signers is updating and I have been working on kernel(.apk) and OTA(updates over qr) model to be able to do smaller updates like nu7 just by scanning, well a shit ton of QR codes, but avoiding whole hurdle of backing up seeds and doing reinstall with factory resets.

A lot of our development effort over last months went to work on first application: zk.poker(zkbtc.org) that end up winning third prize in recent ZecHub hackathon. I have to admit that I was quite in the deep waters with my mood and having this appreciation really ment a lot and lifted me to complete work getting wallet and poker back to the functional state. So huge thanks for community support. I did also work a new tournament mode on it that where each bracket next round requires last round winnings to be staked in for winner to take all having no intermediary to hold the funds during the tournament as long as all players are willing to co-operate.

For Zigner release we did follow ZODL path to host our own fdroid repository to ease out installation. We are also trying to get accepted in more security focused accrescent app store so we can recommend people with upcoming Motorola phones with GrapheneOS or Google Pixels flashied via webinstaller to have app then directly available without further hurdles together with chips supporting StrongBox security.

2 Likes