> 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/accounts/account.md).

# Account

Interface representing a single account within a Stacks wallet. Contains the private keys and metadata needed for STX transactions, Gaia storage, and app-specific key derivation.

***

### Usage

```ts
import { generateWallet, getStxAddress, Account } from '@stacks/wallet-sdk';

const wallet = await generateWallet({
  secretKey: 'your 24-word seed phrase ...',
  password: 'password',
});

const account: Account = wallet.accounts[0];

console.log(account.index);          // 0
console.log(account.stxPrivateKey);  // hex string — used for STX transactions
console.log(account.dataPrivateKey); // hex string — used for Gaia/profiles
console.log(account.appsKey);       // xprv... — root for app-specific keys
console.log(account.salt);           // hex string — wallet-level salt
```

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

***

### Definition

```ts
interface Account {
  /** The private key used for STX payments */
  stxPrivateKey: string;
  /** The private key used in Stacks 1.0 to register BNS names */
  dataPrivateKey: string;
  /** The salt is the same as the wallet-level salt. Used for app-specific keys */
  salt: string;
  /** A single username registered via BNS for this account */
  username?: string;
  /** A profile object that is publicly associated with this account's username */
  profile?: Profile;
  /** The root of the keychain used to generate app-specific keys */
  appsKey: string;
  /** The index of this account in the user's wallet */
  index: number;
}
```

***

### Properties

| Property         | Type                   | Description                                                                       |
| ---------------- | ---------------------- | --------------------------------------------------------------------------------- |
| `stxPrivateKey`  | `string`               | Hex-encoded private key for signing STX transactions.                             |
| `dataPrivateKey` | `string`               | Hex-encoded private key for Gaia storage and profile operations.                  |
| `salt`           | `string`               | Wallet-level salt used when deriving app-specific keys.                           |
| `username`       | `string \| undefined`  | BNS username registered for this account, if any.                                 |
| `profile`        | `Profile \| undefined` | Public profile associated with this account's username.                           |
| `appsKey`        | `string`               | Extended private key (`xprv...`) used as the root for deriving app-specific keys. |
| `index`          | `number`               | The index of this account in the wallet (0-based).                                |


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.stacks.co/reference/stacks.js/stacks-wallet/accounts/account.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
