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

Compatibility with SAFE API #87

Open
mmaker opened this issue Jan 3, 2023 · 4 comments
Open

Compatibility with SAFE API #87

mmaker opened this issue Jan 3, 2023 · 4 comments

Comments

@mmaker
Copy link
Member

mmaker commented Jan 3, 2023

It'd be really nice if arkworks was compatible with the SAFE API described here https://hackmd.io/bHgsH6mMStCVibM_wYvb2w
(an upcoming paper will be published here).

@Pratyush Pratyush transferred this issue from arkworks-rs/sponge Jan 19, 2023
@burdges
Copy link

burdges commented Jun 9, 2023

IOPattern being exposed makes composition too difficult. Interesting optimization though, maybe viable as a wrapper type.

@mmaker
Copy link
Member Author

mmaker commented Jun 9, 2023

A similar feature could be achieved statically chaining IOPatterns,but...

Marlin-style composition (and this) are not really fit for chaining: protocols with non-unique response chained together may have the same transcript for two different protocol executions

@burdges
Copy link

burdges commented Jun 9, 2023

I've never looked at marlin, so maybe it brings other specialized concerns, but..

At first blush it looked clear how IOPattern helps: A non-snark-friendly sponge, or merlin, wants many domain separation labels nested everywhere, but those add constraints in a snark-friendly sponge. You've compressed them all into one label, but made gadget composition harder in groth16, etc. (no idea about marlin).

You could maybe impose IOPattern asserts using a wrapper type, but leave the traits more composition friendly.

pub struct AssertIOPattern<.., S: Sponge<..>> {
    sponge: S
    pattern: ...
}

impl<.., S: Sponge<..>> Sponge for AssertIOPattern<.., S> { ... }

impl<.., S: Sponge<..>> Sponge for AssertIOPattern<.., S> {
    pub fn new(s: S, p: &IOPattern) -> Self { .. }
}

pub fn apply_io_pattern_sans_assert<.., S:Sponge<..>>(s: &mut S, p: &IOPattern);

@mmaker
Copy link
Member Author

mmaker commented Jul 17, 2023

@burdges I thought a bit more about composition and I really don't understand the claim.
I'm pretty sure any decent protocol can just concatenate IOPatterns before concatenating provers 🥸

I made a repository here: https://github.com/mmaker/nimue with some fairly complete examples and plugins for arkworks. Would people be interested in moving arkworks-plugins here (or, even, the whole repo?)

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

No branches or pull requests

2 participants