@skalenetwork/mpp

March 24, 2026 · View on GitHub

SKALE payment method for MPP (Machine Payments Protocol)

Enables private, gasless payments on SKALE Network using confidential tokens with BITE encryption and EIP-3009 gasless transfers.

Installation

npm install @skalenetwork/mpp
# or
pnpm add @skalenetwork/mpp
# or
yarn add @skalenetwork/mpp

Quick Start

import { mpp } from '@skalenetwork/mpp/client'

// Standard transfer on SKALE Base
const method = mpp.charge({
  chain: 'skale-base',
  currency: 'USDC.e'
})

// Gasless with EIP-3009
const gaslessMethod = mpp.charge({
  chain: 'skale-base',
  currency: 'USDC.e',
  extensions: { gasless: 'eip3009' }
})

// Encrypted (BITE Phase I)
const encryptedMethod = mpp.charge({
  chain: 'skale-base',
  currency: 'USDC.e',
  extensions: { skale: { encrypted: true } }
})

// Confidential token (BITE Phase II) + gasless
const confidentialMethod = mpp.charge({
  chain: 'bite-sandbox',
  currency: 'eUSDC',
  extensions: {
    skale: { encrypted: true, confidentialToken: true },
    gasless: 'eip3009'
  }
})

Supported Chains

ChainNetworkChain ID
skale-baseSKALE Base Mainnet284351530983
skale-base-sepoliaSKALE Base Testnet2024883468
bite-sandboxBITE Sandbox Testnet103698795
baseBase Mainnet8453
base-sepoliaBase Sepolia84532

Extensions

Gasless

Enable gasless payments via EIP-3009 or EIP-2612 permit:

extensions: { gasless: 'eip3009' }  // Default gasless mode
extensions: { gasless: 'eip2612' }  // ERC-2612 permit
extensions: { gasless: true }       // Auto-detect EIP-3009

BITE Encryption (Phase I)

Encrypt transfer amounts on-chain:

extensions: { skale: { encrypted: true } }

Confidential Tokens (Phase II)

Use native confidential tokens with BITE:

extensions: {
  skale: {
    encrypted: true,
    confidentialToken: true
  }
}

Payment Strategies

ChainCurrencyGaslessEncryptedConfidential TokenMode
skale-baseUSDC.e---Standard transfer
skale-baseUSDC.eEIP-3009--Gasless permit
skale-baseUSDC.e--Encrypted amount
skale-baseUSDC.eEIP-3009-Gasless + encrypted
bite-sandboxeUSDC--Confidential token
bite-sandboxeUSDCEIP-3009-Confidential + gasless
bite-sandboxeUSDC-Confidential + encrypted
bite-sandboxeUSDCEIP-3009Full privacy (all)

Custom Chains

Use any viem Chain object:

import { mpp } from '@skalenetwork/mpp/client'
import { defineChain } from 'viem'

const myChain = defineChain({
  id: 123456,
  name: 'My Chain',
  nativeCurrency: { name: 'ETH', symbol: 'ETH', decimals: 18 },
  rpcUrls: {
    default: { http: ['https://mychain.rpc'] }
  }
})

const method = mpp.charge({
  chain: myChain,
  currency: {
    address: '0xTokenAddress...',
    symbol: 'TOKEN',
    decimals: 18,
    eip3009: true
  }
})

Server Usage

import { mpp } from '@skalenetwork/mpp/server'

const method = mpp.charge({
  chain: 'skale-base',
  currency: 'USDC.e',
  extensions: { gasless: 'eip3009' }
})

// In your MPPx server setup
const mppx = Mppx.create({
  methods: [method],
  realm: 'api.example.com',
  secretKey: process.env.MPP_SECRET
})

License

MIT