# Account

## Account <a href="#account" id="account"></a>

The SDK provides an `Account` class for creating and managing accounts on Endless network.

Due to ZKLogin and MultiSign Account design, Endless support two types of account:

* `SingleSender` supports `ED25519` signer authenticator
* `MultiAuthKeyAccount` supports one private key holding multi signers authenticator

The `Account` class supports different static methods to generate and/or derive an account

* `Account.generate()`
* `Account.fromPrivateKey()`
* `Account.fromDerivationPath()`

### Generate a new account <a href="#generate-a-new-account" id="generate-a-new-account"></a>

To generate a new account (or a new key pair), the SDK provides a `generate()` static method on the `Account` class.

Account generation supports `Ed25519` key schemes.

```js
const account = Account.generate(); 
```

{% hint style="info" %}
Creating an account with the SDK creates it locally, to create the account on chain we should fund it.
{% endhint %}

```js
const transaction = await endless.fundAccount({
  signer: account
});
```

### Derive an account from private key <a href="#derive-an-account-from-private-key" id="derive-an-account-from-private-key"></a>

The SDK supports deriving an account from a private key with `fromPrivateKey()` static method. This method uses a local calculation and therefore is used to derive an `Account` that has not had its authentication key rotated.

```js
// to derive an account with Ed25519 key scheme
const privateKey = new Ed25519PrivateKey(privateKeyBytes);
const account = Account.fromPrivateKey({ privateKey });
```

### Derive an account from derivation path <a href="#derive-an-account-from-derivation-path" id="derive-an-account-from-derivation-path"></a>

The SDK supports deriving an account from derivation path with `fromDerivationPath()` static method.

```js
// to derive an account with mnemonic and path
const derivationPath = `m/44'/637'/0'/0'/0'`;
const mnemonicWordsStr = "salt purpose ......";

const account = Account.fromDerivationPath({
  path,
  mnemonicWordsStr,
});
```
