arkworks-rs / arkworks-rs/poly-commit

Load G1 and G2 points from a file rather than relying on the setup function

Open
#111 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
440
Forks
160
PR merge metrics
No merged PRs in 30d

Description

## Summary

We're using Arkworks at [sifraitech/rust-kzg](https://github.com/sifraitech/rust-kzg) and are currently undergoing a migration to EIP-4844 by using [ethereum/c-kzg-4844](https://github.com/ethereum/c-kzg-4844) as a reference. The said implementation loads trusted setups from files, e.g., [trusted_setup.txt](https://github.com/ethereum/c-kzg-4844/blob/5cfbc341352f12330aaf8e5f5c4df14dca829f1a/src/trusted_setup.txt), that hold the following information:

```text
G1Count | G2Count | [G1] | [G2]
```

On the contrary, Arkworks invokes the method `kzg10::setup` and feeds it a `RngCore` object to generate the setup, which is not as secure as loading the precomputed `G1` and `G2` points from a file.

## Problem Definition

As far as I'm understanding, `powers_of_g` and `powers_of_gamma_g` are responsible for holding `G1` and `G2` points, respectively. But as you can see, the type of `powers_of_gamma_g` is `BTreeMap::`, which by definition cannot hold `G2` points. We attempted to replace the values of `powers_of_g` with `G1` points loaded from a setup file, but we are unsure of where to put the `G2` points.

## Proposal

Allow us to load `G1` and `G2` points from a file rather than relying on the setup function.
____

#### For Admin Use

- [ ] Not duplicate issue
- [ ] Appropriate labels applied
- [ ] Appropriate contributors tagged
- [ ] Contributor assigned/self-assigned

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.