LTO Network
Search…
Accounts

Creation

Create an account

1
from lto import LTO
2
3
account = LTO(chain_id).Account()
Copied!

Create an account from seed

1
from lto import LTO
2
3
account = LTO(chain_id).Account(seed=my_seed)
Copied!

Create an account from public key

1
from lto import LTO
2
3
account = LTO(chain_id).Account(public_key=my_pub_key)
Copied!

Create an account from private key

1
from lto import LTO
2
3
account = LTO(chain_id).Account(provate_key=my_priv_key)
Copied!

Different encryption algorithms

If not specified EdDSA is default:

ed25519
1
account = LTO(chain_id).Account()
Copied!

For ECDSA we have two available curves:

secp256k1
1
account = LTO(chain_id).Account(key_type = "secp256k1")
Copied!
secp256r1
1
account = LTO(chain_id).Account(key_type = "secp256r1")
Copied!

Signing

Signing a message

We first need to convert the string to bytes using our crypto library
1
from lto import crypto
2
3
message = crypto.str2bytes("test")
4
signature = account.sign(message)
Copied!

Verifying a message

1
account.verify_signature(message, signature)
Copied!