sismo-badges README

The project's README from github.com/sismo-core/sismo-badges. As one markdown file: README.md.


Logo

Sismo Protocol Contracts

Made by Sismo


This repository contains the smart contracts of the Sismo Protocol.

There are three core contracts:

It also contains implementations of attester in attesters/:



Sismo protocol

A complete overview of the protocol is available in our documentation

Deployed contracts

Deployed contracts can be found here

Usage

Installation

yarn

Compile contracts

Compile contracts using hardhat

yarn compile

Test

Launch all tests

yarn test

Print storage layout

yarn storage-layout

Deploy on local chain

Terminal tab 1

yarn chain

Terminal tab 2

yarn deploy:local

Create a new Attester

To develop a new attester, you must inherit the core/Attester.sol abstract contract and implement the following functions:

Other optional hook functions that can be implemented:

The /attesters/hydra-s1/HydraS1SimpleAttester.sol is a good example of an attester implementing those functions.

A guide is offered in our documentation.

Feel free open a PR with your new attester in /attester!

License

Distributed under the MIT License.

Contribute

Please, feel free to open issues, PRs or simply provide feedback!

Contact

Prefer Discord or Twitter


bottom

sismo-badges (sismo-core/sismo-badges)

Searching Database…

这是什么?这是 Sismo Protocol 的智能合约,一个以太坊上的徽章铸造协议。证明(关于账户的声明)记录在注册表中,并以不可转让的徽章(Badge)代币形式呈现。
那徽章是普通的可交易 NFT 吗?不是 — Badges.sol 是一个无状态的、不可转让的 ERC1155 视图合约:实际的证明数据存放在 AttestationsRegistry 中,代币只是对它的反映。
如何在本地把合约跑起来?克隆仓库,安装依赖,然后使用 Hardhat:'hardhat compile' 编译合约,'hardhat test' 运行测试套件,'hardhat node' 加上 deploy:local 脚本就能完成一次完整的本地部署。
我的电脑上需要装什么才能编译和测试?需要一个配置好 Hardhat 的 Node.js 环境 — 所有脚本(compile、test、deploy、存储布局检查)都通过它运行。合约基于 OpenZeppelin 构建,仓库还附带用于本地运行的 Docker 文件。
任何合约都能开始向注册表里发放徽章吗?不能 — AttestationsRegistry 由治理方(governance)所有,由它来授权和取消授权发行者(issuer),所以一个 attester 必须先获得授权,它发出的证明才能被记录。
这个仓库是给徽章持有者的,还是给开发者的?给开发者的。README 的核心指南就是教你构建自己的 attester:继承核心的 Attester 抽象合约,并实现 verifyRequest 和 buildAttestations。
领取徽章是不是意味着要交出我的个人数据?发放过程通过零知识证明完成:Hydra-S1 attester 验证的是你随请求一起提交的 ZK 证明(使用 nullifier),而不是你的原始数据。
这份代码在法律上我可以怎么用?它以 MIT 许可证发布,可以自由地复用、修改和分叉。
Hydra-S1 是什么?它是本仓库自带的 attester 所使用的零知识证明方案。用户在提交徽章请求时一并提交 Hydra-S1 证明,方案中的 nullifier 可以防止同一证明被记录到多个账户上造成重复。
仓库里的两个 attester 有什么区别?HydraS1SimpleAttester 是基础的 ZK attester。HydraS1AccountboundAttester 是它的账户绑定版本,允许用户随意更新证明的存放位置。
我如何创建自己的 attester?继承 core/Attester.sol,并实现 verifyRequest(request, proofData) 和 buildAttestations(request, proofData);beforeRecordAttestations 和 afterRecordAttestations 这两个钩子是可选的。HydraS1SimpleAttester 是参考示例,官方文档提供了指南,也欢迎提交带有新 attester 的 PR。
Creator
sismo-core
Size
4.6 MB
Stars
15.9K
Age
4y
Commits · 90 Days