HackMD
    • Create new note
    • Create a note from template
    • Sharing Link copied
    • /edit
    • View mode
      • Edit mode
      • View mode
      • Book mode
      • Slide mode
      Edit mode View mode Book mode Slide mode
    • Customize slides
    • Note Permission
    • Read
      • Only me
      • Signed-in users
      • Everyone
      Only me Signed-in users Everyone
    • Write
      • Only me
      • Signed-in users
      • Everyone
      Only me Signed-in users Everyone
    • Commenting & Invitee
    • Publishing
      Please check the box to agree to the Community Guidelines.
      Everyone on the web can find and read all notes of this public team.
      After the note is published, everyone on the web can find and read this note.
      See all published notes on profile page.
    • Commenting Enable
      Disabled Forbidden Owners Signed-in users Everyone
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Invitee
    • No invitee
    • Options
    • Versions and GitHub Sync
    • Transfer ownership
    • Delete this note
    • Note settings
    • Template
    • Save as template
    • Insert from template
    • Export
    • Dropbox
    • Google Drive Export to Google Drive
    • Gist
    • Import
    • Dropbox
    • Google Drive Import from Google Drive
    • Gist
    • Clipboard
    • Download
    • Markdown
    • HTML
    • Raw HTML
Menu Note settings Sharing Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync Transfer ownership Delete this note
Export
Dropbox Google Drive Export to Google Drive Gist
Import
Dropbox Google Drive Import from Google Drive Gist Clipboard
Download
Markdown HTML Raw HTML
Back
Sharing
Sharing Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Comment & Invitee
Publishing
Please check the box to agree to the Community Guidelines.
Everyone on the web can find and read all notes of this public team.
After the note is published, everyone on the web can find and read this note.
See all published notes on profile page.
More (Comment, Invitee)
Commenting Enable
Disabled Forbidden Owners Signed-in users Everyone
Permission
Owners
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Invitee
No invitee
   owned this note    owned this note      
