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:
- Identifies the domain as a CMN node
- Resolves to
cmn.jsonathttps://{domain}/.well-known/cmn.json
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:
- Hash ensures mycelium integrity
- Each update produces a new hash
- Hash stored in
cmn.jsonascapsules[0].mycelium_hash
1.3 Spore URI
Content-addressed identifier for code units.
cmn://{domain}/{hash}
Examples:
cmn://cmn.dev/b3.3yMR7vZQ9hL2xKJdFtN8wPcB6sY1mXgU4eH5pTa2
Properties:
- Hash ensures content integrity
- Different content = different hash
- Same content across mirrors = same hash
1.4 Taste URI
Content-addressed identifier for safety evaluation reports.
cmn://{domain}/taste/{hash}
Examples:
cmn://alice.dev/taste/b3.7kLmN2pQrS4tUvWx8yZaB3cD5eF6gH9iJ1kL2mN3o
Properties:
- Domain identifies the taster (evaluator), not the spore being evaluated
- Hash is computed from taste core + core_signature (same pattern as spore hashing)
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:
- Parse URI domain as the host domain
- Read manifest
capsule.core.domainas the author domain - If
capsule.core.domain != URI domain, the object is a replicate/mirror
This keeps URI parsing simple and keeps lineage/authorship in signed core metadata.
2. Hash Format
2.1 Syntax
{algorithm}.{base58_value}| Algorithm | Output Size | Example |
|---|---|---|
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:
- Extract domain:
cmn.dev - Fetch
https://cmn.dev/.well-known/cmn.json - Read primary capsule
capsules[0] - Get spore endpoint template:
https://cdn.cmn.dev/cmn/spore/{hash}.json - Replace
{hash}with spore hash - Fetch spore manifest
3.2 Domain Resolution
Input: cmn://cmn.dev
Output: (full mycelium manifest)
Steps:
- Extract domain:
cmn.dev - Fetch
https://cmn.dev/.well-known/cmn.json - Read primary capsule
capsules[0] - Get mycelium endpoint template and
mycelium_hash - Replace
{hash}→ fetch full mycelium manifest
3.3 Replicate Verification
When verifying a fetched manifest:
- Verify
capsule_signaturewith the host domain key fromcmn.json - Read
capsule.core.domain - Verify
core_signaturewith author domain key (core.key+ trust model from 01-substrate, or domain confirmation fallback) - If author domain differs from URI domain, treat as replicate/mirror
4. URI Parsing
Split the URI by scheme and path:
- Strip the
cmn://scheme prefix - Split the remainder by
/into{domain}and optional path - Validate domain (see §5)
- Determine kind from path:
- No path → Domain
mycelium/{hash}→ Myceliumtaste/{hash}→ Taste{hash}→ Spore
- 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:
- Each label matches
[a-z0-9]([a-z0-9-]*[a-z0-9])? - At least 2 labels (must contain
.) - Each label max 63 characters
- Total length max 253 characters
- No trailing dot
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
- No trust inheritance from parent domains
- Each subdomain has its own keys and
cmn.json
6. URI Comparison
6.1 Equality Rules
Two URIs are equal if all components match exactly:
- Domain matches (domains are always lowercase, see §5.1)
- Kind matches (domain/spore/mycelium/taste)
- Hash matches (if present)
7. Examples
| Entity | URI |
|---|---|
| Domain root | cmn://cmn.dev |
| Mycelium | cmn://cmn.dev/mycelium/b3.3yMR7vZQ9hL2xKJdFtN8wPcB6sY1mXgU4eH5pTa2 |
| Spore | cmn://cmn.dev/b3.3yMR7vZQ9hL2xKJdFtN8wPcB6sY1mXgU4eH5pTa2 |
| Taste report | cmn://alice.dev/taste/b3.7kLmN2pQrS4tUvWx8yZaB3cD5eF6gH9iJ1kL2mN3o |
8. Error Handling
| Error | Description |
|---|---|
INVALID_SCHEME | URI doesn’t start with cmn:// |
INVALID_DOMAIN | Domain is not a valid FQDN |
INVALID_HASH | Hash format is invalid |