Skip to main content

Simple python library to communicate with a Satochip hardware wallet

Project description

Pysatochip

Licence: LGPL v3 Author: Toporin Language: Python (>= 3.6) Homepage: https://github.com/Toporin/pysatochip

Introduction

The Pysatochip library allows to integrate the Satochip Hardware Wallet with a client wallet such as electrum. To use it, you need a device with the Satochip javacard applet installed (see https://github.com/Toporin/SatochipApplet). If the wallet is not intialized yet, the wallet can perform the setup (you only need to do this once). During setup, a seed is created: this seed allows you to recover your wallet at anytime, so make sure to BACKUP THE SEED SECURELY! During setup, a PIN code is also created: this PIN allows to unlock th device to access your funds. If you try too many wrong PIN, your device will be locked indefinitely (it is 'bricked'). If you loose your PIN or brick your device, you can only recover your funds with the seed backup.

The Satochip wallet is currently in Beta, use with caution! In this phase, it is strongly recommended to use the software on the Bitcoin testnet first. This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Remark: Pysatochip uses Python 3.x. In case of error, check first that you are not trying to run with Python 2.x or with Python 2.x libraries.

Satochip 2-Factor-Authentication (2FA)

Satochip-2FA is an optional feature that allows to use 2-Factor-Authentication in conjonction with the Satochip hardware wallet. When enabled, transaction requests are sent to an app on a second device for approval before signing them with the Satochip. For security, once enabled, the 2FA can only be disabled when the seed is reset. Be sure to keep a copy of the 2FA key in a safe location.

​When enabled, a secret key is shared via a qr-code between the satochip and a second device (currently, only Android). The app then regularly polls the Electrum server for new transaction proposals. These transaction candidates are then parsed and displayed on the second device. If approved, a cryptographic code is sent back to securely and uniquely approve the transaction so that the satochip can sign it.

Installing this Module

This module is available for download on PyPy with the command pip3 install pysatochip.

You can install this module on your system with the command python setup.py install.

To use the Command Line Interface, you need to install additional dependencies, use this command instead: pip install "pysatochip[CLI]" or pip install -e ".[CLI]" (local install).

Command Line Interface

Once you have installed the module, you can access its functionality through a command line client satochip-cli

There are a wide range of available commands, each with their own relevant options. The best way to find these is with the --help argument. (satochip-cli --help)

There are also some general tools, such as those required to decrypt encrypted Seedkeeper JSON backups. (These can be accessed either standalone or via the module)

Running from Source

If you don't want to install the pysatochip module, you can also run a number of tools direcly from the repository folder.

Command Line Tool: python satochip_cli.py

SatoChip Hardware Test python test_satochip.py

SeedKeeper Hardware Test python test_seedkeeper.py

Development version (Windows)

Install the latest python 3.6 release from https://www.python.org (https://www.python.org/downloads/release/python-368/) (Caution: installing another release than 3.6 may cause incompatibility issues with pyscard)

Clone or download the code from GitHub.

Install pyscard from https://pyscard.sourceforge.io/ Pyscard is required to connect to the smartcard::

python -m pip install pyscard

In case of error message, you may also install pyscard from the installer: Download the .whl files from https://sourceforge.net/projects/pyscard/files/pyscard/pyscard%201.9.7/ and run::

python -m pip install pyscard-1.9.7-cp36-cp36m-win_amd64.whl

Development version (Ubuntu)

Check out the code from GitHub::

git clone git://github.com/Toporin/pysatochip.git
cd pysatochip

Install pyscard (https://pyscard.sourceforge.io/) Pyscard is required to connect to the smartcard:: sudo apt-get install pcscd sudo apt-get install python3-pyscard (For alternatives, see https://github.com/LudovicRousseau/pyscard/blob/master/INSTALL.md for more detailed installation instructions)

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

pysatochip-0.15.1.tar.gz (190.7 kB view details)

Uploaded Source

Built Distribution

pysatochip-0.15.1-py3-none-any.whl (94.9 kB view details)

Uploaded Python 3

File details

Details for the file pysatochip-0.15.1.tar.gz.

File metadata

  • Download URL: pysatochip-0.15.1.tar.gz
  • Upload date:
  • Size: 190.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for pysatochip-0.15.1.tar.gz
Algorithm Hash digest
SHA256 71cc81bd0d34a7fb8350bcc6789221209222451ac58adb29dbbd707a9ef80c72
MD5 0415908f5c1be87c565c21609ece67c9
BLAKE2b-256 e43c4cd1fa9a97ca9e83cd562fccf86c6c7b028e093ae05feaec3330ae1b38da

See more details on using hashes here.

File details

Details for the file pysatochip-0.15.1-py3-none-any.whl.

File metadata

  • Download URL: pysatochip-0.15.1-py3-none-any.whl
  • Upload date:
  • Size: 94.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for pysatochip-0.15.1-py3-none-any.whl
Algorithm Hash digest
SHA256 88329e5178f9e88986d2e601b317daabc1827c8026cc5697cca98d046a9641a8
MD5 c993f6744cbc3bbb22758898c6917ab9
BLAKE2b-256 04850494d3c0d05a37d8d7008b8b92784be0c3abb3f4aa3407b52562d1df6265

See more details on using hashes here.

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