QALS Wiki · the qalarc networkgenerated 2026-09-06 · qalcode autonomous research

One wallet across every app and agent · 04_credit_token_platform/CREDIT_PLATFORM.md

Qal Credit — Token & Credit Platform Across qalarc Apps

Parent doc: 03_qals_architecture/QALS_ARCHITECTURE.mdDate: 2026-09-06


1. Problem

qalarc's apps (qalarc.com AI services, tradez.au, doof.ing, endispute.com.au, agent hub, compute rig) each need: user balances, metered billing (AI calls, compute seconds), subscriptions, refunds, payouts to partners, and eventually cross-app credit. Classic SaaS billing (Stripe per-app) is expensive, siloed, and cannot express machine-to-machine payments (agent pays agent, agent pays GPU rig) — the exact case IOTA was invented for.

One ledger, one token, every app. QALS is prepaid service credit; the chain is the shared source of truth.

2. Model: three kinds of "money" on Qalnet

Layer Instrument What it is Legal posture (Phase 1)
L1 QALS prepaid service credit for qalarc services; also gas prepaid intangible — see 06_bank_exchange/ for the framing
L2 qAUD (later) tokenized AUD claim (1:1 redeemable) only after custody/licensing work
L3 Metered credits (doofs) per-app internal meters priced in QALS-denominated rates pure accounting

Credit-tier NFTs (see 08_nft_strategy/) sit on top: membership tiers that unlock discounts/limits — the "Zip Pay tier" analogue without being consumer credit.

3. Core Move contract: qal_credit

/// One per user (or agent), created lazily on first top-up.
public struct CreditAccount has key {
    id: UID,
    owner: address,              // bound to a Qal ID DID-controlled address
    balance: Balance<QALS>,      // escrowed prepaid credit
    tier: u8,                    // 0 free / 1 plus / 2 pro / 3 whale (NFT-gated)
    spend_cap_epoch: u64,        // rolling epoch spend cap (agent safety!)
    spent_this_epoch: u64,
    created_ms: u64,
}

/// Pre-authorisation object: like a "card pre-auth" for a job/call.
public struct Hold has key {
    id: UID,
    account: ID,
    amount: u64,                 // max estimated cost, held (not spent)
    expires_at_ms: u64,          // auto-release — no orphaned holds
    purpose: String,             // "llm-call", "gpu-job-123", ...
}

/// Subscription stream: constant drip from account → treasury per epoch.
public struct Subscription has key {
    id: UID,
    account: ID,
    rate_per_epoch: u64,         // QALS/epoch
    app: String,                 // "qalarc.ai", "tradez", ...
    active: bool,
}

Flows: - Top-up: user buys QALS (fiat via Phase-2 exchange path, or earns via compute/airdrop) → CreditAccount balance. - Metered call (AI inference): app backend → place_hold(account, est_cost) → run inference → settle(hold, actual_doofs) (difference released). Identical to how petrol stations pre-authorise cards. On-chain this is 2 small objects, gas sponsored by Qal Pass. - Subscription: Subscription drips per epoch; pausing/cancelling is one object mutation. No external billing provider. - Agent spend: every agent's CreditAccount has a hard spend_cap_epoch — an AI agent literally cannot exceed its allowance, enforced by the chain, not by prompt engineering. This is the killer feature for agentic commerce. - Refund/reversal: settle with negative delta or treasury-signed refund tx; every reversal is an on-chain audit event.

4. Metering: the qal_meter service + price oracle

5. Cross-app experience

Surface Integration
qalarc.com "Qal balance" widget (dApp-kit); sign-in via Qal ID; per-agent spend dashboards
tradez.au trade credits priced in QALS; invoicing emits on-chain receipt DataAnchors
doof.ing Doofs NFT mint paid from CreditAccount; micro-tipping in doofs (feeless-feeling, sponsored gas)
endispute.com.au dispute files notarised (DataAnchor) + escrowed settlement in QALS (hold → release to winning party) — on-chain escrow is a natural fit for a dispute platform
Agent hub every agent has CreditAccount + DID; hub enforces capabilities, chain enforces money
Compute rig jobs settled doof-denominated (see 07_compute_marketplace/)
Mobile/smart devices QR "Qal request" (BIP-21-style URI qal:pay?...) → app deep link; device DIDs with tiny caps

"Exchange system usable across applications and smart device systems" (user's words) = exactly this: Qal ID (who) + CreditAccount (wallet) + PriceTable (what things cost) + Qal Pass (no gas UX) + QR/deep-link (POS-like UX) + Hierarchies caps (device/agent limits). Any new qalarc app plugs into the same four contracts on day one.

6. Credit (deferred credit, Zip-style) — Phase 3

Phase 1 is strictly prepaid (no credit risk, minimal regulation). Phase 3 (after 06_bank_exchange/ licensing path) adds:

7. Treasury & flywheel

 users/apps pay fiat or compute ──► Treasury mints/allocates QALS
        │                                   │
        ▼                                   ▼
  services consumed ──► doofs burned as fees ◄── Qal Pass sponsors gas
        │                                   │
        ▼                                   ▼
  compute providers earn QALS ──► spend on services ──► (loop)

8. Rollout

  1. Now: deploy qal_credit on qalnet-dev-1; wire metering into ONE app (agent hub's LLM calls are the easiest — we already proxy them).
  2. +2w: PriceTable + dashboards; airdrop pilot allocation to internal testers.
  3. +6w: tradez + doof integrations; QR payment links.
  4. +3m: external users (closed beta, identity-gated), compute settlement live.
  5. Later: qAUD bridge, instalments (licensed), device POS pilots (a "smart device" here can be as small as a Raspberry-Pi kiosk with a QR screen).