miden-remote-prover 0.14.6

Miden remote prover
miden-remote-prover-0.14.6 is not a library.
Visit the last successful build: miden-remote-prover-0.13.9

Miden remote prover

A gRPC server which provides a service for proving either transactions, batches or blocks for the Miden blockchain.

This enables weaker devices to offload the proof generation to a beefy remote server running this service.

The implementation provides a configurable request queue and proves one request at a time in FIFO order. This is not intended to cover complex proxy setups nor load-balancing, but can instead be used as a starting point for more advanced setups.

The gRPC specification can be found in the Miden repository. Ensure you are viewing the appropriate version tag or commit.

Quick start

# Install the binary.
cargo install miden-remote-prover --locked

# and start as a transaction prover.
miden-remote-prover   \
  --kind transaction  \ # Specify the kind of proof to generate (transaction, batch, or block)
  --port 50051

In a separate terminal, inspect the available services using grpcurl and reflection.

grpcurl -plaintext localhost:50051 list

or query the status of the prover.

grpcurl -plaintext localhost:50051 remote_prover.WorkerStatusApi/Status

Installation

Debian package

Install the Debian package:

set -e

sudo wget https://github.com/0xMiden/node/releases/download/v0.8/miden-prover-v0.8-arm64.deb -O prover.deb
sudo wget -q -O - https://github.com/0xMiden/node/releases/download/v0.8/miden-prover-v0.8-arm64.deb.checksum | awk '{print $1}' | sudo tee prover.checksum
sudo sha256sum prover.deb | awk '{print $1}' > prover.sha256
sudo diff prover.sha256 prover.checksum
sudo dpkg -i prover.deb
sudo rm prover.deb

Edit the configuration file /lib/systemd/system/miden-prover.service.env

Run the service:

sudo systemctl daemon-reload
sudo systemctl enable miden-prover
sudo systemctl start miden-prover

From source

To build the service from a local version, from the root of the workspace you can run:

make install-remote-prover

The CLI can be installed from the source code using specific git revisions with cargo install or from crates.io with cargo install miden-remote-prover.

Configuration

Quick start:

miden-remote-prover --kind transaction

The prover can be further configured from the command line or using environment variables as per the help message:

> miden-remote-prover --help

Usage: miden-remote-prover [OPTIONS] --kind <KIND>

Options:
      --port <PORT>
          The port the gRPC server will be hosted on

          [env: MIDEN_PROVER_PORT=]
          [default: 50051]

      --kind <KIND>
          The proof type that the prover will be handling

          [env: MIDEN_PROVER_KIND=]
          [possible values: transaction, batch, block]

      --timeout <TIMEOUT>
          Maximum time allowed for a proof request to complete. Once exceeded, the request is aborted

          [env: MIDEN_PROVER_TIMEOUT=]
          [default: 60s]

      --capacity <CAPACITY>
          Maximum number of concurrent proof requests that the prover will allow.

          Note that the prover only proves one request at a time; the rest are queued. 
          This capacity is used to limit the number of requests that can be queued at any given time, 
          and includes the one request that is currently being processed.

          [env: MIDEN_PROVER_CAPACITY=]
          [default: 1]

  -h, --help
          Print help (see a summary with '-h')

Status, health and monitoring

The server implements the following health and status related gRPC services:

The server supports OpenTelemetry traces which can be configured using the environment variables specified in the OpenTelemetry documentation.

For example, to send the traces to HoneyComb:

OTEL_SERVICE_NAME=miden-remote-prover
OTEL_EXPORTER_OTLP_ENDPOINT=https://api.honeycomb.io
OTEL_EXPORTER_OTLP_HEADERS=x-honeycomb-team=<api-key>

A self-hosted alternative is Jaeger.

License

This project is MIT licensed.