Basic
Watch-only keys
A server that receives payments needs a viewing key only. The viewing key shows the payments and makes new addresses. The spending key stays offline.
Use
- a shop server that marks orders as paid;
- an accountant or an auditor who reads the payments of an account;
- a public dashboard of the donations to a project.
Mechanism
seed ──ZIP 32──→ spending key ──→ full viewing key ──→ incoming viewing key
spend see in and out see in
make addresses make addresses
Each key comes from the key on its left. The derivation goes in one direction only. Thus, each step removes a power:
| Key | Spend | See payments in | See payments out | Make addresses |
|---|---|---|---|---|
| Spending key | Yes | Yes | Yes | Yes |
| Full viewing key (UFVK) | No | Yes | Yes | Yes |
| Incoming viewing key (UIVK) | No | Yes | No | Yes |
ZIP 316 encodes a viewing key as a unified key, like a unified address. A UFVK starts with uview1. A
UIVK starts with uivk1. On Testnet, the prefixes end in test1.
Select the smallest key for each task:
- Keep the seed and the spending key in an offline wallet or a hardware wallet.
- Give the shop server the UIVK. The server makes addresses and finds payments.
- Give an auditor the UFVK. The auditor also sees the payments out of the account.
Limits
- All or nothing. A viewing key shows all the past and future payments of the account. To show one payment only, use a payment disclosure (ZIP 311, draft).
- Permanent access. A key that you give out stays valid. To stop new access, move the funds to a new account. The old key still shows the old payments.
- Balances. The UIVK sees each note in. The full viewing key also sees each spend. A balance needs the full viewing key.
Demo: one seed, three keys
The demo uses the orchard and zcash_address crates, compiled to WebAssembly. It derives
the keys of account 0 on Testnet from the seed. It then makes address 0 two times: from the spending key, and from
the UIVK only. The first seed is the seed of the demo shop on the other basics pages.
WARNING: Type only demo seeds here. A seed gives full control of its funds. Keep real seeds in a wallet.
Keys
The WASM module is loading.