Integration of zkFold Symbolic smart contracts with the Cardano blockchain. The repository contains
- the Plutus script for the zkFold Symbolic verifier;
- the Plutus script for the Plonk proof verification token;
- the off-chain code for transaction building;
- benchmarks for the Plutus scripts;
- end-to-end tests for the zkFold Symbolic smart contracts.
This project can be built with Cabal 3.10.2.1 and GHC 9.6.3.
Crypotgraphic depencencies needed for building Haskell packages:
$ cabal update
$ cabal build
TODO
cabal run test
to check the implementations against the test data.
cabal run bench-cpu-mem
to compile the fast implementation to UPLC (.flat
) for the further processing and calculate the cpu/mem units of the tests in the plutus-benchmark package.
To run a local testnet, follow instructions in e2e-test/README.md
.
We have two types of Plutus scripts that facilitate zero-knowledge smart contracts:
- Plonk verifier mints a token if the statement expressed as an arithmetic circuit is correct. The token name plays the role of the public input to the ZKP protocol.
- Symbolic verifier validates a transaction that withdraws ada rewards. The transaction data is hashed and supplied as a public input to the ZKP protocol.
General workflow:
- Create a trusted setup for the Plonk protocol;
- Compile the zero-knowledge smart contract into an arithmetic circuit;
- Deploy a local testnet or use sancho.network testnet;
- Fund a public key address on the testnet;
- Generate a proof from a witness and create the redeemer data for the Plutus scripts;
- Construct a transaction with the Plutus scripts using
cardano-cli
; - Submit transactions using
cardano-cli
.