-
Notifications
You must be signed in to change notification settings - Fork 1
/
query.proto
62 lines (48 loc) · 1.92 KB
/
query.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
syntax = "proto3";
import "google/api/annotations.proto";
package galactica.merkle;
option go_package = "github.com/Galactica-corp/merkle-proof-service/gen/galactica/merkle";
// Query defines the gRPC querier service.
service Query {
// Proof queries the proof of a leaf in the merkle tree.
rpc Proof (QueryProofRequest) returns (QueryProofResponse) {
option (google.api.http).get = "/v1/galactica/merkle/proof/{registry}/{leaf}";
}
// GetEmptyLeafProof queries the proof of the any empty leaf in the merkle tree.
rpc GetEmptyLeafProof (GetEmptyLeafProofRequest) returns (GetEmptyLeafProofResponse) {
option (google.api.http).get = "/v1/galactica/merkle/empty_proof/{registry}";
}
}
// QueryProofRequest is the request type for the Query.Proof method.
message QueryProofRequest {
// registry is the ZkCertificateRegistry hex address, which starts with 0x.
string registry = 1;
// leaf is the leaf uint256 value.
string leaf = 2;
}
// QueryProofResponse is the response type for the Query.Proof method.
message QueryProofResponse {
// proof is the merkle proof.
Proof proof = 1;
}
// GetEmptyLeafProofRequest is the request type for the Query.GetEmptyLeafProof method.
message GetEmptyLeafProofRequest {
// registry is the ZkCertificateRegistry hex address, which starts with 0x.
string registry = 1;
}
// GetEmptyIndexResponse is the response type for the Query.GetEmptyLeafProof method.
message GetEmptyLeafProofResponse {
// proof is the merkle proof of the empty leaf.
Proof proof = 1;
}
// Proof is the merkle proof.
message Proof {
// leaf is the leaf value encoded as a string containing the uint256 value.
string leaf = 1;
// path is the merkle proof path, encoded as a string containing the uint256 values.
repeated string path = 2;
// index is the leaf index.
uint32 index = 3;
// root is the merkle root, value encoded as a string containing the uint256 value.
string root = 4;
}