IPFS
IPFS distributes serialized ALX Blocks through content-addressed retrieval.
Applications receive a CID, retrieve the associated bytes, and validate the resulting Block locally.
ALX blockHash identifies canonicalized Block content and declared parents. An IPFS CID identifies raw file bytes. Applications retain both identifiers when distributing Blocks through IPFS.
Two Identifiers
| Property | ALX blockHash | IPFS CID |
|---|---|---|
| Role | Identifies an ALX Block | Identifies retrievable bytes |
| Hash function | Keccak-256 | Multihash selected by the CID |
| Input | Canonicalized content and parentHashes | Raw file bytes |
| Verified by | A conforming ALX implementation | IPFS content addressing |
Applications maintain the mapping between blockHash and CID.
Application Integration
Applications select and operate the IPFS client, gateway, pinning policy, and identifier mapping.
After retrieval:
- Parse the supplied bytes as a Block.
- Call
validateBlock(). - Compare the recomputed
blockHashwith the expectedblockHash. - Accept the Block after validation succeeds.
Treat retrieval transport and gateway responses as untrusted input until local validation succeeds.
When to Use IPFS
Use IPFS when an application needs CID-based distribution across infrastructure boundaries. Use application storage when the application controls persistence and retrieval directly.
The selected storage layer preserves ALX Block identity and declared lineage.
Responsibilities Around IPFS
- Availability: Configure nodes or pinning services for the required retention period.
- Lineage: Read declared parent relationships from
parentHashesinside each Block. - Block identity: Verify
blockHashwith ALX protocol rules after retrieving the bytes. - Identifier mapping: Retain the CID-to-
blockHashassociation in the application.