Skip to main content

Trezor-crypto python binding

Project description

This is the ctypes and cffi python binding for trezor-crypto used in Monero implementation.

The python module builds trezor-crypto as a shared library. Currently only ctypes is fully supported. CFFI module is built but the python method wrappers are not implemented yet (no the roadmap).

The module automatically generates the bindings from the trezor-crypto header files using ctypeslib2 and pycparser.

Note the forked version of the original trezor-crypto is used in order to support library mode (for now).


  • gcc / clang
  • pkg-config
  • libsodium

In order to use this module please install libsodium.

sudo apt-get install libsodium-dev


pip install py_trezor_crypto_ph4

Dev Requirements:

In order to generate bindings from the trezor-crypto header files the following tools are needed:

  • clang
  • ctypeslib2
  • pycparser
  • / libclang.dylib


  • Code generate CFFI wrappers in the similar manner as ctype wrappers.

Refresh Ctype bindings

In order to refresh method definitions and regenerate ctype wrappers from trezor-crypto header files run

python trezor_crypto/ -a ctypes --debug

Refresh CFFI bindings

In order to refresh data/cffi.h from trezor-crypto header files run:

python trezor_crypto/ -a cffi_h --debug

Project details

Download files

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

Files for py-trezor-crypto-ph4, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size py_trezor_crypto_ph4-0.1.1-cp36-cp36m-macosx_10_12_x86_64.whl (594.5 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size py_trezor_crypto_ph4-0.1.1.tar.gz (3.1 MB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page