Merge pull request #5 from HaoXuan40404/patch-1 Update README.md
Merge pull request #5 from HaoXuan40404/patch-1
Update README.md
FISCO-BCOS use libzkg to generate zero-knowledge proof for user and only governer can oversee it!
Notice: This is an experimental prototype. Do not use it in product.
View at Verifiable Confidential Ledger, VCL get newest fisco bcos zkp tranfer solution!
Security is a basic deveping purpose of FISCO-BCOS.
Libzkg is a zero-knowledge proof library based on FISCO-BCOS project.-
Libzkg is deveped for supporting zero-knowldge proof senarios of FISCO-BCOS.
Every senario supported by libzkg is based on this 3 principle:
waiting for more..
To import libzkg in your project. Cmake is recommended.
Prepare
sudo yum install -y procps-ng procps-ng-devel libgomp
Download
Download cmake file
wget https://github.com/FISCO-BCOS/FISCO-BCOS/blob/master/cmake/ProjectLibZkg.cmake cp ProjectLibZkg.cmake your_project_dir/cmake/
CMakeLists.txt
Import in your CMakeLists.txt
vim your_project_dir/CMakeLists.txt
like
cmake_minimum_required (VERSION 3.0.0) set(ZKG_CLIENT_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}/cmake" CACHE PATH "The path to the cmake directory") list(APPEND CMAKE_MODULE_PATH ${ZKG_CLIENT_CMAKE_DIR}) include(ProjectLibZkg) find_package(OpenMP) if(OPENMP_FOUND) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}") endif() include_directories(${LIBZKG_INCLUDE_DIR}) add_compile_options(-DMULTICORE) add_compile_options(-std=c++11) add_compile_options(-DCURVE_ALT_BN128) add_compile_options(-DNO_PROCPS) add_compile_options(-DBINARY_OUTPUT=OFF) #aux_source_directory(. DIR_SRCS) set(DEMO "demo") add_executable(${DEMO} demo.cpp) target_link_libraries(${DEMO} Zkg) target_link_libraries(${DEMO} Zkg::circuit) target_link_libraries(${DEMO} Zkg::snark) target_link_libraries(${DEMO} Zkg::ff) target_link_libraries(${DEMO} Zkg::zm) target_link_libraries(${DEMO} gmp) target_link_libraries(${DEMO} stdc++) target_link_libraries(${DEMO} procps) target_link_libraries(${DEMO} gmpxx) target_link_libraries(${DEMO} gomp)
cpp files
Include zkg.hpp in your cpp file
#include <circuit/zkg.hpp>
Compile
mkdir build cd build cmake3 .. make #If success, libzkg.a is generated
consult with zkg.hpp and zkg-tx1to1
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802032778号
Libzkg Development Guide
FISCO-BCOS use libzkg to generate zero-knowledge proof for user and only governer can oversee it!
Notice: This is an experimental prototype. Do not use it in product.
View at Verifiable Confidential Ledger, VCL get newest fisco bcos zkp tranfer solution!
Introductions
Background
Security is a basic deveping purpose of FISCO-BCOS.
Ideas
Libzkg is a zero-knowledge proof library based on FISCO-BCOS project.-
Design
Libzkg is deveped for supporting zero-knowldge proof senarios of FISCO-BCOS.
Every senario supported by libzkg is based on this 3 principle:
Supporting Senarios
waiting for more..
Compile Option
To import libzkg in your project. Cmake is recommended.
Prepare
Download
CMakeLists.txt
cpp files
Compile
Senario 1: tx1to1
consult with zkg.hpp and zkg-tx1to1