# Accounts

## Creation

### Create an account

```
from lto import LTO

account = LTO(chain_id).Account()
```

### Create an account from seed

```
from lto import LTO

account = LTO(chain_id).Account(seed=my_seed)
```

### Create an account from public key

```
from lto import LTO

account = LTO(chain_id).Account(public_key=my_pub_key)
```

### Create an account from private key

```
from lto import LTO

account = LTO(chain_id).Account(provate_key=my_priv_key)
```

## Different encryption algorithms

### If not specified EdDSA is default:&#x20;

**ed25519**

```
account = LTO(chain_id).Account()
```

### For ECDSA we have two available curves:

**secp256k1**

```
account = LTO(chain_id).Account(key_type = "secp256k1")
```

**secp256r1**

```
account = LTO(chain_id).Account(key_type = "secp256r1")
```

## Signing

### Signing a message

We first need to convert the string to bytes using our crypto library

```
from lto import crypto

message = crypto.str2bytes("test")
signature = account.sign(message)
```

### Verifying a message

```
account.verify_signature(message, signature)
```


---

# Agent Instructions: 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:

```
GET https://docs.ltonetwork.com/libraries/python/accounts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
