Skip to content

Credits Scheme

The Credits scheme uses FluxA Monetize Credits — an off-chain balance system with EIP-712 signed spend authorizations and atomic settlement via the Credits Facilitator.

Network Parameters

ParameterValue
Networkfluxa-monetize-credits
CurrencyFLUXA_MONETIZE_CREDITS
Assetfluxa-monetize-credit
Decimals2 (100 = 1.0 Credit)
Token nameFluxA Monetize Credits
Token version1
PayTomonetize.fluxapay.xyz

402 Response

json
{
  "x402Version": 1,
  "accepts": [
    {
      "x402Version": 1,
      "scheme": "exact",
      "network": "fluxa-monetize-credits",
      "maxAmountRequired": "100",
      "resource": "/api/data",
      "description": "API access fee",
      "payTo": "monetize.fluxapay.xyz",
      "maxTimeoutSeconds": 60,
      "asset": "fluxa-monetize-credit",
      "extra": {
        "name": "FluxA Monetize Credits",
        "version": "1"
      }
    }
  ]
}

X-Payment Payload

json
{
  "x402Version": 1,
  "scheme": "exact",
  "network": "fluxa-monetize-credits",
  "payload": {
    "signature": "0x...",
    "authorization": {
      "payerWallet": "0x...",
      "asset": "fluxa-monetize-credit",
      "amountCredits": "100",
      "nonce": "0x...",
      "validAfter": "1700000000",
      "validBefore": "1700001200",
      "creditsMandateId": "mnd_..."
    },
    "meta": {
      "approvalId": "papr_...",
      "mandateId": "mnd_...",
      "payTo": "monetize.fluxapay.xyz",
      "host": "example.com",
      "resource": "/api/data",
      "description": "API access fee",
      "amountCredits": "1.00",
      "currency": "FLUXA_MONETIZE_CREDITS"
    }
  }
}

Authorization Fields

FieldTypeDescription
payerWalletaddressPayer's EVM wallet address
assetstringAlways fluxa-monetize-credit
amountCreditsuint256Amount in minor units (2 decimals: 100 = 1 Credit)
noncebytes32Unique nonce (timestamp + random, 20-minute window)
validAfteruint256Unix timestamp — valid after
validBeforeuint256Unix timestamp — expires at
creditsMandateIdstringMandate ID (mnd_...) or approval ID (papr_...)

Meta Fields

FieldTypeDescription
approvalIdstringPayment approval ID
mandateIdstringMandate ID
payTostringPayment recipient identifier
hoststringTarget API host
resourcestringTarget resource path
descriptionstringHuman-readable payment description
amountCreditsstringAmount in major units (e.g. "1.00")
currencystringCurrency identifier

EIP-712 Type Definition

json
{
  "domain": {
    "name": "FluxA Credits Mandate Spend",
    "version": "1",
    "chainId": 8453,
    "verifyingContract": "0x0000000000000000000000000000000000000000"
  },
  "primaryType": "CreditsMandateSpend",
  "types": {
    "CreditsMandateSpend": [
      { "name": "payerWallet", "type": "address" },
      { "name": "asset", "type": "string" },
      { "name": "amountCredits", "type": "uint256" },
      { "name": "nonce", "type": "bytes32" },
      { "name": "validAfter", "type": "uint256" },
      { "name": "validBefore", "type": "uint256" },
      { "name": "creditsMandateId", "type": "string" }
    ]
  }
}

Nonce Format

Credits nonces encode a timestamp for expiry checking:

0x{timestamp_hex_8}{random_hex_16}{zero_padding_40}
  • First 8 hex chars: Unix timestamp
  • Next 16 hex chars: random bytes
  • Remaining 40 hex chars: zero-padded
  • Nonce validity window: 20 minutes

Verification and Settlement

Verification and settlement are handled by the Credits Facilitator:

  1. Verify — recovers EIP-712 signer, validates nonce, amount, wallet, and mandate
  2. Settle — atomically debits the payer's credits balance and writes an immutable ledger entry

Released under the MIT License.