Skip to main content

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:

  1. Clone the Repository

    git clone https://github.com/sajad-salehi/EIP6492-Signature-Verifier.git
    cd EIP6492-Signature-Verifier
    
  2. Install Development Dependencies

    poetry install
    
  3. Run Tests

    Execute the following command to run the tests:

    poetry run pytest
    
  4. 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

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)

Source distribution for erc6492_signature_verifier 0.2.1
File Size Uploaded
erc6492_signature_verifier-0.2.1.tar.gz 9.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for erc6492_signature_verifier 0.2.1
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page