Agent Legal Context
Protocol Integration

MPP Integration

Machine Payments Protocol integration — fork recommendation with dedicated legalContext field.

This section is advisory.

MPP (Machine Payments Protocol) is open source (Apache 2.0) and early-stage (v0.4.7). Rather than overloading existing fields, the recommendation is to add a dedicated legalContext field to the MPP specification.


MPP's current design is not ideal for legal context references:

  • The opaque field is a single untyped string — not designed for structured references
  • TIP-20 memo is 32 raw bytes — room for a hash but nothing else

Adding a dedicated legalContext field is backward compatible — clients that do not understand legalContext ignore it. This change can be submitted upstream as a PR to the MPP specification, given its early stage.


In the 402 Challenge (Proposal Phase)

WWW-Authenticate: Payment id="abc123", realm="api.example.com",
  method="tempo", intent="charge", request="eyJhb...",
  legalContext="alc:url:https://example.com/terms/v3.pdf"

At Level 2+, the contentHash can be included:

legalContext="alc:sha256:0x7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069"

Including the hash in the 402 challenge (proposal phase) allows the agent to verify terms before paying.


In the Payment Receipt (Execution Phase)

{
  "method": "tempo",
  "status": "success",
  "reference": "0x...",
  "legalContext": {
    "type": "sha256",
    "value": "0x7f83b165..."
  }
}

The receipt confirms the contentHash — what was agreed.


TIP-20 Memo (32 Bytes)

The raw SHA-256 content hash can be placed directly in the TIP-20 memo field for on-chain binding. No type prefix — the field's purpose is defined by this integration guide.

The 32-byte memo holds exactly one SHA-256 hash. This provides an on-chain anchor tying the payment to specific terms.