EIP6492-Signature-Verifier
Overview
The EIP6492-Signature-Verifier library is a Python package designed to verify Ethereum signatures in compliance with EIP-6492. It supports both smart contract and externally owned account (EOA) signatures, automatically selecting the appropriate verification method based on the length of the signature. This library simplifies the process of signature verification for Ethereum-based applications.
Features
- Smart Contract Signature Verification: Validates signatures associated with Ethereum smart contracts.
- Externally Owned Account (EOA) Signature Verification: Verifies signatures from externally owned accounts.
- Automatic Method Selection: Determines the appropriate verification method based on the signature length.
Installation
You can install the EIP6492-Signature-Verifier library from PyPI using pip:
pip install eip6492-signature-verifier
Usage
Here’s a quick guide on how to use the SignatureVerifier
class:
Example
from eip6492_signature_verifier import SignatureVerifier
verifier = SignatureVerifier("YOUR_WEB3_PROVIDER_URL")
signature = "0x..."
message = "Hello, world!"
signer = "0x..."
is_valid = verifier.verify_signature(signature, message, signer)
print(f"Signature valid: {is_valid}")
Method Descriptions
SignatureVerifier(web3_provider: str)
: Initializes the verifier with the specified Web3 provider URL.verify_signature(signature: str, message: str, signer: str) -> bool
: Verifies the given signature. The method automatically selects whether to use smart contract or EOA verification based on the signature length.
Development
To contribute to the development of this library, follow these steps:
-
Clone the Repository
git clone https://github.com/Sajad-Salehi/EIP6492-Signature-Verifier.git
cd EIP6492-Signature-Verifier
-
Install Development Dependencies
poetry install
-
Build and Publish
To build the library, use:
poetry build
To upload the package to PyPI, use:
poetry publish --build --username __token__ --password <your-pypi-token>
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contact
For issues or feature requests, please open an issue on the GitHub repository.
For direct contact, email: SajadSolidity@gmail.com