Published Linked with GitHub
Like BookmarkBookmarked
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
# "Streaming" Aggregation techniques for Testudo ## Goal The goal is to allow a prover to prove multiple times the same circuit with different witness but **only using memory linear in one proof**, or with a small constant per proofs. In other words, we would like to have a snarkpack-like aggregation technique for Testudo. In Snarkpack, the prover generates Groth16 proofs sequentially and only keeps around each individual Groth16 proofs before aggregating them all. ## Context Using uniformity of the circuit already brings down cost a lot for uniform circuits. However, sometimes we need to compute _many_ of these proofs at once. For example in Snarkpack, miners will compute thousands of Groth16 proofs first and then aggregate with Snarkpack to only publish one aggregated proof onchain. The nice property in this model is that the memory required by the prover in this case is linear but very small, only 1 Groth16 per proof. **Goal**: Have a snarkpack like aggregation mechanism where the memory of the prover can be linear but for a small amount of memory, i.e. prover is not required to keep the whole witness for each proofs. ## High Level view of current Testudo Testudo is composed of the following: * Two sumcheckS which are the same as Spartan * An optimized PST implementation that replaces the Spartan PCS * Specifically, we use a SQRT size trusted setup PST in combination with MIPP (from IPP paper) * The Computational Commitment (CC) that is the same as Spartan (currently) We are using Testudo on BLS12-377 and BLS12-381, **both curves are part of a 2chain model**. More specifically, we can build another proof on top of a Testudo proof to "compress" the original proof. For BLS12-377 it'd be BW6 with Groth16, and for BLS12-381, it's to-be-defined (it exists but unclear which proof system to use yet). ## Strawman 1 - Do Groth16 for the sumcheck, and keep one Groth16 proof for each circuit - Keep the PST + CC openings in the clear (in the final proof) - (a - optional) Verify PST + CC openings in one testudo proof with outer curve Pros: simple to get Cons: limited in number of aggregation: * verifier work is linear in number of aggregated proof * (a) circuit size will be the limiting factor ## Strawman 2 - Do Groth16 for the sumcheck, and keep one Groth16 proof for each circuit - Random linear combination of PST polynomials - P_p(x) = P_1(x) + r*P_2(x) + r^2P_3(x) ... - only open 1 polynomial P_p(x) - Random linear combination for CC openings Problem is that prover needs to keep all the individual polynomials (witnesses) in memory before deriving the randomness $r$, thus it doesn't solve the problem. ## Final Proposition To prove K relations. This does not require to have the whole K witnesses but only K smaller states. We call $\pi_{PSC}$ the "Spartan Sumcheck Core": the two sumcheck proofs proved in Spartan now. You can also think of it as the _witness_ to our current Groth16 The protocol: - On reception of witness $w_i$ ("keeping" denotes keeping as state) - Compute MIPP comm $T_i$. **Keep $T$ and its opening $\vec{A}$** ($K*\sqrt{N}$ storage in total) - compute $\pi^{(i)}_{SPC}$, that is run the sumcheck protocol leading to point $y_i$. **Keep this sumcheck proof** - Compute polynomials commitments $p^{j}_i$-s. **Keep them** - Compute PST proof for $U_i$. **Keep it** ($K*log(\sqrt{N})$ storage in total) - Partial evaluation of CC proofs: - When it is time to "open", keep the opening point required but **do not open**. - Only $K * log(N)$ storage in total - When done steps above for all witnesses: - Run a single Groth16 for the sumcheck - Run a single MIPP on a linear combination of the U_i - Send all U_is and PST proof - For CC, do a [multi point opening](https://zcash.github.io/halo2/design/proving-system/multipoint-opening.html) to only open _once_ all the points _at once_ on the same polynomial - Since it is the same polynonial, prover only needs to keep the points to open (x,ry) Optimizations: - (a) Do a snarkpack over all individual G16 sumchecks - constraints will be the bottleneck otherwise. - (b) instead of sending all U_i, you commit to the U_i and do a TIPP on it so you only send the committed U_is in the proof * :bulb: How to do it exactly ? * We can run a MIPP to prove a random linear combination of all U_i but how do you subsequently all U_i have been generated correctly ? (you can't do a mipp of a mipp) * $U_i = \prod A_{i,j}^{y_i,j}$ * $C_u = Comm(\mathbf{U})$ // MIPP * $C_T = Comm(\mathbf{T})$ * $U = \prod U_i^{r^i} = \prod_i (\prod_j A_{i,j}^{y_i,j})^{r^i}$ * $T = \prod T_i^{r^i} = \prod_i (\prod e(A_{i,j},h_j))^{r^i}$ ## Verifier $K$ is number of proofs to aggregate, $N$ is circuit size Either natively or in circuit using an "outer curve": * Verify snarkpack for the sumcheck proofs * O(log(K)) for snarkpack * Compute random linear combination of U_i and verify MIPP proof * O(K) group addition then O(1) MIPP verification * :warning: Any way to move from group addition to field addition? and/or to move to O(log(N))? * Verify all PST proofs * O(K) PST verification / pairings * :warning: Any way to go down to O(log(N)) ? Or batch version, like [KZG batch](https://eprint.iacr.org/2020/081.pdf) * Compute random linear combination of CC openings points and verify CC openings * at least O(N) field operations then O(1) CC opening ## State O(K sqrt(N)) ## Proof size O(K log(N)) ## Perf estimation (TODO) We need the following numbers (optimization (a)) * $M_c$ time to perform the PST/MIPP commitment * $S$ time to perform the sumcheckS and its Groth16 proof * $M_p$ time to perform the PST opening (without the MIPP) * $M_m$ time to perform the MIPP proof * $C_c$ time to perform a single CC opening * $P$ time to perform a snarkpack over K groth16 A reasonable lower bound on the estimated proving time should be: $K * (M_c + S + M_p) + C_c + P + M_m$ The verification will be higher but we plan to have a final proof system that verify all of this, for "compression".

Import from clipboard

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lost their connection.

Create a note from template

Create a note from template

Oops...
This template is not available.


Upgrade

All
  • All
  • Team
No template found.

Create custom template


Upgrade

Delete template

Do you really want to delete this template?

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Tutorials

Book Mode Tutorial

Slide Mode Tutorial

YAML Metadata

Contacts

Facebook

Twitter

Discord

Feedback

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions

Versions and GitHub Sync

Sign in to link this note to GitHub Learn more
This note is not linked with GitHub Learn more
 
Add badge Pull Push GitHub Link Settings
Upgrade now

Version named by    

More Less
  • Edit
  • Delete

Note content is identical to the latest version.
Compare with
    Choose a version
    No search result
    Version not found

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub

      Please sign in to GitHub and install the HackMD app on your GitHub repo. Learn more

       Sign in to GitHub

      HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Available push count

      Upgrade

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Upgrade

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully