Skip to Content
DocumentationPythonGetting Started

Getting Started

Requirements

  • Python 3.8 or later
  • Rust toolchain (cargo), to compile the SDK’s Rust core
  • The SDK source code, provided by edeXa

The SDK is not published on PyPI yet, so you build it from source. The build produces a standard wheel that installs with pip.

Installation

Get the SDK source code

Get a copy of the edeXa Signing SDK source code and open a terminal in its root folder, the one that contains pyproject.toml.

Build the wheel

The SDK is built with maturin .

pip install "maturin>=1.5,<2.0" maturin build --release --out dist

This creates a wheel such as dist/edexa_signing-0.1.0-cp38-abi3-manylinux_2_34_x86_64.whl. The abi3 wheel works on every Python version from 3.8 up.

Install it

pip install dist/edexa_signing-*.whl

Check the installation

python -c "import edexa_signing as sdk; print(sdk.hash_document(b'hello world'))"

It should print:

b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9

Quick start

This example hashes a document, signs the hash and verifies the signature. It runs entirely on your machine: no network connection or funds are needed.

import edexa_signing as sdk # 1. Hash the document locally. Only this hash is used from here on. digest = sdk.hash_document(b"Invoice #1042 - CHF 1,250.00") # 2. Create a signer. Use EdexaSigner("0x...") to load an existing key. signer = sdk.EdexaSigner.generate() # 3. Sign the hash. signed = signer.sign( digest, "sha256", chain_id=11155111, contract_address="0x56Bf299f4316483Ee0128b1a8F0473ADD219D475", ) print("signer: ", signed["signer_address"]) print("signature:", signed["signature"]) # 4. Verify the signature against the signer's address. assert sdk.verify_signature(digest, signed["signature"], signer.address()) print("verified")

EdexaSigner.generate() creates a new key every time you run it. To keep signing with the same identity, save the key from signer.private_key() somewhere safe and load it with EdexaSigner(private_key_hex). See Configuration.

Next steps