> For the complete documentation index, see [llms.txt](https://docs.stacks.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stacks.co/reference/stacks.js/stacks-wallet/derivation/deriveconfigprivatekey.md).

# deriveConfigPrivateKey

Derives the configuration private key from the wallet's root node. This key is used to encrypt wallet configuration data that can be synced across devices.

The key is derived from path `m/5757'/0'/1`, following the BIP44 recommendation for keys relating to non-public data.

***

### Usage

```ts
import { deriveConfigPrivateKey } from '@stacks/wallet-sdk';
import { HDKey } from '@scure/bip32';
import { mnemonicToSeed } from '@scure/bip39';

const seed = await mnemonicToSeed('your 24-word seed phrase ...');
const rootNode = HDKey.fromMasterSeed(seed);

const configKey = deriveConfigPrivateKey(rootNode);
// Uint8Array — the raw private key bytes
```

#### Notes

* Returns the raw private key as a `Uint8Array`.
* Throws a `TypeError` if the key cannot be derived.
* This is called internally by `deriveWalletKeys`.

[**Reference Link**](https://github.com/stx-labs/stacks.js/tree/main/packages/wallet-sdk/src/derive.ts#L42)

***

### Signature

```ts
function deriveConfigPrivateKey(rootNode: HDKey): Uint8Array;
```

***

### Returns

`Uint8Array`

The raw private key bytes for the configuration key.

***

### Parameters

#### rootNode (required)

* **Type**: `HDKey` (from `@scure/bip32`)

The root HD key derived from the wallet's seed phrase.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stacks.co/reference/stacks.js/stacks-wallet/derivation/deriveconfigprivatekey.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
