-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #201 from clearmatics/api-refactor
[WIP] Api refactor
- Loading branch information
Showing
29 changed files
with
577 additions
and
267 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,16 @@ | ||
syntax = "proto3"; | ||
|
||
package prover_proto; | ||
package zeth_proto; | ||
|
||
import "google/protobuf/empty.proto"; | ||
import "api/pghr13_messages.proto"; | ||
import "api/groth16_messages.proto"; | ||
|
||
import "api/zeth_messages.proto"; | ||
import "api/snark_messages.proto"; | ||
|
||
service Prover { | ||
// Fetch the verification key from the proving service | ||
// Fetch the verification key from the prover server | ||
rpc GetVerificationKey(google.protobuf.Empty) returns (VerificationKey) {} | ||
|
||
// Request a proof generation on the given input | ||
// Request a proof generation on the given inputs | ||
rpc Prove(ProofInputs) returns (ExtendedProof) {} | ||
} | ||
|
||
// Inputs of the Prove function of the Prover service | ||
message ProofInputs { | ||
string mk_root = 1; | ||
// List of inputs to the Joinsplit | ||
repeated JoinsplitInput js_inputs = 2; | ||
// List of output to the Joinsplit | ||
repeated ZethNote js_outputs = 3; | ||
// Hexadecimal string representing a uint64 value | ||
string pub_in_value = 4; | ||
// Hexadecimal string representing a uint64 value | ||
string pub_out_value = 5; | ||
string h_sig = 6; | ||
string phi = 7; | ||
} | ||
|
||
message VerificationKey { | ||
oneof VK { | ||
VerificationKeyPGHR13 pghr13_verification_key = 1; | ||
VerificationKeyGROTH16 groth16_verification_key = 2; | ||
} | ||
} | ||
|
||
message ExtendedProof { | ||
oneof EP { | ||
ExtendedProofPGHR13 pghr13_extended_proof = 1; | ||
ExtendedProofGROTH16 groth16_extended_proof = 2; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
syntax = "proto3"; | ||
|
||
package zeth_proto; | ||
|
||
import "api/pghr13_messages.proto"; | ||
import "api/groth16_messages.proto"; | ||
|
||
message VerificationKey { | ||
oneof VK { | ||
VerificationKeyPGHR13 pghr13_verification_key = 1; | ||
VerificationKeyGROTH16 groth16_verification_key = 2; | ||
} | ||
} | ||
|
||
message ExtendedProof { | ||
oneof EP { | ||
ExtendedProofPGHR13 pghr13_extended_proof = 1; | ||
ExtendedProofGROTH16 groth16_extended_proof = 2; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
syntax = "proto3"; | ||
|
||
package zeth_proto; | ||
|
||
message ZethNote { | ||
string apk = 1; | ||
// Hex string representing a int64 value | ||
string value = 2; | ||
string rho = 3; | ||
string trap_r = 4; | ||
} | ||
|
||
message JoinsplitInput { | ||
// Merkle authentication path to the commitment | ||
// of the note in the Merkle tree. Each node of | ||
// the merkle tree is treated as a string | ||
repeated string merkle_path = 1; | ||
int64 address = 2; | ||
ZethNote note = 3; | ||
string spending_ask = 4; | ||
string nullifier = 5; | ||
} | ||
|
||
message ProofInputs { | ||
string mk_root = 1; | ||
// List of inputs to the Joinsplit | ||
repeated JoinsplitInput js_inputs = 2; | ||
// List of output to the Joinsplit | ||
repeated ZethNote js_outputs = 3; | ||
// Hexadecimal string representing a uint64 value | ||
string pub_in_value = 4; | ||
// Hexadecimal string representing a uint64 value | ||
string pub_out_value = 5; | ||
string h_sig = 6; | ||
string phi = 7; | ||
} |
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
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
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
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
Oops, something went wrong.