Zingo Wallet for Desktop PoC

Hello my friends how are you doing today?
Apparently there is no Zingo Wallet for desktop? At least I couldn’t find it.

If there are a Zingo Wallet for Desktop, i’m sorry for this post.

Since I’m working on nice projects involving Zcash, I was developing a Node.js library using zecwallet-cli. But it looks like Adityapk00 will no longer develop zecwallet.

So I decieded to develop my libraries using Zingolib instead.

Just for the fun of it, I decided to port Zecwallet-lite to use Zingolib, instead of zecwallet-cli lib.

It’s currently working, but I really don’t know how reliable it is, since I had to do some tricks to make this work.

How it works?
Zecwallet-lite is just a front end written in typescript / electron, all the magic happens behind the scenes using zecwallet-cli lib through a rust/nodejs binding called Neon.

What I’ve done to make zecwallet-lite to work with Zingolib?
Zingolib does things a little differently than zecwallet-cli lib does.
So first of all I rewrote the Neon binding to work with Zingolib.
Then I had to change the calls from zecwallet-lite to the lib, reconstructing the output from Zingolib in a way zecwallet can understand.
Example:
in zecwallet-cli lib the output from balance command is something like:

{
  "uabalance": 100000,
  "zbalance": 1829095,
  "verified_zbalance": 1829095,
  "spendable_zbalance": 1829095,
  "unverified_zbalance": 0,
  "tbalance": 0,
  "ua_addresses": [
    {
      "address": "u1k943x33k0aeet8afy2n37zfdm352kefgnhzgnjxn0nc7rzgmnp45rj2nrwghy8j6xqk54swssjynxps5z0hw9gg6y8wnz7cmkyd62ywt",
      "balance": 100000
    },
],
 "z_addresses": [
    {
      "address": "zs1pzrnyeungrga89kaya257y4qewjy0g600qmjjtp8kwf45sn6plzzvnvzxg9s592tayg6xlc98rn",
      "zbalance": 1819095,
      "verified_zbalance": 1819095,
      "spendable_zbalance": 1819095,
      "unverified_zbalance": 0
    },
],
  "t_addresses": [
    {
      "address": "t1cuKVi4L8bjkAku9WxjKVDRbjmEaMrj4bb",
      "balance": 0
    },
}

while the output from Zingo lib looks like:

{
  "sapling_balance": 0,
  "verified_sapling_balance": 0,
  "spendable_sapling_balance": 0,
  "unverified_sapling_balance": 0,
  "orchard_balance": 0,
  "verified_orchard_balance": 0,
  "spendable_orchard_balance": 0,
  "unverified_orchard_balance": 0,
  "transparent_balance": 0
}

So i had to reconstruct the first, with information from the latter. Some guess work had to be done here, And I don’t know it’s 100% acurate.

The commands that needed to be reconstructed:

  • balance
  • notes
  • list
  • lasttxid (which zingo lib lacks)
  • zecprice

I also changed the default server to https://mainnet.lightwalletd.com:9067
Looks like zcash.in is having some trouble, so I changed the block explorer to zecblockexplorer

And many oother minor changes.

Most of the change I’ve made was on src/rpc.ts file. see the changes here

Functions like wallet encryption, and exporting indivudual keys for addresses won’t work, because zingolib lacks this commands.

Edit 02/25/2023
To understand what I did, see this file in this repo
After compiling native.node you can run the test file with:

$ node test.js

TL;DR

I’ve hacked zecwallet-lite to work with Zingolib under the hood :slight_smile:

You can check it out on this github repo:

It’s just a hack, it’s woking, but I haven’t tested thoroughly.

Other stuff about zingolib you might find interesting:

  • Article about Zingolib cli I wrote on Free2z
  • Article about regtest mode using Zingolib cli I wrote on Free2z

I hope this can be useful somehow.

8 Likes

Awesome! No, zingo-cli is the only desktop zingo wallet, this would be great! Im gonna play with your hack!

3 Likes

This is so cool! Have you joined the Zingolib room on matrix?

2 Likes

I got the following error when i try to enter this room:

MatrixError: [403] You are not invited to this room. (https://matrix-client.matrix.org/_matrix/client/r0/join/!cXEnRRTkCmbWxIAPlM%3Amatrix.org?server_name=matrix.org)

Try this public one: You're invited to talk on Matrix

2 Likes

Great effort, hope to see a good outcome for your courage.

Zingo is a great mobile app, hopefully it can run on desktop soon

cheers

2 Likes

Thanks, it was a fun side project, the ZingoLabs guys already are improving it, you can check more info here

2 Likes