Skip to main content

A comprehensive Python library to verify crypto wallet signatures

Project description

Verify Crypto Signature

A Python library for verifying and working with cryptographic signatures, currently supporting EVM and Solana blockchain signatures.

Features

  • Verify message signatures from EVM and Solana addresses
  • Sign messages using private keys
  • Recover wallet addresses from signatures (Only supports EVM)
  • Validate EVM and Solana addresses

Installation

pip install verify-crypto-signature

Dependencies

  • eth_account
  • eth_utils
  • eth_keys
  • solders

Usage

Verifying an EVM Signature

from verify_crypto_signature.evm import VerifyEVM

# Verify if a message was signed by a specific address
wallet_address = "0x..."  # Example address
message = "Hello, world!"
signature = "0x..."  # Signature obtained from the wallet

# Verify the signature
is_valid = VerifyEVM.verify_signature(wallet_address, message, signature)
if is_valid:
    print("Signature is valid")
else:
    print("Signature is invalid")

Signing a Message

from verify_crypto_signature.evm import VerifyEVM

# Sign a message with a private key
private_key = "0x..."  # Your private key (keep this secret!)
message = "Hello, world!"

# Sign the message
signed_message = VerifyEVM.sign_message(message, private_key)
signature = signed_message.signature.hex()
print(f"Signature: {signature}")

Recovering an Address from a Signature (Only supports EVM)

from verify_crypto_signature.evm import VerifyEVM

# Recover the signer's address
message = "Hello, world!"
signature = "0x..."  # The signature

address = VerifyEVM.get_address_from_message(message, signature=signature)
print(f"Signer address: {address}")

Verifying a Solana Signature

from verify_crypto_signature.sol import VerifySOL

# Verify if a message was signed by a specific address
wallet_address = "5yQ6...."  # Example address
message = "Hello, world!"
signature = "4K2...."  # Signature obtained from the wallet

# Verify the signature
is_valid = VerifySOL.verify_signature(wallet_address, message, signature)

Signing a Message

from verify_crypto_signature.sol import VerifySOL

# Sign a message with a private key
private_key = "4K2...."  # Your private key (keep this secret!)
message = "Hello, world!"

# Sign the message
signed_message = VerifySOL.sign_message(message, private_key)

License

MIT License

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

verify_crypto_signature-0.0.1.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

verify_crypto_signature-0.0.1-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file verify_crypto_signature-0.0.1.tar.gz.

File metadata

  • Download URL: verify_crypto_signature-0.0.1.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for verify_crypto_signature-0.0.1.tar.gz
Algorithm Hash digest
SHA256 0f9085fd1b7990aef0476b7e4e33ade3a602f911c02e52c1f5dab5bc1e3fb19e
MD5 15bfb9407d4dec5a2af0a806edbd3c25
BLAKE2b-256 0ea71ccba064677ec08ccdbbb9ac91aa33b7157768734a525c04787c46596dae

See more details on using hashes here.

File details

Details for the file verify_crypto_signature-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for verify_crypto_signature-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f7336e58d847b720238a4885d958cdf4c42b9c2a8b53b11ad7db76b127b26b85
MD5 ea45ac143606ff5497a4064962db9697
BLAKE2b-256 c0a7ad8abb17c6b632df7bf5d5a256111b84575ed6550833ff1a24862b17fd46

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page