> **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.

# HCA

An ENS hierarchical contract account (HCA) is a smart account whose authorization is tied to ENS
ownership. Ensforge currently targets the **standalone, immutable single-owner generation** recorded
in the Sepolia deployment snapshot. Do not assume every HCA generation has identical ownership,
module, or upgrade behavior.

Use the same `Ensforge` instance for normal ENS actions and `sdk.hca`. Core owns ENS contract actions,
account verification, call preparation, and registration. `@ensforge/hca` supplies provider execution
adapters and provider-specific extensions. React uses the existing `EnsforgeProvider`.

## Install

```sh
pnpm add @ensforge/sdk @ensforge/hca viem effect@rc
# Install only the execution provider you use:
pnpm add permissionless@0.4.0
# or
pnpm add @rhinestone/sdk@1.8.0
```

For Effect-first applications, use `@ensforge/core` in place of the SDK. Add `@ensforge/react` for
hooks. See [compatibility](/hca/compatibility) for exact versions and unverified provider routes.

## Choose an execution route

| Route        | Authorization               | Gas/payment infrastructure                       | Account deployment                |
| ------------ | --------------------------- | ------------------------------------------------ | --------------------------------- |
| Direct owner | Immutable HCA owner wallet  | Ordinary wallet transaction                      | Deploy first                      |
| Pimlico      | HCA owner signature         | EntryPoint 0.7 bundler, optional ETH sponsorship | Supports counterfactual execution |
| Rhinestone   | Enabled destination session | Rhinestone orchestration with sponsorship        | Deploy and enable session first   |

Rhinestone's session signer is a separate key with constrained permissions. Pimlico provides bundler
and paymaster infrastructure; its adapter implements the specific ENS HCA account encoding. Neither
provider replaces the ENS contract implementation. Kernel and Safe are separate account implementations,
not interchangeable ENS HCA providers.

## Configure once

```ts
import { createConfig, createMemoryWorkflowStorage } from "@ensforge/core";
import { Ensforge } from "@ensforge/sdk";
import { createPublicClient, createWalletClient, http } from "viem";
import { sepolia } from "viem/chains";

// owner is your existing wallet account; rpcUrl comes from application configuration.
const config = createConfig({
  network: "sepolia",
  publicClient: createPublicClient({ chain: sepolia, transport: http(rpcUrl) }),
  walletClient: createWalletClient({ chain: sepolia, account: owner, transport: http(rpcUrl) }),
  storage: createMemoryWorkflowStorage(),
});
const sdk = new Ensforge(config);
const address = await sdk.hca.predictHcaAddress({ owner: owner.address });
await sdk.hca.deployHca({ owner: owner.address });
```

Sepolia selects the recorded HCA profile. A custom network must supply a compatible `hca` deployment
profile. Prediction alone does not establish deployment or ownership: use `verifyHca` before relying
on an account. Deployment validates the factory, implementation, owner, salt and on-chain wiring.

Continue with [execution](/hca/execution), [registration](/core/guides/hca-registration), or the
[provider guides](/hca/getting-started). Provider support depends on the configured deployment;
these guides describe implemented APIs, not a claim that every hosted route has passed.

## Provider walkthroughs

Follow [Execute with Pimlico](/hca/pimlico/getting-started) for owner UserOperations,
[Rhinestone Sessions](/hca/rhinestone/getting-started) for sponsored session calls, and
[Cross-chain Funding](/hca/rhinestone/cross-chain) for independent destination funding. The walkthroughs use SDK
actions; the same adapter is accepted by the corresponding core actions and React hooks.
