Integration of zkFold Symbolic smart contracts with the Ethereum blockchain. The repository contains
- user documentation for zkFold Symbolic circuits;
- the smart contracts specification;
- the off-chain code for transaction building;
- end-to-end tests for the zkFold Symbolic smart contracts.
The user documentation contains the necessary information about the development of ZK smart contracts using zkFold Symbolic in application to the Ethereum blockchain.
zkFold Symbolic is a subset of Haskell compilable to arithmetic circuits. It is, therefore, a high-level functional programming language that allows developers to harness the power of zero knowledge protocols for their trustless, decentralized, and privacy-preserving applications. It aims to reduce the barrier to entry in the development of zk-enhanced applications and smart contracts.
- Read the documentation on writing zkFold Symbolic circuits.
- Write your own circuit with zkFold Symbolic (or import one of the examples). (Ethereum support is in progress)
- Core Ethereum smart contract
- ZK-powered token standard
The Core smart contract which is a plonk verifier with pre built setup, created via the gnark. Also called a Verifier contract.
Core verifier contract API:
Verify
: verify your proof and public_inputs;
zkFold Symbolic smart contract can be verified on-chain using a ZK verifier contract. Currently, we provide token contract Symbolic. Namely, Symbolic verifier contract verifies the statement with the public input derived from the state of the contract as well as transaction data.
You can find the Symbolic verifier specification here. Below is the snippet of the Solidity script for the Symbolic verifier contract:
Symbolic verifier contract API:
deposit
: deposits funds to the contract;withdraw
: withdraws funds from the contract;newTransfer
: create transfer with circuit;batchTransfer
: performs batch transfer to accounts.
circuit
: create circuit example;setup
: create setup from circuit;solidity
: create a Verifier from setup;prover
: prove the setup.
This project can be built with Cabal 3.10.2.1 and GHC 9.6.3.
cabal build
go build
npx hardhat node
- Choose a suitable on-chain verifier Symbolic.
- Compile the circuit and write it to a file with
compileIO
. - Create a Verifier contract with setup.
- Post the Verifier smart contract on Ethereum.
- Post the zkFold Symbolic smart contract on Ethereum.
- Сalculate the batch transfer.
- Claim your rewards.