Viewkeys in Zecwallet


The Zcash protocol allows splitting the spending key (i.e., the private key) into a viewing key, which allows a wallet to track incoming and outgoing transactions, but prevents spending funds from it, until the spending key is presented.

Adding this feature in the SDK will also allow other apps, most notably ZBay, to switch to using the lightclient, so that users don't have to download and run a full zcashd node in order to use ZBay.

Viewing keys have many uses:

  • Allow users to keep funds safe in a offline paper wallet, perhaps, and follow the account online with their viewing key.
  • Allow users to disclose funding into an address, while retaining control over the spending of funds.
  • Allow users to create and view secure aliases for users, newsletters, and more by publishing them to an address whose viewing key is disclosed.
  • Allow sending newsletter or other public data to an address whose viewing key is disclosed, allowing everyone to efficiently read their memos.

This funding request is to add support for Zcash viewing keys into the Zecwallet lite SDK and the light client apps.

Feature Overview

Zecwallet Lite will allow importing and exporting Viewing keys.

  • Allow users to export the viewing key of any address in their wallet
  • Allow users to import a viewing key into a wallet, either via the Light client SDK or via the Zecwallet Lite apps
  • Allow "upgrading" an imported viewing key with its corresponding spending key, to allow spending funds from that address.

Technical Overview

Zecwallet Lite SDK will be expanded to add a new "import" command, which will allow importing a viewing or spending key into the wallet. The import command will automatically trigger a rescan from the birthday, allowing the user to recover historical transactions and memos into the wallet.

The viewing key will be stored in the wallet, allowing the wallet to follow transactions into or from the associated address. The wallet format will be upgraded to include storing just view keys. Other wallet functions like listing memos, addresses, transactions and encrypting will continue to work as they do today on the imported viewing keys.

On the Zecwallet Lite Apps, the UI will support exporting a viewing key (in addition to the spending key, which is already supported). A new "import" menu item will allow importing viewing and spending keys into the wallet.

Execution Risks

There aren't many technical risks to this project, as the lightwallet protocol already fully supports viewing keys, and Zecwallet lite (both the SDK and the UI wallet) were built in anticipation of adding this feature in the future.

UX Risks

Allowing importing keys breaks an important user expectation: That the entire wallet can be recovered using just the seed. If a viewing key from an external wallet or external seed is imported, it is, of course, not derivable from the wallet's seed, and so the transactions from/to the viewing key will not be restored if the user restores the wallet on a new machine with the wallet's original seed.

This is somewhat mitigated due to the fact that the user already has access to the viewing key, and can just import it one more time into a newly restored wallet.

The plan to mitigate this in the UI is to:

  • Make it clear in the UI if the wallet has "externally imported" keys.
  • Warn the user when exporting the seed if the wallet contains "imported" keys.

Timeline and Funds

The project will take 1 week, for both the SDK and the Lightclient App.

The total cost of the project will be USD 7,500. This is based on the hourly rate of $187.5, which is what the previous proposals from Zecwallet are based at as well.


Tips Received


a year ago
Funded through  
Viewkey Support in Zecwallet

Viewkey Support in Zecwallet

Estimate: July 2020
Reward: $7,500
The team was awarded $7,500 in ZEC on Jul 24th, 2020, 7:59 pm.
Viewing key import/export in Zecwallet Lite