You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ignore if this is done on purpose or not, but when trying to make Sonobe wasm-compat, one of the things I had to change is to receive bytes directly instead of paths to .r1cs and wasm files.
For the former, this was easy. But for the latter, it turns out to not be possible.
At some point, there's the need to create a WitnessCalculator. This, presents a problem. Which is that the only way for us to create this is to call the API functions this crate exposes as constructors. Which can be seen here.
As seen, all of them rely to pass a Path and read from fs. But this is not possible if we're in a browser env.
So what we would need (and is supported in wasmer already), is another constructor which calls wasmer/struct.Module.html#method.new underneath.
On this way, the WitnessCalculator can be generated from a wasm binary already read by JS previously.
I wonder if this is something that just hasn't been done because no-one needed it, or because there's something I'm missing which explains clearly why this isn't supported.
I'm happy to PR to add this feature :)
The text was updated successfully, but these errors were encountered:
As discussed in arkworks-rs#72
it's not currently possible to load parameters from their binary.
This would help a lot in browser envoiroments where JS can take care of
handling the read and we just open the door in the WASM module to allow
to load new ones from the bytes read.
The commit adds a change in the tests which now load from binary instead
of reading from file. This ensures that the reading is indeed working as
expected although we rely on a different fn from `wasmer`.
Closesarkworks-rs#72
As discussed in arkworks-rs#72
it's not currently possible to load parameters from their binary.
This would help a lot in browser envoiroments where JS can take care of
handling the read and we just open the door in the WASM module to allow
to load new ones from the bytes read.
The commit adds a change in the tests which now load from binary instead
of reading from file. This ensures that the reading is indeed working as
expected although we rely on a different fn from `wasmer`.
I ignore if this is done on purpose or not, but when trying to make Sonobe wasm-compat, one of the things I had to change is to receive bytes directly instead of paths to
.r1cs
andwasm
files.For the former, this was easy. But for the latter, it turns out to not be possible.
At some point, there's the need to create a
WitnessCalculator
. This, presents a problem. Which is that the only way for us to create this is to call the API functions this crate exposes as constructors. Which can be seen here.As seen, all of them rely to pass a
Path
and read from fs. But this is not possible if we're in a browser env.So what we would need (and is supported in wasmer already), is another constructor which calls wasmer/struct.Module.html#method.new underneath.
On this way, the
WitnessCalculator
can be generated from awasm
binary already read by JS previously.I wonder if this is something that just hasn't been done because no-one needed it, or because there's something I'm missing which explains clearly why this isn't supported.
I'm happy to PR to add this feature :)
The text was updated successfully, but these errors were encountered: