EIP6492-Signature-Verifier
Overview
The erc6492_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 erc6492_signature_verifier library from PyPI using pip:
pip install erc6492_signature_verifier
Usage
Here’s a quick guide on how to use the SignatureVerifier class:
Example
from erc6492_signature_verifier import SignatureVerifier
# Initialize the verifier with your Web3 provider URL
verifier = SignatureVerifier("YOUR_WEB3_PROVIDER_URL")
# Example data
signature = "0x..." # Replace with the actual signature
message = "Hello, world!"
signer = "0x..." # Replace with the actual signer's Ethereum address
# Verify the signature
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 -
Run Tests
Execute the following command to run the tests:
poetry run pytest
-
Build and Publish
To build the library, use:
poetry buildTo 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
Metadata
Release files for erc6492_signature_verifier 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| erc6492_signature_verifier-0.2.1.tar.gz | 9.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| erc6492_signature_verifier-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.2 kB
Release files / erc6492_signature_verifier-0.2.1.tar.gz
| Download URL | erc6492_signature_verifier-0.2.1.tar.gz |
|---|---|
| Size | 9.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
57e4ecf85f50454318b76792358e53c56b880957933510aee4eea5ec74d61b5e
|
|
BLAKE2b-256 checksum How to use checksums |
75e5a99bf7ec98df3c2e97c1ac6a07b6d28ea1e68b676b7c03111453035524cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.4 Darwin/23.5.0
|
Release files / erc6492_signature_verifier-0.2.1-py3-none-any.whl
| Download URL | erc6492_signature_verifier-0.2.1-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ff9dd93b683729c17099c385b0947b0ef8f4e80ab7dae9a5b870851b26b1e62a
|
|
BLAKE2b-256 checksum How to use checksums |
fedcd55fdf0d5b6589b88276791cae96230d33f615a7610856af070b836055b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.4 Darwin/23.5.0
|