-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcomputation.proto
35 lines (28 loc) · 1.44 KB
/
computation.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
syntax = "proto3";
package computation;
// Service definition for performing Multi-Scalar Multiplication (MSM) operations
service ComputationService {
// Sends computation data to client nodes for MSM computation
rpc SendComputationData (ComputationRequest) returns (stream ComputationData);
// Receives the computation results from client nodes
rpc ReceiveComputationResult (ComputationResult) returns (ResultAck);
}
// Used by a client node to request computation data (Client -> Server)
message ComputationRequest {
string clientId = 1; // Unique identifier for the client node
}
// Contains the computation data sent from the server to client nodes (Server -> Client)
message ComputationData {
repeated bytes scalar = 1; // The scalar as a byte array, for numbers up to 2^256-1
repeated bytes x = 2; // The x coordinate as a byte array, for numbers up to 2^256-1
repeated bytes y = 3; // The y coordinate as a byte array, for numbers up to 2^256-1
}
// Contains the result of the computation sent from client nodes back to the server (Client -> Server)
message ComputationResult {
bytes resultX = 1; // The computed result's x coordinate as a byte array
bytes resultY = 2; // The computed result's y coordinate as a byte array
}
// Acknowledges the successful reception of computation results (Server -> Client)
message ResultAck {
bool success = 1; // Indicates whether the server successfully received and processed the computation result
}