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

# HdKey.fromExtendedKey

:::info
`HdKey.fromExtendedKey` is a re-export of ox's [`HdKey.fromExtendedKey`](https://oxlib.sh/api/HdKey/fromExtendedKey). Refer to the ox documentation for the full reference.
:::

Creates a HD Key from an extended private key.

## Imports

```ts
import { HdKey } from 'viem/utils'
```

## Examples

```ts twoslash
// @noErrors
import { HdKey } from 'viem/utils'

const hdKey = HdKey.fromExtendedKey('...')

console.log(hdKey.privateKey)
// @log: '0x...'
```

## Definition

```ts
function fromExtendedKey(
  extendedKey: string,
): HdKey
```

## Parameters

### extendedKey

* **Type:** `string`

The extended private key.

## Return Type

The HD Key.

`HdKey.HdKey`
