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.
| Property | Value |
|---|---|
| Package | edexa-signing 0.1.0 |
| Import | import edexa_signing |
| Python | 3.8 or later |
| Built with | A Rust core exposed to Python through PyO3 |
| License | MIT |
How it works
- Hash locally. The document is hashed with SHA-256 on your machine. The document bytes never leave it.
- Sign. The 32-byte hash is signed with your secp256k1 private key, producing a 65-byte recoverable signature.
- Verify. Anyone with the hash, the signature and your address can confirm that you signed it, fully offline.
- Record on-chain (optional).
EdexaChain.sign_document()sends the hash to the eTwin contract’ssignDocument(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
| Name | Kind | Purpose |
|---|---|---|
hash_document | function | SHA-256 hash of document bytes |
verify_signature | function | Check that a signature was made by an address |
Document | class | A named document held in memory, with its hash |
EdexaSigner | class | A secp256k1 key pair that signs document hashes |
EdexaChain | class | A connection to an EVM chain for recording hashes on-chain |
Next steps
- Introduction: the concepts behind hashing, signing, verification and on-chain signing
- Getting Started: install the SDK and run your first signature
- API Reference: every function, parameter, return value and error
- Sign Your First Document: an end-to-end walkthrough with a real file