Fee Structure
ZeroLedger implements a transparent, ultra-precise fee system with three distinct types of fees. Understanding these fees helps you make informed decisions about your transactions.
Understanding Your Costs
Every ZeroLedger transaction may involve up to three types of fees:
1. Protocol Fees ๐
What they are: Small fees that go directly to the ZeroLedger Treasury Contract and generate yield for users.
How they work:
- Deposit Fee: A tiny percentage when you add funds to your private balance
- Example: 0.5% = you pay $0.50 per $100 deposited
- Withdraw Fee: A small percentage when you send funds publicly
- Example: 0.5% = you pay $0.50 per $100 withdrawn
- Spend Fee: A fixed small amount per private transaction
- Example: $0.10 per transaction, regardless of amount
Precision: Protocol fees are read from the contract with high precision (e.g. 9-decimal fee divisor). The web app may round the combined (protocol + paymaster) fee up to 2 decimal places and add the rounding excess to the protocol fee so the total fee looks cleaner (e.g. $0.02 or $0.03); you never pay less than the minimum protocol fee.
2. Paymaster Fees โฝ
What they are: Optional fees paid to services that cover your blockchain gas costs, enabling gasless transactions.
How they work:
- A paymaster pays the blockchain gas fees for your transaction
- You reimburse them through a small fee included in your transaction
- This lets you transact without holding native tokens (like ETH)
Example:
- Blockchain gas cost: $2
- Paymaster markup: $0.20 (10%)
- You pay: $2.20 total, all in your preferred token
Benefits:
- โจ No need to hold ETH or native tokens
- ๐ Smoother user experience
- ๐ฐ Predictable costs in your chosen token
Note: Paymaster fees are completely optional - you can always pay gas directly if you prefer.
3. Decoy Fees ๐ญ
What they are: Small amounts automatically sent to random recipients alongside your real transaction to obscure who you're actually transacting with.
How they work:
- When you send a transaction, 0.005% of your amount is set aside for decoys
- This tiny amount is split among 2+ randomly selected recipients
- These are real transactions with actual (though tiny) value
- Recipients are selected based on wallet activity patterns to look natural
- Your real recipient is hidden among these decoy recipients
Example:
- You send $1,000 privately
- Decoy share: $1,000 ร 0.005% = $0.05
- Split among 2 recipients: $0.025 each
- Transaction graph shows payments to 3+ addresses (your real recipient + 2 decoys)
Why they matter:
- ๐ Hide who you're actually transacting with
- ๐ฅ Create noise in the transaction graph
- ๐ก๏ธ Make transaction pattern analysis much harder
- ๐ฏ Blend your activity with thousands of other transactions
Cost breakdown:
- Decoy amounts: 0.005% of transaction value (goes to random recipients)
- Gas/Paymaster fees: For the additional decoy transactions
- Protocol fees: Same percentage fees apply to your main transaction (not to decoy amounts)
Privacy boost: These tiny costs significantly enhance your privacy by making blockchain analysis exponentially more difficult.
How Fees Are Calculated
Fees are computed from on-chain protocol parameters and paymaster quotes. The web app then applies rounding so the total fee is easier to read (e.g. $0.02 or $0.03 instead of many decimal places).
Raw fee components
- Protocol fee: From the Protocol Manager contract โ e.g. a percentage of the amount (deposit/withdraw) and/or a fixed spend fee. Calculated with high precision (e.g. 9-decimal fee divisor).
- Paymaster fee: Either zero (if the paymaster sponsors gas) or
gasLimit ร gasPricefrom the TES quote. - Decoy amount (spend/withdraw only): A small share of the transaction amount (e.g. 0.005%) for decoy recipients, rounded up to 2 decimals in the UI.
Web app rounding (cleaner UX)
The web app can set a higher protocol fee than the strict minimum so that the combined protocol + paymaster amount rounds up to 2 decimal places. The rounding excess is added to the protocol fee (paymaster fee is unchanged). That way you see a clean number like $0.02 or $0.03 for that part of the fee instead of e.g. $0.0188.
- Deposit:
protocolFee = roundUpToDecimals(minProtocolFee + paymasterFee, decimals, 2) - paymasterFee. So (protocol + paymaster) is rounded up to 2 decimals; the excess goes to the protocol. - Spend / Withdraw: Same idea โ (minimum protocol + paymaster) is rounded up to 2 decimals, and the protocol fee is set to that rounded total minus paymaster fee. Decoy amount is rounded up to 2 decimals separately. Total fee shown = protocol fee + paymaster fee + decoy amount (all in token units, then formatted).
So the displayed total fee can look like $0.03 or $0.04 because the app deliberately rounds up the protocol+paymaster part and assigns the extra to the protocol; you never pay less than the minimum protocol fee, but you may pay a few fractions of a cent more for a cleaner UX.
Example: Deposit $100
- You deposit: $100.00
- Min protocol fee (e.g. 0.01%): $0.01
- Paymaster fee (gas): $0.0047
- Combined raw: $0.0147 โ rounded up to 2 decimals: $0.02
- Protocol fee (after rounding): $0.02 โ $0.0047 = $0.0153
- Paymaster fee: $0.0047
- Net in private balance: $100.00 โ $0.02 = $99.98
Example: Send $50 (private)
Steps match the code: fee inputs โ rounding of (protocol + paymaster) โ then add decoy.
- Send amount: $50.00
- Paymaster fee: from quote (e.g. gas not sponsored) โ e.g. $0.0073
- Minimum protocol fee: fixed spend fee + (withdraw fee % ร (send amount + paymaster fee)). Example with 0% withdraw: $0.01
- Round (min protocol + paymaster) up to 2 decimals: $0.01 + $0.0073 = $0.0173 โ $0.02
- Protocol fee = that rounded total minus paymaster: $0.02 โ $0.0073 = $0.0127 (so protocol + paymaster = $0.02)
- Decoy: 0.005% ร $50 = $0.0025 โ rounded up to 2 decimals = $0.01
- Total fee = (protocol + paymaster) + decoy = $0.02 + $0.01 = $0.03
- Recipient receives (private): $50 โ $0.03 = $49.97
Fee Transparency
All fees are:
- โ Visible upfront - You see the total fee (and its components) before confirming
- โ Automatically synced - The app reads protocol parameters and paymaster quotes from the chain
- โ Rounded for UX - The app may round (protocol + paymaster) up to 2 decimals and add the excess to the protocol fee so the total looks clean (e.g. $0.03)
- โ Fair for all amounts - Minimum protocol fees scale with amount where applicable; you never pay below the contract minimum
Technical Details
Fee Precision
ZeroLedger uses a configurable fee precision system:
- Fee Decimals: 9 decimal places (1,000,000,000 = 100%)
- Minimum Fee Unit: 0.0000001%
Fee Configuration
Protocol fees are set during smart contract deployment and can be updated by protocol governance:
- Deposit & Withdraw Fees: Percentage-based (0 to 100%)
- Spend Fee: Fixed amount per transaction
Permissionless Paymasters
Anyone can become a paymaster - the system is completely permissionless:
- ๐ Run gasless transaction services for your users
- ๐ผ Create your own business model (free, subscription, per-tx fee)
- ๐ง Integrate with EOA wallets via meta-transactions
- โก Support smart contract wallets and EIP-7702 delegation natively
Paymaster Benefits:
- ๐ฐ Revenue generation from sponsored transactions
- ๐ฅ User acquisition through gasless experience
- ๐ฏ Flexible business models for different use cases
- ๐ฑ Contribute to ecosystem growth
