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

refac: improve pcs interface #225

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Conversation

chokobole
Copy link
Contributor

@chokobole chokobole commented Jan 8, 2024

Description

This PR solves 2 problems.

  1. Transcript was only able to handle field or curve point.
    Since proof and hash algorithm can take arbitrary types, this limitation no longer exists.

  2. The interfaces of VectorCommitmentScheme and UnivariatePolynomialCommitmentScheme are organized.

    When committing, there are 3 cases:

    • non interactive: e.g, SHPlonk, MerkleTree
    • non interactive with random: e.g, Pedersen
    • interactive: e.g, FRI

    When opening, there are 2 cases:

    • non interactive: e.g, MerkleTree
    • interactive: e.g, SHPlonk and FRI

    When verifying, there are 2 cases:

    • both committing and opening is non interactive: e.g, MerkleTree
    • either committing or opening is interactive: e.g, SHPlonk and FRI

@chokobole chokobole marked this pull request as ready for review January 9, 2024 08:18
@@ -96,15 +93,28 @@ class TranscriptReaderImpl<Commitment, false> : public Transcript<Commitment> {
const base::Buffer& buffer() const { return buffer_; }

// Read a |commitment| from the proof. Note that it also writes the
// |commitment| to the transcript by calling |WriteToTranscript()| internally.
// |value| to the transcript by calling |WriteToTranscript()| internally when
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// |value| to the transcript by calling |WriteToTranscript()| internally when
// |commitment| to the transcript by calling |WriteToTranscript()| internally when

$$Commit(L) \to C$$
$$Open(i) \to \pi$$
$$Verify(R, \pi) \to true \space or \space false$$
$$L\text{: the set of leaf, }i\text{: index of the leaf }R\text{: merkle root}$$
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$$L\text{: the set of leaf, }i\text{: index of the leaf }R\text{: merkle root}$$
$$L\text{: the set of leaf, }i\text{: index of the leaf }R\text{: the merkle root}$$

This is needed by improving PCS interface.
This commit solves 2 problems.

1. `Transcript` was only able to handle field or curve point.
   Since proof and hash algorithm can take arbitrary types, this limitation is
   overcame.

2. The interfaces of `VectorCommitmentScheme` and
   `UnivariatePolynomialCommitmentScheme` are organized.

   When committing, the cases are divided into 3 cases.

   - non interactive: e.g, SHPlonk, MerkleTree
   - non interactive with random: e.g, Pedersen
   - interactive: e.g, FRI

  When opening, the cases are divided into 2 cases.

  - non interactive: e.g, MerkleTree
  - interactive: e.g, SHPlonk and FRI

  When verifying, the cases are divided into 2 cases.

  - both committing and opening is non interactive: e.g, MerkleTree
  - either committing or opening is interative: e.g, SHPlonk and FRI
@chokobole chokobole marked this pull request as draft January 10, 2024 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants