Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.peaq.xyz/llms.txt

Use this file to discover all available pages before exploring further.

Qualify turns a machine’s on-chain history into a Machine Credit Rating (MCR): a Moody’s-style letter rating that any protocol, agent, or frontend can query from any chain.

What ships

ComponentDescription
EventRegistryOn-chain store for revenue (type 0) and activity (type 1) events, with a cross-chain audit trail.
MCR scoring pipelineComputes AAA-to-NR ratings from a bonded machine’s event history.
MCR APIPublic read API. Any chain, any caller, no auth.
SDK helperssubmitEvent, validateSubmitEventParams, computeDataHash, queryMcr on both JS and Python.

How it works

1

Submit events

Each time a machine earns revenue or performs a trackable activity, the operator submits an event to the EventRegistry. The SDK validates the payload, computes a keccak256 data hash, and writes the minimal on-chain record.
import "dotenv/config";
import { 
  PeaqosClient, 
  EVENT_TYPE_REVENUE, 
  TRUST_SELF_REPORTED, 
  SUPPORTED_CHAIN_IDS 
} from "@peaqos/peaq-os-sdk";

const client = PeaqosClient.fromEnv();
const { txHash, dataHash } = await client.submitEvent({
  machineId,
  eventType: EVENT_TYPE_REVENUE,
  value: 500,                       // $5.00 in cents
  currency: "USD",
  timestamp: Math.floor(Date.now() / 1000) - 10, // Must be after block time
  rawData: new TextEncoder().encode(JSON.stringify({ session: "abc" })),
  trustLevel: TRUST_SELF_REPORTED,
  sourceChainId: SUPPORTED_CHAIN_IDS.peaq,
  sourceTxHash: null,
  metadata: new Uint8Array([]),
});
Full walkthrough: Submit events.
2

Events accumulate

A freshly registered machine is Provisioned until it has enough history to score. Events feed the scoring pipeline, which blends revenue trend, activity cadence, bond status, and trust level.
3

Query the MCR

Any consumer (an agent, protocol, frontend, or another chain) can fetch the current rating from the public API.
curl ${PEAQOS_MCR_API_URL}/mcr/did:peaq:0xabc...
Response includes the rating (AAA / AA / A / BBB / BB / B / NR / Provisioned), score, event counts, revenue trend, and bond status. Full walkthrough: Query MCR.

Cross-chain revenue

Revenue earned on another chain (e.g., Base) is recorded on peaq with sourceChainId and sourceTxHash pointing to the origin transaction. Consumers can verify each event against its source chain. See Events and Trust levels.

Concepts

Machine Credit Rating

AAA-to-NR scale, lifecycle from Provisioned to rated.

Events

Revenue and activity records that feed MCR.

Trust levels

Self-reported, on-chain verifiable, hardware-signed.

SDK reference

API reference

GET /mcr/{did}

Rating, score, trend, bond status for a single machine.

GET /operator/{did}/machines

Paginated operator fleet with per-machine MCR.

Guides

Submit events

Event types, validation, data hashing, cross-chain pattern.

Query MCR

Fetch ratings from curl, JS, or Python.