-
Notifications
You must be signed in to change notification settings - Fork 413
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
feat(gnarkd): exposing gnark APIs through RPCs #54
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…est case, it pulls too many dependencies from go-ethereum
…ion. added cache TTL periodic flushing
…indirect dependencies from geth
gbotrel
changed the title
[WIP]: Adding gnarkd, exposing gnark APIs through RPCs
Adding gnarkd, exposing gnark APIs through RPCs
Feb 2, 2021
gbotrel
changed the title
Adding gnarkd, exposing gnark APIs through RPCs
feat(gnarkd): exposing gnark APIs through RPCs
Feb 9, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a placeholder.
cmd/gnarkd
will expose through some gRPC APIsgroth16.Prove
andgroth16.Verify
. It will handle large circuits and large witness, and be easily callable from non-Go codebases.-->
gnarkd/README.md
contents:WARNING: this is an experimental feature and might not stay in
gnark
main repository in the future.gnarkd
gnarkd
is agnark
Proving / Verifying server.It offers synchronous gRPC APIs (use when proving time & witness size are short) and asynchronous APIs.
See
pb/gnardk.proto
for up to date protobuf service description.gRPC clients can be generated for multiple languages (Go, Rust, ...) see
protoc
doc for more info.In go:
Under the hood
When
gnarkd
starts, it loads the circuits defined incircuits/
folder. Circuits must be stored in a separate folder, under a curve subfolder.Example:
circuits/bn256/cubic
will containcubic.pk
,cubic.vk
andcubic.r1cs
.bn256/cubic
gnarkd
listens on 2 distinct TCP connections: one for gRPC, one for receiving large witnesses on async calls.On this second connection, the server expects:
jobID
|witness
.jobID
is returned byCreateProveJob
and is a standard UUID (RFC 4122) on 16 byte (server impl usesgithub.com/google/uuid
)gnarkd
knows which witness size to expect (viar1cs.GetNbPublicWires
,r1cs.GetNbSecretWires
andr1cs.SizeFrElement
)Example client (Go)
See
client/example.go
.