---
# System prepended metadata

title: zk verify gas profile

---

# zk verify gas profile

[dune ashboard ](https://dune.com/samzkback/zk-verify-pairing)

[add new contract](https://dune.com/contracts/new)

## Metrics

1. pie chart  : total pairing call(gas) for each projects.
2. line chart : monthly paring call(gas) for each projects


## TL;DR

1. The Goal is get the underline market size of proof aggregate optimization.
2. The methology different between Snark and Stark:
    * snark : projects who using bn256 pairing (EVM precompile 0x8)
        * [zksync era](https://dune.com/samzkback/zk-verify-pairing)
        * zksync lite
        * [polygon zkevm](https://dune.com/samzkback/zk-verify-pairing)
        * aztec
        * tornado cash
        * semaphore, Axiom, railgun, Succinct Labs, Loopring, worldcoin (polygon)
    * stark : TODO
        * starkNet
        * starkEx
4. [Dune is fetching the data from `trace_transaction` which doesn't show precompile calls.](https://twitter.com/_hrkrshnn/status/1641848670143348737)
5. Record the function who call 0x8 precompile. (mannully, or analysis script)
6. all the "0x8 call" ? run full node.(etherscan API?)


## zk-Stark

<!-- [starknet core Contract](https://etherscan.io/address/0xc662c410c0ecf747543f5ba90660f6abebd9c8c4) updateState, but it is not the verifier -->

[sharp verifier(immutableX+sorare)](https://docs.starkware.co/starkex/deployments-addresses.html#sharp_verifier_contracts) for starkex(immutableX, and other)

[dydx](https://docs.starkware.co/starkex/deployments-addresses.html#sharp_verifier_contracts)


[starknet also using starkex sharp](https://docs.starknet.io/documentation/useful_info/)



## EVM Precompile

|precompile|name|gas|
| -------- | -------- | -------- |
|0x6    |    bn256Add     |   150    |
|0x7    |    bn256Scalar  |   6000   |
|0x8    |    bn256Pairing |$45000+34000*p$|


## zksync Era

[verifier contract](https://etherscan.io/address/0x3db52ce065f728011ac6732222270b3f2360d919/advanced)

|function|pairing number|event|
| ------ | ------ | ------ |
| proveBlocks | 2 | BlocksVerification|


* pros : simple
* cons : function name keep the same among upgrade


## Get Precompile from ethereum.trace

[Dune is fetching the data from `trace_transaction` which doesn't show precompile calls.](https://twitter.com/_hrkrshnn/status/1641848670143348737)

```sql=
SELECT *
FROM
    ethereum.traces
WHERE
    block_number=17413556
AND
    tx_index=29
```
![](https://hackmd.io/_uploads/ryh3J9sLn.png)


## Polygon zkEVM

[verifier contract](https://etherscan.io/tx/0xa51e3791aac8082ea69c4756388116add0a715103a4b8b14ca18578174a516e8/advanced#internal)

|function|pairing number |
| ------ | ------ |
| verifyBatchesTrustedAggregator | 1 |

## Tornado Cash
[verifier](https://etherscan.io/address/0xce172ce1f20ec0b3728c9965470eaf994a03557a/advanced#internaltx)

|deposit|contract|
| ------ | ------ |
|0.1E|12d66f87a04a9e220743712ce6d9bb1b5616b8fc|
|1E|47ce0c6ed5b0ce3d3a51fdb1c52dc66a7c3c2936|
|10E|910cbd523d972eb0a6f4cae4618ad62622b39dbf|
|100E|a160cdab225685da1d56aa342ad8841c3b53f291|

|function|pairing number |
| ------ | ------ |
| withdraw | 1 |

## Aztec

[Verifier](https://etherscan.io/address/0xb656f4219f565b93df57d531b574e17fe0f25939/advanced#internaltx)

Contract : 0xFF1F2B4ADb9dF6FC8eAFecDcbF96A2B351680455
aztec_v2.RollupProcessor


|function|pairing number |
| ------ | ------ |
| processRollup | 1 |
0xf81cccbe

## Loopring

[Verifier](https://etherscan.io/address/verifier2.loopring.eth/advanced#internaltx)

|function|pairing number |
| ------ | ------ |
| submitBlocksWithCallbacks | 1 |
0xdcb2aa31

0x153CdDD727e407Cb951f728F24bEB9A5FaaA8512

loopring.LoopringIOExchangeOwner


## [WorldCoin](https://docs.worldcoin.org/reference/address-book)

execute in safe ?

0x3bc778e3
polygon.trace


## [Semaphore protocol](https://semaphore.appliedzkp.org/docs/deployed-contracts)

only testnet


## Dune Customize Precompile Table

1. connect ETH RPC, query precompile call as table
```graphql=
    query {
      ethereum {
        blocks {
          count
          precompileCalls {
            count
          }
        }
      }
    }
```

## TODO

1. correctly metric the 0x8 (34000*P)
2. what about multiple 0x7?
3. is there any other "precompile table"
4. decode_call real gas price, instead of assumption 50gwei

