> ## Documentation Index
> Fetch the complete documentation index at: https://docs.primev.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Provider API

## **Providers**

Execution providers can use the `provider` role to run their nodes. This allows them to receive signed bids and issue commitments for execution.
The **Provider RPC API** allows providers to receive signed bids that are being propagated in the network.
Once they get a bid, they'll need to communicate with the mev-commit node to **Accept**.
Accepted bids result in the mev-commit node sending a signed commitment to the p2p network.

The Provider API is implemented using the gRPC framework, supporting two primary operations:

* **Receiving Bids:** Providers receive streaming bids from the mev-commit node.
* **Sending Processed Bids:** Providers send information about processed bids back to the mev-commit node.

### **RPC API Details**

The protobuf file is available in the [repository](https://github.com/primev/mev-commit/blob/main/p2p/rpc/providerapi/v1/providerapi.proto).
The Go client has already been generated in the repository. To generate the RPC client for other languages, please follow the instructions
in the [gRPC documentation](https://grpc.io/docs/languages/).

**Primary RPC Operations:**

```protobuf theme={null}
// ReceiveBids is called by the execution provider to receive bids from the mev-commit node.
// The mev-commit node will stream bids to the execution provider.
rpc ReceiveBids(EmptyMessage) returns (stream Bid) {}

// SendProcessedBids is called by the provider to send processed bids to the mev-commit node.
// The execution provider will stream processed bids to the mev-commit node.
rpc SendProcessedBids(stream BidResponse) returns (EmptyMessage) {}
```

**Message Structures**

```protobuf theme={null}
message Bid {
  repeated string tx_hashes = 1;
  string bid_amount = 2;
  int64 block_number = 3;
  bytes bid_digest = 4;
  int64 decay_start_timestamp = 5;
  int64 decay_end_timestamp = 6;
  repeated string reverting_tx_hashes = 7;
  repeated string raw_transactions = 8;
  string slash_amount = 9;
};

message BidResponse {
  bytes bid_digest = 1;
  enum Status {
    STATUS_UNSPECIFIED = 0;
    STATUS_ACCEPTED = 1;
    STATUS_REJECTED = 2;
  }
  Status status = 2;
  int64 dispatch_timestamp;
};
```

### **HTTP API**

The same API is also available on the HTTP port configured on the node. Please review the [API docs](/v1.1.0/api-reference/provider/receivebids) to understand the usage.

An [example client](https://github.com/primev/mev-commit/tree/main/p2p/examples/provideremulator) is implemented in the repository. This example showcases how to integrate a client into the provider's operational framework. While the sample client automatically accepts every incoming bid, providers should incorporate their own decision-making logic to evaluate and respond to these bids.
