Comments (5)
At minimum some Rng
and rand could become RngCore
and rand_core in both marlin and poly_commit, which simplifies reading the code.
I think merlin has stayed rand_core 0.4 (rand 0.6) so doing this doubles the rand dependencies, although merlin's own rand dependencies could be upgraded.
I do not understand all the code of course, but it appears marlin only uses FiatShamirRng
for actual Fiat-Shamir transforms, aka challenges, never on anything using system randomness. Right now, merlin's challenge methods have no RngCore
implementation. Also, merlin's TranscriptRng
incorporates system randomness, which makes it unsuitable.
I do think merlin's challenge methods could replace your own RngCore
, but this would become some larger change across at least both marlin and poly-commit. It's possible you've some direct Rng
usages around that'd benefit from being instantiated with merlin's .build_rng().finalize(rng)
etc., but maybe more in poly-commit, not sure.
I believe strobe-rs removed all the Vec
usage and now works without std
, so you could use STROBE directly. Also, one could define some STROBERng
that maybe works to merlin's TranscriptRng
, but starts from an arbitrary STROBE state without the system randomness. At first blush such a STROBERng
looks like the minimal change.
from marlin.
@hdevalence Thanks for bringing up this issue. Yes, currently I'm not too happy with our custom hand-written framework for generating FS randomness, but the reason we haven't switched away is that we want to write a R1CS gadget for the marlin verifier, and it's not clear to me how to me how to write a constraint system with custom SNARK-friendky hashes for Merlin.
Maybe if one could abstract away the changes behind a trait or something, it would be easier?
from marlin.
@burdges yes, I should minimize the dependency down to rand_core
. Do you want to open a separate issue for that? If not, I can do that. Thanks!
from marlin.
Sure: #6 arkworks-rs/poly-commit#2
Afaik, anyone using merlin or strobe-rs uses an extension trait anyways, even when only doing trivial stuff: https://github.com/w3f/schnorrkel/blob/master/src/context.rs#L46
If you abstract enough for SNARK-friendky hashes then would you still use RngCore
(Rng
) the same way between marlin and poly-commit? Or would you need some interface that constrains the amount or type of output? You cannot constrain the amount of output needed in poly-commit maybe, but maybe you'd have special more efficient types?
from marlin.
@Pratyush Wanting to be able to write an R1CS gadget for the Marlin verifier is a good reason not to use Merlin, because Merlin is designed only for the "machine model" and isn't intended to be used in R1CS. It would be nice to have an R1CS-friendly Merlin-ish construction for exactly this kind of case but it doesn't exist as a drop-in right now, so it's not useful for this issue.
from marlin.
Related Issues (20)
- rand_core module OsRng not found HOT 2
- Unable to build marlin HOT 3
- Compile error "the trait `ff_fft::domain::EvaluationDomain` cannot be made into an object" HOT 5
- R1CS example not verifying in Marlin
- Benchmarking Marlin HOT 9
- Add end-to-end diagram of Marlin
- Master build is broken HOT 5
- Allow public input of size not 2^k-1 HOT 2
- `to_matrices` is called before `inline_all_lcs` HOT 2
- Commit-and-Prove Marlin HOT 5
- Move Marlin to the new polynomial framework HOT 2
- Outer check may fail due to outlining
- Trouble compiling Marlin with IPA-PC HOT 6
- [Q] why not implement UniversalSetupSNARK for Marlin HOT 2
- Underflow panic HOT 3
- A question in Marlin paper in section 5.3.2 HOT 3
- question on bn254 HOT 3
- Notes on Implementing Marlin + Plookup
- Fix and update dependencies to 0.3
- Why test actually failed inside the `prove_and_verify_with_tall_matrix_big`? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from marlin.