Skip to main content

embit

A minimal bitcoin library for MicroPython and Python 3.10+ 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.

Documentation: https://embit.rocks/

Support the project: bc1qd4flfrxjctls9ya244u39hd67pcprhvka723gv

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 CPython.

Python 3

To install run pip3 install embit.

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

PyPI artifacts are pure Python and do not bundle prebuilt libsecp256k1 binaries. If a compatible system libsecp256k1 is installed, embit can use the ctypes backend. If no compatible system library is available, embit automatically falls back to the pure Python implementation. ctypes library discovery order is:

  1. secp256k1/secp256k1-zkp/.libs (repo-local build outputs)
  2. system loader (libsecp256k1)
  3. system loader (secp256k1)
  4. src/embit/util/prebuilt/* (compatibility-only path; no binaries are shipped in package artifacts)

To build and install libsecp256k1 locally, see: Building secp256k1 for embit.

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)

Development

Install in developer mode with dev dependencies:

pip install -e .[dev]

Install pre-commit hook:

pre-commit install

Run tests with desktop python:

pytest

Run tests with micropython:

cd tests
micropython ./run_tests.py

Inspect built package contents (latest wheel and sdist from dist/):

python tools/package_inspect.py

This helper prints selected package metadata (Name, Version, Requires-Python, dependencies/extras, project URLs) and full file lists for both artifacts.

Metadata

Release files for embit-sinancrypto 0.8.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for embit-sinancrypto 0.8.2
File Size Uploaded Provenance Actions
embit_sinancrypto-0.8.2.tar.gz 94.1 kB Without provenance Details for embit_sinancrypto-0.8.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for embit-sinancrypto 0.8.2
File Interpreter ABI Platform Actions
embit_sinancrypto-0.8.2-py3-none-any.whl Python 3 none any Details for embit_sinancrypto-0.8.2-py3-none-any.whl

Total release size: 201.8 kB

Release files / embit_sinancrypto-0.8.2.tar.gz

Download URL embit_sinancrypto-0.8.2.tar.gz
Size 94.1 kB
Tags Source
SHA-256 checksum
How to use checksums
38a229c55837f71cb85e47e4fd3fe0c85286275188508f09e7158bc49051d9a6
BLAKE2b-256 checksum
How to use checksums
fae24a961fcd13a3a23980fbeddf29457e684b5b181a97e27b4272b3c69bd42f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Release files / embit_sinancrypto-0.8.2-py3-none-any.whl

Download URL embit_sinancrypto-0.8.2-py3-none-any.whl
Size 107.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
70af8f4999b499154abd0154eec4abee6bc6d8ff44419ad3ccefb69341b46c06
BLAKE2b-256 checksum
How to use checksums
33342919afb9cb70e1b219608512569d0febc07a6edaeb38654bc5593dcbf4a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Security for embit-sinancrypto 0.8.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.8.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page