
Sign-In with Ethereum
Sign-In with Ethereum (SIWE) is an authentication method that allows users to sign in to applications using their Ethereum wallet. Its defined by the EIP-4361 standard.
What is EIP-4361?
EIP-4361 is an Ethereum Improvement Proposal that standardizes how Ethereum accounts can be used for authentication. It defines a standard message format for Ethereum-based authentication.
Key Components of EIP-4361
- Domain binding: Ensures the signature is only valid for a specific domain
- Nonce: Prevents replay attacks
- Issued At: Timestamp of when the message was created
- Expiration Time: Optional field to set an expiration for the signature
- Not Before: Optional field to set a future time when the signature becomes valid
Benefits of SIWE
- Decentralized: No need for a centralized identity provider
- Secure: Uses cryptographic signatures for authentication
- User-controlled: Users have full control over their identity
- Interoperable: Can be used across different applications and platforms
Sign-In Process
Heres a step-by-step process of how a user signs in to an application using SIWE:
1
2
3
4
1
2
3
4
Connect
Message
Sign
Verify
- Connect Wallet: User connects with their Ethereum wallet and initiates the sign-in process.
- Exchange Message: The application generates a SIWE message following the EIP-4361 format, and the message is presented to the user, typically through their Ethereum wallet interface.
- Exchange digital signature: User signs the message, and the application verifies the signature on the server-side.
- Establish session: If the signature is valid, the application authenticates the user and establishes a session.
This process ensures secure authentication without exposing the users private key or requiring a traditional username and password.
For more detailed information and implementation guides, refer to the official EIP-4361 specification.