Node API

Proto

syntax = "proto3";

package prove_service;

message ProveBaseRequest {
  string prover_id = 1;            // Unique identifier for the prover
  string circuit_template_id = 2;  // Circuit template identifier
  string input_data = 3;           // Input data used to generate the proof
  bool is_encrypted = 4;           // True if the input data is encrypted
  string auth_token = 5;           // Authentication token
}

message StatusResponse {
  int32 code = 1; // Status code
  string msg = 2; // Additional status information
}

message ProveRequest {
  ProveBaseRequest base_request = 1; // Base request for all proof requests
}

message ProveToCairoRequest {
  ProveBaseRequest base_request = 1; // Base request for all proof requests
}

message ProveNosha256Request {
  ProveBaseRequest base_request = 1; // Base request for all proof requests
  int32 length = 2; // Length of the input data
}

message ProveNosha256OffchainRequest {
  ProveBaseRequest base_request = 1; // Base request for all proof requests
  int32 length = 2; // Length of the input data
}

message GetPublicKeyResponse {
  StatusResponse base_response = 1; // Status code and message
  string public_key = 2; // Retrieved public key string
}

message ProveResponse {
  StatusResponse base_response = 1; // Status code and message
  string proof_data = 2; // Generated proof data
}

message ProveNosha256Response {
  StatusResponse base_response = 1; // Status code and message
  string proof_data = 2; // Generated proof data
}

message ProveToCairoResponse {
  StatusResponse base_response = 1; // Status code and message
  string proof_data = 2; // Generated proof data
  string witness_data = 3; // Additional witness data related to the proof

message ProveNosha256OffchainResponse {
  StatusResponse base_response = 1; // Status code and message
  bytes proof_data = 2; // Generated proof data
  string witness_data = 3; // Additional witness data related to the proof
}

message Empty {
  // An empty message used for requests or responses that don't require additional parameters
}

service ProveService {
  rpc Prove(ProveRequest) returns (ProveResponse); // Generates a proof using the provided parameters
  rpc ProveWithWitness(ProveToCairoRequest) returns (ProveToCairoResponse); // Generates a proof with witness
  rpc ProveNosha256(ProveNosha256Request) returns (ProveNosha256Response);  // Generates a proof using Nosha256 input data
  rpc ProveNosha256WithWitness(ProveNosha256Request) returns (ProveNosha256Response);  // Generates a proof using Nosha256 input data with witness
  rpc ProveNosha256Offchain(ProveNosha256OffchainRequest) returns (ProveNosha256OffchainResponse); // Generates a proof using Nosha256 input data for offchain verify
  rpc GetPublicKey(Empty) returns (GetPublicKeyResponse); // Retrieves the public key for input data encrypted.
  rpc Ping(Empty) returns (Empty); // Ping for health check or to keep the connection alive
}

Service Method Descriptions

Prove

  • Function: prove

  • Request: ProveRequest

    • prover_id: Specify the Prover

    • circuit_template_id: Specify the circuit template

    • input_data: Input data

    • is_encrypted: Whether the Input is encrypted or not

    • auth_token: Unique order number

  • Response: ProveResponse

    • Code: 0 - Successful

    • Response: Returns Proof if successful, otherwise returns an error message

Get Public Key

  • Function: get_public_key

  • Request: EmptyRequest

  • Response: ProveResponse

    • Code: 0 - Successful

    • Response: Return public key if successful, otherwise returns an error message

Last updated