> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://ensforge.com/api/mcp` to find what you need.

# Register a name

Register an available ENS V2 name through Pimlico, from HCA deployment to the final registration.
The example keeps workflow progress in SQLite so you can continue after a process restart.

## Prepare the wallet and name

Complete [Pimlico getting started](/hca/pimlico/getting-started) first. Use a Node runtime with
`node:sqlite` support and a TypeScript runner for these server-side files.

Set the client and provider environment variables from that guide, plus:

* `ENSFORGE_SEPOLIA_V2_NAME`: the available name to register, including `.eth`.
* `ENSFORGE_HCA_REGISTRATION_RESOLVER`: a Permissioned Resolver administered by the HCA.

The owner needs Sepolia ETH for explicit HCA deployment. Sponsorship covers
execution gas, not the name price. Send the registrar's payment token to the predicted HCA address.
`registration.ts` sets a maximum price of 10 USDC for one year; adjust that limit for your name.

## Create the registration resolver

Registration requires a Permissioned Resolver with the HCA as its administrator. An arbitrary
shared resolver is not sufficient. Run this setup once using the owner wallet; it costs Sepolia ETH.
Choose an unused resolver salt if this wallet has already deployed a resolver with `1n`.

:::code-group
```ts [registration-resolver.ts]
// [!include ~/snippets/hca/guides/registration-resolver.ts]
```

```ts [deploy.ts]
// [!include ~/snippets/hca/guides/deploy.ts]
```

```ts [account.ts]
// [!include ~/snippets/hca/guides/account.ts]
```

```ts [client.ts]
// [!include ~/snippets/hca/guides/client.ts]
```
:::

Save the printed resolver address as `ENSFORGE_HCA_REGISTRATION_RESOLVER`. Reuse that address when
resuming registration; do not deploy a new resolver on every run.

## Run the registration

Copy the files into one directory. Run `pimlico-register-name.ts` with your TypeScript runner.
The script deploys or reuses the HCA, starts the registration, tracks submission, waits for the
commitment to mature, and advances to the registration transaction.

:::code-group
```ts [pimlico-register-name.ts]
// [!include ~/snippets/hca/guides/pimlico-register-name.ts]
```

```ts [registration.ts]
// [!include ~/snippets/hca/guides/registration.ts]
```

```ts [advance-registration.ts]
// [!include ~/snippets/hca/guides/advance-registration.ts]
```

```ts [workflow-client.ts]
// [!include ~/snippets/hca/guides/workflow-client.ts]
```

```ts [sqlite-storage.ts]
// [!include ~/snippets/hca/guides/sqlite-storage.ts]
```

```ts [deploy.ts]
// [!include ~/snippets/hca/guides/deploy.ts]
```

```ts [pimlico.ts]
// [!include ~/snippets/hca/guides/pimlico.ts]
```

```ts [account.ts]
// [!include ~/snippets/hca/guides/account.ts]
```

```ts [client.ts]
// [!include ~/snippets/hca/guides/client.ts]
```
:::

## Continue when input is needed

The script prints the operation ID and progress. `registered` is the final success state. Other
states require the following handling:

| Progress                    | What to do                                                                             |
| --------------------------- | -------------------------------------------------------------------------------------- |
| `submitted` or `submitting` | Keep the stored operation and check it again; inclusion is still pending.              |
| `waiting`                   | Wait until `readyAt`. The runner waits automatically within its 15-minute time budget. |
| `needs-funding`             | Transfer the reported payment token amount to the HCA, then rerun.                     |
| `needs-review`              | Inspect the changed quote or limits before explicitly accepting new terms.             |

Rerun with the same inputs and `.ensforge-workflows` directory to continue saved work. Do not delete
the database or change the name, salt or registration parameters to retry a pending transaction.
The SDK derives the workflow identity from the inputs; you do not need to invent a new ID.

## After registration

Only show registration success when progress is `registered`. To edit the new name's profile,
continue with [Update a text record](/hca/pimlico/update-description). That flow checks the
resolver permission for the specific record before writing.
