Subdomains
Subdomains in Solana Name Service (SNS) are similar to .sol domains but have a different parent. They can be considered as normal domains but from a different Top-Level Domain (TLD). For instance, something.example.sol can be considered the something subdomain of example.sol or a domain from the TLD example.sol.
Key Characteristics of Subdomains
Parent Ownership: The owner of the parent domain retains the ability to transfer subdomains without the signature from the owner of the subdomains. This is a unique feature of subdomains in SNS.
Limited Wallet Support: Subdomains have limited wallet support. This means that not all wallets may support transactions involving subdomains.
Feature Support: Subdomains support the same features as main domains. This includes the ability to transfer and update data.
Create a Subdomain
A subdomain created with createSubdomain will initially be owned by the parent owner. A subdomain can be created and transfered inside the same transaction.
import { createSubdomain } from "@bonfida/spl-name-service";
// The subdomain to create with or without .sol e.g something.bonfida.sol or something.bonfida
const subdomain = "something.bonfida.sol";
// The owner of the parent domain
const owner = new PublicKey("...");
const ix = createSubdomain(connection, subdomain, owner);
// Sign and send the tx...Transfer a Subdomain
Delete a Subdomain
While the deletion of a subdomain is a reversible action, it's important to be mindful of potential unintended consequences.
Last updated