Skip to main content

Allowance Voucher

Allowance vouchers (session keys) let a ciphertext owner delegate decrypt/compute access to an ephemeral key for a limited time, entirely off-chain.
Vouchers are revocable by bumping the sharer’s session nonce.

Security model

A session voucher grants the holder access to all of the sharer’s encrypted handles, it is not scoped to a specific program or dApp. Coval checks:
  1. The session key signed the decrypt/compute request
  2. The sharer signed the voucher (exact warning text, expiry, nonce, decrypter)
  3. The sharer has an on-chain allowance PDA for the handle
To limit exposure:
  • Use the shortest expiry that makes sense (minutes rather than hours or days)
  • Call updateActiveVouchersSessionNonce() when the session ends
  • Never log, persist, or forward the signed voucher beyond the narrowest needed scope

Wallet signing prompt

The voucher message puts this warning first so wallets show it before opaque fields:
Inco Warning: signing this message may leak your private data, including from unrelated apps. Sign only if you fully trust this app.
Do not alter this text, Coval rejects vouchers with a different warning. Canonical signed message (UTF-8, newline-separated):

Getting Started

Granting a session voucher gives that key unverified access to all of Alice’s allowed handles for the voucher lifetime (until expiry or nonce revoke).

Attested Decrypt with Voucher

Bob can decrypt any handle Alice is allowed on, using the session key (no Alice wallet popup per request):

Attested Compute with Voucher

Attested Reveal with Voucher

Reveal is the same decryptWithVoucher call, use result.plaintexts for UI display without building an on-chain verification transaction. See Attested Reveal.

Revoking a Voucher

This invalidates all outstanding vouchers for Alice, regardless of expiry.
Selective revoke (per-session-key) is not supported with the default verifier. Re-issue new vouchers to keys that should keep access.

How it differs from EVM

For the EVM guide, see Allowance Voucher (EVM).

API Reference

grantSessionKeyAllowanceVoucher(options, decrypter, expiresAt)

Parameters:
  • options.address: sharer’s wallet public key
  • options.signMessage: sharer’s message signer
  • decrypter: session key public key (PublicKey or base58)
  • expiresAt: Date or unix seconds
Returns: Promise<AllowanceVoucherWithSig>

decryptWithVoucher(handles, options)

Same return type as Attested Decrypt decrypt(), authenticated with a session key + voucher.

attestedComputeWithVoucher(args, options)

Same return type as Attested Compute attestedCompute().

updateActiveVouchersSessionNonce(options)

Bumps the sharer’s session nonce and returns the new value as a string.

Types