Skip to content

Add minimal subdomain support#1

Open
AdekunleBamz wants to merge 2 commits intophessophissy:mainfrom
AdekunleBamz:main
Open

Add minimal subdomain support#1
AdekunleBamz wants to merge 2 commits intophessophissy:mainfrom
AdekunleBamz:main

Conversation

@AdekunleBamz
Copy link

This PR adds basic subdomain functionality to the BiUD decentralized username system, allowing users to register subdomains under their existing names.

Changes Made

Contract Updates (contracts/biud-username.clar)

  • Added validate-subdomain-label function to handle subdomain validation
  • Modified register-name to support subdomain registration with format sub.parent
  • Subdomains require the parent domain to be owned by the registrant and not expired
  • Subdomains use the same registration fees as regular names

Test Updates (tests/biud-username_test.ts)

  • Added comprehensive test suite for subdomain functionality
  • Tests cover successful registration, ownership validation, premium status, renewal, transfer, and format validation

Features

  • Subdomain Registration: Register names like sub.alice.sBTC under alice.sBTC
  • Ownership Validation: Only the parent domain owner can register subdomains
  • Standard Fees: Subdomains use the same fee structure as regular names
  • Full Lifecycle Support: Subdomains support renewal, transfer, and resolver settings like regular names

Technical Details

  • Labels containing one dot are treated as subdomains
  • Parent domain must exist and be owned by the registrant
  • Full name format: subdomain.parent.sBTC
  • Backwards compatible with existing registration flow

- Allow registering subdomains with format sub.parent
- Subdomains require parent ownership and validity
- Added validate-subdomain-label function
- Updated register-name to handle subdomains
- Added comprehensive tests for subdomain functionality
@vercel
Copy link

vercel bot commented Dec 20, 2025

Someone is attempting to deploy a commit to the phessophissy's projects Team on Vercel.

A member of the Team first needs to authorize it.

- Implement register-multiple-names function to register up to 10 names in one transaction
- Each name registration is processed individually with proper validation and fee collection
- Supports mixed successful/failed registrations in the result list
- Compatible with subdomain registration
- Added comprehensive tests for bulk registration scenarios
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant