> For the complete documentation index, see [llms.txt](https://docs.lightning.engineering/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lightning.engineering/lightning-network-tools/aperture/machine-payments-protocol.md).

# Machine Payments Protocol

The Machine Payments Protocol is a proposed protocol for machine-to-machine payments over Lightning and other payment rails

Unlike L402, the Machine Payments Protocol (MPP, not to be confused with Multi-path Payments) allows for payments over multiple payment rails, and is not limited to Lightning Network payments.

Instead of macaroons, it uses credentials, which can either be for a single or multiple uses.

Instead of payment hashes, it uses payment receipts, which are issued by the service upon successful payment, and are passed together with the credential when requesting the resource.

[Read more: MPP](https://mpp.dev/)

## Enable MPP <a href="#docs-internal-guid-e28c0235-7fff-e9b1-4f1b-555c22663108" id="docs-internal-guid-e28c0235-7fff-e9b1-4f1b-555c22663108"></a>

Aperture implements MPP alongside L402.

To enable MPP, amend your `aperture.yaml` file in the authenticator and services sections. You may serve and authenticate L402 and MPP in parallel.

```yaml
authenticator:
  # Enable the Payment HTTP Authentication Scheme (MPP) alongside L402.
  # When enabled, 402 responses include both L402 and Payment challenges.
  # enablempp: true

  # Realm string used in MPP challenge headers. Defaults to the server's
  # listen address.
  # mpprealm: "api.example.com"

  # Enable MPP session intent for prepaid sessions with deposit, bearer,
  # top-up, and close operations. Requires enablempp to be true.
  # enablesessions: true

services:
   # Payment auth scheme for this service. Valid values: "l402" (default),
   # "mpp" (Payment HTTP Auth only), or "l402+mpp" (both schemes).
   # authscheme: "l402"

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.lightning.engineering/lightning-network-tools/aperture/machine-payments-protocol.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
