Skip to main content

REST API

ALX Protocol does not define a REST API. Applications exchange Blocks through HTTP, files, queues, databases, or other transports. Transport choice does not change protocol behavior.

Block Retrieval API​

ALX publishes an informative Block Retrieval API description (OpenAPI 3.1) for applications that expose Block lookup and storage over HTTP. The description is not normative; the protocol specification defines Block validity.

OperationEndpoint
Retrieve a BlockGET /block/{blockHash}
Check that a Block existsHEAD /block/{blockHash}
Publish a BlockPOST /block
Get the IPFS CID recorded for a BlockGET /block/{blockHash}/cid
Retrieve several BlocksPOST /blocks

Client Verification​

After every fetch, parse the response strictly, validate the Block, and compare the returned blockHash with the hash the client requested. Recompute Block identity locally for every response, including responses from a trusted endpoint: a server can return a different Block that is internally valid. Validate Blocks shows the parsing and validation steps. A blockHash and an IPFS CID are different identifiers: the CID addresses stored bytes, and the blockHash identifies the ALX Block.

When to Define an API​

Define an application-owned API when Blocks need remote storage or exchange. Integrate ALX covers trust boundaries and the identity comparison each boundary requires.