Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.xandrlabs.ai/llms.txt

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

ALX Protocol gives you the building blocks to create, publish, and verify Knowledge Blocks — cryptographically identified artifacts whose identity is derived from their content. Whether you’re building AI pipelines, audit systems, or multi-agent workflows, ALX Protocol ensures every artifact is verifiable, reproducible, and traceable across systems and implementations.

Quick Start

Install the SDK and compute your first Knowledge Block identity in minutes.

Core Concepts

Understand Knowledge Blocks, identity, lineage, and canonicalization.

Guides

Step-by-step walkthroughs for publishing, verifying, and settling on-chain.

API Reference

Full reference for every function exported by @alx/protocol.

What you can do with ALX Protocol

ALX Protocol is the foundation for systems that need correctness, reproducibility, and traceability.

Compute verifiable identity

Derive a deterministic kbHash from any artifact using content-addressed hashing.

Publish on-chain

Register Knowledge Blocks on Base mainnet with royalty and attribution metadata.

Verify artifacts

Confirm that a retrieved artifact matches its published cryptographic commitment.

Track lineage

Build composable Knowledge Block DAGs with explicit parent references.

Sign requests (EIP-712)

Authenticate protocol interactions with tamper-proof typed data signatures.

Settle attribution

Distribute query fees across the lineage graph using on-chain settlement.

Get started in 3 steps

1

Install the package

Add @alx/protocol to your project using your preferred package manager.
npm install @alx/protocol
# or
pnpm add @alx/protocol
2

Compute a Knowledge Block identity

Canonicalize your artifact and derive its kbHash — a deterministic, content-addressed identifier.
import { canonicalize, kbHashFromEnvelope } from "@alx/protocol";

const envelope = {
  type: "Practice",
  domain: "engineering.auth.jwt",
  sources: [],
  payload: { title: "JWT Rotation Policy", summary: "Rotate keys every 90 days." }
};

const kbHash = kbHashFromEnvelope(envelope);
console.log(kbHash); // 0x...
3

Publish and verify on-chain

Register the Knowledge Block in the on-chain registry and verify its integrity at any time.
import { ethers } from "ethers";
import { REGISTRY_ABI } from "@alx/protocol";

const registry = new ethers.Contract(CONTRACT_ADDRESS, REGISTRY_ABI, signer);

await registry.publishKB(
  kbHash,
  rootCid,       // IPFS CID of the artifact
  0,             // KB type: Practice
  [],            // parent IDs (empty for root KB)
  500,           // royaltyBps: 5%
  { value: ethers.parseEther("0.001") }
);
ALX Protocol is deployed on Base mainnet at 0xD1F216E872a9ed4b90E364825869c2F377155B29. The minimum stake to publish a Knowledge Block is 0.001 ETH.