---
title: Registrar
description: "Manage the Thru registrar program: registry setup and lease lifecycle"
source_url:
  html: https://thru.org/docs/cli-reference/registrar-commands/
  md: https://thru.org/docs/cli-reference/registrar-commands.md
---

# Registrar

## Prerequisites

- [CLI setup](https://thru.org/docs/program-development/setting-up-thru-devkit.md) with keys and RPC endpoint configured
- Registry payment token mint and treasurer token account ready
- Fee payer funded for signer costs

## Command Overview

- [Initialize Registry](#initialize-registry): Create the .thru registry config and root registrar
- [Purchase Domain](#purchase-domain): Buy a new .thru domain and create its lease
- [Renew Lease](#renew-lease): Extend an existing domain lease
- [Claim Expired Domain](#claim-expired-domain): Reclaim domains whose leases have expired

## Initialize Registry

Create the `.thru` registry and price configuration. The CLI derives the config account (seed `config`) and validates the token mint/treasurer accounts against the provided token program, including requiring the treasurer token account to be active (not frozen).

```bash
thru registrar initialize-registry \
  $root_registrar_account \
  $treasurer_account \
  $token_mint_account \
  $price_per_year \
  [root_domain_name] \
  [OPTIONS]
```

**`root_registrar_account` · *string* · **required****

Root registrar address for the base name service program (must not yet exist)

**`treasurer_account` · *string* · **required****

Token account that receives payments; must use the registry mint, match the token program, and be active (not frozen)

**`token_mint_account` · *string* · **required****

Registry payment token mint address

**`price_per_year` · *u64* · **required****

Price in base units per year of registration as an unsigned 64-bit integer (applied to purchases and renewals)

**`root_domain_name` · *string***

Optional root name stored in the registry config (default: `thru`, max 64 characters)

***string***

Override base name service program address

***string***

Override token program address

***string***

Hex state proof for the config account; auto-generated if omitted

***string***

Hex state proof for the root registrar account; auto-generated if omitted

***string***

Signer paying transaction costs

***string***

Override the thru registrar program address

**Example:**

```bash
thru registrar initialize-registry \
  ta...[root_registrar_account] \
  ta...[treasurer_account] \
  ta...[token_mint_account] \
  10_000_000 \
  --token-program ta...[token_program]
```

## Purchase Domain

Buy a `.thru` domain for a number of years. The CLI derives the lease account from the domain name and validates your payer token account before submitting.

```bash
thru registrar purchase-domain \
  $domain_name \
  $years \
  $config_account \
  $payer_token_account \
  [OPTIONS]
```

**`domain_name` · *string* · **required****

Domain segment without `.thru` (1-64 characters)

**`years` · *u8* · **required****

Lease term in years as an unsigned 8-bit integer (valid range: 1-255)

**`config_account` · *string* · **required****

Initialized registry config account address

**`payer_token_account` · *string* · **required****

Token account for the registry mint owned by the fee payer

***string***

Hex state proof for the lease account; auto-generated if omitted

***string***

Hex state proof for the domain account; auto-generated if omitted

***string***

Signer for the transaction

***string***

Override the thru registrar program address

**Example:**

```bash
thru registrar purchase-domain \
  example \
  2 \
  ta...[config_account] \
  ta...[payer_token_account]
```

> **Caution:**
>
> The treasurer and payer token accounts must use the registry mint and token program, and the payer token account must be owned by the fee payer; otherwise the CLI rejects the transaction.

## Renew Lease

Extend a domain’s lease using the same registry mint and treasurer validation as purchases.

```bash
thru registrar renew-lease \
  $lease_account \
  $years \
  $config_account \
  $payer_token_account \
  [OPTIONS]
```

**`lease_account` · *string* · **required****

Existing lease account address for the domain

**`years` · *u8* · **required****

Additional years to add as an unsigned 8-bit integer (valid range: 1-255)

**`config_account` · *string* · **required****

Registry config account address

**`payer_token_account` · *string* · **required****

Registry mint token account owned by the fee payer

***string***

Signer for the transaction

***string***

Override the thru registrar program address

**Example:**

```bash
thru registrar renew-lease \
  ta...[lease_account] \
  1 \
  ta...[config_account] \
  ta...[payer_token_account]
```

## Claim Expired Domain

Reclaim a domain whose lease has expired by paying for a new term.

```bash
thru registrar claim-expired-domain \
  $lease_account \
  $years \
  $config_account \
  $payer_token_account \
  [OPTIONS]
```

**`lease_account` · *string* · **required****

Expired lease account address to reclaim

**`years` · *u8* · **required****

Years to apply to the new lease as an unsigned 8-bit integer (valid range: 1-255)

**`config_account` · *string* · **required****

Registry config account address

**`payer_token_account` · *string* · **required****

Registry mint token account owned by the fee payer

***string***

Signer for the transaction

***string***

Override the thru registrar program address
