Telegram Tidbits: Late April


v2 gas fees and dev updates.

April 6th

Community member ShiftyBear asked:

What is the average gas cost of a Uniswap swap in gas, compared to the 42k gas of a “zk->zk swap” inside Offshift? My guess is that it’s around 120-150k?


It can vary quite a bit especially based on the routing, but usually between 200k and 400k gas.

Remember that 42k is only the gas cost for the swap itself - the publisher will still need to be paid a fee for proving and there’s the split verification fee (~450K split 16 ways in a full batch so ~30k gas), but it should come out cheaper cost-wise in the end compared to Uniswap as well as use a lot less gas on-chain.


So it’s the 21k gas for burning a utxo (zk asset 1), then 21k gas for minting a new utxo (zk asset 2) + ~30k to pay the prover, if you’re willing to wait for the batch transaction and not self publishing. So a total of around ~72k gas for a zk swap?

Aside from the 450K gas needed to pay the publisher (that’s the same as prover right?), it was also mentioned that there was a free market aspect to the prover fees. Is that still a thing? Or is it always 450K gas for a batch of 16?


There are some other costs depending on what your specific tx wants to do (withdrawing/depositing takes more gas because of additional on-chain interactions, some minor contract state changes that are shared across all users for updating the state root, etc). I broke down the costs somewhere in this chat a while back. They’re still subject to change but roughly they are accurate and will be very cheap compared to what most people are used to for ZK (because of the batching) and will be cheaper than v1 by magnitudes for each user. We’re still expecting the user’s gas cost for most interactions to be cheaper than Uni on average in a full batch.

The publisher/prover technically can be two different people. For most cases we anticipate they will be the same machine/actor initially, but nothing stops a publisher from using a prover network to outsource the proving work. In fact, I assume in the future many ZK networks will function similarly once sequencing is decentralized and there will be arbitrage between user fees and proving network markets (see: things like bonsai by RISC Zero).

The market part is how much the prover/publisher accepts for proving - effectively the users of the network are bidding on the CPU time it takes to prove their tx as part of a batch. Users prove the private part of their transactions locally, and then the publisher has to make a proof for the entire batch of transactions that are being included.

The 450k gas is NOT paid to the publisher - that is the gas cost for the ZK verification itself and is required to be paid on-chain to prove the entire batch is valid and contains valid transactions. That cost is required in every batch and is the part where the ZK “magic” happens - proving unlimited computation succinctly and for a fixed cost.

April 11th

Community member Mouh asked:

Can you inform us how the development process is going?


We’re wrapping up recent updates to the client-side middleware and working on the compliance circuit. Everything else is done (for now).


That looks cool. For the compliance circuit is it the proof of innocence or there’s other things?


POI is the important one. We’re working on some viewing key schemes and we’ll likely roll out additional tools post-launch.

For all the latest developments, make sure to join the official Offshift Telegram and follow us on X !

And keep an eye on our team member’s X accounts as well: Greybeard , n00b and Johnny !