# Generating a new HD wallet root key

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

| Parameter    | Type   | Required | Description                                                                                                       |
| ------------ | ------ | -------- | ----------------------------------------------------------------------------------------------------------------- |
| `rootKey`    | string | No       | Root key generated from the mnemonic. If present, response will only contain this root key.                       |
| `mnemonic`   | string | No       | A 12- to 24-word BIP39 phrase to seed your wallet's root key                                                      |
| `language`   | string | No       | Regional language to generate your wallet's mnemonic phrase (*Default: English*)                                  |
| `passphrase` | string | No       | Passphrase of your HD wallet                                                                                      |
| `index`      | number | No       | The index of the HD wallet to lookup. If present, a specific wallet address will be returned from this HD wallet. |

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

**Response - `200 OK, application/json`**

| Parameter  | Type   | Description                                                                                 |
| ---------- | ------ | ------------------------------------------------------------------------------------------- |
| `rootKey`  | string | Root key generated from the mnemonic. If present, response will only contain this root key. |
| `mnemonic` | string | A 12- to 24-word BIP39 phrase to seed your wallet's root key                                |
| `language` | string | Regional language to generate your wallet's mnemonic phrase (*Default: English*)            |
| `index`    | string | Index of the HD wallet (*Present if `index` parameter is sent in the request*)              |
| `address`  | number | The generated Hycon wallet address. (*Present if `index` parameter is sent in the request*  |

**Response Error Table**

| Status | Error               | Message                                              |
| ------ | ------------------- | ---------------------------------------------------- |
| 400    | `INVALID_PARAMETER` | mnemonic or language is invalid/mismatched           |
| 404    | `NOT_FOUND`         | the resource cannot be found / currently unavailable |

POST/api/v1/HDWallet

**Example request body**

```
{
	"mnemonic": "someone window crucial magic shoulder latin satisfy total siege curtain candy trip",
    "language": "english",
    "index": 0
}
```

**Example request**

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

**Response (Success)**

```
{
    "rootKey": "xprv9s21ZrQH143K4AS5aB6u92QhhFNraGRKE9kHUdtkndLLLu4V5CKHugyAGVgs7R38y8gTG2t",
    "mnemonic": "someone window crucial magic shoulder latin satisfy total siege curtain candy trip",
    "language": "english",
    "index": 0,
    "address": "H34kywGZSMUdPSCa3rqJLeHaRqigS3Bnt"
}
```
