# HdKey.fromSeed

Creates a HD Key from a master seed.

## Imports

:::code-group
```ts [Named]
import { HdKey } from 'ox'
```

```ts [Entrypoint]
import * as HdKey from 'ox/HdKey'
```
:::

## Examples

```ts twoslash
import { HdKey, Mnemonic } from 'ox'

const seed = Mnemonic.toSeed(
  'test test test test test test test test test test test junk'
)
const hdKey = HdKey.fromSeed(seed)
```

### Path Derivation

You can derive a HD Key at a specific path using `derive`.

```ts twoslash
import { HdKey, Mnemonic } from 'ox'

const mnemonic = Mnemonic.toSeed(
  'test test test test test test test test test test test junk'
)
const hdKey = HdKey.fromSeed(mnemonic).derive(HdKey.path())

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

## Definition

```ts
function fromSeed(
  seed: Hex.Hex | Bytes.Bytes,
  options?: fromSeed.Options,
): HdKey
```

**Source:** [src/core/HdKey.ts](https://github.com/wevm/ox/blob/main/src/core/HdKey.ts#L165)

## Parameters

### seed

* **Type:** `Hex.Hex | Bytes.Bytes`

The master seed to create the HD Key from.

### options

* **Type:** `fromSeed.Options`
* **Optional**

Creation options.

#### options.versions

* **Type:** `Versions | undefined`
* **Optional**

The versions to use for the HD Key.

## Return Type

The HD Key.

`HdKey.HdKey`
