Keys
How the privacy keys are derived from one wallet signature, why every spend needs a fresh wallet signature, and how keys are registered.
voidcash has no separate seed phrase. The app derives every privacy key from one signature of a fixed message, and binds the wallet's own secp256k1 key into the owner key, so the wallet must also sign every spend. The keys live in the page's memory only: a reload reconnects the wallet without a click, but asks for the signature again.
The activation message
The wallet signs (personal_sign) a Sign-In with Ethereum (EIP-4361) message, built by keyDerivationMessage in
packages/sdk/src/keys.ts:
{domain} wants you to sign in with your Ethereum account:
{address, EIP-55 checksummed}
Activate privacy for the voidcash vault {vault, lowercase}. This signature derives the keys that reveal your private balance. Sign it only on {domain}.
URI: https://{domain}
Version: 1
Chain ID: {chainId}
Nonce: {the first 16 hex digits of the vault address, lowercase}
Issued At: 2026-01-01T00:00:00.000Z| Field | Value in the app |
|---|---|
domain | voidcash.io |
chainId | 99901 |
vault | The vault proxy, 0x5535fa0d95E4e03783C3A5d693E2f7225e6d23d4 |
Every field is fixed, so the same wallet always signs the same text. Changing the domain, the address, the chain or
the vault changes every key, which is why the app's domain is fixed for good. Because the message is SIWE, wallets
warn when a site on another domain asks for it. (The URI scheme is http only for localhost and 127.0.0.1.)
Derivation
seed = keccak256(signature bytes)
sk = HKDF-SHA256(ikm = seed, no salt, info = "voidcash/v1/sk", 64 bytes) mod p
nk = H(sk)
wallet key = the secp256k1 public key recovered from the same signature: (x, y), 32 bytes each, big-endian
opk = H(nk, x_hi, x_lo, y_hi, y_lo) the four 128-bit halves of x and y
view secret = HKDF-SHA256(ikm = seed, no salt, info = "voidcash/v1/view", 32 bytes)
view public = X25519 public key of the view secretH is Poseidon2 over BN254 and p the BN254 scalar field (see Notes).
| Key | Where it stays | Used for |
|---|---|---|
sk | Device memory | Root secret: nk, the private address's keys and each OTC deal's keys come from it |
nk (nullifier key) | Device memory, and inside proofs | Computing nullifiers and proving ownership of a note |
| Wallet key | Public (recoverable from any signature by the wallet) | Every spend must carry a signature by it, checked inside the circuit |
opk (owner key) | Public, in the registry | The owner field of every note |
| Viewing key (X25519) | Secret half on the device, public half in the registry | Encrypting and finding notes |
At activation the app checks that the address recovered from the signature is the connected account. A smart-contract wallet fails this check: activation needs an account that signs with one secp256k1 key.
The double signature check
The keys come back on a new device only if the wallet produces the same signature for the same message
(deterministic ECDSA, RFC 6979). Otherwise notes received with one set of keys would be lost with the next. So
PrivacyClient.activate checks:
- Already registered: one signature. The derived
opkmust equal the one registered for the address withkeysOf, or activation fails. - First time: two signatures of the same message. They must give the same
opkbefore anything is registered.
A wallet that does not sign deterministically is refused. There is no other key source.
The per-spend signature
For every private transaction the wallet signs EIP-712 typed data (eth_signTypedData_v4):
struct Spend { bytes32 transaction; }
// transaction = H(root, nf0, nf1, nf2, cm0, cm1, cm2, cm3, exitAmount, exitAsset, feeAmount, extDataHash)
// (Poseidon2 of 12 inputs, as bytes32 big-endian)
// domain = EIP712Domain(name = "voidcash", version = "1", chainId = 99901, verifyingContract = vault)
// digest = keccak256(0x1901 || domainSeparator || keccak256(SPEND_TYPEHASH || transaction))
// SPEND_TYPEHASH = keccak256("Spend(bytes32 transaction)")The circuit recomputes the digest with keccak256 and verifies the ECDSA signature against the wallet key that is
hashed into opk, without revealing the key. The prover does not choose the domain separator: the vault passes its
own _domainSeparatorV4() as the last two public inputs, so a signature is valid for this vault on this chain only.
transaction covers every public input but the domain: the three nullifiers, the four new commitments, what leaves
and in which asset, and extDataHash, which covers the recipient, the allowed submitter, the gas fee, the minimum
call gas and all four ciphertexts (see The circuit). So the wallet approves exactly one
transaction.
This is why each spend needs a fresh wallet signature: nk alone does not satisfy the circuit. Whoever learns nk, or
the activation signature it comes from, can see the notes but cannot move them.
Hardware wallets work: the spend is a standard EIP-712 signature on the device. The typed data shows only an opaque
bytes32, so the wallet cannot display the amount; the app shows it.
Private address keys
A private address is a second identity derived from the same activation, with its own
nk and viewing key and the same wallet key:
seed' = SHA-256("voidcash/v1/private-address/0" || sk as 32 bytes)
keys' = the derivation above from seed', with the same wallet keyThese keys are never registered. The link https://voidcash.io/pay#<body> carries them in its fragment, as
base64url of opk' (32) || view public key' (32) || checksum (4), where the checksum is the first 4 bytes of
SHA-256("voidcash/v1/pay" || opk' || view public key'). A mistyped or cut link fails the checksum instead of paying
keys nobody holds. Notes paid there are found by the owner's app with their own, and spending them still needs a
Spend signature by the wallet. A private address receives HYPE only.
Payment link keys
A payment link is a secp256k1 private key, and holds HYPE only. Its creator derives it from a second fixed message,
signed once per session (linkKeyMessage in packages/sdk/src/link.ts):
{domain} wants you to sign in with your Ethereum account:
{address, EIP-55 checksummed}
Open your payment links on the voidcash vault {vault, lowercase}. This signature derives the keys of the links you make. Sign it only on {domain}.
URI: https://{domain}
Version: 1
Chain ID: {chainId}
Nonce: {the last 16 hex digits of the vault address, lowercase}
Issued At: 2026-01-01T00:00:00.000Zlink seed = keccak256("voidcash/v1/links" || signature)
nonce = 32 random bytes, fresh for each link
link key = (keccak256(link seed || nonce) mod (n - 1)) + 1 n = the secp256k1 group orderThe link's privacy keys come from the link key exactly as a wallet's would: the link key signs the activation message
for its own address, locally, and the derivation above runs on that signature. The link key also signs the claim's
Spend. The link is https://voidcash.io/claim#<link key, base64url>.
The creator's change note records only the nonce. Whoever reads the creator's notes sees that a link exists and what it holds, but needs the link seed, and so the wallet's second signature, to open it.
What a leaked activation signature allows
The activation signature is the root of sk, nk, the viewing key, the private address's keys and every OTC deal's
keys. Whoever obtains it can:
- decrypt every note sent to the owner, to their private address and to their OTC deals' keys, past and future, and read the amounts;
- compute each note's nullifier, and so see when each note is spent;
- read the owner's spend memos: whom each spend paid, and which payment links exist;
- link the owner's shields to the later spends of those notes.
They cannot spend: a spend needs a fresh Spend signature by the wallet key, which the activation signature does
not reveal. They cannot open the owner's payment links, which need the second signature. They cannot change the
registered keys either: register must come from the address itself, and registerFor needs a separate EIP-712
signature by it. The response to a leak is to move the notes to keys the attacker does not know, which means a
different wallet.
Registration
A key pair can receive private sends once it is in the vault's registry:
function register(uint256 opk, bytes32 viewKey) external;
function registerFor(address owner, uint256 opk, bytes32 viewKey, uint256 deadline, bytes calldata signature)
external;
// EIP-712, under the vault's domain:
// Register(address owner,uint256 opk,bytes32 viewKey,uint256 nonce,uint256 deadline)
function keysOf(address owner) external view returns (uint256 opk, bytes32 viewKey);
function registerNonces(address owner) external view returns (uint256);
event KeysRegistered(address indexed owner, uint256 opk, bytes32 viewKey);registerrecords the keys formsg.sender. The app calls it from the wallet after activation when the address has no keys yet: one transaction, its gas paid in HYPE by the wallet.registerForlets anyone submit a registration signed byowner, an EOA or an ERC-1271 contract (OpenZeppelin'sSignatureChecker). The nonce isregisterNonces[owner], used once, and the signature expires atdeadline(SignatureExpired).opkmust be non-zero and belowp(NotAFieldElement). The call emitsKeysRegistered(owner, opk, viewKey).- Registering again replaces the keys. Notes already created for the old
opkstay spendable with the old keys.
Registration is public: it shows that an address uses voidcash. It is needed only to receive private sends at that
address, because a sender needs the recipient's opk and viewing key to build and encrypt a note. Shielding, sending,
unshielding, claiming a payment link and receiving at a private address all work without it.
Notes, commitments and nullifiers
What a note contains, how its commitment and nullifier are computed, how notes are encrypted, and how a shield completes a note from its stub.
The transact circuit
The one zero-knowledge circuit behind every private spend - its inputs, constraints, public inputs, ExtData binding, sizes and toolchain.