# Generating a new HD wallet

An HD wallet file will be created in local storage. You can use the UI via the relevant URL or this API to interact with your wallet. An HD wallet contains multiple addresses to send and receive Hycon, and these addresses may be referenced by their `index` value.

**Request Body - `Content-Type: application/json;charset=utf-8`**

| Parameter    | Type   | Required | Description                                                     |
| ------------ | ------ | -------- | --------------------------------------------------------------- |
| `name`       | string | Yes      | A unique wallet name                                            |
| `mnemonic`   | string | Yes      | A 12- to 24-word BIP39 phrase to seed your wallet's private key |
| `language`   | string | Yes      | Language of your wallet's mnemonic                              |
| `password`   | string | No       | A password used to authenticate wallet use                      |
| `passphrase` | string | No       | Custom text used as part of your wallet's address generation    |
| `hint`       | string | No       | A hint for your password                                        |

Please check *Appendix > Language Support* for more information. **$language** is not case-sensitive.

**Response - `200 OK, text/plain`**

| Parameter | Type   | Description      |
| --------- | ------ | ---------------- |
| `name`    | string | Your wallet name |

**Response Error Table**

| Status | Error         | Message                                           |
| ------ | ------------- | ------------------------------------------------- |
| 400    | `BAD_REQUEST` | missing parameters                                |
| 409    | `CONFLICT`    | Error: Wallet name `{name}` already exits         |
| 409    | `CONFLICT`    | Error: mnemonic or language is invalid/mismatched |

POST/api/v1/generateHDWallet

**Example request body**

```
{
    "name": "test",
    "password": "password",
    "passphrase": "passphrase",
    "hint": "default",
    "mnemonic": "someone window crucial magic shoulder latin satisfy total siege curtain candy trip",
    "language": "english"
}
```

**Example request**

```
$ curl -X POST http://localhost:2442/api/v1/generateHDWallet \
    -H 'Content-Type: application/json;charset=utf-8' \
    -d '{
        "name": "test",
        "password": "password",
        "passphrase": "passphrase",
        "hint": "default",
        "mnemonic": "someone window crucial magic shoulder latin satisfy total siege curtain candy trip",
        "language": "english"
    }'
```

**Response (Success)**

```
"test"
```
