博客
关于我
Circom and Snarkjs,基于以太坊的零知识证明实现
阅读量:285 次
发布时间:2019-03-01

本文共 655 字,大约阅读时间需要 2 分钟。

Snarkjs 是一种基于 zkSnarks Pinoccio 和 Groth16 协议的零知识证明(zk-SNARK)实现工具,旨在为构建通用零知识证明语句提供支持。它能够在链外和链上验证,具备较高的灵活性和扩展性。

Snarkjs 的核心功能包括 constraint 解决、零知识证明验证等,适用于需要快速验证的场景。其性能表现虽然较为突出,但在处理大量约束时仍存在一定瓶颈,未来计划通过 Julia 语言重写以提升性能和可扩展性。

关键实现细节

Snarkjs 的主要模块包括 verifier.sol 智能合约,其包含两个核心组件: verifier 和 pairing。前者负责验证过程,后者则是实现零知识证明的关键算法模块。

使用指南

在使用 Snarkjs 时,需特别注意以下事项:

  • 环境配置:建议使用 MetaMask 加上 Ropsten 测试网络,确保ether供应。
  • 部署合约:仅需部署 verifier.sol 智能合约即可。
  • 调用接口:将 snarkjs 生成的验证脚本粘贴至 verifyProof 方框,点击调用按钮即可获得验证结果。
  • Snarkjs 提供了直观的接口,例如 calculatewitness 和 printconstraints 工具,极大简化了开发流程。其生成的 verifier.sol 智能合约基于经典论文 Page-25 的算法设计,兼顾高效性和准确性。

    通过以上方法,开发者能够轻松集成 Snarkjs 进行零知识证明验证,充分发挥其强大的功能优势。

    转载地址:http://puqx.baihongyu.com/

    你可能感兴趣的文章
    No 'Access-Control-Allow-Origin' header is present on the requested resource.
    查看>>
    NO 157 去掉禅道访问地址中的zentao
    查看>>
    No Datastore Session bound to thread, and configuration does not allow creation of non-transactional
    查看>>
    No fallbackFactory instance of type class com.ruoyi---SpringCloud Alibaba_若依微服务框架改造---工作笔记005
    查看>>
    No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-loadbalanc
    查看>>
    No mapping found for HTTP request with URI [/...] in DispatcherServlet with name ...的解决方法
    查看>>
    No mapping found for HTTP request with URI [/logout.do] in DispatcherServlet with name 'springmvc'
    查看>>
    No module named 'crispy_forms'等使用pycharm开发
    查看>>
    No module named cv2
    查看>>
    No module named tensorboard.main在安装tensorboardX的时候遇到的问题
    查看>>
    No module named ‘MySQLdb‘错误解决No module named ‘MySQLdb‘错误解决
    查看>>
    No new migrations found. Your system is up-to-date.
    查看>>
    No qualifying bean of type XXX found for dependency XXX.
    查看>>
    No resource identifier found for attribute 'srcCompat' in package的解决办法
    查看>>
    no session found for current thread
    查看>>
    No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android
    查看>>
    NO.23 ZenTaoPHP目录结构
    查看>>
    NO32 网络层次及OSI7层模型--TCP三次握手四次断开--子网划分
    查看>>
    NoClassDefFoundError: org/springframework/boot/context/properties/ConfigurationBeanFactoryMetadata
    查看>>
    Node JS: < 一> 初识Node JS
    查看>>