Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solidity Verifier Implementation for Accountable Light Client Milestone 2 #1014

Merged
merged 6 commits into from
Sep 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Milestone Delivery :mailbox:

**The delivery is according to the official [milestone delivery guidelines](https://github.com/w3f/Grants-Program/blob/master/docs/Support%20Docs/milestone-deliverables-guidelines.md).**

- **Application Document:** https://github.com/w3f/Grants-Program/blob/master/applications/solidity-verifier-for-accountable-light-client.md
- **Milestone Number:** 2

**Context**

This milestone is to implement the solidity version of the two verifiers in [apk-proof](https://github.com/w3f/apk-proofs), which are the [simple (basic)](https://github.com/w3f/apk-proofs/blob/main/bw6/src/verifier.rs#L38) and [packed](https://github.com/w3f/apk-proofs/blob/main/bw6/src/verifier.rs#L69) verifiers. But The solidity verifiers implemented in this milestone has two differences from the original rust version.

1. Fiat-shamir transformation.

This is listed in the application document.

We replace `Merlin::Transcript` with a more solidity friendly way. https://github.com/darwinia-network/apk-proofs/pull/4.
2. The hash-to-curve function.

Changed to `map_to_curve_simple_swu`. https://github.com/darwinia-network/apk-proofs/pull/3/files.

Switch to `map_to_curve_elligator_2` after arkworks finished this PR, https://github.com/arkworks-rs/algebra/pull/659.

**Deliverables**

| Number | Deliverable | Link | Notes |
| ------- | ------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| **0a.** | License | Apache-2.0 | |
| **0b.** | Documentation | https://darwinia-network.github.io/apk-verifier/index.html | |
| **0c.** | Testing and Testing Guide | https://github.com/darwinia-network/apk-verifier#run-test-in-docker | |
| 1. | Libraries preparation | 1. The solidity friendly fiat-shamir transformation. [code](https://github.com/darwinia-network/apk-verifier/blob/main/src/common/transcript/Simple.sol)<br />2. Lagrange evaluation. [code](https://github.com/darwinia-network/apk-verifier/blob/main/src/common/poly/evaluations/Lagrange.sol) <br />3. KZG verification. [code](https://github.com/darwinia-network/apk-verifier/blob/6b8bfd37e2c4142bf08d8c98f61a1d3e0c3df57d/src/common/pcs/kzg/KZG.sol) | |
| 2. | Basic verifier | [code](https://github.com/darwinia-network/apk-verifier/blob/main/src/Basic.sol) | |
| 3. | Packed verifier | [code](https://github.com/darwinia-network/apk-verifier/blob/main/src/Packed.sol) | |

**Additional Information**

- https://github.com/paritytech/frontier/pull/1207
- https://github.com/ethereum/EIPs/pull/7642
- https://github.com/paritytech/frontier/pull/1173
- https://github.com/ethereum/EIPs/pull/7006
- https://github.com/paritytech/frontier/pull/1049
- https://github.com/darwinia-network/apk-proofs
Loading