Mpp dev patterns

From OrcaQubits/agentic-commerce-skills-plugins · View interactive version

Mpp dev patterns is an AI agent skill from the GitHub repository OrcaQubits/agentic-commerce-skills-plugins. Cross-cutting MPP development patterns — security, replay protection, HMAC challenge binding, receipt validation, error handling, retry logic, TLS requirements, and monitoring. Use when designing architecture or solving production concerns.

How to use this skill

Skill file

MPP Development Patterns

Before writing code

Fetch live docs:

Pattern: HMAC Challenge Binding

The 32-byte secretKey is the server's core security primitive:

const mppx = Mppx.create({
  secretKey: process.env.MPP_SECRET_KEY,  // 32-byte hex
  methods: [/* ... */],
});

Pattern: Replay Protection

Single-use proof semantics prevent double-payment:

Pattern: Transport Security

MPP mandates TLS 1.2+ (TLS 1.3 recommended):

Pattern: JSON Canonicalization

RFC 8785 canonical JSON is required for deterministic encoding:

Pattern: Error Handling

MPP uses RFC 9457 Problem Details for error responses:

{
  "type": "https://paymentauth.org/problems/payment-required",
  "status": 402,
  "detail": "Payment is required.",
  "challengeId": "..."
}

Error types:

Client retry strategy:

Pattern: Receipt Validation

The Payment-Receipt header proves delivery:

Pattern: Rate Limiting

Even with payments, implement rate limiting:

Pattern: Amount Safety

Pattern: Secret Management

Pattern: Monitoring & Observability

Pattern: Testing

Pattern: Caching

Fetch the latest MPP specification and IETF draft for current security requirements, encoding rules, and best practices before implementing.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.