ALX Protocol gives you a deterministic, content-addressed identity layer for Knowledge Blocks (KBs). Every KB you publish on-chain is derived from its canonical content: same payload, same sources, sameDocumentation Index
Fetch the complete documentation index at: https://docs.xandrlabs.ai/llms.txt
Use this file to discover all available pages before exploring further.
kbHash — always. This guide takes you from a fresh install to your first on-chain KB publication in six steps.
Compute the KB identity
A KB’s identity hash (
kbHash) is derived deterministically from a normalized, canonicalized envelope. Import kbHashFromEnvelope and construct your envelope with the four required fields — type, domain, sources, and payload — plus an artifactHash (computed in the next step).kbHashFromEnvelope applies RFC 8785 (JCS) canonicalization, sorts sources
alphabetically, and prepends the KB_V1 domain tag before hashing. Never hash
the envelope yourself — use this function to stay conformant.Compute the artifact hash
The artifact hash records the integrity of the full artifact JSON as it will be stored on IPFS. You can derive it directly from the payload using The two methods target different use cases. Use
artifactHashFromPayload (already done above), or compute it manually using the sha256 approach if you need to match a pre-serialized artifact file.artifactHashFromPayload when you’re building the envelope from scratch. Use the sha256 approach when you already have a serialized artifact file and need to reproduce the hash that the registry stores.Derive the CID
The CID is a content-addressed identifier for the canonical envelope on IPFS. Use
cidV1FromCanonicalSync for synchronous environments (Node.js, protocol tooling) or cidV1FromCanonical for async contexts such as browsers.Publish on-chain
Call
publishKB on the ALX registry contract on Base mainnet. You need a funded signer and at least 0.001 ETH to cover the minimum stake.Contract details
- Registry address (Base mainnet):
0xD1F216E872a9ed4b90E364825869c2F377155B29 - Chain ID:
8453 - Minimum stake:
0.001 ETH(required with everypublishKBcall)
pendingWithdrawals
and are withdrawn via a separate pull-based call.Next steps
Verify an artifact
Recompute and validate KB identity and artifact integrity against on-chain data.
Signed requests
Authenticate protocol interactions with EIP-712 typed signatures.
Lineage and attribution
Understand the KB attribution DAG, parent references, and royalty distribution.