siwe
A Python implementation of Sign-In with Ethereum (EIP-4361).
What it is and what it does
SIWE is a Python library that implements the EIP-4361 standard for Ethereum-based authentication. It provides a `SiweMessage` class that handles the full lifecycle of Sign-In with Ethereum messages: parsing EIP-4361 formatted strings, verifying signatures using EIP-191, and serializing messages back to their canonical form. The library depends on web3, eth-account, eth-typing, eth-utils, and pydantic to handle cryptographic operations and message validation.
Typical usage involves creating a `SiweMessage` from a user-provided string, calling `verify()` with a signature to confirm the message was signed by the claimed address, and handling specific exceptions like `ExpiredMessage`, `DomainMismatch`, or `InvalidSignature` to reject invalid authentication attempts. The package is actively maintained and supports current Python versions.
Use it for:
- Build a web application login flow where users authenticate with their Ethereum wallet instead of a password.
- Verify that a message claiming to be from a specific Ethereum address was actually signed by that address's private key.
- Implement time-based and domain-based message validation to prevent replay attacks in authentication workflows.
- Parse and validate SIWE messages from external sources to confirm their structural integrity and signature validity.
- Serialize authentication messages into EIP-4361 format for transmission to users' wallet applications.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Implements EIP-4361 Sign-In with Ethereum for parsing, verifying, and serializing authentication messages signed with Ethereum private keys.
Yes. SIWE is actively maintained, has no known vulnerabilities, low install friction, and is the standard Python implementation of EIP-4361. Install it if you need Ethereum-based authentication in a Python application. The disclaimer notes it has not undergone formal security audit, so review its use in high-security contexts accordingly.
Install
siwe on PyPI
pip
pip install siweuv
uv add siwepoetry
poetry add siweInstalling siwe
Before you install
Low install friction with a pure-Python wheel. Active maintenance with recent commits and no known vulnerabilities. Supports Python 3.8 through 3.12.
License in practice
Dual-licensed under MIT or Apache-2.0, both permissive licenses allowing commercial and private use with minimal restrictions.
Quickstart
pip install siwe
from siwe import SiweMessage
message = SiweMessage.from_message(message=eip_4361_string)
message.verify(signature="0x...")
Requires web3 and eth-account dependencies; verification requires a valid EIP-191 signature from the claimed signer address.
Verify before relying
- Whether the package has undergone formal security audit since the disclaimer in the description was written.
- Real-world adoption rate beyond the monthly download count.
Package facts
| License | MIT OR Apache-2.0 (permissive) |
| Python support | supports the current Python release (<4.0,>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 8 — abnf, web3, eth-account, eth-typing, eth-utils, pydantic, pydantic-core, typing-extensions |
| Maintenance | actively maintained — 672 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 111,944/month — #12,389 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: siwe-4.4.0-py3-none-any.whl
Keywords: SIWE, EIP-4361, Sign-In with Ethereum, Spruce ID
Tags
More Cryptography packages
Certifi provides Mozilla's curated collection…
copyleft · top 100 on PyPI
cryptographycryptography provides cryptographic recipes and…
permissive · top 100 on PyPI
rsaPure-Python RSA encryption, decryption,…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
azure-identityProvides Microsoft Entra ID token-based…
unclear · top 1,000 on PyPI
PyNaClPyNaCl provides Python bindings to libsodium…
permissive · top 1,000 on PyPI
eip712Provides Python message classes for EIP-712…
permissive · top 15,000 on PyPI
ckzgProvides Python bindings to C-KZG-4844, a…
permissive · top 5,000 on PyPI
signxmlSignXML implements W3C XML Signature (XMLDSig)…
permissive · top 5,000 on PyPI
poly-eip712-structsConstructs and serializes EIP-712 structured…
permissive · top 5,000 on PyPI
eth-accounteth-account signs Ethereum transactions and…
permissive · top 5,000 on PyPI
eth-keysProvides a unified API for Ethereum key…
permissive · top 5,000 on PyPI
standardwebhooksProvides webhook payload verification and…
permissive · top 5,000 on PyPI
vonage-jwtGenerates and verifies JWTs for Vonage API…
permissive · top 15,000 on PyPI
ed25519-blake2b-forkProvides Python bindings to Ed25519 digital…
permissive · top 15,000 on PyPI
sigstoreSigstore is a Python tool for generating and…
permissive · top 5,000 on PyPI