Delete Domains

Domain deletion permanently removes the domain from your ownership and returns it to the global namespace. Once deleted, the domain becomes available for anyone to register, meaning you lose all control and access to it.

Deleting a domain is irreversible, and will cause you to lose ownership of the subdomains and records related to the domain. We do not recommend deleting domains, proceed at your own risk.

import {
  getDomainKeySync,
  NAME_PROGRAM_ID,
  deleteInstruction,
} from "@bonfida/spl-name-service";

const domain = "bonfida.sol"; // With or without .sol

// Owner public key
const owner = new PublicKey("...")

const { pubkey: domainKey } = getDomainKeySync(domain);

const ix = deleteInstruction(
  NAME_PROGRAM_ID,
  domainKey,
  owner,
  owner
);

// sign and send instruction...

Last updated