Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eth-signature-verifier

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eth-signature-verifier

A Python library for verifying Ethereum signatures in compliance with EIP-6492, supporting both smart contracts and externally owned accounts (EOA).

  • 0.1.0
  • PyPI
  • Socket score

Maintainers
1

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

# 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. 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

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc