[BREAKGLASS] Append-only mirror of github.com/seedsigner/embit
Go to file
2021-08-21 23:47:41 +02:00
docs add bip32 docs 2021-08-20 01:16:14 +02:00
examples update explorer example 2021-06-02 20:28:28 +02:00
src/embit add pset.output.verify() 2021-08-21 23:47:41 +02:00
tests fix ecc test, remove surj proof kwargs 2021-08-18 13:10:29 +02:00
.gitignore add prebuilt libsecp binaries 2021-01-18 18:02:40 +01:00
LICENSE Initial commit 2020-01-23 14:29:56 +01:00
README.md Adds support for using the non-English BIP39 wordlists (#11) 2021-06-21 07:08:33 +02:00
setup.cfg prepare for pip 2020-10-30 00:45:38 +01:00
setup.py bump version 2021-07-12 20:49:29 +02:00

embit

A minimal bitcoin library for MicroPython and Python3 with a focus on embedded systems.

Should remain minimal to fit in a microcontroller. Also easy to audit.

Examples can be found in examples/ folder.

Micropython-specific tutorial here.

Requirements

MicroPython

Requires a custom MicroPython build with extended hashlib module and secp256k1 bindings.

To install copy the content of embit folder to the board. To save some space you can remove files embit/util/ctypes_secp256k1.py and embit/util/pyhashlib.py - they are used only in Python3.

Python 3

Can use libsecp256k1 with ctypes if it is installed in the system. Otherwise uses pure python implementation.

To install run pip3 install embit.

To install in development mode (editable) clone and run pip3 install -e . from the root folder.

Using non-English BIP39 wordlists

BIP39 defines wordlists for:

  • English
  • Japanese
  • Korean
  • Spanish
  • Chinese (Simplified)
  • Chinese (Traditional)
  • French
  • Italian
  • Czech
  • Portuguese

embit assumes English and does not include the other wordlists in order to keep this as slim as possible.

However, you can override this default by providing an alternate wordlist to any of the mnemonic-handling methods:

spanish_wordlist = [
    "ábaco",
    "abdomen",
    "abeja",
    "abierto",
    "abogado",
    "abono",
    "aborto",
    "abrazo",
    "abrir",
    "abuelo",
    ...
]

mnemonic_is_valid(mnemonic, wordlist=spanish_wordlist)
mnemonic_to_seed(mnemonic, wordlist=spanish_wordlist)
mnemonic_to_bytes(mnemonic, wordlist=spanish_wordlist)
mnemonic_from_bytes(bytes_data, wordlist=spanish_wordlist)