From ed26927c661ec7d0493b7a4260e904b69d472c43 Mon Sep 17 00:00:00 2001 From: Vladimir Sinyakov Date: Sun, 6 Oct 2024 10:39:52 +0200 Subject: [PATCH 1/7] Move `zfold-base` to a subfolder --- .gitignore | 1 - README.md | 2 +- cabal.project | 3 ++- zkfold-base/LICENSE | 21 +++++++++++++++++++ {bench => zkfold-base/bench}/BenchCompiler.hs | 2 +- {bench => zkfold-base/bench}/BenchPolyMul.hs | 0 .../examples}/Examples/BatchTransfer.hs | 0 .../examples}/Examples/ByteString.hs | 0 .../examples}/Examples/Conditional.hs | 0 .../examples}/Examples/Constant.hs | 0 .../examples}/Examples/Eq.hs | 0 .../examples}/Examples/FFA.hs | 0 .../examples}/Examples/Fibonacci.hs | 0 .../examples}/Examples/LEQ.hs | 0 .../examples}/Examples/MiMCHash.hs | 0 .../examples}/Examples/ReverseList.hs | 0 .../examples}/Examples/UInt.hs | 0 .../examples}/ZkFold/Symbolic/Examples.hs | 0 hie.yaml => zkfold-base/hie.yaml | 6 +++--- .../src}/ZkFold/Base/Algebra/Basic/Class.hs | 0 .../src}/ZkFold/Base/Algebra/Basic/DFT.hs | 0 .../src}/ZkFold/Base/Algebra/Basic/Field.hs | 0 .../src}/ZkFold/Base/Algebra/Basic/Number.hs | 0 .../ZkFold/Base/Algebra/Basic/Permutations.hs | 0 .../ZkFold/Base/Algebra/Basic/VectorSpace.hs | 0 .../Base/Algebra/EllipticCurve/BLS12_381.hs | 0 .../Base/Algebra/EllipticCurve/BN254.hs | 0 .../Base/Algebra/EllipticCurve/Class.hs | 0 .../Base/Algebra/EllipticCurve/Ed25519.hs | 0 .../Base/Algebra/EllipticCurve/Pairing.hs | 0 .../Base/Algebra/EllipticCurve/Pasta.hs | 0 .../Base/Algebra/Polynomials/Multivariate.hs | 0 .../Polynomials/Multivariate/Groebner.hs | 0 .../Polynomials/Multivariate/Monomial.hs | 0 .../Polynomials/Multivariate/Polynomial.hs | 0 .../Polynomials/Multivariate/Substitution.hs | 0 .../Base/Algebra/Polynomials/Univariate.hs | 0 .../src}/ZkFold/Base/Control/HApplicative.hs | 0 .../src}/ZkFold/Base/Data/ByteString.hs | 0 .../src}/ZkFold/Base/Data/HFunctor.hs | 0 .../src}/ZkFold/Base/Data/Matrix.hs | 0 .../src}/ZkFold/Base/Data/Package.hs | 0 .../src}/ZkFold/Base/Data/Par1.hs | 0 .../src}/ZkFold/Base/Data/Product.hs | 0 .../src}/ZkFold/Base/Data/Sparse/Matrix.hs | 0 .../src}/ZkFold/Base/Data/Sparse/Vector.hs | 0 .../src}/ZkFold/Base/Data/Type.hs | 0 .../src}/ZkFold/Base/Data/Vector.hs | 0 .../src}/ZkFold/Base/Protocol/KZG.hs | 0 .../Base/Protocol/NonInteractiveProof.hs | 0 .../Protocol/NonInteractiveProof/Internal.hs | 0 .../Protocol/NonInteractiveProof/Prover.hs | 0 .../Protocol/NonInteractiveProof/Testing.hs | 0 .../src}/ZkFold/Base/Protocol/Plonk.hs | 0 .../src}/ZkFold/Base/Protocol/Plonk/Prover.hs | 0 .../ZkFold/Base/Protocol/Plonk/Verifier.hs | 0 .../src}/ZkFold/Base/Protocol/Plonkup.hs | 0 .../ZkFold/Base/Protocol/Plonkup/Input.hs | 0 .../ZkFold/Base/Protocol/Plonkup/Internal.hs | 0 .../Base/Protocol/Plonkup/LookupConstraint.hs | 0 .../Base/Protocol/Plonkup/PlonkConstraint.hs | 0 .../Protocol/Plonkup/PlonkupConstraint.hs | 0 .../ZkFold/Base/Protocol/Plonkup/Proof.hs | 0 .../ZkFold/Base/Protocol/Plonkup/Prover.hs | 0 .../Protocol/Plonkup/Prover/Polynomials.hs | 0 .../Base/Protocol/Plonkup/Prover/Secret.hs | 0 .../Base/Protocol/Plonkup/Prover/Setup.hs | 0 .../ZkFold/Base/Protocol/Plonkup/Relation.hs | 0 .../ZkFold/Base/Protocol/Plonkup/Setup.hs | 0 .../ZkFold/Base/Protocol/Plonkup/Testing.hs | 0 .../ZkFold/Base/Protocol/Plonkup/Utils.hs | 0 .../ZkFold/Base/Protocol/Plonkup/Verifier.hs | 0 .../Protocol/Plonkup/Verifier/Commitments.hs | 0 .../Base/Protocol/Plonkup/Verifier/Setup.hs | 0 .../ZkFold/Base/Protocol/Plonkup/Witness.hs | 0 .../src}/ZkFold/Base/Protocol/Protostar.hs | 0 .../Base/Protocol/Protostar/Accumulator.hs | 0 .../Protocol/Protostar/AccumulatorScheme.hs | 0 .../Protocol/Protostar/ArithmeticCircuit.hs | 0 .../ZkFold/Base/Protocol/Protostar/Commit.hs | 0 .../Base/Protocol/Protostar/CommitOpen.hs | 0 .../Base/Protocol/Protostar/FiatShamir.hs | 0 .../ZkFold/Base/Protocol/Protostar/Fold.hs | 0 .../ZkFold/Base/Protocol/Protostar/Gate.hs | 0 .../Base/Protocol/Protostar/Internal.hs | 0 .../ZkFold/Base/Protocol/Protostar/Lookup.hs | 0 .../ZkFold/Base/Protocol/Protostar/Oracle.hs | 0 .../Base/Protocol/Protostar/Permutation.hs | 0 .../Base/Protocol/Protostar/SpecialSound.hs | 0 {src => zkfold-base/src}/ZkFold/Prelude.hs | 0 .../Symbolic/Algorithms/Hash/Blake2b.hs | 0 .../Algorithms/Hash/Blake2b/Constants.hs | 0 .../ZkFold/Symbolic/Algorithms/Hash/MiMC.hs | 0 .../Algorithms/Hash/MiMC/Constants.hs | 0 .../ZkFold/Symbolic/Algorithms/Hash/SHA2.hs | 0 .../Algorithms/Hash/SHA2/Constants.hs | 0 .../Cardano/Contracts/BatchTransfer.hs | 0 .../Cardano/Contracts/RandomOracle.hs | 0 .../src}/ZkFold/Symbolic/Cardano/Types.hs | 0 .../ZkFold/Symbolic/Cardano/Types/Address.hs | 0 .../ZkFold/Symbolic/Cardano/Types/Basic.hs | 0 .../ZkFold/Symbolic/Cardano/Types/Input.hs | 0 .../ZkFold/Symbolic/Cardano/Types/Output.hs | 0 .../Symbolic/Cardano/Types/Output/Datum.hs | 0 .../Symbolic/Cardano/Types/OutputRef.hs | 0 .../Symbolic/Cardano/Types/Transaction.hs | 0 .../ZkFold/Symbolic/Cardano/Types/Value.hs | 0 .../src}/ZkFold/Symbolic/Cardano/UPLC.hs | 0 .../ZkFold/Symbolic/Cardano/UPLC/Builtins.hs | 0 .../ZkFold/Symbolic/Cardano/UPLC/Inference.hs | 0 .../Cardano/UPLC/Inference/Internal.hs | 0 .../src}/ZkFold/Symbolic/Cardano/UPLC/Term.hs | 0 .../src}/ZkFold/Symbolic/Cardano/UPLC/Type.hs | 0 .../src}/ZkFold/Symbolic/Cardano/Wrapper.hs | 0 .../src}/ZkFold/Symbolic/Class.hs | 0 .../src}/ZkFold/Symbolic/Compiler.hs | 0 .../Symbolic/Compiler/ArithmeticCircuit.hs | 0 .../Compiler/ArithmeticCircuit/Instance.hs | 0 .../Compiler/ArithmeticCircuit/Internal.hs | 0 .../Compiler/ArithmeticCircuit/Map.hs | 0 .../Compiler/ArithmeticCircuit/MerkleHash.hs | 0 .../src}/ZkFold/Symbolic/Data/Bool.hs | 0 .../src}/ZkFold/Symbolic/Data/ByteString.hs | 0 .../src}/ZkFold/Symbolic/Data/Class.hs | 0 .../src}/ZkFold/Symbolic/Data/Combinators.hs | 0 .../src}/ZkFold/Symbolic/Data/Conditional.hs | 0 .../ZkFold/Symbolic/Data/DiscreteField.hs | 0 .../src}/ZkFold/Symbolic/Data/Ed25519.hs | 0 .../src}/ZkFold/Symbolic/Data/Eq.hs | 0 .../ZkFold/Symbolic/Data/Eq/Structural.hs | 0 .../src}/ZkFold/Symbolic/Data/FFA.hs | 0 .../src}/ZkFold/Symbolic/Data/FieldElement.hs | 0 .../src}/ZkFold/Symbolic/Data/List.hs | 0 .../src}/ZkFold/Symbolic/Data/Maybe.hs | 0 .../src}/ZkFold/Symbolic/Data/Ord.hs | 0 .../src}/ZkFold/Symbolic/Data/UInt.hs | 0 .../src}/ZkFold/Symbolic/Data/UTCTime.hs | 0 .../src}/ZkFold/Symbolic/Interpreter.hs | 0 .../src}/ZkFold/Symbolic/Ledger/Types.hs | 0 .../ZkFold/Symbolic/Ledger/Types/Address.hs | 0 .../ZkFold/Symbolic/Ledger/Types/Basic.hs | 0 .../ZkFold/Symbolic/Ledger/Types/Bridge.hs | 0 .../ZkFold/Symbolic/Ledger/Types/Contract.hs | 0 .../src}/ZkFold/Symbolic/Ledger/Types/Hash.hs | 0 .../ZkFold/Symbolic/Ledger/Types/Input.hs | 0 .../ZkFold/Symbolic/Ledger/Types/Output.hs | 0 .../ZkFold/Symbolic/Ledger/Types/OutputRef.hs | 0 .../Symbolic/Ledger/Types/Transaction.hs | 0 .../ZkFold/Symbolic/Ledger/Types/Update.hs | 0 .../ZkFold/Symbolic/Ledger/Types/Value.hs | 0 .../Symbolic/Ledger/Validation/Bridge.hs | 0 .../Symbolic/Ledger/Validation/Common.hs | 0 .../Symbolic/Ledger/Validation/Contract.hs | 0 .../Ledger/Validation/PrivateInput.hs | 0 .../Symbolic/Ledger/Validation/PublicInput.hs | 0 .../Symbolic/Ledger/Validation/Transaction.hs | 0 .../Symbolic/Ledger/Validation/Update.hs | 0 .../src}/ZkFold/Symbolic/MonadCircuit.hs | 0 .../stats}/ByteString.Add.512 | 0 .../stats}/ByteString.And.32 | 0 .../stats}/ByteString.Extend.1.512 | 0 {stats => zkfold-base/stats}/ByteString.Or.64 | 0 {stats => zkfold-base/stats}/Conditional | 0 {stats => zkfold-base/stats}/Constant.5 | 0 {stats => zkfold-base/stats}/Eq | 0 {stats => zkfold-base/stats}/Eq.Constant.5 | 0 {stats => zkfold-base/stats}/FFA.Add.097 | 0 {stats => zkfold-base/stats}/FFA.Add.337 | 0 {stats => zkfold-base/stats}/FFA.Mul.097 | 0 {stats => zkfold-base/stats}/FFA.Mul.337 | 0 {stats => zkfold-base/stats}/Fibonacci.100 | 0 {stats => zkfold-base/stats}/LEQ | 0 {stats => zkfold-base/stats}/MiMCHash | 0 {stats => zkfold-base/stats}/Reverse.32.3000 | 0 {stats => zkfold-base/stats}/SHA256.32 | 0 .../stats}/UInt.DivMod.32.Auto | 0 {stats => zkfold-base/stats}/UInt.Mul.64.Auto | 0 .../stats}/UInt.StrictAdd.256.Auto | 0 .../stats}/UInt.StrictMul.512.Auto | 0 {tests => zkfold-base/test}/Main.hs | 0 .../test}/Tests/ArithmeticCircuit.hs | 0 .../test}/Tests/Arithmetization.hs | 0 .../test}/Tests/Arithmetization/Test1.hs | 0 .../test}/Tests/Arithmetization/Test2.hs | 0 .../test}/Tests/Arithmetization/Test3.hs | 0 .../test}/Tests/Arithmetization/Test4.hs | 0 {tests => zkfold-base/test}/Tests/Binary.hs | 0 {tests => zkfold-base/test}/Tests/Blake2b.hs | 0 .../test}/Tests/ByteString.hs | 0 {tests => zkfold-base/test}/Tests/FFA.hs | 0 {tests => zkfold-base/test}/Tests/Field.hs | 0 .../test}/Tests/GroebnerBasis.hs | 0 {tests => zkfold-base/test}/Tests/Group.hs | 0 .../test}/Tests/NonInteractiveProof.hs | 0 {tests => zkfold-base/test}/Tests/Pairing.hs | 0 .../test}/Tests/Permutations.hs | 0 {tests => zkfold-base/test}/Tests/Plonkup.hs | 0 .../test}/Tests/Protostar.hs | 0 {tests => zkfold-base/test}/Tests/SHA2.hs | 0 {tests => zkfold-base/test}/Tests/UInt.hs | 0 .../test}/Tests/Univariate.hs | 0 .../test}/Tests/Univariate/Poly.hs | 0 .../test}/Tests/Univariate/PolyVec.hs | 0 .../data/shabittestvectors/SHA224LongMsg.rsp | 0 .../data/shabittestvectors/SHA224ShortMsg.rsp | 0 .../data/shabittestvectors/SHA256LongMsg.rsp | 0 .../data/shabittestvectors/SHA256ShortMsg.rsp | 0 .../data/shabittestvectors/SHA384LongMsg.rsp | 0 .../data/shabittestvectors/SHA384ShortMsg.rsp | 0 .../data/shabittestvectors/SHA512LongMsg.rsp | 0 .../data/shabittestvectors/SHA512ShortMsg.rsp | 0 .../shabittestvectors/SHA512_224LongMsg.rsp | 0 .../shabittestvectors/SHA512_224ShortMsg.rsp | 0 .../shabittestvectors/SHA512_256LongMsg.rsp | 0 .../shabittestvectors/SHA512_256ShortMsg.rsp | 0 .../zkfold-base.cabal | 8 +++---- 216 files changed, 32 insertions(+), 11 deletions(-) create mode 100644 zkfold-base/LICENSE rename {bench => zkfold-base/bench}/BenchCompiler.hs (98%) rename {bench => zkfold-base/bench}/BenchPolyMul.hs (100%) rename {examples => zkfold-base/examples}/Examples/BatchTransfer.hs (100%) rename {examples => zkfold-base/examples}/Examples/ByteString.hs (100%) rename {examples => zkfold-base/examples}/Examples/Conditional.hs (100%) rename {examples => zkfold-base/examples}/Examples/Constant.hs (100%) rename {examples => zkfold-base/examples}/Examples/Eq.hs (100%) rename {examples => zkfold-base/examples}/Examples/FFA.hs (100%) rename {examples => zkfold-base/examples}/Examples/Fibonacci.hs (100%) rename {examples => zkfold-base/examples}/Examples/LEQ.hs (100%) rename {examples => zkfold-base/examples}/Examples/MiMCHash.hs (100%) rename {examples => zkfold-base/examples}/Examples/ReverseList.hs (100%) rename {examples => zkfold-base/examples}/Examples/UInt.hs (100%) rename {examples => zkfold-base/examples}/ZkFold/Symbolic/Examples.hs (100%) rename hie.yaml => zkfold-base/hie.yaml (67%) rename {src => zkfold-base/src}/ZkFold/Base/Algebra/Basic/Class.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Algebra/Basic/DFT.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Algebra/Basic/Field.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Algebra/Basic/Number.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Algebra/Basic/Permutations.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Algebra/Basic/VectorSpace.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Algebra/EllipticCurve/BLS12_381.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Algebra/EllipticCurve/BN254.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Algebra/EllipticCurve/Class.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Algebra/EllipticCurve/Ed25519.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Algebra/EllipticCurve/Pairing.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Algebra/EllipticCurve/Pasta.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Algebra/Polynomials/Multivariate.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Algebra/Polynomials/Multivariate/Groebner.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Algebra/Polynomials/Multivariate/Monomial.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Algebra/Polynomials/Multivariate/Polynomial.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Algebra/Polynomials/Multivariate/Substitution.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Algebra/Polynomials/Univariate.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Control/HApplicative.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Data/ByteString.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Data/HFunctor.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Data/Matrix.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Data/Package.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Data/Par1.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Data/Product.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Data/Sparse/Matrix.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Data/Sparse/Vector.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Data/Type.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Data/Vector.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/KZG.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/NonInteractiveProof.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/NonInteractiveProof/Internal.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/NonInteractiveProof/Prover.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/NonInteractiveProof/Testing.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Plonk.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Plonk/Prover.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Plonk/Verifier.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Plonkup.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Plonkup/Input.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Plonkup/Internal.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Plonkup/LookupConstraint.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Plonkup/PlonkConstraint.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Plonkup/PlonkupConstraint.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Plonkup/Proof.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Plonkup/Prover.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Plonkup/Prover/Polynomials.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Plonkup/Prover/Secret.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Plonkup/Prover/Setup.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Plonkup/Relation.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Plonkup/Setup.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Plonkup/Testing.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Plonkup/Utils.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Plonkup/Verifier.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Plonkup/Verifier/Commitments.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Plonkup/Verifier/Setup.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Plonkup/Witness.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Protostar.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Protostar/Accumulator.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Protostar/AccumulatorScheme.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Protostar/ArithmeticCircuit.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Protostar/Commit.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Protostar/CommitOpen.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Protostar/FiatShamir.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Protostar/Fold.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Protostar/Gate.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Protostar/Internal.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Protostar/Lookup.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Protostar/Oracle.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Protostar/Permutation.hs (100%) rename {src => zkfold-base/src}/ZkFold/Base/Protocol/Protostar/SpecialSound.hs (100%) rename {src => zkfold-base/src}/ZkFold/Prelude.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Algorithms/Hash/Blake2b.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Algorithms/Hash/Blake2b/Constants.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Algorithms/Hash/MiMC.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Algorithms/Hash/MiMC/Constants.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Algorithms/Hash/SHA2.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Algorithms/Hash/SHA2/Constants.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Cardano/Contracts/BatchTransfer.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Cardano/Contracts/RandomOracle.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Cardano/Types.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Cardano/Types/Address.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Cardano/Types/Basic.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Cardano/Types/Input.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Cardano/Types/Output.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Cardano/Types/Output/Datum.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Cardano/Types/OutputRef.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Cardano/Types/Transaction.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Cardano/Types/Value.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Cardano/UPLC.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Cardano/UPLC/Builtins.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Cardano/UPLC/Inference.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Cardano/UPLC/Inference/Internal.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Cardano/UPLC/Term.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Cardano/UPLC/Type.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Cardano/Wrapper.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Class.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Compiler.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Compiler/ArithmeticCircuit.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Compiler/ArithmeticCircuit/Instance.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Compiler/ArithmeticCircuit/Internal.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Compiler/ArithmeticCircuit/Map.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Compiler/ArithmeticCircuit/MerkleHash.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Data/Bool.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Data/ByteString.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Data/Class.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Data/Combinators.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Data/Conditional.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Data/DiscreteField.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Data/Ed25519.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Data/Eq.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Data/Eq/Structural.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Data/FFA.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Data/FieldElement.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Data/List.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Data/Maybe.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Data/Ord.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Data/UInt.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Data/UTCTime.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Interpreter.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Ledger/Types.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Ledger/Types/Address.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Ledger/Types/Basic.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Ledger/Types/Bridge.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Ledger/Types/Contract.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Ledger/Types/Hash.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Ledger/Types/Input.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Ledger/Types/Output.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Ledger/Types/OutputRef.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Ledger/Types/Transaction.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Ledger/Types/Update.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Ledger/Types/Value.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Ledger/Validation/Bridge.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Ledger/Validation/Common.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Ledger/Validation/Contract.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Ledger/Validation/PrivateInput.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Ledger/Validation/PublicInput.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Ledger/Validation/Transaction.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/Ledger/Validation/Update.hs (100%) rename {src => zkfold-base/src}/ZkFold/Symbolic/MonadCircuit.hs (100%) rename {stats => zkfold-base/stats}/ByteString.Add.512 (100%) rename {stats => zkfold-base/stats}/ByteString.And.32 (100%) rename {stats => zkfold-base/stats}/ByteString.Extend.1.512 (100%) rename {stats => zkfold-base/stats}/ByteString.Or.64 (100%) rename {stats => zkfold-base/stats}/Conditional (100%) rename {stats => zkfold-base/stats}/Constant.5 (100%) rename {stats => zkfold-base/stats}/Eq (100%) rename {stats => zkfold-base/stats}/Eq.Constant.5 (100%) rename {stats => zkfold-base/stats}/FFA.Add.097 (100%) rename {stats => zkfold-base/stats}/FFA.Add.337 (100%) rename {stats => zkfold-base/stats}/FFA.Mul.097 (100%) rename {stats => zkfold-base/stats}/FFA.Mul.337 (100%) rename {stats => zkfold-base/stats}/Fibonacci.100 (100%) rename {stats => zkfold-base/stats}/LEQ (100%) rename {stats => zkfold-base/stats}/MiMCHash (100%) rename {stats => zkfold-base/stats}/Reverse.32.3000 (100%) rename {stats => zkfold-base/stats}/SHA256.32 (100%) rename {stats => zkfold-base/stats}/UInt.DivMod.32.Auto (100%) rename {stats => zkfold-base/stats}/UInt.Mul.64.Auto (100%) rename {stats => zkfold-base/stats}/UInt.StrictAdd.256.Auto (100%) rename {stats => zkfold-base/stats}/UInt.StrictMul.512.Auto (100%) rename {tests => zkfold-base/test}/Main.hs (100%) rename {tests => zkfold-base/test}/Tests/ArithmeticCircuit.hs (100%) rename {tests => zkfold-base/test}/Tests/Arithmetization.hs (100%) rename {tests => zkfold-base/test}/Tests/Arithmetization/Test1.hs (100%) rename {tests => zkfold-base/test}/Tests/Arithmetization/Test2.hs (100%) rename {tests => zkfold-base/test}/Tests/Arithmetization/Test3.hs (100%) rename {tests => zkfold-base/test}/Tests/Arithmetization/Test4.hs (100%) rename {tests => zkfold-base/test}/Tests/Binary.hs (100%) rename {tests => zkfold-base/test}/Tests/Blake2b.hs (100%) rename {tests => zkfold-base/test}/Tests/ByteString.hs (100%) rename {tests => zkfold-base/test}/Tests/FFA.hs (100%) rename {tests => zkfold-base/test}/Tests/Field.hs (100%) rename {tests => zkfold-base/test}/Tests/GroebnerBasis.hs (100%) rename {tests => zkfold-base/test}/Tests/Group.hs (100%) rename {tests => zkfold-base/test}/Tests/NonInteractiveProof.hs (100%) rename {tests => zkfold-base/test}/Tests/Pairing.hs (100%) rename {tests => zkfold-base/test}/Tests/Permutations.hs (100%) rename {tests => zkfold-base/test}/Tests/Plonkup.hs (100%) rename {tests => zkfold-base/test}/Tests/Protostar.hs (100%) rename {tests => zkfold-base/test}/Tests/SHA2.hs (100%) rename {tests => zkfold-base/test}/Tests/UInt.hs (100%) rename {tests => zkfold-base/test}/Tests/Univariate.hs (100%) rename {tests => zkfold-base/test}/Tests/Univariate/Poly.hs (100%) rename {tests => zkfold-base/test}/Tests/Univariate/PolyVec.hs (100%) rename {tests => zkfold-base/test}/data/shabittestvectors/SHA224LongMsg.rsp (100%) rename {tests => zkfold-base/test}/data/shabittestvectors/SHA224ShortMsg.rsp (100%) rename {tests => zkfold-base/test}/data/shabittestvectors/SHA256LongMsg.rsp (100%) rename {tests => zkfold-base/test}/data/shabittestvectors/SHA256ShortMsg.rsp (100%) rename {tests => zkfold-base/test}/data/shabittestvectors/SHA384LongMsg.rsp (100%) rename {tests => zkfold-base/test}/data/shabittestvectors/SHA384ShortMsg.rsp (100%) rename {tests => zkfold-base/test}/data/shabittestvectors/SHA512LongMsg.rsp (100%) rename {tests => zkfold-base/test}/data/shabittestvectors/SHA512ShortMsg.rsp (100%) rename {tests => zkfold-base/test}/data/shabittestvectors/SHA512_224LongMsg.rsp (100%) rename {tests => zkfold-base/test}/data/shabittestvectors/SHA512_224ShortMsg.rsp (100%) rename {tests => zkfold-base/test}/data/shabittestvectors/SHA512_256LongMsg.rsp (100%) rename {tests => zkfold-base/test}/data/shabittestvectors/SHA512_256ShortMsg.rsp (100%) rename zkfold-base.cabal => zkfold-base/zkfold-base.cabal (99%) diff --git a/.gitignore b/.gitignore index 8a5585389..bbf65751f 100644 --- a/.gitignore +++ b/.gitignore @@ -21,5 +21,4 @@ cabal.project.local cabal.project.local~ .HTF/ .ghc.environment.* -compiled_scripts/* stack.yaml* diff --git a/README.md b/README.md index 9d07ddf88..25e53ffa7 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ To run the tests, execute cabal run -- zkfold-base-test ``` -# Examples +# Benchmarks The `examples` folder contains several code examples of arithmetizable pure functions. These examples can be compiled into the arithmetic circuits with the zkFold Symbolic compiler. In order to do it, execute ```bash cabal run -- zkfold-base-examples diff --git a/cabal.project b/cabal.project index 416e23b46..d60bc3354 100644 --- a/cabal.project +++ b/cabal.project @@ -1,6 +1,7 @@ index-state: 2023-10-29T16:11:26Z -packages: . +packages: + zkfold-base optimization: 2 diff --git a/zkfold-base/LICENSE b/zkfold-base/LICENSE new file mode 100644 index 000000000..e231bb839 --- /dev/null +++ b/zkfold-base/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 zkFold SA + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/bench/BenchCompiler.hs b/zkfold-base/bench/BenchCompiler.hs similarity index 98% rename from bench/BenchCompiler.hs rename to zkfold-base/bench/BenchCompiler.hs index 56df25f67..ad2cd9710 100644 --- a/bench/BenchCompiler.hs +++ b/zkfold-base/bench/BenchCompiler.hs @@ -37,7 +37,7 @@ benchmark name circuit = bgroup name , env (return $ force $ circuit ()) $ \c -> let input = tabulate (const zero) - path = "stats/" <> name + path = "zkfold-base/stats/" <> name in bgroup "on compilation" [ bench "evaluation" $ nf (witnessGenerator c) input , goldenVsString "# of constraints" path $ return (metrics name c) diff --git a/bench/BenchPolyMul.hs b/zkfold-base/bench/BenchPolyMul.hs similarity index 100% rename from bench/BenchPolyMul.hs rename to zkfold-base/bench/BenchPolyMul.hs diff --git a/examples/Examples/BatchTransfer.hs b/zkfold-base/examples/Examples/BatchTransfer.hs similarity index 100% rename from examples/Examples/BatchTransfer.hs rename to zkfold-base/examples/Examples/BatchTransfer.hs diff --git a/examples/Examples/ByteString.hs b/zkfold-base/examples/Examples/ByteString.hs similarity index 100% rename from examples/Examples/ByteString.hs rename to zkfold-base/examples/Examples/ByteString.hs diff --git a/examples/Examples/Conditional.hs b/zkfold-base/examples/Examples/Conditional.hs similarity index 100% rename from examples/Examples/Conditional.hs rename to zkfold-base/examples/Examples/Conditional.hs diff --git a/examples/Examples/Constant.hs b/zkfold-base/examples/Examples/Constant.hs similarity index 100% rename from examples/Examples/Constant.hs rename to zkfold-base/examples/Examples/Constant.hs diff --git a/examples/Examples/Eq.hs b/zkfold-base/examples/Examples/Eq.hs similarity index 100% rename from examples/Examples/Eq.hs rename to zkfold-base/examples/Examples/Eq.hs diff --git a/examples/Examples/FFA.hs b/zkfold-base/examples/Examples/FFA.hs similarity index 100% rename from examples/Examples/FFA.hs rename to zkfold-base/examples/Examples/FFA.hs diff --git a/examples/Examples/Fibonacci.hs b/zkfold-base/examples/Examples/Fibonacci.hs similarity index 100% rename from examples/Examples/Fibonacci.hs rename to zkfold-base/examples/Examples/Fibonacci.hs diff --git a/examples/Examples/LEQ.hs b/zkfold-base/examples/Examples/LEQ.hs similarity index 100% rename from examples/Examples/LEQ.hs rename to zkfold-base/examples/Examples/LEQ.hs diff --git a/examples/Examples/MiMCHash.hs b/zkfold-base/examples/Examples/MiMCHash.hs similarity index 100% rename from examples/Examples/MiMCHash.hs rename to zkfold-base/examples/Examples/MiMCHash.hs diff --git a/examples/Examples/ReverseList.hs b/zkfold-base/examples/Examples/ReverseList.hs similarity index 100% rename from examples/Examples/ReverseList.hs rename to zkfold-base/examples/Examples/ReverseList.hs diff --git a/examples/Examples/UInt.hs b/zkfold-base/examples/Examples/UInt.hs similarity index 100% rename from examples/Examples/UInt.hs rename to zkfold-base/examples/Examples/UInt.hs diff --git a/examples/ZkFold/Symbolic/Examples.hs b/zkfold-base/examples/ZkFold/Symbolic/Examples.hs similarity index 100% rename from examples/ZkFold/Symbolic/Examples.hs rename to zkfold-base/examples/ZkFold/Symbolic/Examples.hs diff --git a/hie.yaml b/zkfold-base/hie.yaml similarity index 67% rename from hie.yaml rename to zkfold-base/hie.yaml index 8a0f335c7..07f5240fa 100644 --- a/hie.yaml +++ b/zkfold-base/hie.yaml @@ -6,11 +6,11 @@ cradle: - path: "./examples" component: "zkfold-base:lib:zkfold-symbolic-examples" - - path: "./tests" + - path: "./test" component: "zkfold-base:test:zkfold-base-test" - path: "./bench/BenchPolyMul.hs" - component: "zkfold-base:bench:polynomial-multiplication" + component: "zkfold-base:bench:bench-poly-mul" - path: "./bench/BenchCompiler.hs" - component: "zkfold-base:bench:compiler-benchmark" + component: "zkfold-base:bench:bench-compiler" diff --git a/src/ZkFold/Base/Algebra/Basic/Class.hs b/zkfold-base/src/ZkFold/Base/Algebra/Basic/Class.hs similarity index 100% rename from src/ZkFold/Base/Algebra/Basic/Class.hs rename to zkfold-base/src/ZkFold/Base/Algebra/Basic/Class.hs diff --git a/src/ZkFold/Base/Algebra/Basic/DFT.hs b/zkfold-base/src/ZkFold/Base/Algebra/Basic/DFT.hs similarity index 100% rename from src/ZkFold/Base/Algebra/Basic/DFT.hs rename to zkfold-base/src/ZkFold/Base/Algebra/Basic/DFT.hs diff --git a/src/ZkFold/Base/Algebra/Basic/Field.hs b/zkfold-base/src/ZkFold/Base/Algebra/Basic/Field.hs similarity index 100% rename from src/ZkFold/Base/Algebra/Basic/Field.hs rename to zkfold-base/src/ZkFold/Base/Algebra/Basic/Field.hs diff --git a/src/ZkFold/Base/Algebra/Basic/Number.hs b/zkfold-base/src/ZkFold/Base/Algebra/Basic/Number.hs similarity index 100% rename from src/ZkFold/Base/Algebra/Basic/Number.hs rename to zkfold-base/src/ZkFold/Base/Algebra/Basic/Number.hs diff --git a/src/ZkFold/Base/Algebra/Basic/Permutations.hs b/zkfold-base/src/ZkFold/Base/Algebra/Basic/Permutations.hs similarity index 100% rename from src/ZkFold/Base/Algebra/Basic/Permutations.hs rename to zkfold-base/src/ZkFold/Base/Algebra/Basic/Permutations.hs diff --git a/src/ZkFold/Base/Algebra/Basic/VectorSpace.hs b/zkfold-base/src/ZkFold/Base/Algebra/Basic/VectorSpace.hs similarity index 100% rename from src/ZkFold/Base/Algebra/Basic/VectorSpace.hs rename to zkfold-base/src/ZkFold/Base/Algebra/Basic/VectorSpace.hs diff --git a/src/ZkFold/Base/Algebra/EllipticCurve/BLS12_381.hs b/zkfold-base/src/ZkFold/Base/Algebra/EllipticCurve/BLS12_381.hs similarity index 100% rename from src/ZkFold/Base/Algebra/EllipticCurve/BLS12_381.hs rename to zkfold-base/src/ZkFold/Base/Algebra/EllipticCurve/BLS12_381.hs diff --git a/src/ZkFold/Base/Algebra/EllipticCurve/BN254.hs b/zkfold-base/src/ZkFold/Base/Algebra/EllipticCurve/BN254.hs similarity index 100% rename from src/ZkFold/Base/Algebra/EllipticCurve/BN254.hs rename to zkfold-base/src/ZkFold/Base/Algebra/EllipticCurve/BN254.hs diff --git a/src/ZkFold/Base/Algebra/EllipticCurve/Class.hs b/zkfold-base/src/ZkFold/Base/Algebra/EllipticCurve/Class.hs similarity index 100% rename from src/ZkFold/Base/Algebra/EllipticCurve/Class.hs rename to zkfold-base/src/ZkFold/Base/Algebra/EllipticCurve/Class.hs diff --git a/src/ZkFold/Base/Algebra/EllipticCurve/Ed25519.hs b/zkfold-base/src/ZkFold/Base/Algebra/EllipticCurve/Ed25519.hs similarity index 100% rename from src/ZkFold/Base/Algebra/EllipticCurve/Ed25519.hs rename to zkfold-base/src/ZkFold/Base/Algebra/EllipticCurve/Ed25519.hs diff --git a/src/ZkFold/Base/Algebra/EllipticCurve/Pairing.hs b/zkfold-base/src/ZkFold/Base/Algebra/EllipticCurve/Pairing.hs similarity index 100% rename from src/ZkFold/Base/Algebra/EllipticCurve/Pairing.hs rename to zkfold-base/src/ZkFold/Base/Algebra/EllipticCurve/Pairing.hs diff --git a/src/ZkFold/Base/Algebra/EllipticCurve/Pasta.hs b/zkfold-base/src/ZkFold/Base/Algebra/EllipticCurve/Pasta.hs similarity index 100% rename from src/ZkFold/Base/Algebra/EllipticCurve/Pasta.hs rename to zkfold-base/src/ZkFold/Base/Algebra/EllipticCurve/Pasta.hs diff --git a/src/ZkFold/Base/Algebra/Polynomials/Multivariate.hs b/zkfold-base/src/ZkFold/Base/Algebra/Polynomials/Multivariate.hs similarity index 100% rename from src/ZkFold/Base/Algebra/Polynomials/Multivariate.hs rename to zkfold-base/src/ZkFold/Base/Algebra/Polynomials/Multivariate.hs diff --git a/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Groebner.hs b/zkfold-base/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Groebner.hs similarity index 100% rename from src/ZkFold/Base/Algebra/Polynomials/Multivariate/Groebner.hs rename to zkfold-base/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Groebner.hs diff --git a/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Monomial.hs b/zkfold-base/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Monomial.hs similarity index 100% rename from src/ZkFold/Base/Algebra/Polynomials/Multivariate/Monomial.hs rename to zkfold-base/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Monomial.hs diff --git a/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Polynomial.hs b/zkfold-base/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Polynomial.hs similarity index 100% rename from src/ZkFold/Base/Algebra/Polynomials/Multivariate/Polynomial.hs rename to zkfold-base/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Polynomial.hs diff --git a/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Substitution.hs b/zkfold-base/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Substitution.hs similarity index 100% rename from src/ZkFold/Base/Algebra/Polynomials/Multivariate/Substitution.hs rename to zkfold-base/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Substitution.hs diff --git a/src/ZkFold/Base/Algebra/Polynomials/Univariate.hs b/zkfold-base/src/ZkFold/Base/Algebra/Polynomials/Univariate.hs similarity index 100% rename from src/ZkFold/Base/Algebra/Polynomials/Univariate.hs rename to zkfold-base/src/ZkFold/Base/Algebra/Polynomials/Univariate.hs diff --git a/src/ZkFold/Base/Control/HApplicative.hs b/zkfold-base/src/ZkFold/Base/Control/HApplicative.hs similarity index 100% rename from src/ZkFold/Base/Control/HApplicative.hs rename to zkfold-base/src/ZkFold/Base/Control/HApplicative.hs diff --git a/src/ZkFold/Base/Data/ByteString.hs b/zkfold-base/src/ZkFold/Base/Data/ByteString.hs similarity index 100% rename from src/ZkFold/Base/Data/ByteString.hs rename to zkfold-base/src/ZkFold/Base/Data/ByteString.hs diff --git a/src/ZkFold/Base/Data/HFunctor.hs b/zkfold-base/src/ZkFold/Base/Data/HFunctor.hs similarity index 100% rename from src/ZkFold/Base/Data/HFunctor.hs rename to zkfold-base/src/ZkFold/Base/Data/HFunctor.hs diff --git a/src/ZkFold/Base/Data/Matrix.hs b/zkfold-base/src/ZkFold/Base/Data/Matrix.hs similarity index 100% rename from src/ZkFold/Base/Data/Matrix.hs rename to zkfold-base/src/ZkFold/Base/Data/Matrix.hs diff --git a/src/ZkFold/Base/Data/Package.hs b/zkfold-base/src/ZkFold/Base/Data/Package.hs similarity index 100% rename from src/ZkFold/Base/Data/Package.hs rename to zkfold-base/src/ZkFold/Base/Data/Package.hs diff --git a/src/ZkFold/Base/Data/Par1.hs b/zkfold-base/src/ZkFold/Base/Data/Par1.hs similarity index 100% rename from src/ZkFold/Base/Data/Par1.hs rename to zkfold-base/src/ZkFold/Base/Data/Par1.hs diff --git a/src/ZkFold/Base/Data/Product.hs b/zkfold-base/src/ZkFold/Base/Data/Product.hs similarity index 100% rename from src/ZkFold/Base/Data/Product.hs rename to zkfold-base/src/ZkFold/Base/Data/Product.hs diff --git a/src/ZkFold/Base/Data/Sparse/Matrix.hs b/zkfold-base/src/ZkFold/Base/Data/Sparse/Matrix.hs similarity index 100% rename from src/ZkFold/Base/Data/Sparse/Matrix.hs rename to zkfold-base/src/ZkFold/Base/Data/Sparse/Matrix.hs diff --git a/src/ZkFold/Base/Data/Sparse/Vector.hs b/zkfold-base/src/ZkFold/Base/Data/Sparse/Vector.hs similarity index 100% rename from src/ZkFold/Base/Data/Sparse/Vector.hs rename to zkfold-base/src/ZkFold/Base/Data/Sparse/Vector.hs diff --git a/src/ZkFold/Base/Data/Type.hs b/zkfold-base/src/ZkFold/Base/Data/Type.hs similarity index 100% rename from src/ZkFold/Base/Data/Type.hs rename to zkfold-base/src/ZkFold/Base/Data/Type.hs diff --git a/src/ZkFold/Base/Data/Vector.hs b/zkfold-base/src/ZkFold/Base/Data/Vector.hs similarity index 100% rename from src/ZkFold/Base/Data/Vector.hs rename to zkfold-base/src/ZkFold/Base/Data/Vector.hs diff --git a/src/ZkFold/Base/Protocol/KZG.hs b/zkfold-base/src/ZkFold/Base/Protocol/KZG.hs similarity index 100% rename from src/ZkFold/Base/Protocol/KZG.hs rename to zkfold-base/src/ZkFold/Base/Protocol/KZG.hs diff --git a/src/ZkFold/Base/Protocol/NonInteractiveProof.hs b/zkfold-base/src/ZkFold/Base/Protocol/NonInteractiveProof.hs similarity index 100% rename from src/ZkFold/Base/Protocol/NonInteractiveProof.hs rename to zkfold-base/src/ZkFold/Base/Protocol/NonInteractiveProof.hs diff --git a/src/ZkFold/Base/Protocol/NonInteractiveProof/Internal.hs b/zkfold-base/src/ZkFold/Base/Protocol/NonInteractiveProof/Internal.hs similarity index 100% rename from src/ZkFold/Base/Protocol/NonInteractiveProof/Internal.hs rename to zkfold-base/src/ZkFold/Base/Protocol/NonInteractiveProof/Internal.hs diff --git a/src/ZkFold/Base/Protocol/NonInteractiveProof/Prover.hs b/zkfold-base/src/ZkFold/Base/Protocol/NonInteractiveProof/Prover.hs similarity index 100% rename from src/ZkFold/Base/Protocol/NonInteractiveProof/Prover.hs rename to zkfold-base/src/ZkFold/Base/Protocol/NonInteractiveProof/Prover.hs diff --git a/src/ZkFold/Base/Protocol/NonInteractiveProof/Testing.hs b/zkfold-base/src/ZkFold/Base/Protocol/NonInteractiveProof/Testing.hs similarity index 100% rename from src/ZkFold/Base/Protocol/NonInteractiveProof/Testing.hs rename to zkfold-base/src/ZkFold/Base/Protocol/NonInteractiveProof/Testing.hs diff --git a/src/ZkFold/Base/Protocol/Plonk.hs b/zkfold-base/src/ZkFold/Base/Protocol/Plonk.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Plonk.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Plonk.hs diff --git a/src/ZkFold/Base/Protocol/Plonk/Prover.hs b/zkfold-base/src/ZkFold/Base/Protocol/Plonk/Prover.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Plonk/Prover.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Plonk/Prover.hs diff --git a/src/ZkFold/Base/Protocol/Plonk/Verifier.hs b/zkfold-base/src/ZkFold/Base/Protocol/Plonk/Verifier.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Plonk/Verifier.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Plonk/Verifier.hs diff --git a/src/ZkFold/Base/Protocol/Plonkup.hs b/zkfold-base/src/ZkFold/Base/Protocol/Plonkup.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Plonkup.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Plonkup.hs diff --git a/src/ZkFold/Base/Protocol/Plonkup/Input.hs b/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Input.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Plonkup/Input.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Input.hs diff --git a/src/ZkFold/Base/Protocol/Plonkup/Internal.hs b/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Internal.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Plonkup/Internal.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Internal.hs diff --git a/src/ZkFold/Base/Protocol/Plonkup/LookupConstraint.hs b/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/LookupConstraint.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Plonkup/LookupConstraint.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Plonkup/LookupConstraint.hs diff --git a/src/ZkFold/Base/Protocol/Plonkup/PlonkConstraint.hs b/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/PlonkConstraint.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Plonkup/PlonkConstraint.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Plonkup/PlonkConstraint.hs diff --git a/src/ZkFold/Base/Protocol/Plonkup/PlonkupConstraint.hs b/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/PlonkupConstraint.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Plonkup/PlonkupConstraint.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Plonkup/PlonkupConstraint.hs diff --git a/src/ZkFold/Base/Protocol/Plonkup/Proof.hs b/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Proof.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Plonkup/Proof.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Proof.hs diff --git a/src/ZkFold/Base/Protocol/Plonkup/Prover.hs b/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Prover.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Plonkup/Prover.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Prover.hs diff --git a/src/ZkFold/Base/Protocol/Plonkup/Prover/Polynomials.hs b/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Prover/Polynomials.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Plonkup/Prover/Polynomials.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Prover/Polynomials.hs diff --git a/src/ZkFold/Base/Protocol/Plonkup/Prover/Secret.hs b/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Prover/Secret.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Plonkup/Prover/Secret.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Prover/Secret.hs diff --git a/src/ZkFold/Base/Protocol/Plonkup/Prover/Setup.hs b/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Prover/Setup.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Plonkup/Prover/Setup.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Prover/Setup.hs diff --git a/src/ZkFold/Base/Protocol/Plonkup/Relation.hs b/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Relation.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Plonkup/Relation.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Relation.hs diff --git a/src/ZkFold/Base/Protocol/Plonkup/Setup.hs b/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Setup.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Plonkup/Setup.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Setup.hs diff --git a/src/ZkFold/Base/Protocol/Plonkup/Testing.hs b/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Testing.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Plonkup/Testing.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Testing.hs diff --git a/src/ZkFold/Base/Protocol/Plonkup/Utils.hs b/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Utils.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Plonkup/Utils.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Utils.hs diff --git a/src/ZkFold/Base/Protocol/Plonkup/Verifier.hs b/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Verifier.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Plonkup/Verifier.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Verifier.hs diff --git a/src/ZkFold/Base/Protocol/Plonkup/Verifier/Commitments.hs b/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Verifier/Commitments.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Plonkup/Verifier/Commitments.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Verifier/Commitments.hs diff --git a/src/ZkFold/Base/Protocol/Plonkup/Verifier/Setup.hs b/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Verifier/Setup.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Plonkup/Verifier/Setup.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Verifier/Setup.hs diff --git a/src/ZkFold/Base/Protocol/Plonkup/Witness.hs b/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Witness.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Plonkup/Witness.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Witness.hs diff --git a/src/ZkFold/Base/Protocol/Protostar.hs b/zkfold-base/src/ZkFold/Base/Protocol/Protostar.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Protostar.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Protostar.hs diff --git a/src/ZkFold/Base/Protocol/Protostar/Accumulator.hs b/zkfold-base/src/ZkFold/Base/Protocol/Protostar/Accumulator.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Protostar/Accumulator.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Protostar/Accumulator.hs diff --git a/src/ZkFold/Base/Protocol/Protostar/AccumulatorScheme.hs b/zkfold-base/src/ZkFold/Base/Protocol/Protostar/AccumulatorScheme.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Protostar/AccumulatorScheme.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Protostar/AccumulatorScheme.hs diff --git a/src/ZkFold/Base/Protocol/Protostar/ArithmeticCircuit.hs b/zkfold-base/src/ZkFold/Base/Protocol/Protostar/ArithmeticCircuit.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Protostar/ArithmeticCircuit.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Protostar/ArithmeticCircuit.hs diff --git a/src/ZkFold/Base/Protocol/Protostar/Commit.hs b/zkfold-base/src/ZkFold/Base/Protocol/Protostar/Commit.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Protostar/Commit.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Protostar/Commit.hs diff --git a/src/ZkFold/Base/Protocol/Protostar/CommitOpen.hs b/zkfold-base/src/ZkFold/Base/Protocol/Protostar/CommitOpen.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Protostar/CommitOpen.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Protostar/CommitOpen.hs diff --git a/src/ZkFold/Base/Protocol/Protostar/FiatShamir.hs b/zkfold-base/src/ZkFold/Base/Protocol/Protostar/FiatShamir.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Protostar/FiatShamir.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Protostar/FiatShamir.hs diff --git a/src/ZkFold/Base/Protocol/Protostar/Fold.hs b/zkfold-base/src/ZkFold/Base/Protocol/Protostar/Fold.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Protostar/Fold.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Protostar/Fold.hs diff --git a/src/ZkFold/Base/Protocol/Protostar/Gate.hs b/zkfold-base/src/ZkFold/Base/Protocol/Protostar/Gate.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Protostar/Gate.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Protostar/Gate.hs diff --git a/src/ZkFold/Base/Protocol/Protostar/Internal.hs b/zkfold-base/src/ZkFold/Base/Protocol/Protostar/Internal.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Protostar/Internal.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Protostar/Internal.hs diff --git a/src/ZkFold/Base/Protocol/Protostar/Lookup.hs b/zkfold-base/src/ZkFold/Base/Protocol/Protostar/Lookup.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Protostar/Lookup.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Protostar/Lookup.hs diff --git a/src/ZkFold/Base/Protocol/Protostar/Oracle.hs b/zkfold-base/src/ZkFold/Base/Protocol/Protostar/Oracle.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Protostar/Oracle.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Protostar/Oracle.hs diff --git a/src/ZkFold/Base/Protocol/Protostar/Permutation.hs b/zkfold-base/src/ZkFold/Base/Protocol/Protostar/Permutation.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Protostar/Permutation.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Protostar/Permutation.hs diff --git a/src/ZkFold/Base/Protocol/Protostar/SpecialSound.hs b/zkfold-base/src/ZkFold/Base/Protocol/Protostar/SpecialSound.hs similarity index 100% rename from src/ZkFold/Base/Protocol/Protostar/SpecialSound.hs rename to zkfold-base/src/ZkFold/Base/Protocol/Protostar/SpecialSound.hs diff --git a/src/ZkFold/Prelude.hs b/zkfold-base/src/ZkFold/Prelude.hs similarity index 100% rename from src/ZkFold/Prelude.hs rename to zkfold-base/src/ZkFold/Prelude.hs diff --git a/src/ZkFold/Symbolic/Algorithms/Hash/Blake2b.hs b/zkfold-base/src/ZkFold/Symbolic/Algorithms/Hash/Blake2b.hs similarity index 100% rename from src/ZkFold/Symbolic/Algorithms/Hash/Blake2b.hs rename to zkfold-base/src/ZkFold/Symbolic/Algorithms/Hash/Blake2b.hs diff --git a/src/ZkFold/Symbolic/Algorithms/Hash/Blake2b/Constants.hs b/zkfold-base/src/ZkFold/Symbolic/Algorithms/Hash/Blake2b/Constants.hs similarity index 100% rename from src/ZkFold/Symbolic/Algorithms/Hash/Blake2b/Constants.hs rename to zkfold-base/src/ZkFold/Symbolic/Algorithms/Hash/Blake2b/Constants.hs diff --git a/src/ZkFold/Symbolic/Algorithms/Hash/MiMC.hs b/zkfold-base/src/ZkFold/Symbolic/Algorithms/Hash/MiMC.hs similarity index 100% rename from src/ZkFold/Symbolic/Algorithms/Hash/MiMC.hs rename to zkfold-base/src/ZkFold/Symbolic/Algorithms/Hash/MiMC.hs diff --git a/src/ZkFold/Symbolic/Algorithms/Hash/MiMC/Constants.hs b/zkfold-base/src/ZkFold/Symbolic/Algorithms/Hash/MiMC/Constants.hs similarity index 100% rename from src/ZkFold/Symbolic/Algorithms/Hash/MiMC/Constants.hs rename to zkfold-base/src/ZkFold/Symbolic/Algorithms/Hash/MiMC/Constants.hs diff --git a/src/ZkFold/Symbolic/Algorithms/Hash/SHA2.hs b/zkfold-base/src/ZkFold/Symbolic/Algorithms/Hash/SHA2.hs similarity index 100% rename from src/ZkFold/Symbolic/Algorithms/Hash/SHA2.hs rename to zkfold-base/src/ZkFold/Symbolic/Algorithms/Hash/SHA2.hs diff --git a/src/ZkFold/Symbolic/Algorithms/Hash/SHA2/Constants.hs b/zkfold-base/src/ZkFold/Symbolic/Algorithms/Hash/SHA2/Constants.hs similarity index 100% rename from src/ZkFold/Symbolic/Algorithms/Hash/SHA2/Constants.hs rename to zkfold-base/src/ZkFold/Symbolic/Algorithms/Hash/SHA2/Constants.hs diff --git a/src/ZkFold/Symbolic/Cardano/Contracts/BatchTransfer.hs b/zkfold-base/src/ZkFold/Symbolic/Cardano/Contracts/BatchTransfer.hs similarity index 100% rename from src/ZkFold/Symbolic/Cardano/Contracts/BatchTransfer.hs rename to zkfold-base/src/ZkFold/Symbolic/Cardano/Contracts/BatchTransfer.hs diff --git a/src/ZkFold/Symbolic/Cardano/Contracts/RandomOracle.hs b/zkfold-base/src/ZkFold/Symbolic/Cardano/Contracts/RandomOracle.hs similarity index 100% rename from src/ZkFold/Symbolic/Cardano/Contracts/RandomOracle.hs rename to zkfold-base/src/ZkFold/Symbolic/Cardano/Contracts/RandomOracle.hs diff --git a/src/ZkFold/Symbolic/Cardano/Types.hs b/zkfold-base/src/ZkFold/Symbolic/Cardano/Types.hs similarity index 100% rename from src/ZkFold/Symbolic/Cardano/Types.hs rename to zkfold-base/src/ZkFold/Symbolic/Cardano/Types.hs diff --git a/src/ZkFold/Symbolic/Cardano/Types/Address.hs b/zkfold-base/src/ZkFold/Symbolic/Cardano/Types/Address.hs similarity index 100% rename from src/ZkFold/Symbolic/Cardano/Types/Address.hs rename to zkfold-base/src/ZkFold/Symbolic/Cardano/Types/Address.hs diff --git a/src/ZkFold/Symbolic/Cardano/Types/Basic.hs b/zkfold-base/src/ZkFold/Symbolic/Cardano/Types/Basic.hs similarity index 100% rename from src/ZkFold/Symbolic/Cardano/Types/Basic.hs rename to zkfold-base/src/ZkFold/Symbolic/Cardano/Types/Basic.hs diff --git a/src/ZkFold/Symbolic/Cardano/Types/Input.hs b/zkfold-base/src/ZkFold/Symbolic/Cardano/Types/Input.hs similarity index 100% rename from src/ZkFold/Symbolic/Cardano/Types/Input.hs rename to zkfold-base/src/ZkFold/Symbolic/Cardano/Types/Input.hs diff --git a/src/ZkFold/Symbolic/Cardano/Types/Output.hs b/zkfold-base/src/ZkFold/Symbolic/Cardano/Types/Output.hs similarity index 100% rename from src/ZkFold/Symbolic/Cardano/Types/Output.hs rename to zkfold-base/src/ZkFold/Symbolic/Cardano/Types/Output.hs diff --git a/src/ZkFold/Symbolic/Cardano/Types/Output/Datum.hs b/zkfold-base/src/ZkFold/Symbolic/Cardano/Types/Output/Datum.hs similarity index 100% rename from src/ZkFold/Symbolic/Cardano/Types/Output/Datum.hs rename to zkfold-base/src/ZkFold/Symbolic/Cardano/Types/Output/Datum.hs diff --git a/src/ZkFold/Symbolic/Cardano/Types/OutputRef.hs b/zkfold-base/src/ZkFold/Symbolic/Cardano/Types/OutputRef.hs similarity index 100% rename from src/ZkFold/Symbolic/Cardano/Types/OutputRef.hs rename to zkfold-base/src/ZkFold/Symbolic/Cardano/Types/OutputRef.hs diff --git a/src/ZkFold/Symbolic/Cardano/Types/Transaction.hs b/zkfold-base/src/ZkFold/Symbolic/Cardano/Types/Transaction.hs similarity index 100% rename from src/ZkFold/Symbolic/Cardano/Types/Transaction.hs rename to zkfold-base/src/ZkFold/Symbolic/Cardano/Types/Transaction.hs diff --git a/src/ZkFold/Symbolic/Cardano/Types/Value.hs b/zkfold-base/src/ZkFold/Symbolic/Cardano/Types/Value.hs similarity index 100% rename from src/ZkFold/Symbolic/Cardano/Types/Value.hs rename to zkfold-base/src/ZkFold/Symbolic/Cardano/Types/Value.hs diff --git a/src/ZkFold/Symbolic/Cardano/UPLC.hs b/zkfold-base/src/ZkFold/Symbolic/Cardano/UPLC.hs similarity index 100% rename from src/ZkFold/Symbolic/Cardano/UPLC.hs rename to zkfold-base/src/ZkFold/Symbolic/Cardano/UPLC.hs diff --git a/src/ZkFold/Symbolic/Cardano/UPLC/Builtins.hs b/zkfold-base/src/ZkFold/Symbolic/Cardano/UPLC/Builtins.hs similarity index 100% rename from src/ZkFold/Symbolic/Cardano/UPLC/Builtins.hs rename to zkfold-base/src/ZkFold/Symbolic/Cardano/UPLC/Builtins.hs diff --git a/src/ZkFold/Symbolic/Cardano/UPLC/Inference.hs b/zkfold-base/src/ZkFold/Symbolic/Cardano/UPLC/Inference.hs similarity index 100% rename from src/ZkFold/Symbolic/Cardano/UPLC/Inference.hs rename to zkfold-base/src/ZkFold/Symbolic/Cardano/UPLC/Inference.hs diff --git a/src/ZkFold/Symbolic/Cardano/UPLC/Inference/Internal.hs b/zkfold-base/src/ZkFold/Symbolic/Cardano/UPLC/Inference/Internal.hs similarity index 100% rename from src/ZkFold/Symbolic/Cardano/UPLC/Inference/Internal.hs rename to zkfold-base/src/ZkFold/Symbolic/Cardano/UPLC/Inference/Internal.hs diff --git a/src/ZkFold/Symbolic/Cardano/UPLC/Term.hs b/zkfold-base/src/ZkFold/Symbolic/Cardano/UPLC/Term.hs similarity index 100% rename from src/ZkFold/Symbolic/Cardano/UPLC/Term.hs rename to zkfold-base/src/ZkFold/Symbolic/Cardano/UPLC/Term.hs diff --git a/src/ZkFold/Symbolic/Cardano/UPLC/Type.hs b/zkfold-base/src/ZkFold/Symbolic/Cardano/UPLC/Type.hs similarity index 100% rename from src/ZkFold/Symbolic/Cardano/UPLC/Type.hs rename to zkfold-base/src/ZkFold/Symbolic/Cardano/UPLC/Type.hs diff --git a/src/ZkFold/Symbolic/Cardano/Wrapper.hs b/zkfold-base/src/ZkFold/Symbolic/Cardano/Wrapper.hs similarity index 100% rename from src/ZkFold/Symbolic/Cardano/Wrapper.hs rename to zkfold-base/src/ZkFold/Symbolic/Cardano/Wrapper.hs diff --git a/src/ZkFold/Symbolic/Class.hs b/zkfold-base/src/ZkFold/Symbolic/Class.hs similarity index 100% rename from src/ZkFold/Symbolic/Class.hs rename to zkfold-base/src/ZkFold/Symbolic/Class.hs diff --git a/src/ZkFold/Symbolic/Compiler.hs b/zkfold-base/src/ZkFold/Symbolic/Compiler.hs similarity index 100% rename from src/ZkFold/Symbolic/Compiler.hs rename to zkfold-base/src/ZkFold/Symbolic/Compiler.hs diff --git a/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit.hs b/zkfold-base/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit.hs similarity index 100% rename from src/ZkFold/Symbolic/Compiler/ArithmeticCircuit.hs rename to zkfold-base/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit.hs diff --git a/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/Instance.hs b/zkfold-base/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/Instance.hs similarity index 100% rename from src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/Instance.hs rename to zkfold-base/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/Instance.hs diff --git a/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/Internal.hs b/zkfold-base/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/Internal.hs similarity index 100% rename from src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/Internal.hs rename to zkfold-base/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/Internal.hs diff --git a/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/Map.hs b/zkfold-base/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/Map.hs similarity index 100% rename from src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/Map.hs rename to zkfold-base/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/Map.hs diff --git a/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/MerkleHash.hs b/zkfold-base/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/MerkleHash.hs similarity index 100% rename from src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/MerkleHash.hs rename to zkfold-base/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/MerkleHash.hs diff --git a/src/ZkFold/Symbolic/Data/Bool.hs b/zkfold-base/src/ZkFold/Symbolic/Data/Bool.hs similarity index 100% rename from src/ZkFold/Symbolic/Data/Bool.hs rename to zkfold-base/src/ZkFold/Symbolic/Data/Bool.hs diff --git a/src/ZkFold/Symbolic/Data/ByteString.hs b/zkfold-base/src/ZkFold/Symbolic/Data/ByteString.hs similarity index 100% rename from src/ZkFold/Symbolic/Data/ByteString.hs rename to zkfold-base/src/ZkFold/Symbolic/Data/ByteString.hs diff --git a/src/ZkFold/Symbolic/Data/Class.hs b/zkfold-base/src/ZkFold/Symbolic/Data/Class.hs similarity index 100% rename from src/ZkFold/Symbolic/Data/Class.hs rename to zkfold-base/src/ZkFold/Symbolic/Data/Class.hs diff --git a/src/ZkFold/Symbolic/Data/Combinators.hs b/zkfold-base/src/ZkFold/Symbolic/Data/Combinators.hs similarity index 100% rename from src/ZkFold/Symbolic/Data/Combinators.hs rename to zkfold-base/src/ZkFold/Symbolic/Data/Combinators.hs diff --git a/src/ZkFold/Symbolic/Data/Conditional.hs b/zkfold-base/src/ZkFold/Symbolic/Data/Conditional.hs similarity index 100% rename from src/ZkFold/Symbolic/Data/Conditional.hs rename to zkfold-base/src/ZkFold/Symbolic/Data/Conditional.hs diff --git a/src/ZkFold/Symbolic/Data/DiscreteField.hs b/zkfold-base/src/ZkFold/Symbolic/Data/DiscreteField.hs similarity index 100% rename from src/ZkFold/Symbolic/Data/DiscreteField.hs rename to zkfold-base/src/ZkFold/Symbolic/Data/DiscreteField.hs diff --git a/src/ZkFold/Symbolic/Data/Ed25519.hs b/zkfold-base/src/ZkFold/Symbolic/Data/Ed25519.hs similarity index 100% rename from src/ZkFold/Symbolic/Data/Ed25519.hs rename to zkfold-base/src/ZkFold/Symbolic/Data/Ed25519.hs diff --git a/src/ZkFold/Symbolic/Data/Eq.hs b/zkfold-base/src/ZkFold/Symbolic/Data/Eq.hs similarity index 100% rename from src/ZkFold/Symbolic/Data/Eq.hs rename to zkfold-base/src/ZkFold/Symbolic/Data/Eq.hs diff --git a/src/ZkFold/Symbolic/Data/Eq/Structural.hs b/zkfold-base/src/ZkFold/Symbolic/Data/Eq/Structural.hs similarity index 100% rename from src/ZkFold/Symbolic/Data/Eq/Structural.hs rename to zkfold-base/src/ZkFold/Symbolic/Data/Eq/Structural.hs diff --git a/src/ZkFold/Symbolic/Data/FFA.hs b/zkfold-base/src/ZkFold/Symbolic/Data/FFA.hs similarity index 100% rename from src/ZkFold/Symbolic/Data/FFA.hs rename to zkfold-base/src/ZkFold/Symbolic/Data/FFA.hs diff --git a/src/ZkFold/Symbolic/Data/FieldElement.hs b/zkfold-base/src/ZkFold/Symbolic/Data/FieldElement.hs similarity index 100% rename from src/ZkFold/Symbolic/Data/FieldElement.hs rename to zkfold-base/src/ZkFold/Symbolic/Data/FieldElement.hs diff --git a/src/ZkFold/Symbolic/Data/List.hs b/zkfold-base/src/ZkFold/Symbolic/Data/List.hs similarity index 100% rename from src/ZkFold/Symbolic/Data/List.hs rename to zkfold-base/src/ZkFold/Symbolic/Data/List.hs diff --git a/src/ZkFold/Symbolic/Data/Maybe.hs b/zkfold-base/src/ZkFold/Symbolic/Data/Maybe.hs similarity index 100% rename from src/ZkFold/Symbolic/Data/Maybe.hs rename to zkfold-base/src/ZkFold/Symbolic/Data/Maybe.hs diff --git a/src/ZkFold/Symbolic/Data/Ord.hs b/zkfold-base/src/ZkFold/Symbolic/Data/Ord.hs similarity index 100% rename from src/ZkFold/Symbolic/Data/Ord.hs rename to zkfold-base/src/ZkFold/Symbolic/Data/Ord.hs diff --git a/src/ZkFold/Symbolic/Data/UInt.hs b/zkfold-base/src/ZkFold/Symbolic/Data/UInt.hs similarity index 100% rename from src/ZkFold/Symbolic/Data/UInt.hs rename to zkfold-base/src/ZkFold/Symbolic/Data/UInt.hs diff --git a/src/ZkFold/Symbolic/Data/UTCTime.hs b/zkfold-base/src/ZkFold/Symbolic/Data/UTCTime.hs similarity index 100% rename from src/ZkFold/Symbolic/Data/UTCTime.hs rename to zkfold-base/src/ZkFold/Symbolic/Data/UTCTime.hs diff --git a/src/ZkFold/Symbolic/Interpreter.hs b/zkfold-base/src/ZkFold/Symbolic/Interpreter.hs similarity index 100% rename from src/ZkFold/Symbolic/Interpreter.hs rename to zkfold-base/src/ZkFold/Symbolic/Interpreter.hs diff --git a/src/ZkFold/Symbolic/Ledger/Types.hs b/zkfold-base/src/ZkFold/Symbolic/Ledger/Types.hs similarity index 100% rename from src/ZkFold/Symbolic/Ledger/Types.hs rename to zkfold-base/src/ZkFold/Symbolic/Ledger/Types.hs diff --git a/src/ZkFold/Symbolic/Ledger/Types/Address.hs b/zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Address.hs similarity index 100% rename from src/ZkFold/Symbolic/Ledger/Types/Address.hs rename to zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Address.hs diff --git a/src/ZkFold/Symbolic/Ledger/Types/Basic.hs b/zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Basic.hs similarity index 100% rename from src/ZkFold/Symbolic/Ledger/Types/Basic.hs rename to zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Basic.hs diff --git a/src/ZkFold/Symbolic/Ledger/Types/Bridge.hs b/zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Bridge.hs similarity index 100% rename from src/ZkFold/Symbolic/Ledger/Types/Bridge.hs rename to zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Bridge.hs diff --git a/src/ZkFold/Symbolic/Ledger/Types/Contract.hs b/zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Contract.hs similarity index 100% rename from src/ZkFold/Symbolic/Ledger/Types/Contract.hs rename to zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Contract.hs diff --git a/src/ZkFold/Symbolic/Ledger/Types/Hash.hs b/zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Hash.hs similarity index 100% rename from src/ZkFold/Symbolic/Ledger/Types/Hash.hs rename to zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Hash.hs diff --git a/src/ZkFold/Symbolic/Ledger/Types/Input.hs b/zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Input.hs similarity index 100% rename from src/ZkFold/Symbolic/Ledger/Types/Input.hs rename to zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Input.hs diff --git a/src/ZkFold/Symbolic/Ledger/Types/Output.hs b/zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Output.hs similarity index 100% rename from src/ZkFold/Symbolic/Ledger/Types/Output.hs rename to zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Output.hs diff --git a/src/ZkFold/Symbolic/Ledger/Types/OutputRef.hs b/zkfold-base/src/ZkFold/Symbolic/Ledger/Types/OutputRef.hs similarity index 100% rename from src/ZkFold/Symbolic/Ledger/Types/OutputRef.hs rename to zkfold-base/src/ZkFold/Symbolic/Ledger/Types/OutputRef.hs diff --git a/src/ZkFold/Symbolic/Ledger/Types/Transaction.hs b/zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Transaction.hs similarity index 100% rename from src/ZkFold/Symbolic/Ledger/Types/Transaction.hs rename to zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Transaction.hs diff --git a/src/ZkFold/Symbolic/Ledger/Types/Update.hs b/zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Update.hs similarity index 100% rename from src/ZkFold/Symbolic/Ledger/Types/Update.hs rename to zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Update.hs diff --git a/src/ZkFold/Symbolic/Ledger/Types/Value.hs b/zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Value.hs similarity index 100% rename from src/ZkFold/Symbolic/Ledger/Types/Value.hs rename to zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Value.hs diff --git a/src/ZkFold/Symbolic/Ledger/Validation/Bridge.hs b/zkfold-base/src/ZkFold/Symbolic/Ledger/Validation/Bridge.hs similarity index 100% rename from src/ZkFold/Symbolic/Ledger/Validation/Bridge.hs rename to zkfold-base/src/ZkFold/Symbolic/Ledger/Validation/Bridge.hs diff --git a/src/ZkFold/Symbolic/Ledger/Validation/Common.hs b/zkfold-base/src/ZkFold/Symbolic/Ledger/Validation/Common.hs similarity index 100% rename from src/ZkFold/Symbolic/Ledger/Validation/Common.hs rename to zkfold-base/src/ZkFold/Symbolic/Ledger/Validation/Common.hs diff --git a/src/ZkFold/Symbolic/Ledger/Validation/Contract.hs b/zkfold-base/src/ZkFold/Symbolic/Ledger/Validation/Contract.hs similarity index 100% rename from src/ZkFold/Symbolic/Ledger/Validation/Contract.hs rename to zkfold-base/src/ZkFold/Symbolic/Ledger/Validation/Contract.hs diff --git a/src/ZkFold/Symbolic/Ledger/Validation/PrivateInput.hs b/zkfold-base/src/ZkFold/Symbolic/Ledger/Validation/PrivateInput.hs similarity index 100% rename from src/ZkFold/Symbolic/Ledger/Validation/PrivateInput.hs rename to zkfold-base/src/ZkFold/Symbolic/Ledger/Validation/PrivateInput.hs diff --git a/src/ZkFold/Symbolic/Ledger/Validation/PublicInput.hs b/zkfold-base/src/ZkFold/Symbolic/Ledger/Validation/PublicInput.hs similarity index 100% rename from src/ZkFold/Symbolic/Ledger/Validation/PublicInput.hs rename to zkfold-base/src/ZkFold/Symbolic/Ledger/Validation/PublicInput.hs diff --git a/src/ZkFold/Symbolic/Ledger/Validation/Transaction.hs b/zkfold-base/src/ZkFold/Symbolic/Ledger/Validation/Transaction.hs similarity index 100% rename from src/ZkFold/Symbolic/Ledger/Validation/Transaction.hs rename to zkfold-base/src/ZkFold/Symbolic/Ledger/Validation/Transaction.hs diff --git a/src/ZkFold/Symbolic/Ledger/Validation/Update.hs b/zkfold-base/src/ZkFold/Symbolic/Ledger/Validation/Update.hs similarity index 100% rename from src/ZkFold/Symbolic/Ledger/Validation/Update.hs rename to zkfold-base/src/ZkFold/Symbolic/Ledger/Validation/Update.hs diff --git a/src/ZkFold/Symbolic/MonadCircuit.hs b/zkfold-base/src/ZkFold/Symbolic/MonadCircuit.hs similarity index 100% rename from src/ZkFold/Symbolic/MonadCircuit.hs rename to zkfold-base/src/ZkFold/Symbolic/MonadCircuit.hs diff --git a/stats/ByteString.Add.512 b/zkfold-base/stats/ByteString.Add.512 similarity index 100% rename from stats/ByteString.Add.512 rename to zkfold-base/stats/ByteString.Add.512 diff --git a/stats/ByteString.And.32 b/zkfold-base/stats/ByteString.And.32 similarity index 100% rename from stats/ByteString.And.32 rename to zkfold-base/stats/ByteString.And.32 diff --git a/stats/ByteString.Extend.1.512 b/zkfold-base/stats/ByteString.Extend.1.512 similarity index 100% rename from stats/ByteString.Extend.1.512 rename to zkfold-base/stats/ByteString.Extend.1.512 diff --git a/stats/ByteString.Or.64 b/zkfold-base/stats/ByteString.Or.64 similarity index 100% rename from stats/ByteString.Or.64 rename to zkfold-base/stats/ByteString.Or.64 diff --git a/stats/Conditional b/zkfold-base/stats/Conditional similarity index 100% rename from stats/Conditional rename to zkfold-base/stats/Conditional diff --git a/stats/Constant.5 b/zkfold-base/stats/Constant.5 similarity index 100% rename from stats/Constant.5 rename to zkfold-base/stats/Constant.5 diff --git a/stats/Eq b/zkfold-base/stats/Eq similarity index 100% rename from stats/Eq rename to zkfold-base/stats/Eq diff --git a/stats/Eq.Constant.5 b/zkfold-base/stats/Eq.Constant.5 similarity index 100% rename from stats/Eq.Constant.5 rename to zkfold-base/stats/Eq.Constant.5 diff --git a/stats/FFA.Add.097 b/zkfold-base/stats/FFA.Add.097 similarity index 100% rename from stats/FFA.Add.097 rename to zkfold-base/stats/FFA.Add.097 diff --git a/stats/FFA.Add.337 b/zkfold-base/stats/FFA.Add.337 similarity index 100% rename from stats/FFA.Add.337 rename to zkfold-base/stats/FFA.Add.337 diff --git a/stats/FFA.Mul.097 b/zkfold-base/stats/FFA.Mul.097 similarity index 100% rename from stats/FFA.Mul.097 rename to zkfold-base/stats/FFA.Mul.097 diff --git a/stats/FFA.Mul.337 b/zkfold-base/stats/FFA.Mul.337 similarity index 100% rename from stats/FFA.Mul.337 rename to zkfold-base/stats/FFA.Mul.337 diff --git a/stats/Fibonacci.100 b/zkfold-base/stats/Fibonacci.100 similarity index 100% rename from stats/Fibonacci.100 rename to zkfold-base/stats/Fibonacci.100 diff --git a/stats/LEQ b/zkfold-base/stats/LEQ similarity index 100% rename from stats/LEQ rename to zkfold-base/stats/LEQ diff --git a/stats/MiMCHash b/zkfold-base/stats/MiMCHash similarity index 100% rename from stats/MiMCHash rename to zkfold-base/stats/MiMCHash diff --git a/stats/Reverse.32.3000 b/zkfold-base/stats/Reverse.32.3000 similarity index 100% rename from stats/Reverse.32.3000 rename to zkfold-base/stats/Reverse.32.3000 diff --git a/stats/SHA256.32 b/zkfold-base/stats/SHA256.32 similarity index 100% rename from stats/SHA256.32 rename to zkfold-base/stats/SHA256.32 diff --git a/stats/UInt.DivMod.32.Auto b/zkfold-base/stats/UInt.DivMod.32.Auto similarity index 100% rename from stats/UInt.DivMod.32.Auto rename to zkfold-base/stats/UInt.DivMod.32.Auto diff --git a/stats/UInt.Mul.64.Auto b/zkfold-base/stats/UInt.Mul.64.Auto similarity index 100% rename from stats/UInt.Mul.64.Auto rename to zkfold-base/stats/UInt.Mul.64.Auto diff --git a/stats/UInt.StrictAdd.256.Auto b/zkfold-base/stats/UInt.StrictAdd.256.Auto similarity index 100% rename from stats/UInt.StrictAdd.256.Auto rename to zkfold-base/stats/UInt.StrictAdd.256.Auto diff --git a/stats/UInt.StrictMul.512.Auto b/zkfold-base/stats/UInt.StrictMul.512.Auto similarity index 100% rename from stats/UInt.StrictMul.512.Auto rename to zkfold-base/stats/UInt.StrictMul.512.Auto diff --git a/tests/Main.hs b/zkfold-base/test/Main.hs similarity index 100% rename from tests/Main.hs rename to zkfold-base/test/Main.hs diff --git a/tests/Tests/ArithmeticCircuit.hs b/zkfold-base/test/Tests/ArithmeticCircuit.hs similarity index 100% rename from tests/Tests/ArithmeticCircuit.hs rename to zkfold-base/test/Tests/ArithmeticCircuit.hs diff --git a/tests/Tests/Arithmetization.hs b/zkfold-base/test/Tests/Arithmetization.hs similarity index 100% rename from tests/Tests/Arithmetization.hs rename to zkfold-base/test/Tests/Arithmetization.hs diff --git a/tests/Tests/Arithmetization/Test1.hs b/zkfold-base/test/Tests/Arithmetization/Test1.hs similarity index 100% rename from tests/Tests/Arithmetization/Test1.hs rename to zkfold-base/test/Tests/Arithmetization/Test1.hs diff --git a/tests/Tests/Arithmetization/Test2.hs b/zkfold-base/test/Tests/Arithmetization/Test2.hs similarity index 100% rename from tests/Tests/Arithmetization/Test2.hs rename to zkfold-base/test/Tests/Arithmetization/Test2.hs diff --git a/tests/Tests/Arithmetization/Test3.hs b/zkfold-base/test/Tests/Arithmetization/Test3.hs similarity index 100% rename from tests/Tests/Arithmetization/Test3.hs rename to zkfold-base/test/Tests/Arithmetization/Test3.hs diff --git a/tests/Tests/Arithmetization/Test4.hs b/zkfold-base/test/Tests/Arithmetization/Test4.hs similarity index 100% rename from tests/Tests/Arithmetization/Test4.hs rename to zkfold-base/test/Tests/Arithmetization/Test4.hs diff --git a/tests/Tests/Binary.hs b/zkfold-base/test/Tests/Binary.hs similarity index 100% rename from tests/Tests/Binary.hs rename to zkfold-base/test/Tests/Binary.hs diff --git a/tests/Tests/Blake2b.hs b/zkfold-base/test/Tests/Blake2b.hs similarity index 100% rename from tests/Tests/Blake2b.hs rename to zkfold-base/test/Tests/Blake2b.hs diff --git a/tests/Tests/ByteString.hs b/zkfold-base/test/Tests/ByteString.hs similarity index 100% rename from tests/Tests/ByteString.hs rename to zkfold-base/test/Tests/ByteString.hs diff --git a/tests/Tests/FFA.hs b/zkfold-base/test/Tests/FFA.hs similarity index 100% rename from tests/Tests/FFA.hs rename to zkfold-base/test/Tests/FFA.hs diff --git a/tests/Tests/Field.hs b/zkfold-base/test/Tests/Field.hs similarity index 100% rename from tests/Tests/Field.hs rename to zkfold-base/test/Tests/Field.hs diff --git a/tests/Tests/GroebnerBasis.hs b/zkfold-base/test/Tests/GroebnerBasis.hs similarity index 100% rename from tests/Tests/GroebnerBasis.hs rename to zkfold-base/test/Tests/GroebnerBasis.hs diff --git a/tests/Tests/Group.hs b/zkfold-base/test/Tests/Group.hs similarity index 100% rename from tests/Tests/Group.hs rename to zkfold-base/test/Tests/Group.hs diff --git a/tests/Tests/NonInteractiveProof.hs b/zkfold-base/test/Tests/NonInteractiveProof.hs similarity index 100% rename from tests/Tests/NonInteractiveProof.hs rename to zkfold-base/test/Tests/NonInteractiveProof.hs diff --git a/tests/Tests/Pairing.hs b/zkfold-base/test/Tests/Pairing.hs similarity index 100% rename from tests/Tests/Pairing.hs rename to zkfold-base/test/Tests/Pairing.hs diff --git a/tests/Tests/Permutations.hs b/zkfold-base/test/Tests/Permutations.hs similarity index 100% rename from tests/Tests/Permutations.hs rename to zkfold-base/test/Tests/Permutations.hs diff --git a/tests/Tests/Plonkup.hs b/zkfold-base/test/Tests/Plonkup.hs similarity index 100% rename from tests/Tests/Plonkup.hs rename to zkfold-base/test/Tests/Plonkup.hs diff --git a/tests/Tests/Protostar.hs b/zkfold-base/test/Tests/Protostar.hs similarity index 100% rename from tests/Tests/Protostar.hs rename to zkfold-base/test/Tests/Protostar.hs diff --git a/tests/Tests/SHA2.hs b/zkfold-base/test/Tests/SHA2.hs similarity index 100% rename from tests/Tests/SHA2.hs rename to zkfold-base/test/Tests/SHA2.hs diff --git a/tests/Tests/UInt.hs b/zkfold-base/test/Tests/UInt.hs similarity index 100% rename from tests/Tests/UInt.hs rename to zkfold-base/test/Tests/UInt.hs diff --git a/tests/Tests/Univariate.hs b/zkfold-base/test/Tests/Univariate.hs similarity index 100% rename from tests/Tests/Univariate.hs rename to zkfold-base/test/Tests/Univariate.hs diff --git a/tests/Tests/Univariate/Poly.hs b/zkfold-base/test/Tests/Univariate/Poly.hs similarity index 100% rename from tests/Tests/Univariate/Poly.hs rename to zkfold-base/test/Tests/Univariate/Poly.hs diff --git a/tests/Tests/Univariate/PolyVec.hs b/zkfold-base/test/Tests/Univariate/PolyVec.hs similarity index 100% rename from tests/Tests/Univariate/PolyVec.hs rename to zkfold-base/test/Tests/Univariate/PolyVec.hs diff --git a/tests/data/shabittestvectors/SHA224LongMsg.rsp b/zkfold-base/test/data/shabittestvectors/SHA224LongMsg.rsp similarity index 100% rename from tests/data/shabittestvectors/SHA224LongMsg.rsp rename to zkfold-base/test/data/shabittestvectors/SHA224LongMsg.rsp diff --git a/tests/data/shabittestvectors/SHA224ShortMsg.rsp b/zkfold-base/test/data/shabittestvectors/SHA224ShortMsg.rsp similarity index 100% rename from tests/data/shabittestvectors/SHA224ShortMsg.rsp rename to zkfold-base/test/data/shabittestvectors/SHA224ShortMsg.rsp diff --git a/tests/data/shabittestvectors/SHA256LongMsg.rsp b/zkfold-base/test/data/shabittestvectors/SHA256LongMsg.rsp similarity index 100% rename from tests/data/shabittestvectors/SHA256LongMsg.rsp rename to zkfold-base/test/data/shabittestvectors/SHA256LongMsg.rsp diff --git a/tests/data/shabittestvectors/SHA256ShortMsg.rsp b/zkfold-base/test/data/shabittestvectors/SHA256ShortMsg.rsp similarity index 100% rename from tests/data/shabittestvectors/SHA256ShortMsg.rsp rename to zkfold-base/test/data/shabittestvectors/SHA256ShortMsg.rsp diff --git a/tests/data/shabittestvectors/SHA384LongMsg.rsp b/zkfold-base/test/data/shabittestvectors/SHA384LongMsg.rsp similarity index 100% rename from tests/data/shabittestvectors/SHA384LongMsg.rsp rename to zkfold-base/test/data/shabittestvectors/SHA384LongMsg.rsp diff --git a/tests/data/shabittestvectors/SHA384ShortMsg.rsp b/zkfold-base/test/data/shabittestvectors/SHA384ShortMsg.rsp similarity index 100% rename from tests/data/shabittestvectors/SHA384ShortMsg.rsp rename to zkfold-base/test/data/shabittestvectors/SHA384ShortMsg.rsp diff --git a/tests/data/shabittestvectors/SHA512LongMsg.rsp b/zkfold-base/test/data/shabittestvectors/SHA512LongMsg.rsp similarity index 100% rename from tests/data/shabittestvectors/SHA512LongMsg.rsp rename to zkfold-base/test/data/shabittestvectors/SHA512LongMsg.rsp diff --git a/tests/data/shabittestvectors/SHA512ShortMsg.rsp b/zkfold-base/test/data/shabittestvectors/SHA512ShortMsg.rsp similarity index 100% rename from tests/data/shabittestvectors/SHA512ShortMsg.rsp rename to zkfold-base/test/data/shabittestvectors/SHA512ShortMsg.rsp diff --git a/tests/data/shabittestvectors/SHA512_224LongMsg.rsp b/zkfold-base/test/data/shabittestvectors/SHA512_224LongMsg.rsp similarity index 100% rename from tests/data/shabittestvectors/SHA512_224LongMsg.rsp rename to zkfold-base/test/data/shabittestvectors/SHA512_224LongMsg.rsp diff --git a/tests/data/shabittestvectors/SHA512_224ShortMsg.rsp b/zkfold-base/test/data/shabittestvectors/SHA512_224ShortMsg.rsp similarity index 100% rename from tests/data/shabittestvectors/SHA512_224ShortMsg.rsp rename to zkfold-base/test/data/shabittestvectors/SHA512_224ShortMsg.rsp diff --git a/tests/data/shabittestvectors/SHA512_256LongMsg.rsp b/zkfold-base/test/data/shabittestvectors/SHA512_256LongMsg.rsp similarity index 100% rename from tests/data/shabittestvectors/SHA512_256LongMsg.rsp rename to zkfold-base/test/data/shabittestvectors/SHA512_256LongMsg.rsp diff --git a/tests/data/shabittestvectors/SHA512_256ShortMsg.rsp b/zkfold-base/test/data/shabittestvectors/SHA512_256ShortMsg.rsp similarity index 100% rename from tests/data/shabittestvectors/SHA512_256ShortMsg.rsp rename to zkfold-base/test/data/shabittestvectors/SHA512_256ShortMsg.rsp diff --git a/zkfold-base.cabal b/zkfold-base/zkfold-base.cabal similarity index 99% rename from zkfold-base.cabal rename to zkfold-base/zkfold-base.cabal index e72f1e424..a6d3489a9 100644 --- a/zkfold-base.cabal +++ b/zkfold-base/zkfold-base.cabal @@ -12,7 +12,7 @@ license: MIT license-file: LICENSE build-type: Simple Data-Files: - tests/data/shabittestvectors/*.rsp + test/data/shabittestvectors/*.rsp description: This package contains the base library for the ZkFold project. It includes zkFold Symbolic compiler and a number of zero knowledge proof protocols. @@ -333,9 +333,9 @@ test-suite zkfold-base-test vector , vector-algorithms , zkfold-base , - hs-source-dirs: tests + hs-source-dirs: test -benchmark polynomial-multiplication +benchmark bench-poly-mul import: options-exe main-is: BenchPolyMul.hs hs-source-dirs: bench @@ -351,7 +351,7 @@ benchmark polynomial-multiplication vector, zkfold-base -benchmark compiler-benchmark +benchmark bench-compiler import: options-exe main-is: BenchCompiler.hs hs-source-dirs: bench From 898a045c3f1734e6506c5484a37d7ded1e11ef0b Mon Sep 17 00:00:00 2001 From: Vladimir Sinyakov Date: Sun, 6 Oct 2024 11:39:18 +0200 Subject: [PATCH 2/7] Separate `symbolic-cardano` and `symbolic-examples` --- cabal.project | 4 +- {zkfold-base => symbolic-base}/LICENSE | 0 .../bench/BenchPolyMul.hs | 0 .../examples/Examples/BatchTransfer.hs | 0 .../examples/Examples/ByteString.hs | 0 .../examples/Examples/Conditional.hs | 0 .../examples/Examples/Constant.hs | 0 .../examples/Examples/Eq.hs | 0 .../examples/Examples/FFA.hs | 0 .../examples/Examples/Fibonacci.hs | 0 .../examples/Examples/LEQ.hs | 0 .../examples/Examples/MiMCHash.hs | 0 .../examples/Examples/ReverseList.hs | 0 .../examples/Examples/UInt.hs | 0 .../examples/ZkFold/Symbolic/Examples.hs | 0 symbolic-base/hie.yaml | 10 ++ .../src/ZkFold/Base/Algebra/Basic/Class.hs | 0 .../src/ZkFold/Base/Algebra/Basic/DFT.hs | 0 .../src/ZkFold/Base/Algebra/Basic/Field.hs | 0 .../src/ZkFold/Base/Algebra/Basic/Number.hs | 0 .../ZkFold/Base/Algebra/Basic/Permutations.hs | 0 .../ZkFold/Base/Algebra/Basic/VectorSpace.hs | 0 .../Base/Algebra/EllipticCurve/BLS12_381.hs | 0 .../Base/Algebra/EllipticCurve/BN254.hs | 0 .../Base/Algebra/EllipticCurve/Class.hs | 0 .../Base/Algebra/EllipticCurve/Ed25519.hs | 0 .../Base/Algebra/EllipticCurve/Pairing.hs | 0 .../Base/Algebra/EllipticCurve/Pasta.hs | 0 .../Base/Algebra/Polynomials/Multivariate.hs | 0 .../Polynomials/Multivariate/Groebner.hs | 0 .../Polynomials/Multivariate/Monomial.hs | 0 .../Polynomials/Multivariate/Polynomial.hs | 0 .../Polynomials/Multivariate/Substitution.hs | 0 .../Base/Algebra/Polynomials/Univariate.hs | 0 .../src/ZkFold/Base/Control/HApplicative.hs | 0 .../src/ZkFold/Base/Data/ByteString.hs | 0 .../src/ZkFold/Base/Data/HFunctor.hs | 0 .../src/ZkFold/Base/Data/Matrix.hs | 0 .../src/ZkFold/Base/Data/Package.hs | 0 .../src/ZkFold/Base/Data/Par1.hs | 0 .../src/ZkFold/Base/Data/Product.hs | 0 .../src/ZkFold/Base/Data/Sparse/Matrix.hs | 0 .../src/ZkFold/Base/Data/Sparse/Vector.hs | 0 .../src/ZkFold/Base/Data/Type.hs | 0 .../src/ZkFold/Base/Data/Vector.hs | 0 .../src/ZkFold/Base/Protocol/KZG.hs | 0 .../Base/Protocol/NonInteractiveProof.hs | 0 .../Protocol/NonInteractiveProof/Internal.hs | 0 .../Protocol/NonInteractiveProof/Prover.hs | 0 .../Protocol/NonInteractiveProof/Testing.hs | 0 .../src/ZkFold/Base/Protocol/Plonk.hs | 0 .../src/ZkFold/Base/Protocol/Plonk/Prover.hs | 0 .../ZkFold/Base/Protocol/Plonk/Verifier.hs | 0 .../src/ZkFold/Base/Protocol/Plonkup.hs | 0 .../src/ZkFold/Base/Protocol/Plonkup/Input.hs | 0 .../ZkFold/Base/Protocol/Plonkup/Internal.hs | 0 .../Base/Protocol/Plonkup/LookupConstraint.hs | 0 .../Base/Protocol/Plonkup/PlonkConstraint.hs | 0 .../Protocol/Plonkup/PlonkupConstraint.hs | 0 .../src/ZkFold/Base/Protocol/Plonkup/Proof.hs | 0 .../ZkFold/Base/Protocol/Plonkup/Prover.hs | 0 .../Protocol/Plonkup/Prover/Polynomials.hs | 0 .../Base/Protocol/Plonkup/Prover/Secret.hs | 0 .../Base/Protocol/Plonkup/Prover/Setup.hs | 0 .../ZkFold/Base/Protocol/Plonkup/Relation.hs | 0 .../src/ZkFold/Base/Protocol/Plonkup/Setup.hs | 0 .../ZkFold/Base/Protocol/Plonkup/Testing.hs | 0 .../src/ZkFold/Base/Protocol/Plonkup/Utils.hs | 0 .../ZkFold/Base/Protocol/Plonkup/Verifier.hs | 0 .../Protocol/Plonkup/Verifier/Commitments.hs | 0 .../Base/Protocol/Plonkup/Verifier/Setup.hs | 0 .../ZkFold/Base/Protocol/Plonkup/Witness.hs | 0 .../src/ZkFold/Base/Protocol/Protostar.hs | 0 .../Base/Protocol/Protostar/Accumulator.hs | 0 .../Protocol/Protostar/AccumulatorScheme.hs | 0 .../Protocol/Protostar/ArithmeticCircuit.hs | 0 .../ZkFold/Base/Protocol/Protostar/Commit.hs | 0 .../Base/Protocol/Protostar/CommitOpen.hs | 0 .../Base/Protocol/Protostar/FiatShamir.hs | 0 .../ZkFold/Base/Protocol/Protostar/Fold.hs | 0 .../ZkFold/Base/Protocol/Protostar/Gate.hs | 0 .../Base/Protocol/Protostar/Internal.hs | 0 .../ZkFold/Base/Protocol/Protostar/Lookup.hs | 0 .../ZkFold/Base/Protocol/Protostar/Oracle.hs | 0 .../Base/Protocol/Protostar/Permutation.hs | 0 .../Base/Protocol/Protostar/SpecialSound.hs | 0 .../src/ZkFold/Prelude.hs | 0 .../Symbolic/Algorithms/Hash/Blake2b.hs | 0 .../Algorithms/Hash/Blake2b/Constants.hs | 0 .../ZkFold/Symbolic/Algorithms/Hash/MiMC.hs | 0 .../Algorithms/Hash/MiMC/Constants.hs | 0 .../ZkFold/Symbolic/Algorithms/Hash/SHA2.hs | 0 .../Algorithms/Hash/SHA2/Constants.hs | 0 .../src/ZkFold/Symbolic/Class.hs | 0 .../src/ZkFold/Symbolic/Compiler.hs | 0 .../Symbolic/Compiler/ArithmeticCircuit.hs | 0 .../Compiler/ArithmeticCircuit/Instance.hs | 0 .../Compiler/ArithmeticCircuit/Internal.hs | 0 .../Compiler/ArithmeticCircuit/Map.hs | 0 .../Compiler/ArithmeticCircuit/MerkleHash.hs | 0 .../src/ZkFold/Symbolic/Data/Bool.hs | 0 .../src/ZkFold/Symbolic/Data/ByteString.hs | 0 .../src/ZkFold/Symbolic/Data/Class.hs | 0 .../src/ZkFold/Symbolic/Data/Combinators.hs | 0 .../src/ZkFold/Symbolic/Data/Conditional.hs | 0 .../src/ZkFold/Symbolic/Data/DiscreteField.hs | 0 .../src/ZkFold/Symbolic/Data/Ed25519.hs | 0 .../src/ZkFold/Symbolic/Data/Eq.hs | 0 .../src/ZkFold/Symbolic/Data/Eq/Structural.hs | 0 .../src/ZkFold/Symbolic/Data/FFA.hs | 0 .../src/ZkFold/Symbolic/Data/FieldElement.hs | 0 .../src/ZkFold/Symbolic/Data/List.hs | 0 .../src/ZkFold/Symbolic/Data/Maybe.hs | 0 .../src/ZkFold/Symbolic/Data/Ord.hs | 0 .../src/ZkFold/Symbolic/Data/UInt.hs | 0 .../src/ZkFold/Symbolic/Data/UTCTime.hs | 0 .../src/ZkFold/Symbolic/Interpreter.hs | 0 .../src/ZkFold/Symbolic/Ledger/Types.hs | 0 .../ZkFold/Symbolic/Ledger/Types/Address.hs | 0 .../src/ZkFold/Symbolic/Ledger/Types/Basic.hs | 0 .../ZkFold/Symbolic/Ledger/Types/Bridge.hs | 0 .../ZkFold/Symbolic/Ledger/Types/Contract.hs | 0 .../src/ZkFold/Symbolic/Ledger/Types/Hash.hs | 0 .../src/ZkFold/Symbolic/Ledger/Types/Input.hs | 0 .../ZkFold/Symbolic/Ledger/Types/Output.hs | 0 .../ZkFold/Symbolic/Ledger/Types/OutputRef.hs | 0 .../Symbolic/Ledger/Types/Transaction.hs | 0 .../ZkFold/Symbolic/Ledger/Types/Update.hs | 0 .../src/ZkFold/Symbolic/Ledger/Types/Value.hs | 0 .../Symbolic/Ledger/Validation/Bridge.hs | 0 .../Symbolic/Ledger/Validation/Common.hs | 0 .../Symbolic/Ledger/Validation/Contract.hs | 0 .../Ledger/Validation/PrivateInput.hs | 0 .../Symbolic/Ledger/Validation/PublicInput.hs | 0 .../Symbolic/Ledger/Validation/Transaction.hs | 0 .../Symbolic/Ledger/Validation/Update.hs | 0 .../src/ZkFold/Symbolic/MonadCircuit.hs | 0 .../stats/ByteString.Add.512 | 0 .../stats/ByteString.And.32 | 0 .../stats/ByteString.Extend.1.512 | 0 .../stats/ByteString.Or.64 | 0 .../stats/Conditional | 0 .../stats/Constant.5 | 0 {zkfold-base => symbolic-base}/stats/Eq | 0 .../stats/Eq.Constant.5 | 0 .../stats/FFA.Add.097 | 0 .../stats/FFA.Add.337 | 0 .../stats/FFA.Mul.097 | 0 .../stats/FFA.Mul.337 | 0 .../stats/Fibonacci.100 | 0 {zkfold-base => symbolic-base}/stats/LEQ | 0 {zkfold-base => symbolic-base}/stats/MiMCHash | 0 .../stats/Reverse.32.3000 | 0 .../stats/SHA256.32 | 0 .../stats/UInt.DivMod.32.Auto | 0 .../stats/UInt.Mul.64.Auto | 0 .../stats/UInt.StrictAdd.256.Auto | 0 .../stats/UInt.StrictMul.512.Auto | 0 .../symbolic-base.cabal | 73 +-------- {zkfold-base => symbolic-base}/test/Main.hs | 0 .../test/Tests/ArithmeticCircuit.hs | 0 .../test/Tests/Arithmetization.hs | 0 .../test/Tests/Arithmetization/Test1.hs | 0 .../test/Tests/Arithmetization/Test2.hs | 0 .../test/Tests/Arithmetization/Test3.hs | 0 .../test/Tests/Arithmetization/Test4.hs | 0 .../test/Tests/Binary.hs | 0 .../test/Tests/Blake2b.hs | 0 .../test/Tests/ByteString.hs | 0 .../test/Tests/FFA.hs | 0 .../test/Tests/Field.hs | 0 .../test/Tests/GroebnerBasis.hs | 0 .../test/Tests/Group.hs | 0 .../test/Tests/NonInteractiveProof.hs | 0 .../test/Tests/Pairing.hs | 0 .../test/Tests/Permutations.hs | 0 .../test/Tests/Plonkup.hs | 0 .../test/Tests/Protostar.hs | 0 .../test/Tests/SHA2.hs | 0 .../test/Tests/UInt.hs | 0 .../test/Tests/Univariate.hs | 0 .../test/Tests/Univariate/Poly.hs | 0 .../test/Tests/Univariate/PolyVec.hs | 0 .../data/shabittestvectors/SHA224LongMsg.rsp | 0 .../data/shabittestvectors/SHA224ShortMsg.rsp | 0 .../data/shabittestvectors/SHA256LongMsg.rsp | 0 .../data/shabittestvectors/SHA256ShortMsg.rsp | 0 .../data/shabittestvectors/SHA384LongMsg.rsp | 0 .../data/shabittestvectors/SHA384ShortMsg.rsp | 0 .../data/shabittestvectors/SHA512LongMsg.rsp | 0 .../data/shabittestvectors/SHA512ShortMsg.rsp | 0 .../shabittestvectors/SHA512_224LongMsg.rsp | 0 .../shabittestvectors/SHA512_224ShortMsg.rsp | 0 .../shabittestvectors/SHA512_256LongMsg.rsp | 0 .../shabittestvectors/SHA512_256ShortMsg.rsp | 0 symbolic-cardano/LICENSE | 21 +++ symbolic-cardano/hie.yaml | 4 + .../Cardano/Contracts/BatchTransfer.hs | 0 .../Cardano/Contracts/RandomOracle.hs | 0 .../src/ZkFold/Symbolic/Cardano/Types.hs | 0 .../ZkFold/Symbolic/Cardano/Types/Address.hs | 0 .../ZkFold/Symbolic/Cardano/Types/Basic.hs | 0 .../ZkFold/Symbolic/Cardano/Types/Input.hs | 0 .../ZkFold/Symbolic/Cardano/Types/Output.hs | 0 .../Symbolic/Cardano/Types/Output/Datum.hs | 0 .../Symbolic/Cardano/Types/OutputRef.hs | 0 .../Symbolic/Cardano/Types/Transaction.hs | 0 .../ZkFold/Symbolic/Cardano/Types/Value.hs | 0 .../src/ZkFold/Symbolic/Cardano/UPLC.hs | 0 .../ZkFold/Symbolic/Cardano/UPLC/Builtins.hs | 0 .../ZkFold/Symbolic/Cardano/UPLC/Inference.hs | 0 .../Cardano/UPLC/Inference/Internal.hs | 0 .../src/ZkFold/Symbolic/Cardano/UPLC/Term.hs | 0 .../src/ZkFold/Symbolic/Cardano/UPLC/Type.hs | 0 .../src/ZkFold/Symbolic/Cardano/Wrapper.hs | 0 symbolic-cardano/symbolic-cardano.cabal | 141 ++++++++++++++++++ symbolic-examples/LICENSE | 21 +++ .../bench/BenchCompiler.hs | 3 +- symbolic-examples/hie.yaml | 7 + .../src/Examples/BatchTransfer.hs | 18 +++ symbolic-examples/src/Examples/ByteString.hs | 38 +++++ symbolic-examples/src/Examples/Conditional.hs | 10 ++ symbolic-examples/src/Examples/Constant.hs | 15 ++ symbolic-examples/src/Examples/Eq.hs | 10 ++ symbolic-examples/src/Examples/FFA.hs | 31 ++++ symbolic-examples/src/Examples/Fibonacci.hs | 28 ++++ symbolic-examples/src/Examples/LEQ.hs | 10 ++ symbolic-examples/src/Examples/MiMCHash.hs | 12 ++ symbolic-examples/src/Examples/ReverseList.hs | 7 + symbolic-examples/src/Examples/UInt.hs | 40 +++++ .../src/ZkFold/Symbolic/Examples.hs | 76 ++++++++++ symbolic-examples/symbolic-examples.cabal | 130 ++++++++++++++++ zkfold-base/hie.yaml | 16 -- 233 files changed, 640 insertions(+), 85 deletions(-) rename {zkfold-base => symbolic-base}/LICENSE (100%) rename {zkfold-base => symbolic-base}/bench/BenchPolyMul.hs (100%) rename {zkfold-base => symbolic-base}/examples/Examples/BatchTransfer.hs (100%) rename {zkfold-base => symbolic-base}/examples/Examples/ByteString.hs (100%) rename {zkfold-base => symbolic-base}/examples/Examples/Conditional.hs (100%) rename {zkfold-base => symbolic-base}/examples/Examples/Constant.hs (100%) rename {zkfold-base => symbolic-base}/examples/Examples/Eq.hs (100%) rename {zkfold-base => symbolic-base}/examples/Examples/FFA.hs (100%) rename {zkfold-base => symbolic-base}/examples/Examples/Fibonacci.hs (100%) rename {zkfold-base => symbolic-base}/examples/Examples/LEQ.hs (100%) rename {zkfold-base => symbolic-base}/examples/Examples/MiMCHash.hs (100%) rename {zkfold-base => symbolic-base}/examples/Examples/ReverseList.hs (100%) rename {zkfold-base => symbolic-base}/examples/Examples/UInt.hs (100%) rename {zkfold-base => symbolic-base}/examples/ZkFold/Symbolic/Examples.hs (100%) create mode 100644 symbolic-base/hie.yaml rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Algebra/Basic/Class.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Algebra/Basic/DFT.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Algebra/Basic/Field.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Algebra/Basic/Number.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Algebra/Basic/Permutations.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Algebra/Basic/VectorSpace.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Algebra/EllipticCurve/BLS12_381.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Algebra/EllipticCurve/BN254.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Algebra/EllipticCurve/Class.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Algebra/EllipticCurve/Ed25519.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Algebra/EllipticCurve/Pairing.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Algebra/EllipticCurve/Pasta.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Algebra/Polynomials/Multivariate.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Groebner.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Monomial.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Polynomial.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Substitution.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Algebra/Polynomials/Univariate.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Control/HApplicative.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Data/ByteString.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Data/HFunctor.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Data/Matrix.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Data/Package.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Data/Par1.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Data/Product.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Data/Sparse/Matrix.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Data/Sparse/Vector.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Data/Type.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Data/Vector.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/KZG.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/NonInteractiveProof.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/NonInteractiveProof/Internal.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/NonInteractiveProof/Prover.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/NonInteractiveProof/Testing.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Plonk.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Plonk/Prover.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Plonk/Verifier.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Plonkup.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Plonkup/Input.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Plonkup/Internal.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Plonkup/LookupConstraint.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Plonkup/PlonkConstraint.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Plonkup/PlonkupConstraint.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Plonkup/Proof.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Plonkup/Prover.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Plonkup/Prover/Polynomials.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Plonkup/Prover/Secret.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Plonkup/Prover/Setup.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Plonkup/Relation.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Plonkup/Setup.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Plonkup/Testing.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Plonkup/Utils.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Plonkup/Verifier.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Plonkup/Verifier/Commitments.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Plonkup/Verifier/Setup.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Plonkup/Witness.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Protostar.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Protostar/Accumulator.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Protostar/AccumulatorScheme.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Protostar/ArithmeticCircuit.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Protostar/Commit.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Protostar/CommitOpen.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Protostar/FiatShamir.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Protostar/Fold.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Protostar/Gate.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Protostar/Internal.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Protostar/Lookup.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Protostar/Oracle.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Protostar/Permutation.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Base/Protocol/Protostar/SpecialSound.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Prelude.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Algorithms/Hash/Blake2b.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Algorithms/Hash/Blake2b/Constants.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Algorithms/Hash/MiMC.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Algorithms/Hash/MiMC/Constants.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Algorithms/Hash/SHA2.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Algorithms/Hash/SHA2/Constants.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Class.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Compiler.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/Instance.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/Internal.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/Map.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/MerkleHash.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Data/Bool.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Data/ByteString.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Data/Class.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Data/Combinators.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Data/Conditional.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Data/DiscreteField.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Data/Ed25519.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Data/Eq.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Data/Eq/Structural.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Data/FFA.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Data/FieldElement.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Data/List.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Data/Maybe.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Data/Ord.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Data/UInt.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Data/UTCTime.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Interpreter.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Ledger/Types.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Ledger/Types/Address.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Ledger/Types/Basic.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Ledger/Types/Bridge.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Ledger/Types/Contract.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Ledger/Types/Hash.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Ledger/Types/Input.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Ledger/Types/Output.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Ledger/Types/OutputRef.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Ledger/Types/Transaction.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Ledger/Types/Update.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Ledger/Types/Value.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Ledger/Validation/Bridge.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Ledger/Validation/Common.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Ledger/Validation/Contract.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Ledger/Validation/PrivateInput.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Ledger/Validation/PublicInput.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Ledger/Validation/Transaction.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/Ledger/Validation/Update.hs (100%) rename {zkfold-base => symbolic-base}/src/ZkFold/Symbolic/MonadCircuit.hs (100%) rename {zkfold-base => symbolic-base}/stats/ByteString.Add.512 (100%) rename {zkfold-base => symbolic-base}/stats/ByteString.And.32 (100%) rename {zkfold-base => symbolic-base}/stats/ByteString.Extend.1.512 (100%) rename {zkfold-base => symbolic-base}/stats/ByteString.Or.64 (100%) rename {zkfold-base => symbolic-base}/stats/Conditional (100%) rename {zkfold-base => symbolic-base}/stats/Constant.5 (100%) rename {zkfold-base => symbolic-base}/stats/Eq (100%) rename {zkfold-base => symbolic-base}/stats/Eq.Constant.5 (100%) rename {zkfold-base => symbolic-base}/stats/FFA.Add.097 (100%) rename {zkfold-base => symbolic-base}/stats/FFA.Add.337 (100%) rename {zkfold-base => symbolic-base}/stats/FFA.Mul.097 (100%) rename {zkfold-base => symbolic-base}/stats/FFA.Mul.337 (100%) rename {zkfold-base => symbolic-base}/stats/Fibonacci.100 (100%) rename {zkfold-base => symbolic-base}/stats/LEQ (100%) rename {zkfold-base => symbolic-base}/stats/MiMCHash (100%) rename {zkfold-base => symbolic-base}/stats/Reverse.32.3000 (100%) rename {zkfold-base => symbolic-base}/stats/SHA256.32 (100%) rename {zkfold-base => symbolic-base}/stats/UInt.DivMod.32.Auto (100%) rename {zkfold-base => symbolic-base}/stats/UInt.Mul.64.Auto (100%) rename {zkfold-base => symbolic-base}/stats/UInt.StrictAdd.256.Auto (100%) rename {zkfold-base => symbolic-base}/stats/UInt.StrictMul.512.Auto (100%) rename zkfold-base/zkfold-base.cabal => symbolic-base/symbolic-base.cabal (84%) rename {zkfold-base => symbolic-base}/test/Main.hs (100%) rename {zkfold-base => symbolic-base}/test/Tests/ArithmeticCircuit.hs (100%) rename {zkfold-base => symbolic-base}/test/Tests/Arithmetization.hs (100%) rename {zkfold-base => symbolic-base}/test/Tests/Arithmetization/Test1.hs (100%) rename {zkfold-base => symbolic-base}/test/Tests/Arithmetization/Test2.hs (100%) rename {zkfold-base => symbolic-base}/test/Tests/Arithmetization/Test3.hs (100%) rename {zkfold-base => symbolic-base}/test/Tests/Arithmetization/Test4.hs (100%) rename {zkfold-base => symbolic-base}/test/Tests/Binary.hs (100%) rename {zkfold-base => symbolic-base}/test/Tests/Blake2b.hs (100%) rename {zkfold-base => symbolic-base}/test/Tests/ByteString.hs (100%) rename {zkfold-base => symbolic-base}/test/Tests/FFA.hs (100%) rename {zkfold-base => symbolic-base}/test/Tests/Field.hs (100%) rename {zkfold-base => symbolic-base}/test/Tests/GroebnerBasis.hs (100%) rename {zkfold-base => symbolic-base}/test/Tests/Group.hs (100%) rename {zkfold-base => symbolic-base}/test/Tests/NonInteractiveProof.hs (100%) rename {zkfold-base => symbolic-base}/test/Tests/Pairing.hs (100%) rename {zkfold-base => symbolic-base}/test/Tests/Permutations.hs (100%) rename {zkfold-base => symbolic-base}/test/Tests/Plonkup.hs (100%) rename {zkfold-base => symbolic-base}/test/Tests/Protostar.hs (100%) rename {zkfold-base => symbolic-base}/test/Tests/SHA2.hs (100%) rename {zkfold-base => symbolic-base}/test/Tests/UInt.hs (100%) rename {zkfold-base => symbolic-base}/test/Tests/Univariate.hs (100%) rename {zkfold-base => symbolic-base}/test/Tests/Univariate/Poly.hs (100%) rename {zkfold-base => symbolic-base}/test/Tests/Univariate/PolyVec.hs (100%) rename {zkfold-base => symbolic-base}/test/data/shabittestvectors/SHA224LongMsg.rsp (100%) rename {zkfold-base => symbolic-base}/test/data/shabittestvectors/SHA224ShortMsg.rsp (100%) rename {zkfold-base => symbolic-base}/test/data/shabittestvectors/SHA256LongMsg.rsp (100%) rename {zkfold-base => symbolic-base}/test/data/shabittestvectors/SHA256ShortMsg.rsp (100%) rename {zkfold-base => symbolic-base}/test/data/shabittestvectors/SHA384LongMsg.rsp (100%) rename {zkfold-base => symbolic-base}/test/data/shabittestvectors/SHA384ShortMsg.rsp (100%) rename {zkfold-base => symbolic-base}/test/data/shabittestvectors/SHA512LongMsg.rsp (100%) rename {zkfold-base => symbolic-base}/test/data/shabittestvectors/SHA512ShortMsg.rsp (100%) rename {zkfold-base => symbolic-base}/test/data/shabittestvectors/SHA512_224LongMsg.rsp (100%) rename {zkfold-base => symbolic-base}/test/data/shabittestvectors/SHA512_224ShortMsg.rsp (100%) rename {zkfold-base => symbolic-base}/test/data/shabittestvectors/SHA512_256LongMsg.rsp (100%) rename {zkfold-base => symbolic-base}/test/data/shabittestvectors/SHA512_256ShortMsg.rsp (100%) create mode 100644 symbolic-cardano/LICENSE create mode 100644 symbolic-cardano/hie.yaml rename {zkfold-base => symbolic-cardano}/src/ZkFold/Symbolic/Cardano/Contracts/BatchTransfer.hs (100%) rename {zkfold-base => symbolic-cardano}/src/ZkFold/Symbolic/Cardano/Contracts/RandomOracle.hs (100%) rename {zkfold-base => symbolic-cardano}/src/ZkFold/Symbolic/Cardano/Types.hs (100%) rename {zkfold-base => symbolic-cardano}/src/ZkFold/Symbolic/Cardano/Types/Address.hs (100%) rename {zkfold-base => symbolic-cardano}/src/ZkFold/Symbolic/Cardano/Types/Basic.hs (100%) rename {zkfold-base => symbolic-cardano}/src/ZkFold/Symbolic/Cardano/Types/Input.hs (100%) rename {zkfold-base => symbolic-cardano}/src/ZkFold/Symbolic/Cardano/Types/Output.hs (100%) rename {zkfold-base => symbolic-cardano}/src/ZkFold/Symbolic/Cardano/Types/Output/Datum.hs (100%) rename {zkfold-base => symbolic-cardano}/src/ZkFold/Symbolic/Cardano/Types/OutputRef.hs (100%) rename {zkfold-base => symbolic-cardano}/src/ZkFold/Symbolic/Cardano/Types/Transaction.hs (100%) rename {zkfold-base => symbolic-cardano}/src/ZkFold/Symbolic/Cardano/Types/Value.hs (100%) rename {zkfold-base => symbolic-cardano}/src/ZkFold/Symbolic/Cardano/UPLC.hs (100%) rename {zkfold-base => symbolic-cardano}/src/ZkFold/Symbolic/Cardano/UPLC/Builtins.hs (100%) rename {zkfold-base => symbolic-cardano}/src/ZkFold/Symbolic/Cardano/UPLC/Inference.hs (100%) rename {zkfold-base => symbolic-cardano}/src/ZkFold/Symbolic/Cardano/UPLC/Inference/Internal.hs (100%) rename {zkfold-base => symbolic-cardano}/src/ZkFold/Symbolic/Cardano/UPLC/Term.hs (100%) rename {zkfold-base => symbolic-cardano}/src/ZkFold/Symbolic/Cardano/UPLC/Type.hs (100%) rename {zkfold-base => symbolic-cardano}/src/ZkFold/Symbolic/Cardano/Wrapper.hs (100%) create mode 100644 symbolic-cardano/symbolic-cardano.cabal create mode 100644 symbolic-examples/LICENSE rename {zkfold-base => symbolic-examples}/bench/BenchCompiler.hs (98%) create mode 100644 symbolic-examples/hie.yaml create mode 100644 symbolic-examples/src/Examples/BatchTransfer.hs create mode 100644 symbolic-examples/src/Examples/ByteString.hs create mode 100644 symbolic-examples/src/Examples/Conditional.hs create mode 100644 symbolic-examples/src/Examples/Constant.hs create mode 100644 symbolic-examples/src/Examples/Eq.hs create mode 100644 symbolic-examples/src/Examples/FFA.hs create mode 100644 symbolic-examples/src/Examples/Fibonacci.hs create mode 100644 symbolic-examples/src/Examples/LEQ.hs create mode 100644 symbolic-examples/src/Examples/MiMCHash.hs create mode 100644 symbolic-examples/src/Examples/ReverseList.hs create mode 100644 symbolic-examples/src/Examples/UInt.hs create mode 100644 symbolic-examples/src/ZkFold/Symbolic/Examples.hs create mode 100644 symbolic-examples/symbolic-examples.cabal delete mode 100644 zkfold-base/hie.yaml diff --git a/cabal.project b/cabal.project index d60bc3354..e7b26140a 100644 --- a/cabal.project +++ b/cabal.project @@ -1,7 +1,9 @@ index-state: 2023-10-29T16:11:26Z packages: - zkfold-base + symbolic-base + symbolic-cardano + symbolic-examples optimization: 2 diff --git a/zkfold-base/LICENSE b/symbolic-base/LICENSE similarity index 100% rename from zkfold-base/LICENSE rename to symbolic-base/LICENSE diff --git a/zkfold-base/bench/BenchPolyMul.hs b/symbolic-base/bench/BenchPolyMul.hs similarity index 100% rename from zkfold-base/bench/BenchPolyMul.hs rename to symbolic-base/bench/BenchPolyMul.hs diff --git a/zkfold-base/examples/Examples/BatchTransfer.hs b/symbolic-base/examples/Examples/BatchTransfer.hs similarity index 100% rename from zkfold-base/examples/Examples/BatchTransfer.hs rename to symbolic-base/examples/Examples/BatchTransfer.hs diff --git a/zkfold-base/examples/Examples/ByteString.hs b/symbolic-base/examples/Examples/ByteString.hs similarity index 100% rename from zkfold-base/examples/Examples/ByteString.hs rename to symbolic-base/examples/Examples/ByteString.hs diff --git a/zkfold-base/examples/Examples/Conditional.hs b/symbolic-base/examples/Examples/Conditional.hs similarity index 100% rename from zkfold-base/examples/Examples/Conditional.hs rename to symbolic-base/examples/Examples/Conditional.hs diff --git a/zkfold-base/examples/Examples/Constant.hs b/symbolic-base/examples/Examples/Constant.hs similarity index 100% rename from zkfold-base/examples/Examples/Constant.hs rename to symbolic-base/examples/Examples/Constant.hs diff --git a/zkfold-base/examples/Examples/Eq.hs b/symbolic-base/examples/Examples/Eq.hs similarity index 100% rename from zkfold-base/examples/Examples/Eq.hs rename to symbolic-base/examples/Examples/Eq.hs diff --git a/zkfold-base/examples/Examples/FFA.hs b/symbolic-base/examples/Examples/FFA.hs similarity index 100% rename from zkfold-base/examples/Examples/FFA.hs rename to symbolic-base/examples/Examples/FFA.hs diff --git a/zkfold-base/examples/Examples/Fibonacci.hs b/symbolic-base/examples/Examples/Fibonacci.hs similarity index 100% rename from zkfold-base/examples/Examples/Fibonacci.hs rename to symbolic-base/examples/Examples/Fibonacci.hs diff --git a/zkfold-base/examples/Examples/LEQ.hs b/symbolic-base/examples/Examples/LEQ.hs similarity index 100% rename from zkfold-base/examples/Examples/LEQ.hs rename to symbolic-base/examples/Examples/LEQ.hs diff --git a/zkfold-base/examples/Examples/MiMCHash.hs b/symbolic-base/examples/Examples/MiMCHash.hs similarity index 100% rename from zkfold-base/examples/Examples/MiMCHash.hs rename to symbolic-base/examples/Examples/MiMCHash.hs diff --git a/zkfold-base/examples/Examples/ReverseList.hs b/symbolic-base/examples/Examples/ReverseList.hs similarity index 100% rename from zkfold-base/examples/Examples/ReverseList.hs rename to symbolic-base/examples/Examples/ReverseList.hs diff --git a/zkfold-base/examples/Examples/UInt.hs b/symbolic-base/examples/Examples/UInt.hs similarity index 100% rename from zkfold-base/examples/Examples/UInt.hs rename to symbolic-base/examples/Examples/UInt.hs diff --git a/zkfold-base/examples/ZkFold/Symbolic/Examples.hs b/symbolic-base/examples/ZkFold/Symbolic/Examples.hs similarity index 100% rename from zkfold-base/examples/ZkFold/Symbolic/Examples.hs rename to symbolic-base/examples/ZkFold/Symbolic/Examples.hs diff --git a/symbolic-base/hie.yaml b/symbolic-base/hie.yaml new file mode 100644 index 000000000..2e5be7a74 --- /dev/null +++ b/symbolic-base/hie.yaml @@ -0,0 +1,10 @@ +cradle: + cabal: + - path: "./src" + component: "lib:symbolic-base" + + - path: "./test" + component: "symbolic-base:test:symbolic-base-test" + + - path: "./bench/BenchPolyMul.hs" + component: "symbolic-base:bench:bench-poly-mul" diff --git a/zkfold-base/src/ZkFold/Base/Algebra/Basic/Class.hs b/symbolic-base/src/ZkFold/Base/Algebra/Basic/Class.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Algebra/Basic/Class.hs rename to symbolic-base/src/ZkFold/Base/Algebra/Basic/Class.hs diff --git a/zkfold-base/src/ZkFold/Base/Algebra/Basic/DFT.hs b/symbolic-base/src/ZkFold/Base/Algebra/Basic/DFT.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Algebra/Basic/DFT.hs rename to symbolic-base/src/ZkFold/Base/Algebra/Basic/DFT.hs diff --git a/zkfold-base/src/ZkFold/Base/Algebra/Basic/Field.hs b/symbolic-base/src/ZkFold/Base/Algebra/Basic/Field.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Algebra/Basic/Field.hs rename to symbolic-base/src/ZkFold/Base/Algebra/Basic/Field.hs diff --git a/zkfold-base/src/ZkFold/Base/Algebra/Basic/Number.hs b/symbolic-base/src/ZkFold/Base/Algebra/Basic/Number.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Algebra/Basic/Number.hs rename to symbolic-base/src/ZkFold/Base/Algebra/Basic/Number.hs diff --git a/zkfold-base/src/ZkFold/Base/Algebra/Basic/Permutations.hs b/symbolic-base/src/ZkFold/Base/Algebra/Basic/Permutations.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Algebra/Basic/Permutations.hs rename to symbolic-base/src/ZkFold/Base/Algebra/Basic/Permutations.hs diff --git a/zkfold-base/src/ZkFold/Base/Algebra/Basic/VectorSpace.hs b/symbolic-base/src/ZkFold/Base/Algebra/Basic/VectorSpace.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Algebra/Basic/VectorSpace.hs rename to symbolic-base/src/ZkFold/Base/Algebra/Basic/VectorSpace.hs diff --git a/zkfold-base/src/ZkFold/Base/Algebra/EllipticCurve/BLS12_381.hs b/symbolic-base/src/ZkFold/Base/Algebra/EllipticCurve/BLS12_381.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Algebra/EllipticCurve/BLS12_381.hs rename to symbolic-base/src/ZkFold/Base/Algebra/EllipticCurve/BLS12_381.hs diff --git a/zkfold-base/src/ZkFold/Base/Algebra/EllipticCurve/BN254.hs b/symbolic-base/src/ZkFold/Base/Algebra/EllipticCurve/BN254.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Algebra/EllipticCurve/BN254.hs rename to symbolic-base/src/ZkFold/Base/Algebra/EllipticCurve/BN254.hs diff --git a/zkfold-base/src/ZkFold/Base/Algebra/EllipticCurve/Class.hs b/symbolic-base/src/ZkFold/Base/Algebra/EllipticCurve/Class.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Algebra/EllipticCurve/Class.hs rename to symbolic-base/src/ZkFold/Base/Algebra/EllipticCurve/Class.hs diff --git a/zkfold-base/src/ZkFold/Base/Algebra/EllipticCurve/Ed25519.hs b/symbolic-base/src/ZkFold/Base/Algebra/EllipticCurve/Ed25519.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Algebra/EllipticCurve/Ed25519.hs rename to symbolic-base/src/ZkFold/Base/Algebra/EllipticCurve/Ed25519.hs diff --git a/zkfold-base/src/ZkFold/Base/Algebra/EllipticCurve/Pairing.hs b/symbolic-base/src/ZkFold/Base/Algebra/EllipticCurve/Pairing.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Algebra/EllipticCurve/Pairing.hs rename to symbolic-base/src/ZkFold/Base/Algebra/EllipticCurve/Pairing.hs diff --git a/zkfold-base/src/ZkFold/Base/Algebra/EllipticCurve/Pasta.hs b/symbolic-base/src/ZkFold/Base/Algebra/EllipticCurve/Pasta.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Algebra/EllipticCurve/Pasta.hs rename to symbolic-base/src/ZkFold/Base/Algebra/EllipticCurve/Pasta.hs diff --git a/zkfold-base/src/ZkFold/Base/Algebra/Polynomials/Multivariate.hs b/symbolic-base/src/ZkFold/Base/Algebra/Polynomials/Multivariate.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Algebra/Polynomials/Multivariate.hs rename to symbolic-base/src/ZkFold/Base/Algebra/Polynomials/Multivariate.hs diff --git a/zkfold-base/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Groebner.hs b/symbolic-base/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Groebner.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Groebner.hs rename to symbolic-base/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Groebner.hs diff --git a/zkfold-base/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Monomial.hs b/symbolic-base/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Monomial.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Monomial.hs rename to symbolic-base/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Monomial.hs diff --git a/zkfold-base/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Polynomial.hs b/symbolic-base/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Polynomial.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Polynomial.hs rename to symbolic-base/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Polynomial.hs diff --git a/zkfold-base/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Substitution.hs b/symbolic-base/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Substitution.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Substitution.hs rename to symbolic-base/src/ZkFold/Base/Algebra/Polynomials/Multivariate/Substitution.hs diff --git a/zkfold-base/src/ZkFold/Base/Algebra/Polynomials/Univariate.hs b/symbolic-base/src/ZkFold/Base/Algebra/Polynomials/Univariate.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Algebra/Polynomials/Univariate.hs rename to symbolic-base/src/ZkFold/Base/Algebra/Polynomials/Univariate.hs diff --git a/zkfold-base/src/ZkFold/Base/Control/HApplicative.hs b/symbolic-base/src/ZkFold/Base/Control/HApplicative.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Control/HApplicative.hs rename to symbolic-base/src/ZkFold/Base/Control/HApplicative.hs diff --git a/zkfold-base/src/ZkFold/Base/Data/ByteString.hs b/symbolic-base/src/ZkFold/Base/Data/ByteString.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Data/ByteString.hs rename to symbolic-base/src/ZkFold/Base/Data/ByteString.hs diff --git a/zkfold-base/src/ZkFold/Base/Data/HFunctor.hs b/symbolic-base/src/ZkFold/Base/Data/HFunctor.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Data/HFunctor.hs rename to symbolic-base/src/ZkFold/Base/Data/HFunctor.hs diff --git a/zkfold-base/src/ZkFold/Base/Data/Matrix.hs b/symbolic-base/src/ZkFold/Base/Data/Matrix.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Data/Matrix.hs rename to symbolic-base/src/ZkFold/Base/Data/Matrix.hs diff --git a/zkfold-base/src/ZkFold/Base/Data/Package.hs b/symbolic-base/src/ZkFold/Base/Data/Package.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Data/Package.hs rename to symbolic-base/src/ZkFold/Base/Data/Package.hs diff --git a/zkfold-base/src/ZkFold/Base/Data/Par1.hs b/symbolic-base/src/ZkFold/Base/Data/Par1.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Data/Par1.hs rename to symbolic-base/src/ZkFold/Base/Data/Par1.hs diff --git a/zkfold-base/src/ZkFold/Base/Data/Product.hs b/symbolic-base/src/ZkFold/Base/Data/Product.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Data/Product.hs rename to symbolic-base/src/ZkFold/Base/Data/Product.hs diff --git a/zkfold-base/src/ZkFold/Base/Data/Sparse/Matrix.hs b/symbolic-base/src/ZkFold/Base/Data/Sparse/Matrix.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Data/Sparse/Matrix.hs rename to symbolic-base/src/ZkFold/Base/Data/Sparse/Matrix.hs diff --git a/zkfold-base/src/ZkFold/Base/Data/Sparse/Vector.hs b/symbolic-base/src/ZkFold/Base/Data/Sparse/Vector.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Data/Sparse/Vector.hs rename to symbolic-base/src/ZkFold/Base/Data/Sparse/Vector.hs diff --git a/zkfold-base/src/ZkFold/Base/Data/Type.hs b/symbolic-base/src/ZkFold/Base/Data/Type.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Data/Type.hs rename to symbolic-base/src/ZkFold/Base/Data/Type.hs diff --git a/zkfold-base/src/ZkFold/Base/Data/Vector.hs b/symbolic-base/src/ZkFold/Base/Data/Vector.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Data/Vector.hs rename to symbolic-base/src/ZkFold/Base/Data/Vector.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/KZG.hs b/symbolic-base/src/ZkFold/Base/Protocol/KZG.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/KZG.hs rename to symbolic-base/src/ZkFold/Base/Protocol/KZG.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/NonInteractiveProof.hs b/symbolic-base/src/ZkFold/Base/Protocol/NonInteractiveProof.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/NonInteractiveProof.hs rename to symbolic-base/src/ZkFold/Base/Protocol/NonInteractiveProof.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/NonInteractiveProof/Internal.hs b/symbolic-base/src/ZkFold/Base/Protocol/NonInteractiveProof/Internal.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/NonInteractiveProof/Internal.hs rename to symbolic-base/src/ZkFold/Base/Protocol/NonInteractiveProof/Internal.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/NonInteractiveProof/Prover.hs b/symbolic-base/src/ZkFold/Base/Protocol/NonInteractiveProof/Prover.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/NonInteractiveProof/Prover.hs rename to symbolic-base/src/ZkFold/Base/Protocol/NonInteractiveProof/Prover.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/NonInteractiveProof/Testing.hs b/symbolic-base/src/ZkFold/Base/Protocol/NonInteractiveProof/Testing.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/NonInteractiveProof/Testing.hs rename to symbolic-base/src/ZkFold/Base/Protocol/NonInteractiveProof/Testing.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Plonk.hs b/symbolic-base/src/ZkFold/Base/Protocol/Plonk.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Plonk.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Plonk.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Plonk/Prover.hs b/symbolic-base/src/ZkFold/Base/Protocol/Plonk/Prover.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Plonk/Prover.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Plonk/Prover.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Plonk/Verifier.hs b/symbolic-base/src/ZkFold/Base/Protocol/Plonk/Verifier.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Plonk/Verifier.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Plonk/Verifier.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Plonkup.hs b/symbolic-base/src/ZkFold/Base/Protocol/Plonkup.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Plonkup.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Plonkup.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Input.hs b/symbolic-base/src/ZkFold/Base/Protocol/Plonkup/Input.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Input.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Plonkup/Input.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Internal.hs b/symbolic-base/src/ZkFold/Base/Protocol/Plonkup/Internal.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Internal.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Plonkup/Internal.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/LookupConstraint.hs b/symbolic-base/src/ZkFold/Base/Protocol/Plonkup/LookupConstraint.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Plonkup/LookupConstraint.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Plonkup/LookupConstraint.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/PlonkConstraint.hs b/symbolic-base/src/ZkFold/Base/Protocol/Plonkup/PlonkConstraint.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Plonkup/PlonkConstraint.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Plonkup/PlonkConstraint.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/PlonkupConstraint.hs b/symbolic-base/src/ZkFold/Base/Protocol/Plonkup/PlonkupConstraint.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Plonkup/PlonkupConstraint.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Plonkup/PlonkupConstraint.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Proof.hs b/symbolic-base/src/ZkFold/Base/Protocol/Plonkup/Proof.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Proof.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Plonkup/Proof.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Prover.hs b/symbolic-base/src/ZkFold/Base/Protocol/Plonkup/Prover.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Prover.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Plonkup/Prover.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Prover/Polynomials.hs b/symbolic-base/src/ZkFold/Base/Protocol/Plonkup/Prover/Polynomials.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Prover/Polynomials.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Plonkup/Prover/Polynomials.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Prover/Secret.hs b/symbolic-base/src/ZkFold/Base/Protocol/Plonkup/Prover/Secret.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Prover/Secret.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Plonkup/Prover/Secret.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Prover/Setup.hs b/symbolic-base/src/ZkFold/Base/Protocol/Plonkup/Prover/Setup.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Prover/Setup.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Plonkup/Prover/Setup.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Relation.hs b/symbolic-base/src/ZkFold/Base/Protocol/Plonkup/Relation.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Relation.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Plonkup/Relation.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Setup.hs b/symbolic-base/src/ZkFold/Base/Protocol/Plonkup/Setup.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Setup.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Plonkup/Setup.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Testing.hs b/symbolic-base/src/ZkFold/Base/Protocol/Plonkup/Testing.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Testing.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Plonkup/Testing.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Utils.hs b/symbolic-base/src/ZkFold/Base/Protocol/Plonkup/Utils.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Utils.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Plonkup/Utils.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Verifier.hs b/symbolic-base/src/ZkFold/Base/Protocol/Plonkup/Verifier.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Verifier.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Plonkup/Verifier.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Verifier/Commitments.hs b/symbolic-base/src/ZkFold/Base/Protocol/Plonkup/Verifier/Commitments.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Verifier/Commitments.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Plonkup/Verifier/Commitments.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Verifier/Setup.hs b/symbolic-base/src/ZkFold/Base/Protocol/Plonkup/Verifier/Setup.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Verifier/Setup.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Plonkup/Verifier/Setup.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Witness.hs b/symbolic-base/src/ZkFold/Base/Protocol/Plonkup/Witness.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Plonkup/Witness.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Plonkup/Witness.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Protostar.hs b/symbolic-base/src/ZkFold/Base/Protocol/Protostar.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Protostar.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Protostar.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Protostar/Accumulator.hs b/symbolic-base/src/ZkFold/Base/Protocol/Protostar/Accumulator.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Protostar/Accumulator.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Protostar/Accumulator.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Protostar/AccumulatorScheme.hs b/symbolic-base/src/ZkFold/Base/Protocol/Protostar/AccumulatorScheme.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Protostar/AccumulatorScheme.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Protostar/AccumulatorScheme.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Protostar/ArithmeticCircuit.hs b/symbolic-base/src/ZkFold/Base/Protocol/Protostar/ArithmeticCircuit.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Protostar/ArithmeticCircuit.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Protostar/ArithmeticCircuit.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Protostar/Commit.hs b/symbolic-base/src/ZkFold/Base/Protocol/Protostar/Commit.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Protostar/Commit.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Protostar/Commit.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Protostar/CommitOpen.hs b/symbolic-base/src/ZkFold/Base/Protocol/Protostar/CommitOpen.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Protostar/CommitOpen.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Protostar/CommitOpen.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Protostar/FiatShamir.hs b/symbolic-base/src/ZkFold/Base/Protocol/Protostar/FiatShamir.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Protostar/FiatShamir.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Protostar/FiatShamir.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Protostar/Fold.hs b/symbolic-base/src/ZkFold/Base/Protocol/Protostar/Fold.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Protostar/Fold.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Protostar/Fold.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Protostar/Gate.hs b/symbolic-base/src/ZkFold/Base/Protocol/Protostar/Gate.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Protostar/Gate.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Protostar/Gate.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Protostar/Internal.hs b/symbolic-base/src/ZkFold/Base/Protocol/Protostar/Internal.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Protostar/Internal.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Protostar/Internal.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Protostar/Lookup.hs b/symbolic-base/src/ZkFold/Base/Protocol/Protostar/Lookup.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Protostar/Lookup.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Protostar/Lookup.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Protostar/Oracle.hs b/symbolic-base/src/ZkFold/Base/Protocol/Protostar/Oracle.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Protostar/Oracle.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Protostar/Oracle.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Protostar/Permutation.hs b/symbolic-base/src/ZkFold/Base/Protocol/Protostar/Permutation.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Protostar/Permutation.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Protostar/Permutation.hs diff --git a/zkfold-base/src/ZkFold/Base/Protocol/Protostar/SpecialSound.hs b/symbolic-base/src/ZkFold/Base/Protocol/Protostar/SpecialSound.hs similarity index 100% rename from zkfold-base/src/ZkFold/Base/Protocol/Protostar/SpecialSound.hs rename to symbolic-base/src/ZkFold/Base/Protocol/Protostar/SpecialSound.hs diff --git a/zkfold-base/src/ZkFold/Prelude.hs b/symbolic-base/src/ZkFold/Prelude.hs similarity index 100% rename from zkfold-base/src/ZkFold/Prelude.hs rename to symbolic-base/src/ZkFold/Prelude.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Algorithms/Hash/Blake2b.hs b/symbolic-base/src/ZkFold/Symbolic/Algorithms/Hash/Blake2b.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Algorithms/Hash/Blake2b.hs rename to symbolic-base/src/ZkFold/Symbolic/Algorithms/Hash/Blake2b.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Algorithms/Hash/Blake2b/Constants.hs b/symbolic-base/src/ZkFold/Symbolic/Algorithms/Hash/Blake2b/Constants.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Algorithms/Hash/Blake2b/Constants.hs rename to symbolic-base/src/ZkFold/Symbolic/Algorithms/Hash/Blake2b/Constants.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Algorithms/Hash/MiMC.hs b/symbolic-base/src/ZkFold/Symbolic/Algorithms/Hash/MiMC.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Algorithms/Hash/MiMC.hs rename to symbolic-base/src/ZkFold/Symbolic/Algorithms/Hash/MiMC.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Algorithms/Hash/MiMC/Constants.hs b/symbolic-base/src/ZkFold/Symbolic/Algorithms/Hash/MiMC/Constants.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Algorithms/Hash/MiMC/Constants.hs rename to symbolic-base/src/ZkFold/Symbolic/Algorithms/Hash/MiMC/Constants.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Algorithms/Hash/SHA2.hs b/symbolic-base/src/ZkFold/Symbolic/Algorithms/Hash/SHA2.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Algorithms/Hash/SHA2.hs rename to symbolic-base/src/ZkFold/Symbolic/Algorithms/Hash/SHA2.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Algorithms/Hash/SHA2/Constants.hs b/symbolic-base/src/ZkFold/Symbolic/Algorithms/Hash/SHA2/Constants.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Algorithms/Hash/SHA2/Constants.hs rename to symbolic-base/src/ZkFold/Symbolic/Algorithms/Hash/SHA2/Constants.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Class.hs b/symbolic-base/src/ZkFold/Symbolic/Class.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Class.hs rename to symbolic-base/src/ZkFold/Symbolic/Class.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Compiler.hs b/symbolic-base/src/ZkFold/Symbolic/Compiler.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Compiler.hs rename to symbolic-base/src/ZkFold/Symbolic/Compiler.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit.hs b/symbolic-base/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit.hs rename to symbolic-base/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/Instance.hs b/symbolic-base/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/Instance.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/Instance.hs rename to symbolic-base/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/Instance.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/Internal.hs b/symbolic-base/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/Internal.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/Internal.hs rename to symbolic-base/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/Internal.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/Map.hs b/symbolic-base/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/Map.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/Map.hs rename to symbolic-base/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/Map.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/MerkleHash.hs b/symbolic-base/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/MerkleHash.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/MerkleHash.hs rename to symbolic-base/src/ZkFold/Symbolic/Compiler/ArithmeticCircuit/MerkleHash.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Data/Bool.hs b/symbolic-base/src/ZkFold/Symbolic/Data/Bool.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Data/Bool.hs rename to symbolic-base/src/ZkFold/Symbolic/Data/Bool.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Data/ByteString.hs b/symbolic-base/src/ZkFold/Symbolic/Data/ByteString.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Data/ByteString.hs rename to symbolic-base/src/ZkFold/Symbolic/Data/ByteString.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Data/Class.hs b/symbolic-base/src/ZkFold/Symbolic/Data/Class.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Data/Class.hs rename to symbolic-base/src/ZkFold/Symbolic/Data/Class.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Data/Combinators.hs b/symbolic-base/src/ZkFold/Symbolic/Data/Combinators.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Data/Combinators.hs rename to symbolic-base/src/ZkFold/Symbolic/Data/Combinators.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Data/Conditional.hs b/symbolic-base/src/ZkFold/Symbolic/Data/Conditional.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Data/Conditional.hs rename to symbolic-base/src/ZkFold/Symbolic/Data/Conditional.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Data/DiscreteField.hs b/symbolic-base/src/ZkFold/Symbolic/Data/DiscreteField.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Data/DiscreteField.hs rename to symbolic-base/src/ZkFold/Symbolic/Data/DiscreteField.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Data/Ed25519.hs b/symbolic-base/src/ZkFold/Symbolic/Data/Ed25519.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Data/Ed25519.hs rename to symbolic-base/src/ZkFold/Symbolic/Data/Ed25519.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Data/Eq.hs b/symbolic-base/src/ZkFold/Symbolic/Data/Eq.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Data/Eq.hs rename to symbolic-base/src/ZkFold/Symbolic/Data/Eq.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Data/Eq/Structural.hs b/symbolic-base/src/ZkFold/Symbolic/Data/Eq/Structural.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Data/Eq/Structural.hs rename to symbolic-base/src/ZkFold/Symbolic/Data/Eq/Structural.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Data/FFA.hs b/symbolic-base/src/ZkFold/Symbolic/Data/FFA.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Data/FFA.hs rename to symbolic-base/src/ZkFold/Symbolic/Data/FFA.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Data/FieldElement.hs b/symbolic-base/src/ZkFold/Symbolic/Data/FieldElement.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Data/FieldElement.hs rename to symbolic-base/src/ZkFold/Symbolic/Data/FieldElement.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Data/List.hs b/symbolic-base/src/ZkFold/Symbolic/Data/List.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Data/List.hs rename to symbolic-base/src/ZkFold/Symbolic/Data/List.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Data/Maybe.hs b/symbolic-base/src/ZkFold/Symbolic/Data/Maybe.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Data/Maybe.hs rename to symbolic-base/src/ZkFold/Symbolic/Data/Maybe.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Data/Ord.hs b/symbolic-base/src/ZkFold/Symbolic/Data/Ord.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Data/Ord.hs rename to symbolic-base/src/ZkFold/Symbolic/Data/Ord.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Data/UInt.hs b/symbolic-base/src/ZkFold/Symbolic/Data/UInt.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Data/UInt.hs rename to symbolic-base/src/ZkFold/Symbolic/Data/UInt.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Data/UTCTime.hs b/symbolic-base/src/ZkFold/Symbolic/Data/UTCTime.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Data/UTCTime.hs rename to symbolic-base/src/ZkFold/Symbolic/Data/UTCTime.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Interpreter.hs b/symbolic-base/src/ZkFold/Symbolic/Interpreter.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Interpreter.hs rename to symbolic-base/src/ZkFold/Symbolic/Interpreter.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Ledger/Types.hs b/symbolic-base/src/ZkFold/Symbolic/Ledger/Types.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Ledger/Types.hs rename to symbolic-base/src/ZkFold/Symbolic/Ledger/Types.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Address.hs b/symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Address.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Address.hs rename to symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Address.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Basic.hs b/symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Basic.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Basic.hs rename to symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Basic.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Bridge.hs b/symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Bridge.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Bridge.hs rename to symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Bridge.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Contract.hs b/symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Contract.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Contract.hs rename to symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Contract.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Hash.hs b/symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Hash.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Hash.hs rename to symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Hash.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Input.hs b/symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Input.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Input.hs rename to symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Input.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Output.hs b/symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Output.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Output.hs rename to symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Output.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Ledger/Types/OutputRef.hs b/symbolic-base/src/ZkFold/Symbolic/Ledger/Types/OutputRef.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Ledger/Types/OutputRef.hs rename to symbolic-base/src/ZkFold/Symbolic/Ledger/Types/OutputRef.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Transaction.hs b/symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Transaction.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Transaction.hs rename to symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Transaction.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Update.hs b/symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Update.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Update.hs rename to symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Update.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Value.hs b/symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Value.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Ledger/Types/Value.hs rename to symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Value.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Ledger/Validation/Bridge.hs b/symbolic-base/src/ZkFold/Symbolic/Ledger/Validation/Bridge.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Ledger/Validation/Bridge.hs rename to symbolic-base/src/ZkFold/Symbolic/Ledger/Validation/Bridge.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Ledger/Validation/Common.hs b/symbolic-base/src/ZkFold/Symbolic/Ledger/Validation/Common.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Ledger/Validation/Common.hs rename to symbolic-base/src/ZkFold/Symbolic/Ledger/Validation/Common.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Ledger/Validation/Contract.hs b/symbolic-base/src/ZkFold/Symbolic/Ledger/Validation/Contract.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Ledger/Validation/Contract.hs rename to symbolic-base/src/ZkFold/Symbolic/Ledger/Validation/Contract.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Ledger/Validation/PrivateInput.hs b/symbolic-base/src/ZkFold/Symbolic/Ledger/Validation/PrivateInput.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Ledger/Validation/PrivateInput.hs rename to symbolic-base/src/ZkFold/Symbolic/Ledger/Validation/PrivateInput.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Ledger/Validation/PublicInput.hs b/symbolic-base/src/ZkFold/Symbolic/Ledger/Validation/PublicInput.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Ledger/Validation/PublicInput.hs rename to symbolic-base/src/ZkFold/Symbolic/Ledger/Validation/PublicInput.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Ledger/Validation/Transaction.hs b/symbolic-base/src/ZkFold/Symbolic/Ledger/Validation/Transaction.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Ledger/Validation/Transaction.hs rename to symbolic-base/src/ZkFold/Symbolic/Ledger/Validation/Transaction.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Ledger/Validation/Update.hs b/symbolic-base/src/ZkFold/Symbolic/Ledger/Validation/Update.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Ledger/Validation/Update.hs rename to symbolic-base/src/ZkFold/Symbolic/Ledger/Validation/Update.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/MonadCircuit.hs b/symbolic-base/src/ZkFold/Symbolic/MonadCircuit.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/MonadCircuit.hs rename to symbolic-base/src/ZkFold/Symbolic/MonadCircuit.hs diff --git a/zkfold-base/stats/ByteString.Add.512 b/symbolic-base/stats/ByteString.Add.512 similarity index 100% rename from zkfold-base/stats/ByteString.Add.512 rename to symbolic-base/stats/ByteString.Add.512 diff --git a/zkfold-base/stats/ByteString.And.32 b/symbolic-base/stats/ByteString.And.32 similarity index 100% rename from zkfold-base/stats/ByteString.And.32 rename to symbolic-base/stats/ByteString.And.32 diff --git a/zkfold-base/stats/ByteString.Extend.1.512 b/symbolic-base/stats/ByteString.Extend.1.512 similarity index 100% rename from zkfold-base/stats/ByteString.Extend.1.512 rename to symbolic-base/stats/ByteString.Extend.1.512 diff --git a/zkfold-base/stats/ByteString.Or.64 b/symbolic-base/stats/ByteString.Or.64 similarity index 100% rename from zkfold-base/stats/ByteString.Or.64 rename to symbolic-base/stats/ByteString.Or.64 diff --git a/zkfold-base/stats/Conditional b/symbolic-base/stats/Conditional similarity index 100% rename from zkfold-base/stats/Conditional rename to symbolic-base/stats/Conditional diff --git a/zkfold-base/stats/Constant.5 b/symbolic-base/stats/Constant.5 similarity index 100% rename from zkfold-base/stats/Constant.5 rename to symbolic-base/stats/Constant.5 diff --git a/zkfold-base/stats/Eq b/symbolic-base/stats/Eq similarity index 100% rename from zkfold-base/stats/Eq rename to symbolic-base/stats/Eq diff --git a/zkfold-base/stats/Eq.Constant.5 b/symbolic-base/stats/Eq.Constant.5 similarity index 100% rename from zkfold-base/stats/Eq.Constant.5 rename to symbolic-base/stats/Eq.Constant.5 diff --git a/zkfold-base/stats/FFA.Add.097 b/symbolic-base/stats/FFA.Add.097 similarity index 100% rename from zkfold-base/stats/FFA.Add.097 rename to symbolic-base/stats/FFA.Add.097 diff --git a/zkfold-base/stats/FFA.Add.337 b/symbolic-base/stats/FFA.Add.337 similarity index 100% rename from zkfold-base/stats/FFA.Add.337 rename to symbolic-base/stats/FFA.Add.337 diff --git a/zkfold-base/stats/FFA.Mul.097 b/symbolic-base/stats/FFA.Mul.097 similarity index 100% rename from zkfold-base/stats/FFA.Mul.097 rename to symbolic-base/stats/FFA.Mul.097 diff --git a/zkfold-base/stats/FFA.Mul.337 b/symbolic-base/stats/FFA.Mul.337 similarity index 100% rename from zkfold-base/stats/FFA.Mul.337 rename to symbolic-base/stats/FFA.Mul.337 diff --git a/zkfold-base/stats/Fibonacci.100 b/symbolic-base/stats/Fibonacci.100 similarity index 100% rename from zkfold-base/stats/Fibonacci.100 rename to symbolic-base/stats/Fibonacci.100 diff --git a/zkfold-base/stats/LEQ b/symbolic-base/stats/LEQ similarity index 100% rename from zkfold-base/stats/LEQ rename to symbolic-base/stats/LEQ diff --git a/zkfold-base/stats/MiMCHash b/symbolic-base/stats/MiMCHash similarity index 100% rename from zkfold-base/stats/MiMCHash rename to symbolic-base/stats/MiMCHash diff --git a/zkfold-base/stats/Reverse.32.3000 b/symbolic-base/stats/Reverse.32.3000 similarity index 100% rename from zkfold-base/stats/Reverse.32.3000 rename to symbolic-base/stats/Reverse.32.3000 diff --git a/zkfold-base/stats/SHA256.32 b/symbolic-base/stats/SHA256.32 similarity index 100% rename from zkfold-base/stats/SHA256.32 rename to symbolic-base/stats/SHA256.32 diff --git a/zkfold-base/stats/UInt.DivMod.32.Auto b/symbolic-base/stats/UInt.DivMod.32.Auto similarity index 100% rename from zkfold-base/stats/UInt.DivMod.32.Auto rename to symbolic-base/stats/UInt.DivMod.32.Auto diff --git a/zkfold-base/stats/UInt.Mul.64.Auto b/symbolic-base/stats/UInt.Mul.64.Auto similarity index 100% rename from zkfold-base/stats/UInt.Mul.64.Auto rename to symbolic-base/stats/UInt.Mul.64.Auto diff --git a/zkfold-base/stats/UInt.StrictAdd.256.Auto b/symbolic-base/stats/UInt.StrictAdd.256.Auto similarity index 100% rename from zkfold-base/stats/UInt.StrictAdd.256.Auto rename to symbolic-base/stats/UInt.StrictAdd.256.Auto diff --git a/zkfold-base/stats/UInt.StrictMul.512.Auto b/symbolic-base/stats/UInt.StrictMul.512.Auto similarity index 100% rename from zkfold-base/stats/UInt.StrictMul.512.Auto rename to symbolic-base/stats/UInt.StrictMul.512.Auto diff --git a/zkfold-base/zkfold-base.cabal b/symbolic-base/symbolic-base.cabal similarity index 84% rename from zkfold-base/zkfold-base.cabal rename to symbolic-base/symbolic-base.cabal index a6d3489a9..287433213 100644 --- a/zkfold-base/zkfold-base.cabal +++ b/symbolic-base/symbolic-base.cabal @@ -1,12 +1,12 @@ cabal-version: 3.0 -name: zkfold-base +name: symbolic-base version: 0.1.0.0 tested-with: GHC ==9.6.4 synopsis: ZkFold Symbolic compiler and zero-knowledge proof protocols homepage: https://zkfold.io/ category: Cryptography, DSL, Math, Symbolic Computation -author: Vladimir Sinyakov, Pavel Sokolov, Murat Kasimov, Vladimir Morozov, Eitan Chatav, Ilya Baryshnikov +author: Vladimir Sinyakov, Pavel Sokolov, Vladimir Morozov, Eitan Chatav, Ilya Baryshnikov, Anna Hovanskaya, Evgenii Samodelov, Murat Kasimov, Maxim Churilov maintainer: vlasin@zkfold.io license: MIT license-file: LICENSE @@ -16,7 +16,7 @@ Data-Files: description: This package contains the base library for the ZkFold project. It includes zkFold Symbolic compiler and a number of zero knowledge proof protocols. - The compiler translates a subset of Haskell into arithmetic circuits, which can be used to generate zero knowledge proofs. + The compiler translates code written using the zkFold Symbolic framework into arithmetic circuits. The zero knowledge proof protocols are used to verify statements about the circuits. Flag Pedantic Description: Enable pedantic build with -Werror @@ -166,24 +166,6 @@ library ZkFold.Symbolic.Algorithms.Hash.MiMC.Constants ZkFold.Symbolic.Algorithms.Hash.SHA2 ZkFold.Symbolic.Algorithms.Hash.SHA2.Constants - ZkFold.Symbolic.Cardano.Wrapper - ZkFold.Symbolic.Cardano.Contracts.BatchTransfer - ZkFold.Symbolic.Cardano.Contracts.RandomOracle - ZkFold.Symbolic.Cardano.Types - ZkFold.Symbolic.Cardano.Types.Address - ZkFold.Symbolic.Cardano.Types.Basic - ZkFold.Symbolic.Cardano.Types.Input - ZkFold.Symbolic.Cardano.Types.Output - ZkFold.Symbolic.Cardano.Types.Output.Datum - ZkFold.Symbolic.Cardano.Types.OutputRef - ZkFold.Symbolic.Cardano.Types.Transaction - ZkFold.Symbolic.Cardano.Types.Value - ZkFold.Symbolic.Cardano.UPLC - ZkFold.Symbolic.Cardano.UPLC.Builtins - ZkFold.Symbolic.Cardano.UPLC.Inference - ZkFold.Symbolic.Cardano.UPLC.Inference.Internal - ZkFold.Symbolic.Cardano.UPLC.Term - ZkFold.Symbolic.Cardano.UPLC.Type ZkFold.Symbolic.Class ZkFold.Symbolic.Compiler ZkFold.Symbolic.Compiler.ArithmeticCircuit @@ -262,30 +244,7 @@ library vector-split < 1.1, hs-source-dirs: src -library zkfold-symbolic-examples - import: options - exposed-modules: - ZkFold.Symbolic.Examples - other-modules: - Examples.BatchTransfer - Examples.ByteString - Examples.Conditional - Examples.Constant - Examples.Eq - Examples.FFA - Examples.Fibonacci - Examples.LEQ - Examples.MiMCHash - Examples.ReverseList - Examples.UInt - build-depends: - base, - containers, - deepseq, - zkfold-base, - hs-source-dirs: examples - -test-suite zkfold-base-test +test-suite symbolic-base-test import: options-exe type: exitcode-stdio-1.0 ghc-options: @@ -330,9 +289,9 @@ test-suite zkfold-base-test QuickCheck , regex-tdfa <= 1.3.2.2, split < 0.2.6, + symbolic-base , vector , vector-algorithms , - zkfold-base , hs-source-dirs: test benchmark bench-poly-mul @@ -347,26 +306,6 @@ benchmark bench-poly-mul array, deepseq, random, + symbolic-base, tasty-bench, vector, - zkfold-base - -benchmark bench-compiler - import: options-exe - main-is: BenchCompiler.hs - hs-source-dirs: bench - type: exitcode-stdio-1.0 - ghc-options: - -fprof-auto - -fprof-cafs - -O3 - build-depends: - adjunctions, - base, - bytestring, - containers, - deepseq, - tasty-bench, - tasty-golden, - zkfold-base, - zkfold-symbolic-examples diff --git a/zkfold-base/test/Main.hs b/symbolic-base/test/Main.hs similarity index 100% rename from zkfold-base/test/Main.hs rename to symbolic-base/test/Main.hs diff --git a/zkfold-base/test/Tests/ArithmeticCircuit.hs b/symbolic-base/test/Tests/ArithmeticCircuit.hs similarity index 100% rename from zkfold-base/test/Tests/ArithmeticCircuit.hs rename to symbolic-base/test/Tests/ArithmeticCircuit.hs diff --git a/zkfold-base/test/Tests/Arithmetization.hs b/symbolic-base/test/Tests/Arithmetization.hs similarity index 100% rename from zkfold-base/test/Tests/Arithmetization.hs rename to symbolic-base/test/Tests/Arithmetization.hs diff --git a/zkfold-base/test/Tests/Arithmetization/Test1.hs b/symbolic-base/test/Tests/Arithmetization/Test1.hs similarity index 100% rename from zkfold-base/test/Tests/Arithmetization/Test1.hs rename to symbolic-base/test/Tests/Arithmetization/Test1.hs diff --git a/zkfold-base/test/Tests/Arithmetization/Test2.hs b/symbolic-base/test/Tests/Arithmetization/Test2.hs similarity index 100% rename from zkfold-base/test/Tests/Arithmetization/Test2.hs rename to symbolic-base/test/Tests/Arithmetization/Test2.hs diff --git a/zkfold-base/test/Tests/Arithmetization/Test3.hs b/symbolic-base/test/Tests/Arithmetization/Test3.hs similarity index 100% rename from zkfold-base/test/Tests/Arithmetization/Test3.hs rename to symbolic-base/test/Tests/Arithmetization/Test3.hs diff --git a/zkfold-base/test/Tests/Arithmetization/Test4.hs b/symbolic-base/test/Tests/Arithmetization/Test4.hs similarity index 100% rename from zkfold-base/test/Tests/Arithmetization/Test4.hs rename to symbolic-base/test/Tests/Arithmetization/Test4.hs diff --git a/zkfold-base/test/Tests/Binary.hs b/symbolic-base/test/Tests/Binary.hs similarity index 100% rename from zkfold-base/test/Tests/Binary.hs rename to symbolic-base/test/Tests/Binary.hs diff --git a/zkfold-base/test/Tests/Blake2b.hs b/symbolic-base/test/Tests/Blake2b.hs similarity index 100% rename from zkfold-base/test/Tests/Blake2b.hs rename to symbolic-base/test/Tests/Blake2b.hs diff --git a/zkfold-base/test/Tests/ByteString.hs b/symbolic-base/test/Tests/ByteString.hs similarity index 100% rename from zkfold-base/test/Tests/ByteString.hs rename to symbolic-base/test/Tests/ByteString.hs diff --git a/zkfold-base/test/Tests/FFA.hs b/symbolic-base/test/Tests/FFA.hs similarity index 100% rename from zkfold-base/test/Tests/FFA.hs rename to symbolic-base/test/Tests/FFA.hs diff --git a/zkfold-base/test/Tests/Field.hs b/symbolic-base/test/Tests/Field.hs similarity index 100% rename from zkfold-base/test/Tests/Field.hs rename to symbolic-base/test/Tests/Field.hs diff --git a/zkfold-base/test/Tests/GroebnerBasis.hs b/symbolic-base/test/Tests/GroebnerBasis.hs similarity index 100% rename from zkfold-base/test/Tests/GroebnerBasis.hs rename to symbolic-base/test/Tests/GroebnerBasis.hs diff --git a/zkfold-base/test/Tests/Group.hs b/symbolic-base/test/Tests/Group.hs similarity index 100% rename from zkfold-base/test/Tests/Group.hs rename to symbolic-base/test/Tests/Group.hs diff --git a/zkfold-base/test/Tests/NonInteractiveProof.hs b/symbolic-base/test/Tests/NonInteractiveProof.hs similarity index 100% rename from zkfold-base/test/Tests/NonInteractiveProof.hs rename to symbolic-base/test/Tests/NonInteractiveProof.hs diff --git a/zkfold-base/test/Tests/Pairing.hs b/symbolic-base/test/Tests/Pairing.hs similarity index 100% rename from zkfold-base/test/Tests/Pairing.hs rename to symbolic-base/test/Tests/Pairing.hs diff --git a/zkfold-base/test/Tests/Permutations.hs b/symbolic-base/test/Tests/Permutations.hs similarity index 100% rename from zkfold-base/test/Tests/Permutations.hs rename to symbolic-base/test/Tests/Permutations.hs diff --git a/zkfold-base/test/Tests/Plonkup.hs b/symbolic-base/test/Tests/Plonkup.hs similarity index 100% rename from zkfold-base/test/Tests/Plonkup.hs rename to symbolic-base/test/Tests/Plonkup.hs diff --git a/zkfold-base/test/Tests/Protostar.hs b/symbolic-base/test/Tests/Protostar.hs similarity index 100% rename from zkfold-base/test/Tests/Protostar.hs rename to symbolic-base/test/Tests/Protostar.hs diff --git a/zkfold-base/test/Tests/SHA2.hs b/symbolic-base/test/Tests/SHA2.hs similarity index 100% rename from zkfold-base/test/Tests/SHA2.hs rename to symbolic-base/test/Tests/SHA2.hs diff --git a/zkfold-base/test/Tests/UInt.hs b/symbolic-base/test/Tests/UInt.hs similarity index 100% rename from zkfold-base/test/Tests/UInt.hs rename to symbolic-base/test/Tests/UInt.hs diff --git a/zkfold-base/test/Tests/Univariate.hs b/symbolic-base/test/Tests/Univariate.hs similarity index 100% rename from zkfold-base/test/Tests/Univariate.hs rename to symbolic-base/test/Tests/Univariate.hs diff --git a/zkfold-base/test/Tests/Univariate/Poly.hs b/symbolic-base/test/Tests/Univariate/Poly.hs similarity index 100% rename from zkfold-base/test/Tests/Univariate/Poly.hs rename to symbolic-base/test/Tests/Univariate/Poly.hs diff --git a/zkfold-base/test/Tests/Univariate/PolyVec.hs b/symbolic-base/test/Tests/Univariate/PolyVec.hs similarity index 100% rename from zkfold-base/test/Tests/Univariate/PolyVec.hs rename to symbolic-base/test/Tests/Univariate/PolyVec.hs diff --git a/zkfold-base/test/data/shabittestvectors/SHA224LongMsg.rsp b/symbolic-base/test/data/shabittestvectors/SHA224LongMsg.rsp similarity index 100% rename from zkfold-base/test/data/shabittestvectors/SHA224LongMsg.rsp rename to symbolic-base/test/data/shabittestvectors/SHA224LongMsg.rsp diff --git a/zkfold-base/test/data/shabittestvectors/SHA224ShortMsg.rsp b/symbolic-base/test/data/shabittestvectors/SHA224ShortMsg.rsp similarity index 100% rename from zkfold-base/test/data/shabittestvectors/SHA224ShortMsg.rsp rename to symbolic-base/test/data/shabittestvectors/SHA224ShortMsg.rsp diff --git a/zkfold-base/test/data/shabittestvectors/SHA256LongMsg.rsp b/symbolic-base/test/data/shabittestvectors/SHA256LongMsg.rsp similarity index 100% rename from zkfold-base/test/data/shabittestvectors/SHA256LongMsg.rsp rename to symbolic-base/test/data/shabittestvectors/SHA256LongMsg.rsp diff --git a/zkfold-base/test/data/shabittestvectors/SHA256ShortMsg.rsp b/symbolic-base/test/data/shabittestvectors/SHA256ShortMsg.rsp similarity index 100% rename from zkfold-base/test/data/shabittestvectors/SHA256ShortMsg.rsp rename to symbolic-base/test/data/shabittestvectors/SHA256ShortMsg.rsp diff --git a/zkfold-base/test/data/shabittestvectors/SHA384LongMsg.rsp b/symbolic-base/test/data/shabittestvectors/SHA384LongMsg.rsp similarity index 100% rename from zkfold-base/test/data/shabittestvectors/SHA384LongMsg.rsp rename to symbolic-base/test/data/shabittestvectors/SHA384LongMsg.rsp diff --git a/zkfold-base/test/data/shabittestvectors/SHA384ShortMsg.rsp b/symbolic-base/test/data/shabittestvectors/SHA384ShortMsg.rsp similarity index 100% rename from zkfold-base/test/data/shabittestvectors/SHA384ShortMsg.rsp rename to symbolic-base/test/data/shabittestvectors/SHA384ShortMsg.rsp diff --git a/zkfold-base/test/data/shabittestvectors/SHA512LongMsg.rsp b/symbolic-base/test/data/shabittestvectors/SHA512LongMsg.rsp similarity index 100% rename from zkfold-base/test/data/shabittestvectors/SHA512LongMsg.rsp rename to symbolic-base/test/data/shabittestvectors/SHA512LongMsg.rsp diff --git a/zkfold-base/test/data/shabittestvectors/SHA512ShortMsg.rsp b/symbolic-base/test/data/shabittestvectors/SHA512ShortMsg.rsp similarity index 100% rename from zkfold-base/test/data/shabittestvectors/SHA512ShortMsg.rsp rename to symbolic-base/test/data/shabittestvectors/SHA512ShortMsg.rsp diff --git a/zkfold-base/test/data/shabittestvectors/SHA512_224LongMsg.rsp b/symbolic-base/test/data/shabittestvectors/SHA512_224LongMsg.rsp similarity index 100% rename from zkfold-base/test/data/shabittestvectors/SHA512_224LongMsg.rsp rename to symbolic-base/test/data/shabittestvectors/SHA512_224LongMsg.rsp diff --git a/zkfold-base/test/data/shabittestvectors/SHA512_224ShortMsg.rsp b/symbolic-base/test/data/shabittestvectors/SHA512_224ShortMsg.rsp similarity index 100% rename from zkfold-base/test/data/shabittestvectors/SHA512_224ShortMsg.rsp rename to symbolic-base/test/data/shabittestvectors/SHA512_224ShortMsg.rsp diff --git a/zkfold-base/test/data/shabittestvectors/SHA512_256LongMsg.rsp b/symbolic-base/test/data/shabittestvectors/SHA512_256LongMsg.rsp similarity index 100% rename from zkfold-base/test/data/shabittestvectors/SHA512_256LongMsg.rsp rename to symbolic-base/test/data/shabittestvectors/SHA512_256LongMsg.rsp diff --git a/zkfold-base/test/data/shabittestvectors/SHA512_256ShortMsg.rsp b/symbolic-base/test/data/shabittestvectors/SHA512_256ShortMsg.rsp similarity index 100% rename from zkfold-base/test/data/shabittestvectors/SHA512_256ShortMsg.rsp rename to symbolic-base/test/data/shabittestvectors/SHA512_256ShortMsg.rsp diff --git a/symbolic-cardano/LICENSE b/symbolic-cardano/LICENSE new file mode 100644 index 000000000..e231bb839 --- /dev/null +++ b/symbolic-cardano/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 zkFold SA + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/symbolic-cardano/hie.yaml b/symbolic-cardano/hie.yaml new file mode 100644 index 000000000..434decdfb --- /dev/null +++ b/symbolic-cardano/hie.yaml @@ -0,0 +1,4 @@ +cradle: + cabal: + - path: "./src" + component: "lib:symbolic-cardano" \ No newline at end of file diff --git a/zkfold-base/src/ZkFold/Symbolic/Cardano/Contracts/BatchTransfer.hs b/symbolic-cardano/src/ZkFold/Symbolic/Cardano/Contracts/BatchTransfer.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Cardano/Contracts/BatchTransfer.hs rename to symbolic-cardano/src/ZkFold/Symbolic/Cardano/Contracts/BatchTransfer.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Cardano/Contracts/RandomOracle.hs b/symbolic-cardano/src/ZkFold/Symbolic/Cardano/Contracts/RandomOracle.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Cardano/Contracts/RandomOracle.hs rename to symbolic-cardano/src/ZkFold/Symbolic/Cardano/Contracts/RandomOracle.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Cardano/Types.hs b/symbolic-cardano/src/ZkFold/Symbolic/Cardano/Types.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Cardano/Types.hs rename to symbolic-cardano/src/ZkFold/Symbolic/Cardano/Types.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Cardano/Types/Address.hs b/symbolic-cardano/src/ZkFold/Symbolic/Cardano/Types/Address.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Cardano/Types/Address.hs rename to symbolic-cardano/src/ZkFold/Symbolic/Cardano/Types/Address.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Cardano/Types/Basic.hs b/symbolic-cardano/src/ZkFold/Symbolic/Cardano/Types/Basic.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Cardano/Types/Basic.hs rename to symbolic-cardano/src/ZkFold/Symbolic/Cardano/Types/Basic.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Cardano/Types/Input.hs b/symbolic-cardano/src/ZkFold/Symbolic/Cardano/Types/Input.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Cardano/Types/Input.hs rename to symbolic-cardano/src/ZkFold/Symbolic/Cardano/Types/Input.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Cardano/Types/Output.hs b/symbolic-cardano/src/ZkFold/Symbolic/Cardano/Types/Output.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Cardano/Types/Output.hs rename to symbolic-cardano/src/ZkFold/Symbolic/Cardano/Types/Output.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Cardano/Types/Output/Datum.hs b/symbolic-cardano/src/ZkFold/Symbolic/Cardano/Types/Output/Datum.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Cardano/Types/Output/Datum.hs rename to symbolic-cardano/src/ZkFold/Symbolic/Cardano/Types/Output/Datum.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Cardano/Types/OutputRef.hs b/symbolic-cardano/src/ZkFold/Symbolic/Cardano/Types/OutputRef.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Cardano/Types/OutputRef.hs rename to symbolic-cardano/src/ZkFold/Symbolic/Cardano/Types/OutputRef.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Cardano/Types/Transaction.hs b/symbolic-cardano/src/ZkFold/Symbolic/Cardano/Types/Transaction.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Cardano/Types/Transaction.hs rename to symbolic-cardano/src/ZkFold/Symbolic/Cardano/Types/Transaction.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Cardano/Types/Value.hs b/symbolic-cardano/src/ZkFold/Symbolic/Cardano/Types/Value.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Cardano/Types/Value.hs rename to symbolic-cardano/src/ZkFold/Symbolic/Cardano/Types/Value.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Cardano/UPLC.hs b/symbolic-cardano/src/ZkFold/Symbolic/Cardano/UPLC.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Cardano/UPLC.hs rename to symbolic-cardano/src/ZkFold/Symbolic/Cardano/UPLC.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Cardano/UPLC/Builtins.hs b/symbolic-cardano/src/ZkFold/Symbolic/Cardano/UPLC/Builtins.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Cardano/UPLC/Builtins.hs rename to symbolic-cardano/src/ZkFold/Symbolic/Cardano/UPLC/Builtins.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Cardano/UPLC/Inference.hs b/symbolic-cardano/src/ZkFold/Symbolic/Cardano/UPLC/Inference.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Cardano/UPLC/Inference.hs rename to symbolic-cardano/src/ZkFold/Symbolic/Cardano/UPLC/Inference.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Cardano/UPLC/Inference/Internal.hs b/symbolic-cardano/src/ZkFold/Symbolic/Cardano/UPLC/Inference/Internal.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Cardano/UPLC/Inference/Internal.hs rename to symbolic-cardano/src/ZkFold/Symbolic/Cardano/UPLC/Inference/Internal.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Cardano/UPLC/Term.hs b/symbolic-cardano/src/ZkFold/Symbolic/Cardano/UPLC/Term.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Cardano/UPLC/Term.hs rename to symbolic-cardano/src/ZkFold/Symbolic/Cardano/UPLC/Term.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Cardano/UPLC/Type.hs b/symbolic-cardano/src/ZkFold/Symbolic/Cardano/UPLC/Type.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Cardano/UPLC/Type.hs rename to symbolic-cardano/src/ZkFold/Symbolic/Cardano/UPLC/Type.hs diff --git a/zkfold-base/src/ZkFold/Symbolic/Cardano/Wrapper.hs b/symbolic-cardano/src/ZkFold/Symbolic/Cardano/Wrapper.hs similarity index 100% rename from zkfold-base/src/ZkFold/Symbolic/Cardano/Wrapper.hs rename to symbolic-cardano/src/ZkFold/Symbolic/Cardano/Wrapper.hs diff --git a/symbolic-cardano/symbolic-cardano.cabal b/symbolic-cardano/symbolic-cardano.cabal new file mode 100644 index 000000000..ab9a4dcc4 --- /dev/null +++ b/symbolic-cardano/symbolic-cardano.cabal @@ -0,0 +1,141 @@ +cabal-version: 3.0 + +name: symbolic-cardano +version: 0.1.0.0 +tested-with: GHC ==9.6.4 +synopsis: ZkFold Symbolic library for integration with Cardano +homepage: https://zkfold.io/ +category: Cryptography, DSL, Math, Symbolic Computation +author: Vladimir Sinyakov, Pavel Sokolov, Vladimir Morozov, Eitan Chatav, Ilya Baryshnikov, Anna Hovanskaya, Evgenii Samodelov, Murat Kasimov, Maxim Churilov +maintainer: vlasin@zkfold.io +license: MIT +license-file: LICENSE +build-type: Simple + +description: + This package contains the library for integration of the zkFold Symbolic framework with the Cardano blockchain. + It provides the types and functions for verifying statements about Cardano transactions. + +Flag Pedantic + Description: Enable pedantic build with -Werror + Manual: True + Default: False + +common options + default-language: Haskell2010 + ghc-options: + -fwarn-redundant-constraints + -Wall + -Wcompat + -Widentities + -Wincomplete-record-updates + -Wincomplete-uni-patterns + -Wnoncanonical-monad-instances + -Wpartial-fields + -Wredundant-constraints + -O2 + -threaded + if flag(pedantic) + ghc-options: + -Werror + default-extensions: + BangPatterns, + BinaryLiterals, + ConstraintKinds, + DataKinds, + DefaultSignatures, + DeriveDataTypeable, + DeriveFoldable, + DeriveFunctor, + DeriveGeneric, + DeriveTraversable, + ExistentialQuantification, + FlexibleContexts, + FlexibleInstances, + FunctionalDependencies, + GADTs, + GeneralizedNewtypeDeriving, + InstanceSigs, + KindSignatures, + LambdaCase, + MultiParamTypeClasses, + MultiWayIf, + NamedFieldPuns, + NoImplicitPrelude, + NoStarIsType, + NumericUnderscores, + OverloadedStrings, + OverloadedLabels, + PolyKinds, + RankNTypes, + RecordWildCards, + ScopedTypeVariables, + StandaloneDeriving, + StandaloneKindSignatures, + TupleSections, + TypeApplications, + TypeFamilies, + ViewPatterns + +common options-exe + import: options + ghc-options: + -rtsopts + ghc-prof-options: + -with-rtsopts=-pj + +library + import: options + exposed-modules: + ZkFold.Symbolic.Cardano.Wrapper + ZkFold.Symbolic.Cardano.Contracts.BatchTransfer + ZkFold.Symbolic.Cardano.Contracts.RandomOracle + ZkFold.Symbolic.Cardano.Types + ZkFold.Symbolic.Cardano.Types.Address + ZkFold.Symbolic.Cardano.Types.Basic + ZkFold.Symbolic.Cardano.Types.Input + ZkFold.Symbolic.Cardano.Types.Output + ZkFold.Symbolic.Cardano.Types.Output.Datum + ZkFold.Symbolic.Cardano.Types.OutputRef + ZkFold.Symbolic.Cardano.Types.Transaction + ZkFold.Symbolic.Cardano.Types.Value + ZkFold.Symbolic.Cardano.UPLC + ZkFold.Symbolic.Cardano.UPLC.Builtins + ZkFold.Symbolic.Cardano.UPLC.Inference + ZkFold.Symbolic.Cardano.UPLC.Inference.Internal + ZkFold.Symbolic.Cardano.UPLC.Term + ZkFold.Symbolic.Cardano.UPLC.Type + build-depends: + base >= 4.9 && < 5, + adjunctions < 4.5, + aeson < 2.3, + base64-bytestring , + binary < 0.11, + -- TODO: remove `blake2` after refactoring of ZK protocols + blake2 < 0.4, + bytestring < 0.12, + containers < 0.7, + cryptohash-sha256 < 0.12, + deepseq <= 1.5.0.0, + distributive , + lens , + mtl < 2.4, + optics < 0.5, + parallel < 3.2.3.0, + pretty-simple < 4.2, + QuickCheck < 2.15, + random < 1.3, + semialign < 1.4, + semigroups , + split < 0.2.6, + symbolic-base , + -- TODO: remove `swagger2` after moving the related code to `zkfold-prover` + swagger2 , + text , + tfp < 1.1, + these < 1.3, + type-errors < 0.2.1, + vector < 0.14, + vector-binary-instances < 0.3, + vector-split < 1.1, + hs-source-dirs: src diff --git a/symbolic-examples/LICENSE b/symbolic-examples/LICENSE new file mode 100644 index 000000000..e231bb839 --- /dev/null +++ b/symbolic-examples/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 zkFold SA + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/zkfold-base/bench/BenchCompiler.hs b/symbolic-examples/bench/BenchCompiler.hs similarity index 98% rename from zkfold-base/bench/BenchCompiler.hs rename to symbolic-examples/bench/BenchCompiler.hs index ad2cd9710..fb3d410b8 100644 --- a/zkfold-base/bench/BenchCompiler.hs +++ b/symbolic-examples/bench/BenchCompiler.hs @@ -1,4 +1,5 @@ {-# LANGUAGE TypeOperators #-} + module Main where import Control.DeepSeq (NFData, force) @@ -37,7 +38,7 @@ benchmark name circuit = bgroup name , env (return $ force $ circuit ()) $ \c -> let input = tabulate (const zero) - path = "zkfold-base/stats/" <> name + path = "symbolic-base/stats/" <> name in bgroup "on compilation" [ bench "evaluation" $ nf (witnessGenerator c) input , goldenVsString "# of constraints" path $ return (metrics name c) diff --git a/symbolic-examples/hie.yaml b/symbolic-examples/hie.yaml new file mode 100644 index 000000000..adaf87f52 --- /dev/null +++ b/symbolic-examples/hie.yaml @@ -0,0 +1,7 @@ +cradle: + cabal: + - path: "./src" + component: "lib:symbolic-examples" + + - path: "./bench/BenchCompiler.hs" + component: "symbolic-examples:bench:bench-compiler" diff --git a/symbolic-examples/src/Examples/BatchTransfer.hs b/symbolic-examples/src/Examples/BatchTransfer.hs new file mode 100644 index 000000000..9519085f1 --- /dev/null +++ b/symbolic-examples/src/Examples/BatchTransfer.hs @@ -0,0 +1,18 @@ +module Examples.BatchTransfer (exampleBatchTransfer) where + +import ZkFold.Base.Algebra.Basic.Number (KnownNat) +import ZkFold.Base.Data.Vector (Vector) +import ZkFold.Symbolic.Cardano.Contracts.BatchTransfer (Tokens, Tx, TxOut, batchTransfer) +import ZkFold.Symbolic.Cardano.Types (Bool, ByteString, Value) +import ZkFold.Symbolic.Cardano.Types.Value (SingleAsset) +import ZkFold.Symbolic.Class (Symbolic (..)) +import ZkFold.Symbolic.Data.Class (SymbolicData (..)) + +exampleBatchTransfer :: + ( Symbolic c + , SymbolicData (TxOut c) + , KnownNat (TypeSize (TxOut c)) + , KnownNat (TypeSize (SingleAsset c)) + , KnownNat (TypeSize (Value Tokens c)) + ) => Tx c -> Vector 5 (TxOut c, TxOut c, ByteString 256 c) -> Bool c +exampleBatchTransfer = batchTransfer diff --git a/symbolic-examples/src/Examples/ByteString.hs b/symbolic-examples/src/Examples/ByteString.hs new file mode 100644 index 000000000..13c329909 --- /dev/null +++ b/symbolic-examples/src/Examples/ByteString.hs @@ -0,0 +1,38 @@ +{-# LANGUAGE TypeOperators #-} + +module Examples.ByteString ( + exampleByteStringAnd, + exampleByteStringOr, + exampleByteStringExtend, + exampleByteStringAdd, + exampleSHA + ) where + +import ZkFold.Base.Algebra.Basic.Class +import ZkFold.Base.Algebra.Basic.Number (KnownNat, type (<=)) +import ZkFold.Symbolic.Algorithms.Hash.SHA2 (SHA2, sha2) +import ZkFold.Symbolic.Class (Symbolic) +import ZkFold.Symbolic.Data.Bool (BoolType (..)) +import ZkFold.Symbolic.Data.ByteString (ByteString) +import ZkFold.Symbolic.Data.Combinators (Extend (..), Iso (..), RegisterSize (..)) +import ZkFold.Symbolic.Data.UInt (UInt) + +exampleByteStringAnd :: + (KnownNat n, Symbolic c) => ByteString n c -> ByteString n c -> ByteString n c +exampleByteStringAnd = (&&) + +exampleByteStringOr :: + (KnownNat n, Symbolic c) => ByteString n c -> ByteString n c -> ByteString n c +exampleByteStringOr = (||) + +exampleByteStringExtend :: + (KnownNat n, KnownNat k, n <= k, Symbolic c) => + ByteString n c -> ByteString k c +exampleByteStringExtend = extend + +exampleByteStringAdd :: + forall n c. (KnownNat n, Symbolic c) => ByteString n c -> ByteString n c -> ByteString n c +exampleByteStringAdd x y = from (from x + from y :: UInt n Auto c) + +exampleSHA :: forall n c. SHA2 "SHA256" c n => ByteString n c -> ByteString 256 c +exampleSHA = sha2 @"SHA256" diff --git a/symbolic-examples/src/Examples/Conditional.hs b/symbolic-examples/src/Examples/Conditional.hs new file mode 100644 index 000000000..a17f4c068 --- /dev/null +++ b/symbolic-examples/src/Examples/Conditional.hs @@ -0,0 +1,10 @@ +module Examples.Conditional (exampleConditional) where + +import ZkFold.Symbolic.Class (Symbolic) +import ZkFold.Symbolic.Data.Bool (Bool) +import ZkFold.Symbolic.Data.Conditional (Conditional (..)) +import ZkFold.Symbolic.Data.FieldElement (FieldElement) + +exampleConditional :: + Symbolic c => FieldElement c -> FieldElement c -> Bool c -> FieldElement c +exampleConditional = bool diff --git a/symbolic-examples/src/Examples/Constant.hs b/symbolic-examples/src/Examples/Constant.hs new file mode 100644 index 000000000..becc7d8e6 --- /dev/null +++ b/symbolic-examples/src/Examples/Constant.hs @@ -0,0 +1,15 @@ +module Examples.Constant (exampleConst5, exampleEq5) where + +import Examples.Eq (exampleEq) +import Numeric.Natural (Natural) + +import ZkFold.Base.Algebra.Basic.Class (FromConstant (..)) +import ZkFold.Symbolic.Class (Symbolic) +import ZkFold.Symbolic.Data.Bool (Bool) +import ZkFold.Symbolic.Data.FieldElement (FieldElement) + +exampleConst5 :: Symbolic c => FieldElement c +exampleConst5 = fromConstant (5 :: Natural) + +exampleEq5 :: Symbolic c => FieldElement c -> Bool c +exampleEq5 = exampleEq exampleConst5 diff --git a/symbolic-examples/src/Examples/Eq.hs b/symbolic-examples/src/Examples/Eq.hs new file mode 100644 index 000000000..748f0a119 --- /dev/null +++ b/symbolic-examples/src/Examples/Eq.hs @@ -0,0 +1,10 @@ +module Examples.Eq (exampleEq) where + +import ZkFold.Symbolic.Class (Symbolic) +import ZkFold.Symbolic.Data.Bool (Bool) +import ZkFold.Symbolic.Data.Eq (Eq (..)) +import ZkFold.Symbolic.Data.FieldElement (FieldElement) + +-- | (==) operation +exampleEq :: Symbolic c => FieldElement c -> FieldElement c -> Bool c +exampleEq x y = x == y diff --git a/symbolic-examples/src/Examples/FFA.hs b/symbolic-examples/src/Examples/FFA.hs new file mode 100644 index 000000000..86af80ac9 --- /dev/null +++ b/symbolic-examples/src/Examples/FFA.hs @@ -0,0 +1,31 @@ +module Examples.FFA + ( exampleFFAadd337 + , exampleFFAadd097 + , exampleFFAmul337 + , exampleFFAmul097) where + +import ZkFold.Base.Algebra.Basic.Class +import ZkFold.Base.Algebra.Basic.Number +import ZkFold.Symbolic.Class (Symbolic) +import ZkFold.Symbolic.Data.FFA (FFA) + +type Prime256_1 = 28948022309329048855892746252171976963363056481941560715954676764349967630337 +type Prime256_2 = 28948022309329048855892746252171976963363056481941647379679742748393362948097 + +exampleFFAadd337 :: Symbolic c => FFA Prime256_1 c -> FFA Prime256_1 c -> FFA Prime256_1 c +exampleFFAadd337 = exampleFFAadd + +exampleFFAadd097 :: Symbolic c => FFA Prime256_2 c -> FFA Prime256_2 c -> FFA Prime256_2 c +exampleFFAadd097 = exampleFFAadd + +exampleFFAmul337 :: Symbolic c => FFA Prime256_1 c -> FFA Prime256_1 c -> FFA Prime256_1 c +exampleFFAmul337 = exampleFFAmul + +exampleFFAmul097 :: Symbolic c => FFA Prime256_2 c -> FFA Prime256_2 c -> FFA Prime256_2 c +exampleFFAmul097 = exampleFFAmul + +exampleFFAadd :: forall p c. (Symbolic c, KnownNat p) => FFA p c -> FFA p c -> FFA p c +exampleFFAadd = (+) + +exampleFFAmul :: forall p c. (Symbolic c, KnownNat p) => FFA p c -> FFA p c -> FFA p c +exampleFFAmul = (*) diff --git a/symbolic-examples/src/Examples/Fibonacci.hs b/symbolic-examples/src/Examples/Fibonacci.hs new file mode 100644 index 000000000..5ccf53440 --- /dev/null +++ b/symbolic-examples/src/Examples/Fibonacci.hs @@ -0,0 +1,28 @@ +{-# LANGUAGE TypeApplications #-} + +module Examples.Fibonacci (exampleFibonacci) where + +import Data.Foldable (foldl) +import Prelude (Integer) + +import ZkFold.Base.Algebra.Basic.Class +import ZkFold.Symbolic.Class (Symbolic) +import ZkFold.Symbolic.Data.Bool (Bool) +import ZkFold.Symbolic.Data.Conditional (bool) +import ZkFold.Symbolic.Data.Eq (Eq (..)) +import ZkFold.Symbolic.Data.FieldElement (FieldElement) + +-- | The Fibonacci index function. +-- If `x` is a Fibonacci number, returns its index (up until `nMax`). +-- Otherwise, returns `0`. +exampleFibonacci :: + forall c. Symbolic c => Integer -> FieldElement c -> FieldElement c +exampleFibonacci nMax x = + foldl + (\m k -> bool @(Bool c) m (fromConstant k) (fib k one one == x)) + zero + [1..nMax] + where + fib :: Integer -> FieldElement c -> FieldElement c -> FieldElement c + fib 1 x1 _ = x1 + fib n x1 x2 = fib (n - 1) x2 (x1 + x2) diff --git a/symbolic-examples/src/Examples/LEQ.hs b/symbolic-examples/src/Examples/LEQ.hs new file mode 100644 index 000000000..b5785465b --- /dev/null +++ b/symbolic-examples/src/Examples/LEQ.hs @@ -0,0 +1,10 @@ +module Examples.LEQ (exampleLEQ) where + +import ZkFold.Symbolic.Class (Symbolic) +import ZkFold.Symbolic.Data.Bool (Bool) +import ZkFold.Symbolic.Data.FieldElement (FieldElement) +import ZkFold.Symbolic.Data.Ord ((<=)) + +-- | (<=) operation +exampleLEQ :: Symbolic c => FieldElement c -> FieldElement c -> Bool c +exampleLEQ x y = x <= y diff --git a/symbolic-examples/src/Examples/MiMCHash.hs b/symbolic-examples/src/Examples/MiMCHash.hs new file mode 100644 index 000000000..e03a98fa4 --- /dev/null +++ b/symbolic-examples/src/Examples/MiMCHash.hs @@ -0,0 +1,12 @@ +module Examples.MiMCHash (exampleMiMC) where + +import ZkFold.Base.Algebra.Basic.Class +import ZkFold.Symbolic.Algorithms.Hash.MiMC (mimcHash2) +import ZkFold.Symbolic.Algorithms.Hash.MiMC.Constants (mimcConstants) +import ZkFold.Symbolic.Class (Symbolic (..)) +import ZkFold.Symbolic.Data.FieldElement (FieldElement) + +exampleMiMC :: + forall c. (Symbolic c, FromConstant (BaseField c) (FieldElement c)) => + FieldElement c -> FieldElement c -> FieldElement c +exampleMiMC = mimcHash2 mimcConstants (zero :: BaseField c) diff --git a/symbolic-examples/src/Examples/ReverseList.hs b/symbolic-examples/src/Examples/ReverseList.hs new file mode 100644 index 000000000..fbb0f574e --- /dev/null +++ b/symbolic-examples/src/Examples/ReverseList.hs @@ -0,0 +1,7 @@ +module Examples.ReverseList (exampleReverseList) where + +import ZkFold.Base.Data.Vector (Vector, reverse) + +-- | Reverses the order of elements in a vector +exampleReverseList :: Vector n t -> Vector n t +exampleReverseList = reverse diff --git a/symbolic-examples/src/Examples/UInt.hs b/symbolic-examples/src/Examples/UInt.hs new file mode 100644 index 000000000..ce6b79e10 --- /dev/null +++ b/symbolic-examples/src/Examples/UInt.hs @@ -0,0 +1,40 @@ +{-# LANGUAGE TypeOperators #-} + +module Examples.UInt ( + exampleUIntMul, + exampleUIntDivMod, + exampleUIntStrictAdd, + exampleUIntStrictMul + ) where + +import Control.DeepSeq (NFData) +import Data.Type.Equality (type (~)) + +import ZkFold.Base.Algebra.Basic.Class +import ZkFold.Base.Algebra.Basic.Number (KnownNat) +import ZkFold.Base.Data.Vector (Vector) +import ZkFold.Symbolic.Class (Symbolic (BaseField)) +import ZkFold.Symbolic.Data.Combinators (KnownRegisterSize, NumberOfRegisters) +import ZkFold.Symbolic.Data.UInt (StrictNum (..), UInt) + +exampleUIntMul :: + (KnownNat n, KnownRegisterSize r, Symbolic c) => + UInt n r c -> UInt n r c -> UInt n r c +exampleUIntMul = (*) + +exampleUIntDivMod :: + (KnownNat n, KnownRegisterSize r, Symbolic c, + NumberOfRegisters (BaseField c) n r ~ k, + KnownNat k, NFData (c (Vector k))) => + UInt n r c -> UInt n r c -> (UInt n r c, UInt n r c) +exampleUIntDivMod = divMod + +exampleUIntStrictAdd :: + (KnownNat n, KnownRegisterSize r, Symbolic c) => + UInt n r c -> UInt n r c -> UInt n r c +exampleUIntStrictAdd = strictAdd + +exampleUIntStrictMul :: + (KnownNat n, KnownRegisterSize r, Symbolic c) => + UInt n r c -> UInt n r c -> UInt n r c +exampleUIntStrictMul = strictMul diff --git a/symbolic-examples/src/ZkFold/Symbolic/Examples.hs b/symbolic-examples/src/ZkFold/Symbolic/Examples.hs new file mode 100644 index 000000000..792e94fc5 --- /dev/null +++ b/symbolic-examples/src/ZkFold/Symbolic/Examples.hs @@ -0,0 +1,76 @@ +{-# LANGUAGE TypeOperators #-} + +module ZkFold.Symbolic.Examples (ExampleOutput (..), examples) where + +import Data.Function (const, ($), (.)) +import Data.Proxy (Proxy) +import Data.String (String) +import Data.Type.Equality (type (~)) +import Examples.BatchTransfer (exampleBatchTransfer) +import Examples.ByteString +import Examples.Conditional (exampleConditional) +import Examples.Constant (exampleConst5, exampleEq5) +import Examples.Eq (exampleEq) +import Examples.FFA +import Examples.Fibonacci (exampleFibonacci) +import Examples.LEQ (exampleLEQ) +import Examples.MiMCHash (exampleMiMC) +import Examples.ReverseList (exampleReverseList) +import Examples.UInt + +import ZkFold.Base.Algebra.Basic.Field (Zp) +import ZkFold.Base.Algebra.Basic.Number (KnownNat) +import ZkFold.Base.Algebra.EllipticCurve.BLS12_381 (BLS12_381_Scalar) +import ZkFold.Base.Data.Vector (Vector) +import ZkFold.Symbolic.Compiler (ArithmeticCircuit, compile) +import ZkFold.Symbolic.Data.ByteString (ByteString) +import ZkFold.Symbolic.Data.Class +import ZkFold.Symbolic.Data.Combinators (RegisterSize (Auto)) + +type C = ArithmeticCircuit (Zp BLS12_381_Scalar) + +data ExampleOutput where + ExampleOutput + :: forall i_n o_n. KnownNat i_n + => (() -> C (Vector i_n) (Vector o_n)) + -> ExampleOutput + +exampleOutput :: + forall i_n o_n c f. + ( KnownNat i_n + , i_n ~ TypeSize (Support f) + , SymbolicData f + , c ~ C (Vector i_n) + , Context f ~ c + , TypeSize f ~ o_n + , SymbolicData (Support f) + , Context (Support f) ~ c + , Support (Support f) ~ Proxy c + ) => f -> ExampleOutput +exampleOutput = ExampleOutput @i_n @o_n . const . compile + +examples :: [(String, ExampleOutput)] +examples = + [ ("Eq", exampleOutput exampleEq) + , ("Conditional", exampleOutput exampleConditional) + , ("Constant.5", exampleOutput exampleConst5) + , ("Eq.Constant.5", exampleOutput exampleEq5) + , ("ByteString.And.32", exampleOutput $ exampleByteStringAnd @32) + , ("ByteString.Or.64", exampleOutput $ exampleByteStringOr @64) + , ("UInt.Mul.64.Auto", exampleOutput $ exampleUIntMul @64 @Auto) + , ("LEQ", exampleOutput exampleLEQ) + , ("ByteString.Extend.1.512", exampleOutput $ exampleByteStringExtend @1 @512) + , ("ByteString.Add.512", exampleOutput $ exampleByteStringAdd @512) + , ("UInt.StrictAdd.256.Auto", exampleOutput $ exampleUIntStrictAdd @256 @Auto) + , ("UInt.StrictMul.512.Auto", exampleOutput $ exampleUIntStrictMul @512 @Auto) + , ("UInt.DivMod.32.Auto", exampleOutput $ exampleUIntDivMod @32 @Auto) + , ("Reverse.32.3000", exampleOutput $ exampleReverseList @32 @(ByteString 3000 (C (Vector _)))) + , ("Fibonacci.100", exampleOutput $ exampleFibonacci 100) + , ("MiMCHash", exampleOutput exampleMiMC) + , ("SHA256.32", exampleOutput $ exampleSHA @32) + , ("FFA.Add.337", exampleOutput exampleFFAadd337) + , ("FFA.Add.097", exampleOutput exampleFFAadd097) + , ("FFA.Mul.337", exampleOutput exampleFFAmul337) + , ("FFA.Mul.097", exampleOutput exampleFFAmul097) + , ("BatchTransfer", exampleOutput exampleBatchTransfer) + ] diff --git a/symbolic-examples/symbolic-examples.cabal b/symbolic-examples/symbolic-examples.cabal new file mode 100644 index 000000000..24732882c --- /dev/null +++ b/symbolic-examples/symbolic-examples.cabal @@ -0,0 +1,130 @@ +cabal-version: 3.0 + +name: symbolic-examples +version: 0.1.0.0 +tested-with: GHC ==9.6.4 +synopsis: ZkFold Symbolic examples +homepage: https://zkfold.io/ +category: Cryptography, DSL, Math, Symbolic Computation +author: Vladimir Sinyakov, Pavel Sokolov, Vladimir Morozov, Eitan Chatav, Ilya Baryshnikov, Anna Hovanskaya, Evgenii Samodelov +maintainer: vlasin@zkfold.io +license: MIT +license-file: LICENSE +build-type: Simple + +description: + This package contains the examples generated using the the zkFold Symbolic framework. It also contains a benchmark for compiling the examples into arithmetic circuits + and evaluating those circuits on a set of inputs. + +Flag Pedantic + Description: Enable pedantic build with -Werror + Manual: True + Default: False + +common options + default-language: Haskell2010 + ghc-options: + -fwarn-redundant-constraints + -Wall + -Wcompat + -Widentities + -Wincomplete-record-updates + -Wincomplete-uni-patterns + -Wnoncanonical-monad-instances + -Wpartial-fields + -Wredundant-constraints + -O2 + -threaded + if flag(pedantic) + ghc-options: + -Werror + default-extensions: + BangPatterns, + BinaryLiterals, + ConstraintKinds, + DataKinds, + DefaultSignatures, + DeriveDataTypeable, + DeriveFoldable, + DeriveFunctor, + DeriveGeneric, + DeriveTraversable, + ExistentialQuantification, + FlexibleContexts, + FlexibleInstances, + FunctionalDependencies, + GADTs, + GeneralizedNewtypeDeriving, + InstanceSigs, + KindSignatures, + LambdaCase, + MultiParamTypeClasses, + MultiWayIf, + NamedFieldPuns, + NoImplicitPrelude, + NoStarIsType, + NumericUnderscores, + OverloadedStrings, + OverloadedLabels, + PolyKinds, + RankNTypes, + RecordWildCards, + ScopedTypeVariables, + StandaloneDeriving, + StandaloneKindSignatures, + TupleSections, + TypeApplications, + TypeFamilies, + ViewPatterns + +common options-exe + import: options + ghc-options: + -rtsopts + ghc-prof-options: + -with-rtsopts=-pj + +library + import: options + exposed-modules: + ZkFold.Symbolic.Examples + other-modules: + Examples.BatchTransfer + Examples.ByteString + Examples.Conditional + Examples.Constant + Examples.Eq + Examples.FFA + Examples.Fibonacci + Examples.LEQ + Examples.MiMCHash + Examples.ReverseList + Examples.UInt + build-depends: + base, + containers, + deepseq, + symbolic-base, + symbolic-cardano, + hs-source-dirs: src + +benchmark bench-compiler + import: options-exe + main-is: BenchCompiler.hs + hs-source-dirs: bench + type: exitcode-stdio-1.0 + ghc-options: + -fprof-auto + -fprof-cafs + -O3 + build-depends: + adjunctions, + base, + bytestring, + containers, + deepseq, + symbolic-base, + symbolic-cardano, + symbolic-examples, + tasty-bench, + tasty-golden, diff --git a/zkfold-base/hie.yaml b/zkfold-base/hie.yaml deleted file mode 100644 index 07f5240fa..000000000 --- a/zkfold-base/hie.yaml +++ /dev/null @@ -1,16 +0,0 @@ -cradle: - cabal: - - path: "./src" - component: "lib:zkfold-base" - - - path: "./examples" - component: "zkfold-base:lib:zkfold-symbolic-examples" - - - path: "./test" - component: "zkfold-base:test:zkfold-base-test" - - - path: "./bench/BenchPolyMul.hs" - component: "zkfold-base:bench:bench-poly-mul" - - - path: "./bench/BenchCompiler.hs" - component: "zkfold-base:bench:bench-compiler" From e73ea5d7129434687f9023801abdcb8ac14fe77c Mon Sep 17 00:00:00 2001 From: Vladimir Sinyakov Date: Sun, 6 Oct 2024 12:51:01 +0200 Subject: [PATCH 3/7] Separate zkFold Ledger package --- .github/workflows/main-pull.yml | 1 + .github/workflows/main-push.yml | 4 +- cabal.project | 1 + symbolic-base/symbolic-base.cabal | 28 +---- symbolic-cardano/symbolic-cardano.cabal | 33 +---- symbolic-examples/symbolic-examples.cabal | 6 +- zkfold-ledger/LICENSE | 21 ++++ zkfold-ledger/hie.yaml | 4 + .../src/ZkFold/Symbolic/Ledger/Types.hs | 0 .../ZkFold/Symbolic/Ledger/Types/Address.hs | 0 .../src/ZkFold/Symbolic/Ledger/Types/Basic.hs | 0 .../ZkFold/Symbolic/Ledger/Types/Bridge.hs | 0 .../ZkFold/Symbolic/Ledger/Types/Contract.hs | 0 .../src/ZkFold/Symbolic/Ledger/Types/Hash.hs | 0 .../src/ZkFold/Symbolic/Ledger/Types/Input.hs | 0 .../ZkFold/Symbolic/Ledger/Types/Output.hs | 0 .../ZkFold/Symbolic/Ledger/Types/OutputRef.hs | 0 .../Symbolic/Ledger/Types/Transaction.hs | 0 .../ZkFold/Symbolic/Ledger/Types/Update.hs | 0 .../src/ZkFold/Symbolic/Ledger/Types/Value.hs | 0 .../Symbolic/Ledger/Validation/Bridge.hs | 0 .../Symbolic/Ledger/Validation/Common.hs | 0 .../Symbolic/Ledger/Validation/Contract.hs | 0 .../Ledger/Validation/PrivateInput.hs | 0 .../Symbolic/Ledger/Validation/PublicInput.hs | 0 .../Symbolic/Ledger/Validation/Transaction.hs | 0 .../Symbolic/Ledger/Validation/Update.hs | 0 zkfold-ledger/zkfold-ledger.cabal | 113 ++++++++++++++++++ 28 files changed, 150 insertions(+), 61 deletions(-) create mode 100644 zkfold-ledger/LICENSE create mode 100644 zkfold-ledger/hie.yaml rename {symbolic-base => zkfold-ledger}/src/ZkFold/Symbolic/Ledger/Types.hs (100%) rename {symbolic-base => zkfold-ledger}/src/ZkFold/Symbolic/Ledger/Types/Address.hs (100%) rename {symbolic-base => zkfold-ledger}/src/ZkFold/Symbolic/Ledger/Types/Basic.hs (100%) rename {symbolic-base => zkfold-ledger}/src/ZkFold/Symbolic/Ledger/Types/Bridge.hs (100%) rename {symbolic-base => zkfold-ledger}/src/ZkFold/Symbolic/Ledger/Types/Contract.hs (100%) rename {symbolic-base => zkfold-ledger}/src/ZkFold/Symbolic/Ledger/Types/Hash.hs (100%) rename {symbolic-base => zkfold-ledger}/src/ZkFold/Symbolic/Ledger/Types/Input.hs (100%) rename {symbolic-base => zkfold-ledger}/src/ZkFold/Symbolic/Ledger/Types/Output.hs (100%) rename {symbolic-base => zkfold-ledger}/src/ZkFold/Symbolic/Ledger/Types/OutputRef.hs (100%) rename {symbolic-base => zkfold-ledger}/src/ZkFold/Symbolic/Ledger/Types/Transaction.hs (100%) rename {symbolic-base => zkfold-ledger}/src/ZkFold/Symbolic/Ledger/Types/Update.hs (100%) rename {symbolic-base => zkfold-ledger}/src/ZkFold/Symbolic/Ledger/Types/Value.hs (100%) rename {symbolic-base => zkfold-ledger}/src/ZkFold/Symbolic/Ledger/Validation/Bridge.hs (100%) rename {symbolic-base => zkfold-ledger}/src/ZkFold/Symbolic/Ledger/Validation/Common.hs (100%) rename {symbolic-base => zkfold-ledger}/src/ZkFold/Symbolic/Ledger/Validation/Contract.hs (100%) rename {symbolic-base => zkfold-ledger}/src/ZkFold/Symbolic/Ledger/Validation/PrivateInput.hs (100%) rename {symbolic-base => zkfold-ledger}/src/ZkFold/Symbolic/Ledger/Validation/PublicInput.hs (100%) rename {symbolic-base => zkfold-ledger}/src/ZkFold/Symbolic/Ledger/Validation/Transaction.hs (100%) rename {symbolic-base => zkfold-ledger}/src/ZkFold/Symbolic/Ledger/Validation/Update.hs (100%) create mode 100644 zkfold-ledger/zkfold-ledger.cabal diff --git a/.github/workflows/main-pull.yml b/.github/workflows/main-pull.yml index b170b16dd..430f9d818 100644 --- a/.github/workflows/main-pull.yml +++ b/.github/workflows/main-pull.yml @@ -32,6 +32,7 @@ jobs: - name: Configure Cabal run: | + cabal update cabal configure --enable-tests --enable-benchmarks --enable-documentation - name: Generate cache key diff --git a/.github/workflows/main-push.yml b/.github/workflows/main-push.yml index 942b16d83..e8f6bde24 100644 --- a/.github/workflows/main-push.yml +++ b/.github/workflows/main-push.yml @@ -37,14 +37,14 @@ jobs: shell: bash run: | cabal update - cabal new-build all -f Pedantic + cabal build all -f Pedantic - name: Upload package env: HACKAGE_PASSWORD: ${{ secrets.HACKAGE_PASSWORD }} shell: bash run: | - cabal sdist + cabal sdist all cabal upload --username=VladimirSinyakov --password="$HACKAGE_PASSWORD" dist-newstyle/sdist/*.tar.gz cabal v2-haddock --haddock-for-hackage --enable-doc diff --git a/cabal.project b/cabal.project index e7b26140a..28886d084 100644 --- a/cabal.project +++ b/cabal.project @@ -4,6 +4,7 @@ packages: symbolic-base symbolic-cardano symbolic-examples + zkfold-ledger optimization: 2 diff --git a/symbolic-base/symbolic-base.cabal b/symbolic-base/symbolic-base.cabal index 287433213..c51b5df72 100644 --- a/symbolic-base/symbolic-base.cabal +++ b/symbolic-base/symbolic-base.cabal @@ -2,7 +2,7 @@ cabal-version: 3.0 name: symbolic-base version: 0.1.0.0 -tested-with: GHC ==9.6.4 +tested-with: GHC == 9.6.3 synopsis: ZkFold Symbolic compiler and zero-knowledge proof protocols homepage: https://zkfold.io/ category: Cryptography, DSL, Math, Symbolic Computation @@ -15,7 +15,7 @@ Data-Files: test/data/shabittestvectors/*.rsp description: - This package contains the base library for the ZkFold project. It includes zkFold Symbolic compiler and a number of zero knowledge proof protocols. + This package contains the zkFold Symbolic framework base library. It includes the zkFold Symbolic compiler and a number of zero knowledge proof protocols. The compiler translates code written using the zkFold Symbolic framework into arithmetic circuits. The zero knowledge proof protocols are used to verify statements about the circuits. Flag Pedantic @@ -35,6 +35,7 @@ common options -Wnoncanonical-monad-instances -Wpartial-fields -Wredundant-constraints + -Wunused-packages -O2 -threaded if flag(pedantic) @@ -190,25 +191,6 @@ library ZkFold.Symbolic.Data.UTCTime ZkFold.Symbolic.Data.FieldElement ZkFold.Symbolic.Interpreter - ZkFold.Symbolic.Ledger.Types - ZkFold.Symbolic.Ledger.Types.Address - ZkFold.Symbolic.Ledger.Types.Basic - ZkFold.Symbolic.Ledger.Types.Bridge - ZkFold.Symbolic.Ledger.Types.Contract - ZkFold.Symbolic.Ledger.Types.Hash - ZkFold.Symbolic.Ledger.Types.Input - ZkFold.Symbolic.Ledger.Types.Output - ZkFold.Symbolic.Ledger.Types.OutputRef - ZkFold.Symbolic.Ledger.Types.Transaction - ZkFold.Symbolic.Ledger.Types.Update - ZkFold.Symbolic.Ledger.Types.Value - ZkFold.Symbolic.Ledger.Validation.Bridge - ZkFold.Symbolic.Ledger.Validation.Contract - ZkFold.Symbolic.Ledger.Validation.Common - ZkFold.Symbolic.Ledger.Validation.PrivateInput - ZkFold.Symbolic.Ledger.Validation.PublicInput - ZkFold.Symbolic.Ledger.Validation.Transaction - ZkFold.Symbolic.Ledger.Validation.Update ZkFold.Symbolic.MonadCircuit build-depends: base >= 4.9 && < 5, @@ -226,7 +208,6 @@ library lens , mtl < 2.4, optics < 0.5, - parallel < 3.2.3.0, pretty-simple < 4.2, QuickCheck < 2.15, random < 1.3, @@ -236,7 +217,6 @@ library -- TODO: remove `swagger2` after moving the related code to `zkfold-prover` swagger2 , text , - tfp < 1.1, these < 1.3, type-errors < 0.2.1, vector < 0.14, @@ -281,7 +261,6 @@ test-suite symbolic-base-test bytestring , blake2 , containers , - deepseq , containers , directory <= 1.3.8.4, filepath <= 1.5.2.0, @@ -303,7 +282,6 @@ benchmark bench-poly-mul -O3 build-depends: base, - array, deepseq, random, symbolic-base, diff --git a/symbolic-cardano/symbolic-cardano.cabal b/symbolic-cardano/symbolic-cardano.cabal index ab9a4dcc4..b58d74deb 100644 --- a/symbolic-cardano/symbolic-cardano.cabal +++ b/symbolic-cardano/symbolic-cardano.cabal @@ -2,10 +2,10 @@ cabal-version: 3.0 name: symbolic-cardano version: 0.1.0.0 -tested-with: GHC ==9.6.4 +tested-with: GHC == 9.6.3 synopsis: ZkFold Symbolic library for integration with Cardano homepage: https://zkfold.io/ -category: Cryptography, DSL, Math, Symbolic Computation +category: Blockchain, Cryptography, DSL, Math, Symbolic Computation author: Vladimir Sinyakov, Pavel Sokolov, Vladimir Morozov, Eitan Chatav, Ilya Baryshnikov, Anna Hovanskaya, Evgenii Samodelov, Murat Kasimov, Maxim Churilov maintainer: vlasin@zkfold.io license: MIT @@ -33,6 +33,7 @@ common options -Wnoncanonical-monad-instances -Wpartial-fields -Wredundant-constraints + -Wunused-packages -O2 -threaded if flag(pedantic) @@ -107,35 +108,7 @@ library ZkFold.Symbolic.Cardano.UPLC.Type build-depends: base >= 4.9 && < 5, - adjunctions < 4.5, - aeson < 2.3, - base64-bytestring , - binary < 0.11, - -- TODO: remove `blake2` after refactoring of ZK protocols - blake2 < 0.4, - bytestring < 0.12, containers < 0.7, - cryptohash-sha256 < 0.12, - deepseq <= 1.5.0.0, - distributive , - lens , - mtl < 2.4, - optics < 0.5, - parallel < 3.2.3.0, - pretty-simple < 4.2, - QuickCheck < 2.15, - random < 1.3, semialign < 1.4, - semigroups , - split < 0.2.6, symbolic-base , - -- TODO: remove `swagger2` after moving the related code to `zkfold-prover` - swagger2 , - text , - tfp < 1.1, - these < 1.3, - type-errors < 0.2.1, - vector < 0.14, - vector-binary-instances < 0.3, - vector-split < 1.1, hs-source-dirs: src diff --git a/symbolic-examples/symbolic-examples.cabal b/symbolic-examples/symbolic-examples.cabal index 24732882c..9aadbfd1b 100644 --- a/symbolic-examples/symbolic-examples.cabal +++ b/symbolic-examples/symbolic-examples.cabal @@ -2,7 +2,7 @@ cabal-version: 3.0 name: symbolic-examples version: 0.1.0.0 -tested-with: GHC ==9.6.4 +tested-with: GHC == 9.6.3 synopsis: ZkFold Symbolic examples homepage: https://zkfold.io/ category: Cryptography, DSL, Math, Symbolic Computation @@ -33,6 +33,7 @@ common options -Wnoncanonical-monad-instances -Wpartial-fields -Wredundant-constraints + -Wunused-packages -O2 -threaded if flag(pedantic) @@ -102,7 +103,6 @@ library Examples.UInt build-depends: base, - containers, deepseq, symbolic-base, symbolic-cardano, @@ -121,10 +121,8 @@ benchmark bench-compiler adjunctions, base, bytestring, - containers, deepseq, symbolic-base, - symbolic-cardano, symbolic-examples, tasty-bench, tasty-golden, diff --git a/zkfold-ledger/LICENSE b/zkfold-ledger/LICENSE new file mode 100644 index 000000000..e231bb839 --- /dev/null +++ b/zkfold-ledger/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 zkFold SA + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/zkfold-ledger/hie.yaml b/zkfold-ledger/hie.yaml new file mode 100644 index 000000000..cbecb0e40 --- /dev/null +++ b/zkfold-ledger/hie.yaml @@ -0,0 +1,4 @@ +cradle: + cabal: + - path: "./src" + component: "lib:zkfold-ledger" diff --git a/symbolic-base/src/ZkFold/Symbolic/Ledger/Types.hs b/zkfold-ledger/src/ZkFold/Symbolic/Ledger/Types.hs similarity index 100% rename from symbolic-base/src/ZkFold/Symbolic/Ledger/Types.hs rename to zkfold-ledger/src/ZkFold/Symbolic/Ledger/Types.hs diff --git a/symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Address.hs b/zkfold-ledger/src/ZkFold/Symbolic/Ledger/Types/Address.hs similarity index 100% rename from symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Address.hs rename to zkfold-ledger/src/ZkFold/Symbolic/Ledger/Types/Address.hs diff --git a/symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Basic.hs b/zkfold-ledger/src/ZkFold/Symbolic/Ledger/Types/Basic.hs similarity index 100% rename from symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Basic.hs rename to zkfold-ledger/src/ZkFold/Symbolic/Ledger/Types/Basic.hs diff --git a/symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Bridge.hs b/zkfold-ledger/src/ZkFold/Symbolic/Ledger/Types/Bridge.hs similarity index 100% rename from symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Bridge.hs rename to zkfold-ledger/src/ZkFold/Symbolic/Ledger/Types/Bridge.hs diff --git a/symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Contract.hs b/zkfold-ledger/src/ZkFold/Symbolic/Ledger/Types/Contract.hs similarity index 100% rename from symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Contract.hs rename to zkfold-ledger/src/ZkFold/Symbolic/Ledger/Types/Contract.hs diff --git a/symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Hash.hs b/zkfold-ledger/src/ZkFold/Symbolic/Ledger/Types/Hash.hs similarity index 100% rename from symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Hash.hs rename to zkfold-ledger/src/ZkFold/Symbolic/Ledger/Types/Hash.hs diff --git a/symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Input.hs b/zkfold-ledger/src/ZkFold/Symbolic/Ledger/Types/Input.hs similarity index 100% rename from symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Input.hs rename to zkfold-ledger/src/ZkFold/Symbolic/Ledger/Types/Input.hs diff --git a/symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Output.hs b/zkfold-ledger/src/ZkFold/Symbolic/Ledger/Types/Output.hs similarity index 100% rename from symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Output.hs rename to zkfold-ledger/src/ZkFold/Symbolic/Ledger/Types/Output.hs diff --git a/symbolic-base/src/ZkFold/Symbolic/Ledger/Types/OutputRef.hs b/zkfold-ledger/src/ZkFold/Symbolic/Ledger/Types/OutputRef.hs similarity index 100% rename from symbolic-base/src/ZkFold/Symbolic/Ledger/Types/OutputRef.hs rename to zkfold-ledger/src/ZkFold/Symbolic/Ledger/Types/OutputRef.hs diff --git a/symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Transaction.hs b/zkfold-ledger/src/ZkFold/Symbolic/Ledger/Types/Transaction.hs similarity index 100% rename from symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Transaction.hs rename to zkfold-ledger/src/ZkFold/Symbolic/Ledger/Types/Transaction.hs diff --git a/symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Update.hs b/zkfold-ledger/src/ZkFold/Symbolic/Ledger/Types/Update.hs similarity index 100% rename from symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Update.hs rename to zkfold-ledger/src/ZkFold/Symbolic/Ledger/Types/Update.hs diff --git a/symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Value.hs b/zkfold-ledger/src/ZkFold/Symbolic/Ledger/Types/Value.hs similarity index 100% rename from symbolic-base/src/ZkFold/Symbolic/Ledger/Types/Value.hs rename to zkfold-ledger/src/ZkFold/Symbolic/Ledger/Types/Value.hs diff --git a/symbolic-base/src/ZkFold/Symbolic/Ledger/Validation/Bridge.hs b/zkfold-ledger/src/ZkFold/Symbolic/Ledger/Validation/Bridge.hs similarity index 100% rename from symbolic-base/src/ZkFold/Symbolic/Ledger/Validation/Bridge.hs rename to zkfold-ledger/src/ZkFold/Symbolic/Ledger/Validation/Bridge.hs diff --git a/symbolic-base/src/ZkFold/Symbolic/Ledger/Validation/Common.hs b/zkfold-ledger/src/ZkFold/Symbolic/Ledger/Validation/Common.hs similarity index 100% rename from symbolic-base/src/ZkFold/Symbolic/Ledger/Validation/Common.hs rename to zkfold-ledger/src/ZkFold/Symbolic/Ledger/Validation/Common.hs diff --git a/symbolic-base/src/ZkFold/Symbolic/Ledger/Validation/Contract.hs b/zkfold-ledger/src/ZkFold/Symbolic/Ledger/Validation/Contract.hs similarity index 100% rename from symbolic-base/src/ZkFold/Symbolic/Ledger/Validation/Contract.hs rename to zkfold-ledger/src/ZkFold/Symbolic/Ledger/Validation/Contract.hs diff --git a/symbolic-base/src/ZkFold/Symbolic/Ledger/Validation/PrivateInput.hs b/zkfold-ledger/src/ZkFold/Symbolic/Ledger/Validation/PrivateInput.hs similarity index 100% rename from symbolic-base/src/ZkFold/Symbolic/Ledger/Validation/PrivateInput.hs rename to zkfold-ledger/src/ZkFold/Symbolic/Ledger/Validation/PrivateInput.hs diff --git a/symbolic-base/src/ZkFold/Symbolic/Ledger/Validation/PublicInput.hs b/zkfold-ledger/src/ZkFold/Symbolic/Ledger/Validation/PublicInput.hs similarity index 100% rename from symbolic-base/src/ZkFold/Symbolic/Ledger/Validation/PublicInput.hs rename to zkfold-ledger/src/ZkFold/Symbolic/Ledger/Validation/PublicInput.hs diff --git a/symbolic-base/src/ZkFold/Symbolic/Ledger/Validation/Transaction.hs b/zkfold-ledger/src/ZkFold/Symbolic/Ledger/Validation/Transaction.hs similarity index 100% rename from symbolic-base/src/ZkFold/Symbolic/Ledger/Validation/Transaction.hs rename to zkfold-ledger/src/ZkFold/Symbolic/Ledger/Validation/Transaction.hs diff --git a/symbolic-base/src/ZkFold/Symbolic/Ledger/Validation/Update.hs b/zkfold-ledger/src/ZkFold/Symbolic/Ledger/Validation/Update.hs similarity index 100% rename from symbolic-base/src/ZkFold/Symbolic/Ledger/Validation/Update.hs rename to zkfold-ledger/src/ZkFold/Symbolic/Ledger/Validation/Update.hs diff --git a/zkfold-ledger/zkfold-ledger.cabal b/zkfold-ledger/zkfold-ledger.cabal new file mode 100644 index 000000000..443fd34d8 --- /dev/null +++ b/zkfold-ledger/zkfold-ledger.cabal @@ -0,0 +1,113 @@ +cabal-version: 3.0 + +name: zkfold-ledger +version: 0.1.0.0 +tested-with: GHC == 9.6.3 +synopsis: zkFold Ledger +homepage: https://zkfold.io/ +category: Blockchain, Cryptography, DSL, Math, Symbolic Computation +author: Vladimir Sinyakov, Pavel Sokolov, Vladimir Morozov, Eitan Chatav, Ilya Baryshnikov, Anna Hovanskaya, Evgenii Samodelov, Maxim Churilov +maintainer: vlasin@zkfold.io +license: MIT +license-file: LICENSE +build-type: Simple + +description: + This package contains the definitions related to the zkFold Ledger. + +Flag Pedantic + Description: Enable pedantic build with -Werror + Manual: True + Default: False + +common options + default-language: Haskell2010 + ghc-options: + -fwarn-redundant-constraints + -Wall + -Wcompat + -Widentities + -Wincomplete-record-updates + -Wincomplete-uni-patterns + -Wnoncanonical-monad-instances + -Wpartial-fields + -Wredundant-constraints + -Wunused-packages + -O2 + -threaded + if flag(pedantic) + ghc-options: + -Werror + default-extensions: + BangPatterns, + BinaryLiterals, + ConstraintKinds, + DataKinds, + DefaultSignatures, + DeriveDataTypeable, + DeriveFoldable, + DeriveFunctor, + DeriveGeneric, + DeriveTraversable, + ExistentialQuantification, + FlexibleContexts, + FlexibleInstances, + FunctionalDependencies, + GADTs, + GeneralizedNewtypeDeriving, + InstanceSigs, + KindSignatures, + LambdaCase, + MultiParamTypeClasses, + MultiWayIf, + NamedFieldPuns, + NoImplicitPrelude, + NoStarIsType, + NumericUnderscores, + OverloadedStrings, + OverloadedLabels, + PolyKinds, + RankNTypes, + RecordWildCards, + ScopedTypeVariables, + StandaloneDeriving, + StandaloneKindSignatures, + TupleSections, + TypeApplications, + TypeFamilies, + ViewPatterns + +common options-exe + import: options + ghc-options: + -rtsopts + ghc-prof-options: + -with-rtsopts=-pj + +library + import: options + exposed-modules: + ZkFold.Symbolic.Ledger.Types + ZkFold.Symbolic.Ledger.Types.Address + ZkFold.Symbolic.Ledger.Types.Basic + ZkFold.Symbolic.Ledger.Types.Bridge + ZkFold.Symbolic.Ledger.Types.Contract + ZkFold.Symbolic.Ledger.Types.Hash + ZkFold.Symbolic.Ledger.Types.Input + ZkFold.Symbolic.Ledger.Types.Output + ZkFold.Symbolic.Ledger.Types.OutputRef + ZkFold.Symbolic.Ledger.Types.Transaction + ZkFold.Symbolic.Ledger.Types.Update + ZkFold.Symbolic.Ledger.Types.Value + ZkFold.Symbolic.Ledger.Validation.Bridge + ZkFold.Symbolic.Ledger.Validation.Contract + ZkFold.Symbolic.Ledger.Validation.Common + ZkFold.Symbolic.Ledger.Validation.PrivateInput + ZkFold.Symbolic.Ledger.Validation.PublicInput + ZkFold.Symbolic.Ledger.Validation.Transaction + ZkFold.Symbolic.Ledger.Validation.Update + build-depends: + base >= 4.9 && < 5, + semialign < 1.4, + symbolic-base , + hs-source-dirs: src From 7065f0a9a629c9c1628d9cc9aab781372f1f783d Mon Sep 17 00:00:00 2001 From: Vladimir Sinyakov Date: Sun, 6 Oct 2024 13:06:36 +0200 Subject: [PATCH 4/7] Update readmes --- README.md | 22 ++++++++++--------- symbolic-base/README.md | 2 ++ symbolic-cardano/README.md | 2 ++ symbolic-examples/README.md | 2 ++ symbolic-examples/bench/BenchCompiler.hs | 2 +- .../stats/ByteString.Add.512 | 0 .../stats/ByteString.And.32 | 0 .../stats/ByteString.Extend.1.512 | 0 .../stats/ByteString.Or.64 | 0 .../stats/Conditional | 0 .../stats/Constant.5 | 0 {symbolic-base => symbolic-examples}/stats/Eq | 0 .../stats/Eq.Constant.5 | 0 .../stats/FFA.Add.097 | 0 .../stats/FFA.Add.337 | 0 .../stats/FFA.Mul.097 | 0 .../stats/FFA.Mul.337 | 0 .../stats/Fibonacci.100 | 0 .../stats/LEQ | 0 .../stats/MiMCHash | 0 .../stats/Reverse.32.3000 | 0 .../stats/SHA256.32 | 0 .../stats/UInt.DivMod.32.Auto | 0 .../stats/UInt.Mul.64.Auto | 0 .../stats/UInt.StrictAdd.256.Auto | 0 .../stats/UInt.StrictMul.512.Auto | 0 symbolic-examples/symbolic-examples.cabal | 4 ++-- zkfold-ledger/README.md | 2 ++ 28 files changed, 23 insertions(+), 13 deletions(-) create mode 100644 symbolic-base/README.md create mode 100644 symbolic-cardano/README.md create mode 100644 symbolic-examples/README.md rename {symbolic-base => symbolic-examples}/stats/ByteString.Add.512 (100%) rename {symbolic-base => symbolic-examples}/stats/ByteString.And.32 (100%) rename {symbolic-base => symbolic-examples}/stats/ByteString.Extend.1.512 (100%) rename {symbolic-base => symbolic-examples}/stats/ByteString.Or.64 (100%) rename {symbolic-base => symbolic-examples}/stats/Conditional (100%) rename {symbolic-base => symbolic-examples}/stats/Constant.5 (100%) rename {symbolic-base => symbolic-examples}/stats/Eq (100%) rename {symbolic-base => symbolic-examples}/stats/Eq.Constant.5 (100%) rename {symbolic-base => symbolic-examples}/stats/FFA.Add.097 (100%) rename {symbolic-base => symbolic-examples}/stats/FFA.Add.337 (100%) rename {symbolic-base => symbolic-examples}/stats/FFA.Mul.097 (100%) rename {symbolic-base => symbolic-examples}/stats/FFA.Mul.337 (100%) rename {symbolic-base => symbolic-examples}/stats/Fibonacci.100 (100%) rename {symbolic-base => symbolic-examples}/stats/LEQ (100%) rename {symbolic-base => symbolic-examples}/stats/MiMCHash (100%) rename {symbolic-base => symbolic-examples}/stats/Reverse.32.3000 (100%) rename {symbolic-base => symbolic-examples}/stats/SHA256.32 (100%) rename {symbolic-base => symbolic-examples}/stats/UInt.DivMod.32.Auto (100%) rename {symbolic-base => symbolic-examples}/stats/UInt.Mul.64.Auto (100%) rename {symbolic-base => symbolic-examples}/stats/UInt.StrictAdd.256.Auto (100%) rename {symbolic-base => symbolic-examples}/stats/UInt.StrictMul.512.Auto (100%) create mode 100644 zkfold-ledger/README.md diff --git a/README.md b/README.md index 25e53ffa7..12b4cc9f7 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,27 @@ -# zkFold Base library -This repository contains the base library for the ZkFold project. It includes the zkFold Symbolic compiler and a number of zero knowledge proof protocols. The compiler translates a subset of Haskell into arithmetic circuits, which can be used to generate zero knowledge proofs. +# zkFold Symbolic framework +This repository contains the zkFold Symbolic framework base library as well as additional packages written using the framework. # Documentation -The zkFold Symbolic language can be utilized to create zero-knowledge smart contracts and privacy-preserving applications. +The zkFold Symbolic framework can be utilized to create zero-knowledge smart contracts and privacy-preserving applications. -User documentation can be found at [docs.zkfold.io](https://docs.zkfold.io "zkFold Symbolic User Documentation"). +User documentation can be found at [docs.zkfold.io](https://docs.zkfold.io/symbolic/introduction/ "zkFold Symbolic User Documentation"). If you want to contribute to the project or find out how it works "under the hood", check out [package documentation](https://hackage.haskell.org/package/zkfold-base-0.1.0.0/candidate "zkFold Base package") on Hackage. # Build -The package compiles with GHC 9.6.3 and Cabal 3.10.2.1. +The package compiles with GHC 9.6.3 and Cabal 3.10.2.1. To build all packages, execute +```bash +cabal build all +``` # Tests To run the tests, execute ```bash -cabal run -- zkfold-base-test +cabal test all ``` # Benchmarks -The `examples` folder contains several code examples of arithmetizable pure functions. These examples can be compiled into the arithmetic circuits with the zkFold Symbolic compiler. In order to do it, execute +To run the benchmarks, execute ```bash -cabal run -- zkfold-base-examples -``` -The output is placed into the `compiled_scripts` folder. +cabal bench all +``` \ No newline at end of file diff --git a/symbolic-base/README.md b/symbolic-base/README.md new file mode 100644 index 000000000..97b970499 --- /dev/null +++ b/symbolic-base/README.md @@ -0,0 +1,2 @@ +# zkFold Symbolic Base package +This package contains the zkFold Symbolic framework base library. It includes the zkFold Symbolic compiler and a number of zero knowledge proof protocols. The compiler translates code written using the zkFold Symbolic framework into arithmetic circuits. The zero knowledge proof protocols are used to verify statements about the circuits. \ No newline at end of file diff --git a/symbolic-cardano/README.md b/symbolic-cardano/README.md new file mode 100644 index 000000000..93369a4f7 --- /dev/null +++ b/symbolic-cardano/README.md @@ -0,0 +1,2 @@ +# zkFold Symbolic Cardano package +This package contains the library for integration of the zkFold Symbolic framework with the Cardano blockchain. It provides the types and functions for verifying statements about Cardano transactions. \ No newline at end of file diff --git a/symbolic-examples/README.md b/symbolic-examples/README.md new file mode 100644 index 000000000..9ccfa014a --- /dev/null +++ b/symbolic-examples/README.md @@ -0,0 +1,2 @@ +# zkFold Symbolic Examples package +This package contains the examples generated using the the zkFold Symbolic framework. It also contains a benchmark for compiling the examples into arithmetic circuits and evaluating those circuits on a set of inputs. \ No newline at end of file diff --git a/symbolic-examples/bench/BenchCompiler.hs b/symbolic-examples/bench/BenchCompiler.hs index fb3d410b8..ecde3324a 100644 --- a/symbolic-examples/bench/BenchCompiler.hs +++ b/symbolic-examples/bench/BenchCompiler.hs @@ -38,7 +38,7 @@ benchmark name circuit = bgroup name , env (return $ force $ circuit ()) $ \c -> let input = tabulate (const zero) - path = "symbolic-base/stats/" <> name + path = "stats/" <> name in bgroup "on compilation" [ bench "evaluation" $ nf (witnessGenerator c) input , goldenVsString "# of constraints" path $ return (metrics name c) diff --git a/symbolic-base/stats/ByteString.Add.512 b/symbolic-examples/stats/ByteString.Add.512 similarity index 100% rename from symbolic-base/stats/ByteString.Add.512 rename to symbolic-examples/stats/ByteString.Add.512 diff --git a/symbolic-base/stats/ByteString.And.32 b/symbolic-examples/stats/ByteString.And.32 similarity index 100% rename from symbolic-base/stats/ByteString.And.32 rename to symbolic-examples/stats/ByteString.And.32 diff --git a/symbolic-base/stats/ByteString.Extend.1.512 b/symbolic-examples/stats/ByteString.Extend.1.512 similarity index 100% rename from symbolic-base/stats/ByteString.Extend.1.512 rename to symbolic-examples/stats/ByteString.Extend.1.512 diff --git a/symbolic-base/stats/ByteString.Or.64 b/symbolic-examples/stats/ByteString.Or.64 similarity index 100% rename from symbolic-base/stats/ByteString.Or.64 rename to symbolic-examples/stats/ByteString.Or.64 diff --git a/symbolic-base/stats/Conditional b/symbolic-examples/stats/Conditional similarity index 100% rename from symbolic-base/stats/Conditional rename to symbolic-examples/stats/Conditional diff --git a/symbolic-base/stats/Constant.5 b/symbolic-examples/stats/Constant.5 similarity index 100% rename from symbolic-base/stats/Constant.5 rename to symbolic-examples/stats/Constant.5 diff --git a/symbolic-base/stats/Eq b/symbolic-examples/stats/Eq similarity index 100% rename from symbolic-base/stats/Eq rename to symbolic-examples/stats/Eq diff --git a/symbolic-base/stats/Eq.Constant.5 b/symbolic-examples/stats/Eq.Constant.5 similarity index 100% rename from symbolic-base/stats/Eq.Constant.5 rename to symbolic-examples/stats/Eq.Constant.5 diff --git a/symbolic-base/stats/FFA.Add.097 b/symbolic-examples/stats/FFA.Add.097 similarity index 100% rename from symbolic-base/stats/FFA.Add.097 rename to symbolic-examples/stats/FFA.Add.097 diff --git a/symbolic-base/stats/FFA.Add.337 b/symbolic-examples/stats/FFA.Add.337 similarity index 100% rename from symbolic-base/stats/FFA.Add.337 rename to symbolic-examples/stats/FFA.Add.337 diff --git a/symbolic-base/stats/FFA.Mul.097 b/symbolic-examples/stats/FFA.Mul.097 similarity index 100% rename from symbolic-base/stats/FFA.Mul.097 rename to symbolic-examples/stats/FFA.Mul.097 diff --git a/symbolic-base/stats/FFA.Mul.337 b/symbolic-examples/stats/FFA.Mul.337 similarity index 100% rename from symbolic-base/stats/FFA.Mul.337 rename to symbolic-examples/stats/FFA.Mul.337 diff --git a/symbolic-base/stats/Fibonacci.100 b/symbolic-examples/stats/Fibonacci.100 similarity index 100% rename from symbolic-base/stats/Fibonacci.100 rename to symbolic-examples/stats/Fibonacci.100 diff --git a/symbolic-base/stats/LEQ b/symbolic-examples/stats/LEQ similarity index 100% rename from symbolic-base/stats/LEQ rename to symbolic-examples/stats/LEQ diff --git a/symbolic-base/stats/MiMCHash b/symbolic-examples/stats/MiMCHash similarity index 100% rename from symbolic-base/stats/MiMCHash rename to symbolic-examples/stats/MiMCHash diff --git a/symbolic-base/stats/Reverse.32.3000 b/symbolic-examples/stats/Reverse.32.3000 similarity index 100% rename from symbolic-base/stats/Reverse.32.3000 rename to symbolic-examples/stats/Reverse.32.3000 diff --git a/symbolic-base/stats/SHA256.32 b/symbolic-examples/stats/SHA256.32 similarity index 100% rename from symbolic-base/stats/SHA256.32 rename to symbolic-examples/stats/SHA256.32 diff --git a/symbolic-base/stats/UInt.DivMod.32.Auto b/symbolic-examples/stats/UInt.DivMod.32.Auto similarity index 100% rename from symbolic-base/stats/UInt.DivMod.32.Auto rename to symbolic-examples/stats/UInt.DivMod.32.Auto diff --git a/symbolic-base/stats/UInt.Mul.64.Auto b/symbolic-examples/stats/UInt.Mul.64.Auto similarity index 100% rename from symbolic-base/stats/UInt.Mul.64.Auto rename to symbolic-examples/stats/UInt.Mul.64.Auto diff --git a/symbolic-base/stats/UInt.StrictAdd.256.Auto b/symbolic-examples/stats/UInt.StrictAdd.256.Auto similarity index 100% rename from symbolic-base/stats/UInt.StrictAdd.256.Auto rename to symbolic-examples/stats/UInt.StrictAdd.256.Auto diff --git a/symbolic-base/stats/UInt.StrictMul.512.Auto b/symbolic-examples/stats/UInt.StrictMul.512.Auto similarity index 100% rename from symbolic-base/stats/UInt.StrictMul.512.Auto rename to symbolic-examples/stats/UInt.StrictMul.512.Auto diff --git a/symbolic-examples/symbolic-examples.cabal b/symbolic-examples/symbolic-examples.cabal index 9aadbfd1b..5bdd23e8e 100644 --- a/symbolic-examples/symbolic-examples.cabal +++ b/symbolic-examples/symbolic-examples.cabal @@ -13,8 +13,8 @@ license-file: LICENSE build-type: Simple description: - This package contains the examples generated using the the zkFold Symbolic framework. It also contains a benchmark for compiling the examples into arithmetic circuits - and evaluating those circuits on a set of inputs. + This package contains the examples generated using the the zkFold Symbolic framework. + It also contains a benchmark for compiling the examples into arithmetic circuits and evaluating those circuits on a set of inputs. Flag Pedantic Description: Enable pedantic build with -Werror diff --git a/zkfold-ledger/README.md b/zkfold-ledger/README.md new file mode 100644 index 000000000..4091d245c --- /dev/null +++ b/zkfold-ledger/README.md @@ -0,0 +1,2 @@ +# zkFold Ledger +This package contains the zkFold Symbolic framework base library. It includes the zkFold Symbolic compiler and a number of zero knowledge proof protocols. The compiler translates code written using the zkFold Symbolic framework into arithmetic circuits. The zero knowledge proof protocols are used to verify statements about the circuits. \ No newline at end of file From 84586b0eeae7a39c36200bef0a17709560583675 Mon Sep 17 00:00:00 2001 From: Vladimir Sinyakov Date: Mon, 7 Oct 2024 10:11:32 +0200 Subject: [PATCH 5/7] Clean up `symbolic-base` --- .../examples/Examples/BatchTransfer.hs | 19 ----- symbolic-base/examples/Examples/ByteString.hs | 38 ---------- .../examples/Examples/Conditional.hs | 10 --- symbolic-base/examples/Examples/Constant.hs | 15 ---- symbolic-base/examples/Examples/Eq.hs | 10 --- symbolic-base/examples/Examples/FFA.hs | 31 -------- symbolic-base/examples/Examples/Fibonacci.hs | 28 ------- symbolic-base/examples/Examples/LEQ.hs | 10 --- symbolic-base/examples/Examples/MiMCHash.hs | 12 --- .../examples/Examples/ReverseList.hs | 7 -- symbolic-base/examples/Examples/UInt.hs | 40 ---------- .../examples/ZkFold/Symbolic/Examples.hs | 76 ------------------- 12 files changed, 296 deletions(-) delete mode 100644 symbolic-base/examples/Examples/BatchTransfer.hs delete mode 100644 symbolic-base/examples/Examples/ByteString.hs delete mode 100644 symbolic-base/examples/Examples/Conditional.hs delete mode 100644 symbolic-base/examples/Examples/Constant.hs delete mode 100644 symbolic-base/examples/Examples/Eq.hs delete mode 100644 symbolic-base/examples/Examples/FFA.hs delete mode 100644 symbolic-base/examples/Examples/Fibonacci.hs delete mode 100644 symbolic-base/examples/Examples/LEQ.hs delete mode 100644 symbolic-base/examples/Examples/MiMCHash.hs delete mode 100644 symbolic-base/examples/Examples/ReverseList.hs delete mode 100644 symbolic-base/examples/Examples/UInt.hs delete mode 100644 symbolic-base/examples/ZkFold/Symbolic/Examples.hs diff --git a/symbolic-base/examples/Examples/BatchTransfer.hs b/symbolic-base/examples/Examples/BatchTransfer.hs deleted file mode 100644 index ddb2328d1..000000000 --- a/symbolic-base/examples/Examples/BatchTransfer.hs +++ /dev/null @@ -1,19 +0,0 @@ -module Examples.BatchTransfer (exampleBatchTransfer) where - -import ZkFold.Base.Algebra.Basic.Number (KnownNat) -import ZkFold.Base.Data.Vector (Vector) -import ZkFold.Symbolic.Cardano.Contracts.BatchTransfer (Tokens, Tx, TxOut, batchTransfer) -import ZkFold.Symbolic.Cardano.Types (Bool, ByteString, Value) -import ZkFold.Symbolic.Cardano.Types.Value (SingleAsset) -import ZkFold.Symbolic.Class (Symbolic (..)) -import ZkFold.Symbolic.Data.Class (SymbolicData (..)) - - -exampleBatchTransfer :: - ( Symbolic c - , SymbolicData (TxOut c) - , KnownNat (TypeSize (TxOut c)) - , KnownNat (TypeSize (SingleAsset c)) - , KnownNat (TypeSize (Value Tokens c)) - ) => Tx c -> Vector 5 (TxOut c, TxOut c, ByteString 256 c) -> Bool c -exampleBatchTransfer = batchTransfer diff --git a/symbolic-base/examples/Examples/ByteString.hs b/symbolic-base/examples/Examples/ByteString.hs deleted file mode 100644 index 13c329909..000000000 --- a/symbolic-base/examples/Examples/ByteString.hs +++ /dev/null @@ -1,38 +0,0 @@ -{-# LANGUAGE TypeOperators #-} - -module Examples.ByteString ( - exampleByteStringAnd, - exampleByteStringOr, - exampleByteStringExtend, - exampleByteStringAdd, - exampleSHA - ) where - -import ZkFold.Base.Algebra.Basic.Class -import ZkFold.Base.Algebra.Basic.Number (KnownNat, type (<=)) -import ZkFold.Symbolic.Algorithms.Hash.SHA2 (SHA2, sha2) -import ZkFold.Symbolic.Class (Symbolic) -import ZkFold.Symbolic.Data.Bool (BoolType (..)) -import ZkFold.Symbolic.Data.ByteString (ByteString) -import ZkFold.Symbolic.Data.Combinators (Extend (..), Iso (..), RegisterSize (..)) -import ZkFold.Symbolic.Data.UInt (UInt) - -exampleByteStringAnd :: - (KnownNat n, Symbolic c) => ByteString n c -> ByteString n c -> ByteString n c -exampleByteStringAnd = (&&) - -exampleByteStringOr :: - (KnownNat n, Symbolic c) => ByteString n c -> ByteString n c -> ByteString n c -exampleByteStringOr = (||) - -exampleByteStringExtend :: - (KnownNat n, KnownNat k, n <= k, Symbolic c) => - ByteString n c -> ByteString k c -exampleByteStringExtend = extend - -exampleByteStringAdd :: - forall n c. (KnownNat n, Symbolic c) => ByteString n c -> ByteString n c -> ByteString n c -exampleByteStringAdd x y = from (from x + from y :: UInt n Auto c) - -exampleSHA :: forall n c. SHA2 "SHA256" c n => ByteString n c -> ByteString 256 c -exampleSHA = sha2 @"SHA256" diff --git a/symbolic-base/examples/Examples/Conditional.hs b/symbolic-base/examples/Examples/Conditional.hs deleted file mode 100644 index a17f4c068..000000000 --- a/symbolic-base/examples/Examples/Conditional.hs +++ /dev/null @@ -1,10 +0,0 @@ -module Examples.Conditional (exampleConditional) where - -import ZkFold.Symbolic.Class (Symbolic) -import ZkFold.Symbolic.Data.Bool (Bool) -import ZkFold.Symbolic.Data.Conditional (Conditional (..)) -import ZkFold.Symbolic.Data.FieldElement (FieldElement) - -exampleConditional :: - Symbolic c => FieldElement c -> FieldElement c -> Bool c -> FieldElement c -exampleConditional = bool diff --git a/symbolic-base/examples/Examples/Constant.hs b/symbolic-base/examples/Examples/Constant.hs deleted file mode 100644 index becc7d8e6..000000000 --- a/symbolic-base/examples/Examples/Constant.hs +++ /dev/null @@ -1,15 +0,0 @@ -module Examples.Constant (exampleConst5, exampleEq5) where - -import Examples.Eq (exampleEq) -import Numeric.Natural (Natural) - -import ZkFold.Base.Algebra.Basic.Class (FromConstant (..)) -import ZkFold.Symbolic.Class (Symbolic) -import ZkFold.Symbolic.Data.Bool (Bool) -import ZkFold.Symbolic.Data.FieldElement (FieldElement) - -exampleConst5 :: Symbolic c => FieldElement c -exampleConst5 = fromConstant (5 :: Natural) - -exampleEq5 :: Symbolic c => FieldElement c -> Bool c -exampleEq5 = exampleEq exampleConst5 diff --git a/symbolic-base/examples/Examples/Eq.hs b/symbolic-base/examples/Examples/Eq.hs deleted file mode 100644 index 748f0a119..000000000 --- a/symbolic-base/examples/Examples/Eq.hs +++ /dev/null @@ -1,10 +0,0 @@ -module Examples.Eq (exampleEq) where - -import ZkFold.Symbolic.Class (Symbolic) -import ZkFold.Symbolic.Data.Bool (Bool) -import ZkFold.Symbolic.Data.Eq (Eq (..)) -import ZkFold.Symbolic.Data.FieldElement (FieldElement) - --- | (==) operation -exampleEq :: Symbolic c => FieldElement c -> FieldElement c -> Bool c -exampleEq x y = x == y diff --git a/symbolic-base/examples/Examples/FFA.hs b/symbolic-base/examples/Examples/FFA.hs deleted file mode 100644 index 86af80ac9..000000000 --- a/symbolic-base/examples/Examples/FFA.hs +++ /dev/null @@ -1,31 +0,0 @@ -module Examples.FFA - ( exampleFFAadd337 - , exampleFFAadd097 - , exampleFFAmul337 - , exampleFFAmul097) where - -import ZkFold.Base.Algebra.Basic.Class -import ZkFold.Base.Algebra.Basic.Number -import ZkFold.Symbolic.Class (Symbolic) -import ZkFold.Symbolic.Data.FFA (FFA) - -type Prime256_1 = 28948022309329048855892746252171976963363056481941560715954676764349967630337 -type Prime256_2 = 28948022309329048855892746252171976963363056481941647379679742748393362948097 - -exampleFFAadd337 :: Symbolic c => FFA Prime256_1 c -> FFA Prime256_1 c -> FFA Prime256_1 c -exampleFFAadd337 = exampleFFAadd - -exampleFFAadd097 :: Symbolic c => FFA Prime256_2 c -> FFA Prime256_2 c -> FFA Prime256_2 c -exampleFFAadd097 = exampleFFAadd - -exampleFFAmul337 :: Symbolic c => FFA Prime256_1 c -> FFA Prime256_1 c -> FFA Prime256_1 c -exampleFFAmul337 = exampleFFAmul - -exampleFFAmul097 :: Symbolic c => FFA Prime256_2 c -> FFA Prime256_2 c -> FFA Prime256_2 c -exampleFFAmul097 = exampleFFAmul - -exampleFFAadd :: forall p c. (Symbolic c, KnownNat p) => FFA p c -> FFA p c -> FFA p c -exampleFFAadd = (+) - -exampleFFAmul :: forall p c. (Symbolic c, KnownNat p) => FFA p c -> FFA p c -> FFA p c -exampleFFAmul = (*) diff --git a/symbolic-base/examples/Examples/Fibonacci.hs b/symbolic-base/examples/Examples/Fibonacci.hs deleted file mode 100644 index 5ccf53440..000000000 --- a/symbolic-base/examples/Examples/Fibonacci.hs +++ /dev/null @@ -1,28 +0,0 @@ -{-# LANGUAGE TypeApplications #-} - -module Examples.Fibonacci (exampleFibonacci) where - -import Data.Foldable (foldl) -import Prelude (Integer) - -import ZkFold.Base.Algebra.Basic.Class -import ZkFold.Symbolic.Class (Symbolic) -import ZkFold.Symbolic.Data.Bool (Bool) -import ZkFold.Symbolic.Data.Conditional (bool) -import ZkFold.Symbolic.Data.Eq (Eq (..)) -import ZkFold.Symbolic.Data.FieldElement (FieldElement) - --- | The Fibonacci index function. --- If `x` is a Fibonacci number, returns its index (up until `nMax`). --- Otherwise, returns `0`. -exampleFibonacci :: - forall c. Symbolic c => Integer -> FieldElement c -> FieldElement c -exampleFibonacci nMax x = - foldl - (\m k -> bool @(Bool c) m (fromConstant k) (fib k one one == x)) - zero - [1..nMax] - where - fib :: Integer -> FieldElement c -> FieldElement c -> FieldElement c - fib 1 x1 _ = x1 - fib n x1 x2 = fib (n - 1) x2 (x1 + x2) diff --git a/symbolic-base/examples/Examples/LEQ.hs b/symbolic-base/examples/Examples/LEQ.hs deleted file mode 100644 index b5785465b..000000000 --- a/symbolic-base/examples/Examples/LEQ.hs +++ /dev/null @@ -1,10 +0,0 @@ -module Examples.LEQ (exampleLEQ) where - -import ZkFold.Symbolic.Class (Symbolic) -import ZkFold.Symbolic.Data.Bool (Bool) -import ZkFold.Symbolic.Data.FieldElement (FieldElement) -import ZkFold.Symbolic.Data.Ord ((<=)) - --- | (<=) operation -exampleLEQ :: Symbolic c => FieldElement c -> FieldElement c -> Bool c -exampleLEQ x y = x <= y diff --git a/symbolic-base/examples/Examples/MiMCHash.hs b/symbolic-base/examples/Examples/MiMCHash.hs deleted file mode 100644 index e03a98fa4..000000000 --- a/symbolic-base/examples/Examples/MiMCHash.hs +++ /dev/null @@ -1,12 +0,0 @@ -module Examples.MiMCHash (exampleMiMC) where - -import ZkFold.Base.Algebra.Basic.Class -import ZkFold.Symbolic.Algorithms.Hash.MiMC (mimcHash2) -import ZkFold.Symbolic.Algorithms.Hash.MiMC.Constants (mimcConstants) -import ZkFold.Symbolic.Class (Symbolic (..)) -import ZkFold.Symbolic.Data.FieldElement (FieldElement) - -exampleMiMC :: - forall c. (Symbolic c, FromConstant (BaseField c) (FieldElement c)) => - FieldElement c -> FieldElement c -> FieldElement c -exampleMiMC = mimcHash2 mimcConstants (zero :: BaseField c) diff --git a/symbolic-base/examples/Examples/ReverseList.hs b/symbolic-base/examples/Examples/ReverseList.hs deleted file mode 100644 index fbb0f574e..000000000 --- a/symbolic-base/examples/Examples/ReverseList.hs +++ /dev/null @@ -1,7 +0,0 @@ -module Examples.ReverseList (exampleReverseList) where - -import ZkFold.Base.Data.Vector (Vector, reverse) - --- | Reverses the order of elements in a vector -exampleReverseList :: Vector n t -> Vector n t -exampleReverseList = reverse diff --git a/symbolic-base/examples/Examples/UInt.hs b/symbolic-base/examples/Examples/UInt.hs deleted file mode 100644 index ce6b79e10..000000000 --- a/symbolic-base/examples/Examples/UInt.hs +++ /dev/null @@ -1,40 +0,0 @@ -{-# LANGUAGE TypeOperators #-} - -module Examples.UInt ( - exampleUIntMul, - exampleUIntDivMod, - exampleUIntStrictAdd, - exampleUIntStrictMul - ) where - -import Control.DeepSeq (NFData) -import Data.Type.Equality (type (~)) - -import ZkFold.Base.Algebra.Basic.Class -import ZkFold.Base.Algebra.Basic.Number (KnownNat) -import ZkFold.Base.Data.Vector (Vector) -import ZkFold.Symbolic.Class (Symbolic (BaseField)) -import ZkFold.Symbolic.Data.Combinators (KnownRegisterSize, NumberOfRegisters) -import ZkFold.Symbolic.Data.UInt (StrictNum (..), UInt) - -exampleUIntMul :: - (KnownNat n, KnownRegisterSize r, Symbolic c) => - UInt n r c -> UInt n r c -> UInt n r c -exampleUIntMul = (*) - -exampleUIntDivMod :: - (KnownNat n, KnownRegisterSize r, Symbolic c, - NumberOfRegisters (BaseField c) n r ~ k, - KnownNat k, NFData (c (Vector k))) => - UInt n r c -> UInt n r c -> (UInt n r c, UInt n r c) -exampleUIntDivMod = divMod - -exampleUIntStrictAdd :: - (KnownNat n, KnownRegisterSize r, Symbolic c) => - UInt n r c -> UInt n r c -> UInt n r c -exampleUIntStrictAdd = strictAdd - -exampleUIntStrictMul :: - (KnownNat n, KnownRegisterSize r, Symbolic c) => - UInt n r c -> UInt n r c -> UInt n r c -exampleUIntStrictMul = strictMul diff --git a/symbolic-base/examples/ZkFold/Symbolic/Examples.hs b/symbolic-base/examples/ZkFold/Symbolic/Examples.hs deleted file mode 100644 index 792e94fc5..000000000 --- a/symbolic-base/examples/ZkFold/Symbolic/Examples.hs +++ /dev/null @@ -1,76 +0,0 @@ -{-# LANGUAGE TypeOperators #-} - -module ZkFold.Symbolic.Examples (ExampleOutput (..), examples) where - -import Data.Function (const, ($), (.)) -import Data.Proxy (Proxy) -import Data.String (String) -import Data.Type.Equality (type (~)) -import Examples.BatchTransfer (exampleBatchTransfer) -import Examples.ByteString -import Examples.Conditional (exampleConditional) -import Examples.Constant (exampleConst5, exampleEq5) -import Examples.Eq (exampleEq) -import Examples.FFA -import Examples.Fibonacci (exampleFibonacci) -import Examples.LEQ (exampleLEQ) -import Examples.MiMCHash (exampleMiMC) -import Examples.ReverseList (exampleReverseList) -import Examples.UInt - -import ZkFold.Base.Algebra.Basic.Field (Zp) -import ZkFold.Base.Algebra.Basic.Number (KnownNat) -import ZkFold.Base.Algebra.EllipticCurve.BLS12_381 (BLS12_381_Scalar) -import ZkFold.Base.Data.Vector (Vector) -import ZkFold.Symbolic.Compiler (ArithmeticCircuit, compile) -import ZkFold.Symbolic.Data.ByteString (ByteString) -import ZkFold.Symbolic.Data.Class -import ZkFold.Symbolic.Data.Combinators (RegisterSize (Auto)) - -type C = ArithmeticCircuit (Zp BLS12_381_Scalar) - -data ExampleOutput where - ExampleOutput - :: forall i_n o_n. KnownNat i_n - => (() -> C (Vector i_n) (Vector o_n)) - -> ExampleOutput - -exampleOutput :: - forall i_n o_n c f. - ( KnownNat i_n - , i_n ~ TypeSize (Support f) - , SymbolicData f - , c ~ C (Vector i_n) - , Context f ~ c - , TypeSize f ~ o_n - , SymbolicData (Support f) - , Context (Support f) ~ c - , Support (Support f) ~ Proxy c - ) => f -> ExampleOutput -exampleOutput = ExampleOutput @i_n @o_n . const . compile - -examples :: [(String, ExampleOutput)] -examples = - [ ("Eq", exampleOutput exampleEq) - , ("Conditional", exampleOutput exampleConditional) - , ("Constant.5", exampleOutput exampleConst5) - , ("Eq.Constant.5", exampleOutput exampleEq5) - , ("ByteString.And.32", exampleOutput $ exampleByteStringAnd @32) - , ("ByteString.Or.64", exampleOutput $ exampleByteStringOr @64) - , ("UInt.Mul.64.Auto", exampleOutput $ exampleUIntMul @64 @Auto) - , ("LEQ", exampleOutput exampleLEQ) - , ("ByteString.Extend.1.512", exampleOutput $ exampleByteStringExtend @1 @512) - , ("ByteString.Add.512", exampleOutput $ exampleByteStringAdd @512) - , ("UInt.StrictAdd.256.Auto", exampleOutput $ exampleUIntStrictAdd @256 @Auto) - , ("UInt.StrictMul.512.Auto", exampleOutput $ exampleUIntStrictMul @512 @Auto) - , ("UInt.DivMod.32.Auto", exampleOutput $ exampleUIntDivMod @32 @Auto) - , ("Reverse.32.3000", exampleOutput $ exampleReverseList @32 @(ByteString 3000 (C (Vector _)))) - , ("Fibonacci.100", exampleOutput $ exampleFibonacci 100) - , ("MiMCHash", exampleOutput exampleMiMC) - , ("SHA256.32", exampleOutput $ exampleSHA @32) - , ("FFA.Add.337", exampleOutput exampleFFAadd337) - , ("FFA.Add.097", exampleOutput exampleFFAadd097) - , ("FFA.Mul.337", exampleOutput exampleFFAmul337) - , ("FFA.Mul.097", exampleOutput exampleFFAmul097) - , ("BatchTransfer", exampleOutput exampleBatchTransfer) - ] From 07beaa49f9702e84bdf0b86853f2672988d2a071 Mon Sep 17 00:00:00 2001 From: Vladimir Sinyakov Date: Mon, 7 Oct 2024 23:24:03 +0200 Subject: [PATCH 6/7] Update main-push.yml --- .github/workflows/main-push.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main-push.yml b/.github/workflows/main-push.yml index e8f6bde24..8a7ce7360 100644 --- a/.github/workflows/main-push.yml +++ b/.github/workflows/main-push.yml @@ -44,8 +44,8 @@ jobs: HACKAGE_PASSWORD: ${{ secrets.HACKAGE_PASSWORD }} shell: bash run: | - cabal sdist all + cabal sdist symbolic-base cabal upload --username=VladimirSinyakov --password="$HACKAGE_PASSWORD" dist-newstyle/sdist/*.tar.gz - cabal v2-haddock --haddock-for-hackage --enable-doc + cabal v2-haddock symbolic-base --haddock-for-hackage --enable-doc cabal upload --documentation --username=VladimirSinyakov --password="$HACKAGE_PASSWORD" dist-newstyle/*-docs.tar.gz From 3089266ba5247012ac213a964650df5967462ff2 Mon Sep 17 00:00:00 2001 From: Vladimir Sinyakov Date: Mon, 7 Oct 2024 23:56:16 +0200 Subject: [PATCH 7/7] Fix SHA2 test --- symbolic-base/test/Tests/SHA2.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symbolic-base/test/Tests/SHA2.hs b/symbolic-base/test/Tests/SHA2.hs index e97c9c20a..7cc782adf 100644 --- a/symbolic-base/test/Tests/SHA2.hs +++ b/symbolic-base/test/Tests/SHA2.hs @@ -42,7 +42,7 @@ import ZkFold.Symbolic.Interpreter (Interpreter (Inter -- https://csrc.nist.gov/Projects/Cryptographic-Algorithm-Validation-Program/Secure-Hashing#shavs -- dataDir :: FilePath -dataDir = "tests/data/shabittestvectors/" +dataDir = "test/data/shabittestvectors/" getTestFiles :: forall (algorithm :: Symbol) . KnownSymbol algorithm => IO [FilePath] getTestFiles = Haskell.filter isAlgoFile <$> listDirectory dataDir