The Tools for Humanity (TFH) contributor team has released an update that bundles transactions to make the World App wallet significantly more scalable and cost efficient. The update combines techniques such as batching and compression to eliminate a substantial portion of layer 1 (L1) gas fees.
Overall, fee expenditures have been slashed significantly (TFH subsidizes World App user gas fees) and the load on Optimism has been reduced by two thirds. Since the update’s release, World App has seen its highest ever single day transaction volume at more than 500K transactions.
A new record pic.twitter.com/4IDXdvDN2u
— Worldcoin (@worldcoin) September 5, 2023
Cost breakdown
World App transaction costs can generally be broken down as follows: 90% go to L1 gas fees on Ethereum, and the remaining 10% go to L2 gas fees on Optimism. The bulk of the cost is due to the size of the transactions (i.e. their data), not what they do.
Batching
World App uses Safe for all user accounts. This adds some overhead to transactions but allows for optimizations that make them cost effective at scale.
One such optimization is the use of MultiCall contracts to batch results from multiple contract constant function calls and amortize the fixed overhead over multiple transactions. This alone saves up to a third of the cost when batches are sufficiently large.
Batch size is determined by the rate of transactions and two parameters: maximum batch size and maximum delay. As transactions come in, they are queued. Once the queue size equals the maximum batch size, or the oldest transaction is maximum delay old, it gets submitted. This method works for any Safe transaction.
Compression
To reduce transaction size, TFH and their collaborators have implemented compression based on the price differential between L1 and L2. Compression algorithms are run in L2.
One particular optimization technique that was developed and upstreamed to Consensys gnark involves compressing Groth16 proofs. This technique modifies the Golang contract template of the Groth16 proof verifier in the gnark library to optimize the verifier for both L1 and L2 gas consumption.
Worldcoin’s Groth16 verifier was audited by Least Authority, a global team of security consultants committed to building and supporting the development of usable technology solutions and ethical business practices. Their findings are available here.
Worldcoin project contributors have developed & open sourced an optimization technique that modifies the Golang contract template of the Groth16 proof verifier in the gnark library to optimize the verifier for both L1 & L2 gas consumption. https://t.co/p1tUnqQJSf
— Worldcoin (@worldcoin) September 20, 2023
Learn more
The purpose of this article is to introduce readers to the most recent World App update that has succeeded in eliminating nearly all L1 gas fees and reducing its load on Optimism’s L2 blockchain by two thirds. More detailed information about this update will be shared in the near future.
If you’d like to stay informed about Worldcoin updates and other important information, sign up for the blog newsletter at the bottom of this page or join the ongoing daily conversations on Twitter, Discord, YouTube and Telegram.
Disclaimer
The above content speaks only as of the date indicated. Further, it is subject to risks, uncertainties and assumptions, and so may be incorrect and may change without notice. A full disclaimer can be found in our Terms of Use and Important User Information can be found on our Risks page.