Skip to Content
DocumentationPythonOverview

edeXa SDK — Python

The edeXa Signing SDK lets your Python application prove that a document existed and was approved by a specific key, without ever sharing the document itself. You hash the document locally, sign the hash with a secp256k1 key, and optionally record the hash on an EVM blockchain through the edeXa eTwin smart contract.

PropertyValue
Packageedexa-signing 0.1.0
Importimport edexa_signing
Python3.8 or later
Built withA Rust core exposed to Python through PyO3
LicenseMIT

How it works

  1. Hash locally. The document is hashed with SHA-256 on your machine. The document bytes never leave it.
  2. Sign. The 32-byte hash is signed with your secp256k1 private key, producing a 65-byte recoverable signature.
  3. Verify. Anyone with the hash, the signature and your address can confirm that you signed it, fully offline.
  4. Record on-chain (optional). EdexaChain.sign_document() sends the hash to the eTwin contract’s signDocument(bytes32) function, giving it a public, timestamped record.
import edexa_signing as sdk digest = sdk.hash_document(b"hello world") signer = sdk.EdexaSigner.generate() signed = signer.sign( digest, "sha256", chain_id=11155111, contract_address="0x56Bf299f4316483Ee0128b1a8F0473ADD219D475", ) assert sdk.verify_signature(digest, signed["signature"], signer.address())

What’s in the SDK

NameKindPurpose
hash_documentfunctionSHA-256 hash of document bytes
verify_signaturefunctionCheck that a signature was made by an address
DocumentclassA named document held in memory, with its hash
EdexaSignerclassA secp256k1 key pair that signs document hashes
EdexaChainclassA connection to an EVM chain for recording hashes on-chain

Next steps