Skip to main content

Spaces and Namespaces

ElastOS Runtime uses a unified addressing scheme where apps request resources by URI and the matching provider capsule handles them. The app doesn't know or care where data physically lives. For the conceptual overview, see Architecture.

localhost:// Paths

Everything on your machine is addressed through localhost:// paths. The runtime mediates all access through the capability system.

PathPurpose
localhost://storage/{path}File storage
localhost://service/media/*Media services
localhost://MyWebSiteStaged local sites

elastos:// Paths

Content that leaves your machine and enters the network is addressed through elastos://:

PathPurpose
elastos://cid/{hash}Content-addressed files
elastos://peer/{wallet}/Public/*Peer public content
elastos://ai/AI model provider contract

PC2 v1 to v2 URI Mapping

As PC2 converges with the runtime, existing API paths map to the new namespace:

PC2 v1 PathRuntime v2 URI
/file?uid=...localhost://storage/{path}
/ipfs/:cidelastos://cid/{hash}
/public/:wallet/*elastos://peer/{wallet}/Public/*
/api/media/*localhost://service/media/*

This mapping is documented in NAMESPACE_MAPPING.md in the runtime repository.

How Provider Capsules Handle URIs

When a capsule requests a resource by URI, the runtime routes the request to the appropriate provider capsule:

  1. The requesting capsule presents its capability token and the resource URI
  2. The runtime validates the token (12-step validation)
  3. The runtime matches the URI to the responsible provider capsule
  4. The provider capsule fulfills the request
  5. The response is returned to the requesting capsule

The requesting capsule never interacts with the provider directly. The runtime mediates every step, enforcing capability tokens at each boundary.