Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stellar_keystore-0.1.2.tar.gz (6.7 kB view hashes)

Uploaded Source

Built Distribution

stellar_keystore-0.1.2-py3-none-any.whl (7.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page