# Milestone 01: Hosting Core

> On-chain name registry and domain verification for Synor Hosting

## Status: Complete

## Tasks

- [x] Create synor-hosting crate structure
- [x] Implement HostingName type with validation
- [x] Implement NameRegistry for on-chain name→CID mapping
- [x] Implement DomainVerifier with CNAME/TXT DNS verification
- [x] Implement HostingRouter with host-based request routing
- [x] Implement RouteConfig for SPA, redirects, and headers
- [x] Create error types and config parsing (synor.json)
- [x] Add comprehensive test coverage (23 tests)

## Files

```
crates/synor-hosting/
├── Cargo.toml
├── src/
│   ├── lib.rs
│   ├── error.rs
│   ├── config.rs
│   ├── registry.rs
│   ├── domain.rs
│   └── router.rs
```

## Key Types

- `HostingName`: Validated deployment name (alphanumeric + hyphens, 3-63 chars)
- `NameEntry`: Registry entry with CID, owner, expiry, custom domains
- `NameRegistry`: In-memory registry for name→CID mapping
- `DomainVerifier`: DNS verification for custom domains
- `HostingRouter`: Routes requests by host header
- `RouteConfig`: SPA mode, redirects, headers, error pages
- `SynorJson`: Configuration file parser

## Validation Commands

```bash
cargo test -p synor-hosting
cargo clippy -p synor-hosting -- -D warnings
```

---

*Completed: January 2026*
