06. URI - Addressing Scheme

The CMN URI is the primary identifier for all entities in the Code Mycelial Network.

1. URI Forms

CMN has four URI forms:

cmn://{domain}                 # Domain root
cmn://{domain}/mycelium/{hash} # Content-addressed mycelium (site descriptor)
cmn://{domain}/{hash}          # Content-addressed spore (code unit)
cmn://{domain}/taste/{hash}    # Content-addressed taste report (safety evaluation)

1.1 Domain URI

The domain’s root identity.

cmn://cmn.dev

Properties:

1.2 Mycelium URI

Content-addressed identifier for a domain’s site descriptor.

cmn://{domain}/mycelium/{hash}

Examples:

cmn://cmn.dev/mycelium/b3.3yMR7vZQ9hL2xKJdFtN8wPcB6sY1mXgU4eH5pTa2

Properties:

1.3 Spore URI

Content-addressed identifier for code units.

cmn://{domain}/{hash}

Examples:

cmn://cmn.dev/b3.3yMR7vZQ9hL2xKJdFtN8wPcB6sY1mXgU4eH5pTa2

Properties:

1.4 Taste URI

Content-addressed identifier for safety evaluation reports.

cmn://{domain}/taste/{hash}

Examples:

cmn://alice.dev/taste/b3.7kLmN2pQrS4tUvWx8yZaB3cD5eF6gH9iJ1kL2mN3o

Properties:

1.5 Replicate Identification

Replicates use the same URI forms as ordinary spores/mycelia/tastes. A replicate is identified during verification, not by a special URI prefix:

This keeps URI parsing simple and keeps lineage/authorship in signed core metadata.

2. Hash Format

2.1 Syntax

{algorithm}.{base58_value}
AlgorithmOutput SizeExample
b3 (BLAKE3)32 bytes (~44 base58 chars)b3.3yMR7vZQ9hL2xKJdFtN8wPcB6sY1mXgU4eH5pTa2

Base58 uses the alphabet 123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz (no 0, O, I, l).

2.2 Consistency

Hashes use dot as separator everywhere: b3.<base58>. This format is used consistently across URIs, JSON fields, filenames, and API paths. No conversion is needed.

3. URI Resolution

3.1 Spore Resolution

Input:  cmn://cmn.dev/b3.3yMR7vZQ9hL2xKJdFtN8wPcB6sY1mXgU4eH5pTa2
Output: https://cdn.cmn.dev/cmn/spore/b3.3yMR7vZQ9hL2xKJdFtN8wPcB6sY1mXgU4eH5pTa2.json

Steps:

  1. Extract domain: cmn.dev
  2. Fetch https://cmn.dev/.well-known/cmn.json
  3. Read primary capsule capsules[0]
  4. Get spore endpoint template: https://cdn.cmn.dev/cmn/spore/{hash}.json
  5. Replace {hash} with spore hash
  6. Fetch spore manifest

3.2 Domain Resolution

Input:  cmn://cmn.dev
Output: (full mycelium manifest)

Steps:

  1. Extract domain: cmn.dev
  2. Fetch https://cmn.dev/.well-known/cmn.json
  3. Read primary capsule capsules[0]
  4. Get mycelium endpoint template and mycelium_hash
  5. Replace {hash} → fetch full mycelium manifest

3.3 Replicate Verification

When verifying a fetched manifest:

  1. Verify capsule_signature with the host domain key from cmn.json
  2. Read capsule.core.domain
  3. Verify core_signature with author domain key (core.key + trust model from 01-substrate, or domain confirmation fallback)
  4. If author domain differs from URI domain, treat as replicate/mirror

4. URI Parsing

Split the URI by scheme and path:

  1. Strip the cmn:// scheme prefix
  2. Split the remainder by / into {domain} and optional path
  3. Validate domain (see §5)
  4. Determine kind from path:
    • No path → Domain
    • mycelium/{hash} → Mycelium
    • taste/{hash} → Taste
    • {hash} → Spore
  5. If hash is present, validate hash format (see §2)

5. Domain Rules

5.1 Valid Domain Names

Domains MUST be lowercase and conform to RFC 1123 hostname rules:

Uppercase characters are invalid — rejected as INVALID_DOMAIN, not normalized.

Valid:

example.com
sub.example.com
my-project.io

Invalid:

Example.com     (uppercase)
example.com.    (trailing dot)
-example.com    (starts with hyphen)
example         (no TLD / single label)

5.2 Subdomain Independence

Each subdomain is a separate sovereign node:

cmn://example.com/b3.3yMR7vZQ...       # Different from
cmn://sub.example.com/b3.3yMR7vZQ...   # These are independent

6. URI Comparison

6.1 Equality Rules

Two URIs are equal if all components match exactly:

  1. Domain matches (domains are always lowercase, see §5.1)
  2. Kind matches (domain/spore/mycelium/taste)
  3. Hash matches (if present)

7. Examples

EntityURI
Domain rootcmn://cmn.dev
Myceliumcmn://cmn.dev/mycelium/b3.3yMR7vZQ9hL2xKJdFtN8wPcB6sY1mXgU4eH5pTa2
Sporecmn://cmn.dev/b3.3yMR7vZQ9hL2xKJdFtN8wPcB6sY1mXgU4eH5pTa2
Taste reportcmn://alice.dev/taste/b3.7kLmN2pQrS4tUvWx8yZaB3cD5eF6gH9iJ1kL2mN3o

8. Error Handling

ErrorDescription
INVALID_SCHEMEURI doesn’t start with cmn://
INVALID_DOMAINDomain is not a valid FQDN
INVALID_HASHHash format is invalid