Tools for handling the encrypted keystore format used to store Stellar keypairs.
Project description
Stellar Keystore
This is a helper library for creating stellar keystore wallets.
Due to the lack of relevant SEPs currently, stellarport/stellar-keystore is the most widely applied implementation, so the implementation of this library is consistent with it.
What is a keystore wallet?
A keystore wallet is a data blob that stores an encrypted secret key. The objective of a keystore wallet is to allow a user who does not want to remember/manage a secret key and would instead rather manage a password, to store and securely encrypt their secret key using their desired password.
What does this library offer?
This library offers methods that will allow your application to create stellar keystore wallets (i.e. keystore wallets containing secret keys controlling stellar public keys) as well as retrieve a stellar keypair given a keystore wallet/password combination.
Installation
pip install stellar-keystore
Usage
from stellar_sdk import Keypair
from stellar_keystore import *
# Create a new keystore wallet
keypair = Keypair.random()
keystore_wallet = create_keystore(keypair, b"password")
# Retrieve the keypair from the keystore wallet
keypair = load_keystore(keystore_wallet, b"password")
API
def create_keystore(keypair: Keypair, password: bytes) -> dict:
"""Create a keystore from a keypair.
:param keypair: The keypair to create a keystore from.
:param password: The password to encrypt the keystore with.
:return: The keystore.
"""
pass
def load_keystore(keystore: dict, password: bytes) -> Keypair:
"""Load a keypair from a keystore.
:param keystore: The keystore to load a keypair from.
:param password: The password to decrypt the keystore with.
:return: The keypair.
"""
pass
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for stellar_keystore-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf14bb2d2ecf4f08b7eff717b3777fb780342b533295469427cf1c978b2c14f8 |
|
MD5 | 922d913c9f7b371280ab76abcb92a906 |
|
BLAKE2b-256 | 2f584a6d8134ca7b075b1e4e38088460e1ff1733d1697938e2aa78fa310c2c12 |