The Service (SVC) module manages the registration and operation of decentralized services within the Sonr ecosystem. It provides a comprehensive framework for services to register with verified domains, define their permission requirements, and integrate with the broader Sonr authorization system through UCAN capabilities.
Services must verify ownership of their domain through DNS TXT records before registration. This ensures that only legitimate domain owners can register services.
### Service Registration
Once domain ownership is verified, services can be registered with:
- Unique service ID
- Verified domain binding
- Requested permissions (UCAN capabilities)
- Service metadata (name, description)
### Permission Model
Services request specific permissions during registration, which are granted as UCAN capabilities. These permissions define what actions the service can perform on behalf of users.
### Service Identity
Each service has a unique identity composed of:
- Service ID (chosen identifier)
- Domain (verified TLD)
- Owner (blockchain address)
## Domain Verification Process
Domain verification follows a strict process to ensure legitimate ownership:
1. **Initiate Verification**:
```bash
# Initiate domain verification
snrd tx svc initiate-domain-verification example.com --from alice
```
2. **Add DNS TXT Record**:
```
Type: TXT
Name: @ (or app if subdomain)
Value: sonr-verification=<provided-token>
TTL: 300 (5 minutes)
```
3. **Complete Verification**:
```bash
# Verify domain after DNS propagation
snrd tx svc verify-domain example.com --from alice
```
### Verification Requirements
- Domain must be a valid TLD
- DNS TXT record must match the generated token
- Verification expires after 7 days if not completed
- Each domain can only be verified by one owner
## Service Registration Guide
### For Service Developers
1. **Domain Setup**:
- Register your domain with a DNS provider
- Ensure you have access to manage DNS TXT records