voidcashdocs

Constants

Every Voidcash constant and default, with its value and where it is set.

Parameters marked as such are set by the admin and can change; read the live values from the Config account's params. Every other value here is fixed by the program, the circuit or a service's defaults. Lamports: 1 SOL is 1,000,000,000.

Fees

NameValueMeaningWhere
Shield fee0 at launchTaken on top of the deposit. A parameterConfig account (params.shield_fee_bps)
Exit fee50 (0.5%) at launchTaken from every unshield. A parameterConfig account (params.exit_fee_bps)
Buyback share5_000 (50%) at launchThe buyback's share of every fee; the treasury gets the rest. A parameterConfig account (params.buyback_share_bps)
MAX_FEE_BPS100 (1%)The highest shield or exit fee the admin can setProgram limit
BPS10_000Basis points in a whole; also the highest buyback shareProgram limit
Private transfer fee0Private transfers pay no pool fee, only the relayer'sProgram rule

A fee is amount × fee_bps / 10,000, rounded down. The buyback's part is fee × buyback_share_bps / 10,000, rounded down, so rounding favours the treasury.

Amounts and sizes

NameValueMeaningWhere
Minimum deposit10_000_000 lamports (0.01 SOL) at launchThe smallest shield. A parameter, always above zeroConfig account (params.min_deposit)
MAX_AMOUNT1 << 60 lamportsThe most any ext_amount or relayer fee can be, so the circuit's field sum cannot wrapProgram limit
CIPHERTEXT_LEN88 bytesOne note ciphertext: an ephemeral x25519 key (32), the encrypted note (40) and its tag (16)transact instruction data
Proof256 bytesA Groth16 proof as the program verifies it: A, B, Ctransact instruction data
transact instruction data595 bytesDiscriminator, proof, root index, nullifiers, commitments and ExtDatatransact instruction
CONFIG_RESERVED128 bytesZero bytes at the end of Config for parameters a later version addsConfig account
Config size280 bytesThe config accountConfig account
Buyback state size450 bytesThe buyback state accountBuyback state account
Nullifier account8 bytesAn Anchor account with no data; its rent is paid on every spend and keptNullifier accounts

The note tree

NameValueMeaningWhere
LEVELS26The tree's depth: 2^26 leaves, two per transactionTree account, circuit
ROOT_HISTORY192Roots kept, one per slot that had an insert: about 77 s of continuous activityTree account
MAGICvoidtreeThe tree account's first 8 bytesTree account
TREE_SIZE9,400 bytesThe tree accountTree account
Empty leaf0Tree account, the app

Keys and addresses

NameValueMeaningWhere
Root32 random bytesThe vault, from which every key derivesThe app
Spending keyHKDF-SHA256(root, info voidcash/v1/spend, 64 bytes) mod rThe app
Viewing keyHKDF-SHA256(root, info voidcash/v1/view, 32 bytes), an x25519 secretThe app
PBKDF2 rounds600_000PBKDF2-SHA256 rounds that turn the passphrase into the AES-256-GCM key sealing the rootThe app
Address prefixvoidEvery private address starts with itPrivate addresses
Address version1The version byte of a private addressPrivate addresses
Recovery version0x81The version byte of a recovery keyRecovery keys
Checksum4 bytesThe first 4 bytes of SHA-256(SHA-256(payload)), on addresses and recovery keysPrivate addresses, recovery keys
Note encryptionXChaCha20-Poly1305, zero nonce, key HKDF-SHA256(shared secret, salt = ephemeral key, info voidcash/v1/note)Each key is used onceNote ciphertexts
Ext-data domainvoidcash/transact/v1The first part of the ext-data hashProgram, the app

The buyback

NameValueMeaningWhere
OBS_INTERVAL30 slotsAt most one observation per interval, about 12 sProgram limit
MAX_OBS_AGE90 slots (3 × OBS_INTERVAL)A longer gap between observations restarts the ring; a buy needs an observation this recentProgram limit
BUY_INTERVAL150 slotsAt most one buy per interval, about a minuteProgram limit
N_OBS15Observations in the ring; the reference is their medianBuyback state account
CHUNK_MAX1_000_000_000 lamports (1 SOL)The largest chunkProgram limit
CHUNK_MIN10_000_000 lamports (0.01 SOL)Below this, no buyProgram limit
CHUNK_RESERVE_BPS50 (0.5%)A chunk is at most this share of the pool's SOL reserveProgram limit
SQRT_BAND_BPS50 (0.5%)The band above the reference, on the square-root price (about 1% on the price)Program limit
MAX_LOSS_BPS200 (2%)The minimum output is what the reference price gives, less thisProgram limit
ROOM_USE_BPS9_000 (90%)The share of the room left in the band one chunk may useProgram limit

Pause flags

Bits of Config.paused.

NameValueWhat it stops
PAUSE_DEPOSITS1Shields
PAUSE_TRANSFERS2Private transfers
PAUSE_EXITS4Unshields and every relayer fee
PAUSE_BUYBACK8The buyback
PAUSE_ALL15All four

The relayer

Defaults of the relayer service.

NameDefaultMeaning
HTTP port8788The port the HTTP server listens on
Priority fee50000 micro-lamportsPriority fee per compute unit
Fee margin100000 lamportsAdded to every quote
Deadline limit900 slotsHow far ahead a request's deadline may be
Address lookup tablesnoneLookup tables used to build transactions
Allowed browser originsnoneOrigins allowed by CORS
Buyback crankonThe crank that calls observe and buyback
Crank interval4000 msHow often the crank looks
Request body limit16 KiBLarger bodies get 413
transact compute budget400_000 unitsAlso the units the quote prices
observe, buyback compute budgets20_000, 200_000 unitsThe crank's transactions
Transaction size limit1232 bytesLarger transactions are refused
Base fee in the quote5_000 lamportsPer transaction

The indexer

Defaults of the indexer service.

NameDefaultMeaning
HTTP port8789The port the HTTP server listens on
Poll interval2000 msHow often the writer polls
Single-exit alert200 (2%)One exit above this share of the vault alerts
Window alert500 (5%)Exits within the window above this share alert
Alert window9000 slotsThe window, about an hour
Page size5_000Most leaves or nullifiers per request
Activity page100Most activity entries per request

The app

NameValueMeaning
Deadlinecurrent slot + 150The deadline slot the app sets on every transaction
Shield compute budget400_000 units, at 50_000 micro-lamports per unitThe shield transaction the wallet signs

The circuit

NameValue
TemplateTransaction(26, 2, 2): depth 26, two inputs, two outputs
Constraints15,494, as compiled
Public inputs7: root, publicAmount, extDataHash, two nullifiers, two output commitments (nPublic in the verifying key)
Amount range64 bits, on every input and output amount
Asset0, native SOL, a constant in every note's commitment
Proving key9,789,307 bytes, SHA-256 34b15fb1a334f8a053ebecfd85377eecb85cf891161a4d705ffc6962e384b0ec, served under /circuit/
Circuit WASM3,133,689 bytes, SHA-256 fbed2c0ce5d0ea4cbaac65289c387ca8240071592a27edf1d22d2f48a3fd4985, served under /circuit/

Addresses

NameAddress
Pool programHjQyQZ3xewjsBb3w8JFGJSh2ztauV4f6X4o5CrZTobZm
Meteora DAMM v2 (cp-amm)cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG
cp-amm pool authorityHLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC
SPL Token programTokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
Wrapped SOL mintSo11111111111111111111111111111111111111112

On this page