Library Implementations
SIWE provides official libraries for integrating EIP-4361 authentication into your application.
Official Libraries
TypeScript/JavaScript
The original and most feature-complete SIWE implementation.
- Package:
@signinwithethereum/siweon npm - Platforms: Node.js, Browser, React Native
- Features: Provider-agnostic (viem, ethers), EIP-6492 support, strict mode
- Best for: Web applications, React/Vue/Angular apps, Node.js backends
Rust
High-performance, pure Rust implementation.
- Package:
signinwithethereumon crates.io - Platforms: Server applications, CLI tools, embedded systems
- Features: Zero-copy parsing, EIP-6492 support via alloy, serde serialization
- Best for: High-performance backends, blockchain infrastructure, CLI tools
Python
Idiomatic Python implementation built on pydantic and web3.py.
- Package:
signinwithethereumon PyPI (imports assiwe) - Platforms: Python 3.10+ backends, scripts, data pipelines
- Features: Pydantic-validated messages, EIP-1271 and EIP-6492 support via web3.py
- Best for: Django / FastAPI / Flask backends, Python services and tooling
Go
Pure-Go implementation, a port of the canonical TypeScript library.
- Module:
github.com/signinwithethereum/siwe-go - Platforms: Go 1.21+ services, CLIs, blockchain infrastructure
- Features: Structured error types with machine-readable codes, EIP-1271 and EIP-6492 support via any go-ethereum–compatible RPC client
- Best for: Go backends (net/http, Gin, Echo, gRPC), indexers, bots
Quick Comparison
| Feature | TypeScript | Rust | Python | Go |
|---|---|---|---|---|
| Message Parsing | ✅ | ✅ | ✅ | ✅ |
| Signature Verification (EIP-191) | ✅ | ✅ | ✅ | ✅ |
| Contract Wallets (EIP-1271) | ✅ | ✅ (with alloy feature) | ✅ (with web3 provider) | ✅ (with EthCaller) |
| Counterfactual Wallets (EIP-6492) | ✅ | ✅ (with alloy feature) | ✅ (with web3 provider) | ✅ (with EthCaller) |
| Nonce Generation | ✅ | ✅ | ✅ | ✅ |
| Serde Serialization | N/A | ✅ (with serde feature) | N/A (pydantic) | N/A (stdlib JSON tags) |
| Browser Support | ✅ | ❌ | ❌ | ❌ |
| Async Verification | ✅ | ✅ | ❌ (sync) | ✅ (ctx-based) |
Specification Compliance
Both libraries implement:
- EIP-4361 (Sign In with Ethereum)
- EIP-191 (Signed Data Standard)
- EIP-1271 (Contract Signatures)
- EIP-6492 (Counterfactual Signatures)
- RFC 3986 (URI Specification)
- RFC 3339 (Timestamp Format)
All libraries generate identical EIP-4361 compliant messages — signatures created in one language can be verified in any other.