# Create/Restore Wallet

## Create Wallet

### Creating Wallet

If you don't have a wallet, you can create a new one with the parameters 'wallet name' and 'wallet password'.

{% hint style="info" %}

* Wallet password can only be a "6-digit string of integers".
* A user can only create one wallet.
  {% endhint %}

```kotlin
val result = fncyWallet.makeWallet(
walletName = "wallet name",
pin = "wallet password", // A 6-digit string of integers
)
```

#### See Also

[makeWallet](https://docs.fncy.world/fncy-2.0.2-eng/for-developers/wallet/sdk/methods#suspend-fun-makewallet)

## Setting Wallet Restore Questions/Answers

If a user loses the password to the wallet, the assets in that wallet are lost forever.

However, if a user has registered a **wallet restore question/answer**, users can recover their wallet using that answer as a **recovery key.**

### Requesting List of Wallet Restore Questions

The recovery key for restoring your wallet is a pair of selected questions and answers.

First, select a restore question by requesting for a list of questions to choose from.

```kotlin
val result = fncyWallet.getQuestionList()
```

#### See Also

[getQuestionList](https://docs.fncy.world/fncy-2.0.2-eng/for-developers/wallet/sdk/methods#suspend-fun-getquestionlist)

[FncyQuestion](https://docs.fncy.world/fncy-2.0.2-eng/for-developers/wallet/sdk/domain#fncyquestion)

### Registering Wallet Restore Questions/Answers

You can register a wallet **restore question/answer** using the **number of the question (questionSeq)**, the c**ontent of the answer**, and the **wallet's password.**

```kotlin
val result = fncyWallet.postRegisterRestorationKey(
wid = wid, //If makeWallet() succeeds, wid is returned in the result.
questionSeq = questionSeq, //user-selected seq from the list of questions returned by getQuesetionList()
answer = "Backup Question's Answers",
pinNumber = "Wallet Password"
)
```

#### See Also&#x20;

[postRegisterRestorationKey](https://docs.fncy.world/fncy-2.0.2-eng/for-developers/wallet/sdk/methods#suspend-fun-postregisterrestorationkey)

[FncyQuestion](https://docs.fncy.world/fncy-2.0.2-eng/for-developers/wallet/sdk/domain#fncyquestion)

## Restoring Wallet

If a user forgets their wallet password, they can change their wallet password and recover their wallet if they have a registered **wallet recovery question/answer pair.**

### Calling User's Registered Questions

If you have a registered **wallet restore question/answer** **pair**, you can request a registered wallet restore questions.

```kotlin
val result = fncyWallet.getResetQuestion()
```

#### See Also

[getResetQuestion](https://docs.fncy.world/fncy-2.0.2-eng/for-developers/wallet/sdk/methods#suspend-fun-getresetquestion)

[FncyQuestion](https://docs.fncy.world/fncy-2.0.2-eng/for-developers/wallet/sdk/domain#fncyquestion)

###

### Entering Question's Answers and New Password

You can change the wallet password and recover the wallet by using the restore **wallet answer** and the **new wallet password.**

```kotlin
val result = fncyWallet.postResetQuestion(
answer = "Backup Question's Answers",
newPinNumber = "New Wallet Password"
)
```

#### See Also

[postResetQuestion](https://docs.fncy.world/fncy-2.0.2-eng/for-developers/wallet/sdk/methods#suspend-fun-postresetquestion)

## Change Wallet Password

You can change your wallet password using the current wallet password and the new wallet password.

### Changing Wallet Password

```kotlin
val result = fncyWallet.resetWalletPin(
oldPinNumber = "Current Wallet Password", 
newPinNumber = "New Wallet Password"
)
```

#### See Also

[resetWalletPin](https://docs.fncy.world/fncy-2.0.2-eng/for-developers/wallet/sdk/methods#suspend-fun-resetwalletpinnumber)
