> For the complete documentation index, see [llms.txt](https://lita.gitbook.io/lita-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lita.gitbook.io/lita-documentation/service/prover-service-api.md).

# Prover Service API

Version: 0.1.1

## Overview

This documentation outlines the Prover and Proof Delivery Service API, defined with OpenAPI 3.0.3. This service allows for the registration of Valida VM programs and inputs, submission of proof generation requests, and retrieval of proofs and their statuses. The API is designed to be integrated with AWS Lambda via the Amazon API Gateway, facilitating seamless backend processing.

## Authentication

To authenticate with the Prover and Proof Delivery Service API, include your API key in the header of each request:

```
x-api-key: YOUR_API_KEY_HERE
```

## Errors

We use conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the `2xx` range indicate success. Codes in the `4xx` range indicate an error that failed given the information provided (e.g., a required parameter was omitted etc.). Codes in the `5xx` range indicate an error with the servers (these are rare).

| Code              | Description                                                              |
| ----------------- | ------------------------------------------------------------------------ |
| 200 OK            | Everything worked as expected.                                           |
| 400 Bad Request   | The request was unacceptable, often due to missing a required parameter. |
| 403 Forbidden     | The API key doesn’t have permissions to perform the request.             |
| 404 Not Found     | The requested resource doesn’t exist.                                    |
| 500 Server Errors | Something went wrong on the server.                                      |

## APIs

| API                                               | Endpoint                  |
| ------------------------------------------------- | ------------------------- |
| [Register program](#register-program)             | **POST** /program         |
| [Register program input](#register-program-input) | **POST** /program-input   |
| [Submit proof request](#submit-proof-request)     | **POST** /proof           |
| [Get proof status](#get-proof-status)             | **GET** /proof/status/:id |
| [Get proof](#get-proof)                           | **GET** /proof/:id        |

### <mark style="color:yellow;">Register program</mark>

Registers a new Valida VM program from binary data

#### Request body <mark style="color:orange;">**required**</mark>

***

Binary data of the Valida VM program.

**Returns**

***

An object with the UUID of the registered program.

```json
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
```

### <mark style="color:yellow;">Register program input</mark>

Registers input for a Valida VM program from binary data.

#### Request body <mark style="color:orange;">**required**</mark>

***

Binary data of the Valida VM program input.

**Returns**

***

An object with the UUID of the registered program input.

```json
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
```

### <mark style="color:yellow;">Submit proof request</mark>

Submits a proof generation request for a specific program and input combination.

#### Request body <mark style="color:orange;">**required**</mark>

***

An object with program UUID and program input UUID.

```json
{
  "program-id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "program-input-id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
```

**Returns**

***

An object with the UUID of the proof request.

```json
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
```

### <mark style="color:yellow;">Get proof status</mark>

Get the status of a proof generation request.

#### Parameters

***

**id** <mark style="color:blue;">string</mark> [<mark style="color:orange;">**required**</mark>](#user-content-fn-1)[^1]

UUID of the proof request

**Returns**

***

An object with the proof status (`SUBMITTED`, `PROCESSING`, `COMPLETED`,  or`ERROR`).

```json
{
  "status": "SUBMITTED"
}
```

### <mark style="color:yellow;">Get proof</mark>

Retrieves a serialized proof given a proof ID.

#### Parameters

***

**id** <mark style="color:blue;">string</mark> [<mark style="color:orange;">**required**</mark>](#user-content-fn-1)[^1]

UUID of the proof request

**Returns**

***

An object with serialized proof.

<pre class="language-json"><code class="lang-json"><strong>{
</strong>  "proof": "string"
}
</code></pre>

## Additional Notes

* The API integrates with AWS Lambda for backend processing, utilizing Amazon API Gateway for connectivity and security.
* Future versions of the API may include endpoints for proof delivery functionalities.

[^1]:
