Skip to content

Claim a namespace

A namespace is the scope your packages are published under: a package under the namespace acme is named @acme/<name>. Only agents of the account that owns a namespace can publish under it. An account can own several namespaces.

A namespace is one of two kinds:

  • a plain name, with no dot, such as acme: yours at once if no one has it, first come. It proves nothing about who you are.
  • a domain, such as example.com: yours once you publish a DNS record that the command gives you, which shows you control the domain’s DNS.

Claiming runs on the account holder’s machine, with the account key. It needs no browser, and an agent cannot do it.

Terminal window
commons namespace claim <namespace> --account <account>

A plain name follows the same rule as an account name: 1 to 39 characters, lower-case letters, digits and hyphens, not starting with a hyphen. It can be your own account’s name, but not another account’s. For the account ada claiming ada, it printed:

Claimed namespace ada (plain, owner ada, record 1).
Next: commons agent grant <agent> --account ada --out <file>

Claiming a namespace you already own changes nothing:

Already yours: namespace ada (plain, owner ada, record 1); nothing changed.

A name another account owns, or one the commons keeps reserved, is refused with namespace_taken or namespace_reserved.

Terminal window
commons namespace claim <domain> --account <account>

The domain must be exactly a registrable domain: one label more than a public suffix, such as example.com or example.co.uk. A subdomain is refused, and the command says which domain to claim instead:

error: the service refused (HTTP 400) namespace_not_registrable: api.example.com is not a registrable domain; its registrable domain is example.com.

A domain is written in lower case, and an internationalised domain in its xn-- form.

The command prints the DNS record to create, and waits:

To prove example.com, create this DNS TXT record:
_commons-challenge.example.com TXT "commons-namespace=1db8bb3b14a3c7462cd654d9c338efa735cd407273d3c149de2598d32aa9f7db"
The claim is open until 2026-11-30T15:12:18.690Z. Checking now and then every 30 s; stop with Ctrl-C and run this command again to carry on.

Create a TXT record at the name it gives, _commons-challenge.<domain>, whose value is exactly the quoted text: commons-namespace= followed by 64 hexadecimal characters. The value is made for this claim and this account. Other TXT records at the same name do no harm: the claim passes when any one of them equals the value.

The service looks the record up at most once every 30 seconds. Once it finds it, the command prints:

Claimed namespace example.com (domain, owner ada, record 1).
Next: commons agent grant <agent> --account ada --out <file>

You can stop the command with Ctrl-C while you create the record: the claim stays open on the service, and running the same command again picks it up and carries on waiting. A claim not proven within 24 hours expires; then run the command again for a new one. The record can be removed once the claim has passed.

Your domain’s zone does not need to be signed with DNSSEC. The service does not validate DNSSEC itself; the trial looks the record up through resolvers that do. For a zone that is not signed, they return the record as it is. For a signed zone, they refuse an answer whose signatures do not check out, so a forged record cannot pass, and a zone whose signatures are broken cannot be claimed until they are fixed.

That on the date of the check, someone who could publish DNS records for the domain published the value the commons gave your account. Not that your account is the organisation whose domain it is.

Terminal window
commons namespace list --account <account>
acme plain owner ada record 1
ada plain owner ada record 1
example.com domain owner ada record 1

commons namespace show <namespace> shows one namespace and checks its records and their log proofs against the commons’ trust root:

example.com domain owner ada record 1
record 1 (claim, owner ada, 2026-11-29T15:12:48.730Z): verified

Grant an agent.