← Back to home

zKpk

ZK friendly pre-compiles for op-stack chains by applying a minimal diff to op-geth

Screenshots

zKpk screenshot 1
zKpk screenshot 2
zKpk screenshot 3

Problem Statement

We added Poseidon hash as a pre-compile to op-geth. This allows smart contract developers to call into this hash function from their solidity. Since Poseidon is a ZK friendly hash , a user can prove that they know the pre-image of a hash without revealing the said pre-image and an on-chain solidity verifier can verify the same. The idea is to add Zk friendly functions as pre-compiles / pre-deploys to this op-stack rollup , thus making it a zk -friendly rollup for develops to build on. We are running op-geth with op-node on goerli as our L1. This is made possible using OP-stack.

Solution

We use op-stack for our rollup.We added pre-compiles to op-geth, this includes adding circom compatable Poseidon hashing to the execution client and testing it.Adding a gas profile to op-geth for this pre-compileUsed foundry to call pre-compilesGenerate solidity verifier for Poseidon hash using circom libraryDevelopers can now call this precompile for zk applications

Hackathon

Scaling Ethereum 2023

2023

Contributors