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
| Parameter | Value |
|---|---|
| Network | fluxa-monetize-credits |
| Currency | FLUXA_MONETIZE_CREDITS |
| Asset | fluxa-monetize-credit |
| Decimals | 2 (100 = 1.0 Credit) |
| Token name | FluxA Monetize Credits |
| Token version | 1 |
| PayTo | monetize.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
| Field | Type | Description |
|---|---|---|
payerWallet | address | Payer's EVM wallet address |
asset | string | Always fluxa-monetize-credit |
amountCredits | uint256 | Amount in minor units (2 decimals: 100 = 1 Credit) |
nonce | bytes32 | Unique nonce (timestamp + random, 20-minute window) |
validAfter | uint256 | Unix timestamp — valid after |
validBefore | uint256 | Unix timestamp — expires at |
creditsMandateId | string | Mandate ID (mnd_...) or approval ID (papr_...) |
Meta Fields
| Field | Type | Description |
|---|---|---|
approvalId | string | Payment approval ID |
mandateId | string | Mandate ID |
payTo | string | Payment recipient identifier |
host | string | Target API host |
resource | string | Target resource path |
description | string | Human-readable payment description |
amountCredits | string | Amount in major units (e.g. "1.00") |
currency | string | Currency 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:
- Verify — recovers EIP-712 signer, validates nonce, amount, wallet, and mandate
- Settle — atomically debits the payer's credits balance and writes an immutable ledger entry
