Limitations
Last updated
Was this helpful?
Last updated
Was this helpful?
Before using ZK Compression to scale your application state, consider the following limitations of compressed accounts:
It may be preferred for an account not to be permanently compressed if:
The account gets updated very frequently within a single block (e.g., shared liquidity pools in a DeFi protocol).
You expect the lifetime number of writes to the same account to be very large (>>1000x).
The account stores large amounts of data, and you need to access a large part of it (>1kb) inside one on-chain transaction.
Solana's transaction size limit is 1232 Bytes. Transactions exceeding this limit will fail. ZK Compression increases your transaction size in two ways:
128 bytes must be reserved for the validity proof, which is a constant size per transaction, assuming the transaction reads from at least one compressed account.
You must send the account data you want to read/write on-chain.
Higher CU usage can:
Lead to usage limits: The total CU limit per transaction is 1,400,000 CU, and the per-block write lock limit per State tree is 12,000,000 CU.
Each write operation incurs a small additional network cost. If you expect a single compressed account to amass a large amount of state updates, the lifetime cost of the compressed account may be higher than its uncompressed equivalent, which currently has a fixed per-byte rent cost at creation.
Solana base fee
5000 per signature
Compensates validators for processing transactions
Write new compressed account state
~300 per leaf (default)
Nullify old compressed account state
5000 per transaction
Create addresses
5000 per transaction
Same as nullify
~100,000 CU system use (state tree hashing et al.)
Require your users to increase their during congestion: Whenever Solana's global per-block CU limit (48,000,000 CU) is reached, validator clients may prioritize transactions with higher per-CU priority fees.
Whenever a writes to a compressed account, it nullifies the previous compressed account state and appends the new compressed account as a leaf to the state tree. Both of these actions incur costs that add to Solana's base fee.
Depends on tree depth:
~300 for the default depth of 26
Reimburses the cost of running a Forester transaction. The current default Forester node implementation can be found
Now you're familiar with the core concepts of ZK Compression, you're ready to take the next step! Dive into or with ZK Compression, or learn how to . For those interested in learning more about the fundamentals of ZK and its applications on Solana, we recommend reading the following: