Appearance
Anonymity mining
A withdrawal hides among the notes in its asset’s tree, so every note that stays in the pool helps everyone else who uses it. Anonymity mining pays for that help. SOL and USDC notes earn VEILIX for every whole day they stay in the pool. Alice collects the reward through a relayer, and the collect does not show which note earned it, when that note was deposited, or how large either one is.
Status. Anonymity mining is live on devnet. The first day that paid was 14 November 2026 (UTC), so the first rewards could be collected from 15 November. On 23 November 2026 the live relayer charged 11 VEILIX for a collect. Its fee follows the VEILIX price, and the program caps it at 100 VEILIX.
What it pays, and why
Rewards come from a Mining Reserve of 100,250,000 VEILIX, 5% of the 2,005,000,000 VEILIX in existence. The reserve is VEILIX set aside in advance. The program does not create new VEILIX to pay a reward. The reserve is released one day at a time over four years, from 14 November 2026, and the daily release halves each year:
| Year | VEILIX released | Per day | SOL pool, 60% | USDC pool, 40% |
|---|---|---|---|---|
| 1 | 53,466,667 | 146,484 | 87,890 | 58,594 |
| 2 | 26,733,333 | 73,242 | 43,945 | 29,297 |
| 3 | 13,366,667 | 36,621 | 21,973 | 14,648 |
| 4 | 6,683,333 | 18,311 | 10,986 | 7,324 |
The four years add up to the whole reserve, and the release stops after the fourth. A day is a UTC day.
SOL notes share 60% of each day’s release, and USDC notes share 40%. VEILIX notes do not earn. Paying VEILIX for holding VEILIX would be circular. Rewards also arrive in the VEILIX pool as notes with hidden amounts, so the program cannot know that pool’s exact total, and the formula below needs it.
The reward is linear: twice the amount, or twice the days, earns twice as much. More value staying longer is what the pool needs. It is also the only rule the program can keep solvent without knowing how old anyone’s notes are.
A reward is an amount of VEILIX, not a rate of return. What one SOL earns in a day is the SOL pool’s share of that day divided by the size of the pool, so it falls as the pool grows. This book does not price VEILIX, and nothing on this page is an APR.
How a reward is computed
For each mining pool, the program keeps the exact total of every note in it. The total moves only by public amounts: a deposit or a swap into the pool adds, and a withdrawal, a bridge, a swap out of it, or the flat fee of a private payment subtracts. During each day, the program also keeps the smallest total the pool reached.
When a day ends, the program adds that day’s reward per unit to the pool’s reward index, a running total of the VEILIX that one unit of the pool’s asset has earned:
text
reward per unit for day d = the pool's share of day d's release ÷ the pool's smallest total during day d
index after day d = index before day d + reward per unit for day dIf the smallest total during a day is below the pool’s floor, the day adds nothing, and its VEILIX stays in the reserve. The floors are 1 SOL and 100 USDC. Without a floor, one dust note in an empty pool would take a whole day’s release.
A note earns for every whole day it spent in the pool: from the day after the one it was deposited in, up to the day before the one it is collected in.
text
reward = floor( note amount × ( index at the start of the collect day
− index at the start of the note's first whole day ) )That gives four rules a holder can plan around:
- Whole days only. The day of the deposit does not count, and neither does the day of the collect. A note needs one whole day in the pool before it has earned anything.
- The smallest total decides the day. Value that arrived and left within a day was never part of that day’s smallest total. It earns nothing, and it takes nothing from the notes that stayed.
- Equal per unit. Every SOL that was in the pool for the same days earns the same. Two 5 SOL notes earn what one 10 SOL note earns.
- The rate follows the crowd. More SOL in the pool means less for each SOL.
Alice’s 2 SOL. Alice deposits a 2 SOL note on a Monday afternoon in year 1. Monday does not count. Say the SOL pool’s smallest total is 1,000 SOL on each of Tuesday, Wednesday, and Thursday. Each of those days adds 87,890 ÷ 1,000, about 87.89 VEILIX per SOL, to the index. If she collects on Friday, her note is owed about 527.34 VEILIX before the relayer’s fee: three days, at 87.89 VEILIX for each of her 2 SOL. Friday is not credited. Had the pool held 2,000 SOL, she would get half. That is arithmetic on an assumed pool, not a forecast.
Why it never pays more than the reserve. The program never sees a reward, and it stays solvent anyway. Only notes that were in the pool for all of a day earn for that day. At every moment of that day they were part of the pool’s total, so together they are at most the day’s smallest total, and they share at most the pool’s release for the day. Summed over days and pools, rewards cannot exceed the release. Rounding down leaves only dust, which stays in the reserve. Mining cannot start in a pool unless the reserve already holds the whole four-year schedule of every mining pool.
Who closes a day. Closing a day writes one entry to the pool’s public epoch table (the code calls a day an epoch): where that day’s notes start in the tree, and the index at that point. The first transaction to touch the pool after midnight closes the day. Anyone may also close a finished day on its own, and relayers do so about a minute after each day ends, so a quiet pool stays current.
How a collect stays private
Alice does not have to withdraw to collect. A collect is its own relayed spend, with its own proof:
- Quote. Her client asks a relayer for its collect fee. The fee is flat, in VEILIX, and the same for every note, so asking reveals nothing about her note. The program caps it. A collect pays no protocol fee.
- Prove. Her client works out the reward on her device. The proof shows that her note is in the pool’s tree, which day it was deposited in, and that the reward is exactly what the index gives for that note and those days. It reveals none of them. The deposit day is proved against two neighboring entries of the epoch table.
- Send. A relayer submits the collect. No wallet signs: not the wallet that deposited, and not Alice’s.
- Result. Her note is spent and comes back renewed: the same amount, in the same pool, as a new note that earns from the next whole day. The reserve pays the relayer’s fee out of her reward, and the rest arrives as a new VEILIX note whose amount is hidden. Both new notes can be sealed for her wallet, like a deposit, so a scan finds them again.
| Public on chain | Hidden by the proof |
|---|---|
| That a collect happened, in which pool, and on which day | Which note was collected, and its amount |
| The spent note’s nullifier, as on any spend | The deposit it came from, and the day of that deposit |
| New commitments in the pool’s tree and in the VEILIX tree | The reward |
| The relayer and its flat fee | Who holds the renewed note and the reward note |
The relayer sees the same public payload the chain stores. The indexer serves each pool’s whole epoch table to anyone who asks. Alice’s client downloads all of it, checks it against the pool account on chain, and computes the reward on her device, the same way it checks her notes. No service learns which note she collects.
In the devnet app, the Mining page shows each pool’s total, what one unit earns a day at that size, and the countdown to the next day. Below that is what each of Alice’s SOL and USDC notes has earned, worked out on her device, with Collect. Veilix Wallet has a Mining tab that does the same.
Collect before spending. A note can collect only while it is unspent. Once it is withdrawn, swapped, bridged, or spent on a private payment, in full or in part, the reward it earned is gone and stays in the reserve, and a change note starts again from nothing. So when a note has earned more than the collect fee, Alice collects first and then spends the renewed note. Collecting just before a spend costs nothing extra: the day of the spend would not have been credited anyway. Before each of those spends, the app and Veilix Wallet offer to collect first when a note’s reward is worth more than the fee.
Each collect restarts the clock. There is no need to collect often: an unspent note’s reward keeps adding up for every whole day, with no deadline. The day of a collect is credited neither to the old note nor to the renewed one, and each collect pays the fee. Collecting as often as possible would give up every other day. Collecting once a month gives up about one day in thirty. Collect when the reward is wanted, or right before a spend, not every day.
Keeping the reward private
The collect gives nothing away. Spending the reward can. A reward is the note’s amount times the growth of the index over its days, so its exact size is a fingerprint of the deposit that earned it. If Alice withdraws a whole reward note, the withdrawal publishes that size. The collect fee is public and flat, so an observer can add it back, then test the deposits in the pool: which amount, deposited on which day, gives exactly this reward? A private swap of a whole reward note publishes the amount the same way, because a swap’s amounts are public.
Counting whole days instead of exact times is what keeps that test weak. The design was checked with a simulation of one SOL pool over 90 days, with 3,668 deposits, most of them round amounts. It took the worst case: the whole reward is withdrawn to the same wallet that received the deposit’s principal, so the observer also knows the deposit’s amount.
| Reward counted in | Deposits the observer cannot tell apart, median | Deposits pinned down exactly |
|---|---|---|
| No reward, the amount alone | 190 | 0% |
| Exact time | 1 | 100% |
| Hours | 1 | 83.8% |
| Six-hour periods | 2 | 36.3% |
| Whole days, the design | 5 | 6.6% |
| Whole weeks | 35 | 0% |
Weeks would hide even a careless withdrawal, but a note would wait about two weeks before it earned anything, and partial weeks would cost holders about a quarter of their reward. Whole days cost a median 9%. The rest depends on how a reward is spent:
- Leave rewards in the pool until they are needed.
- Withdraw round amounts, such as 500 VEILIX from a reward note of about 520, and leave the rest in the pool.
- Do not send a reward to a wallet that deposited, or that received a withdrawal.
In the simulation, a reward that stayed in the pool, or left in round amounts, told the observer nothing beyond the amount alone. The app and Veilix Wallet warn before a whole reward note is withdrawn, and the SDK marks reward notes so other apps can warn too.
What you still trust
The program cannot see a reward. That is the point of the design, and it means the reserve is only as safe as the collect proof. The collect has its own circuit and its own proving files, separate from the spend circuit on the next page, and the SDK checks them against a pinned SHA-256 hash in the same way. A flaw in that circuit could pay VEILIX that no note earned.
A relayer can refuse or delay a collect, as it can any spend. Until a collect confirms, the note stays unspent and keeps earning, and another relayer can send a fresh proof.
For developers
The mining calls arrived in veilix-sdk 0.7.0 and are in every later release, including every @veilixprotocol/sdk release. On a network where mining is not set up, getMiningStatus() reports configured: false, a note’s pending reward comes back not-mining, and getCollectQuote throws.
| Job | Call |
|---|---|
| The schedule, the reserve, and each pool’s total and current rate, read from chain | getMiningStatus() |
| What notes have earned so far, worked out on the device | getPendingRewards(notes) |
| A relayer’s flat fee to collect from a pool | getCollectQuote({ mint }), with mint left out for SOL |
| Prove and send a collect | collect({ note }) |
| Prove now, send later | buildCollectPayload, submitCollectPayload |
ts
const status = await sdk.getMiningStatus(); // { configured, epoch, epochEndsAt, reserve, emitted, feeCap, pools, ... }
const [pending] = await sdk.getPendingRewards([note]);
const { quote } = await sdk.getCollectQuote({ mint: null }); // the SOL pool
if (pending.status === "earning" && BigInt(pending.reward) > BigInt(quote.fee)) {
const result = await sdk.collect({ note, relayerUrl: quote.relayerUrl });
// result.note: the renewed note. result.rewardNote: the reward, holding result.received.
// Save both. The old note is spent.
}getPendingRewards gives each note a status and its reward so far, in VEILIX base units, before the fee. The status is earning, waiting (deposited on a day that is still open), not-mining, spent, not-deposited, or unavailable. collect refuses before it proves when the note’s deposit day is still open, when the reward does not yet cover the fee, or when the note is already spent. With an encryption key loaded, both new notes are sealed and scanOwnedNotes finds them. Note status reports createdBy: "Collect" for a reward note, so an app can warn before a whole one leaves the pool.
The relayer and the indexer:
| Job | Quote | Submit | Follow |
|---|---|---|---|
| Collect | GET {relayer}/v1/collectQuote?mint= | POST {relayer}/v1/veilixCollect | GET {relayer}/v1/jobs/<id> |
/v1/collectQuotereturns{ mint, rewardMint, rewardDecimals, fee, feeCap, relayer, quotedAt }. Leavemintout for SOL./v1/veilixCollecttakes the collect proof and its public fields: the roots, the nullifier, the new commitments, the pool, the day’s position, the fee, the relayer, and four encrypted outputs. It returns a job id. The finished job reports the tree positions of the renewed note and the reward note.GET {relayer}/v1/statusreportsmining: { enabled, rewardMint, collectFee, feeCap }. The SDK sends collects only to relayers that reportenabled: true.- By default a relayer charges what a collect costs it for good, the rent of the spent note’s nullifier account and the signature, priced in VEILIX and rounded up to a whole VEILIX. An operator can set a flat fee instead. Either way the program’s cap bounds it. The reserve pays the fee, so a relayer needs no VEILIX of its own.
GET {indexer}/mining/epochs?asset=returns a pool’s epoch table in order, one entry per day:{ position, epoch, firstIndex, index }.firstIndexis the tree position where that day’s notes begin, andindexis the reward index, a 128-bit number with 64 fraction bits, as a decimal string. The response also carriesenabled,epochOffset,emissionPerEpochRaw, andfloorRaw, and it pages withfromPositionandlimit(at most 4,096). The SDK downloads every entry, rebuilds the epoch tree, and checks its root against the pool account before it proves.
The next page is the mechanism itself: the note, the tree, and the proof, written so you can inspect the same transfer Alice already made.