npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@axobot/mppx

v1.0.0

Published

Lightning-native Machine Payments Protocol SDK with pluggable payment adapters

Downloads

50

Readme

@axobot/mppx

Lightning-native Machine Payments Protocol SDK.

@axobot/mppx is an Axo-maintained implementation of MPP that keeps the protocol public and portable while treating Lightning as a first-class payment method.

It is intended to:

  • follow the MPP and HTTP Payment Authentication specifications
  • model Lightning charge and session flows directly
  • stay provider-agnostic at the adapter boundary
  • ship a ZBD-backed adapter first
  • remain useful outside Axo instead of becoming an Axo-only protocol fork

Why This Package Exists

Most public MPP implementation gravity is currently around Tempo/Spark. Axo wants a Lightning-native implementation where:

  • BOLT11 invoices and preimages are first-class primitives
  • session deposits, top-ups, and refunds work on Lightning
  • the payment adapter can be swapped later for lnd, cln, or others
  • Axo can use the package without owning a proprietary wire protocol

Protocol Compatibility

The official Lightning MPP drafts already define:

  • charge via BOLT11 invoice + preimage proof
  • session via deposit invoice + preimage bearer token + top-up invoices + refund on close

Primary references:

Current Package Surface

Current implementation includes:

  • Payment-auth challenge parsing
  • canonical request and credential encoding helpers
  • Lightning charge credential builders
  • Lightning session open / bearer / topUp / close credential builders
  • high-level helpers for paying charge challenges and opening/top-up/closing sessions
  • BOLT11 payment hash extraction
  • first ZBD Lightning adapter
  • Axo extension support for returnLightningAddress
  • refund helper that prefers returnInvoice and falls back to returnLightningAddress

Package Shape

The package is currently organized into:

  1. core
    • Payment-auth parsing and canonical encoding
    • protocol-safe challenge and credential types
  2. lightning
    • Lightning charge/session helpers
    • invoice/preimage session primitives
  3. adapters
    • ZBD adapter first
    • future lnd / cln adapters later

Axo Extension: returnLightningAddress

The current Lightning session draft uses returnInvoice as the native refund field. @axobot/mppx also supports returnLightningAddress as an Axo extension:

  • if both are present, returnInvoice wins
  • if only returnLightningAddress is present, refund falls back to the adapter
  • this keeps the package ergonomic without throwing away spec-native behavior

Example

import {
  createZbdLightningAdapter,
  openLightningSession,
  createLightningSessionBearerAuthorization,
} from "@axobot/mppx";

const adapter = createZbdLightningAdapter({
  apiKey: process.env.ZBD_API_KEY!,
});

const session = await openLightningSession({
  challenge,
  adapter,
  returnLightningAddress: "[email protected]",
});

const authorization = createLightningSessionBearerAuthorization({
  challenge: bearerChallenge,
  session,
});

Scripts

npm run build
npm test
npm run typecheck

Status

Implemented:

  • protocol primitives
  • Lightning charge/session credential helpers
  • first ZBD adapter
  • initial high-level client helpers

Still pending:

  • richer session manager state model
  • fetch/client integration
  • server middleware integration
  • live validation of zero-amount invoice behavior against ZBD
  • non-ZBD Lightning adapters