Skip to main content

JavaScript Reference Surface

@alx-protocol/sdk exposes the helpers used to create, connect, validate, sign, and verify ALX data. The reference groups the current root exports by protocol task and names the subpaths that carry the rest.

How the Package Is Organized

The root export covers canonicalization, Block identity, graph validation, attribution tracing, signed Blocks, replay checks, hash utilities, and error codes. The same helpers are also reachable through task-specific subpaths (/block, /lineage, /trace, /canonicalization, /signatures, /replay, /hash-utils), and Merkle helpers and the signing suites live only on their subpaths (/merkle, /ed25519, /p256, /eip712, /middleware).

When to Use This Reference

Use this page after choosing a protocol task and before importing a helper. The conceptual and guide pages explain the expected inputs and verification boundaries behind each export.

Serialize protocol JSON the one canonical way, and read the domains and version the hashes bind.

  • Serialization: canonicalizeProtocolJson, parseStrictJson, parseStrictJsonBytes
  • Constants: CANONICALIZATION_ALGORITHM, ALX_PROTOCOL_VERSION, BLOCK_HASH_DOMAIN, CONTENT_HASH_DOMAIN, ATTESTATION_HASH_DOMAIN, MAX_PARENTS, HASH_PATTERN.