πŸ’ŽRuby

A Ruby implementation of EIP-4361: Sign In With Ethereum.

Getting started

  • The Ruby implementation of Sign-In with Ethereum can be found here:

Sign-In with Ethereum can be found on RubyGems. For more information and package information, click here

Installation

Dependencies

Additional packages may be required to install the gem:

After installing any required dependencies SIWE can be easily installed with:

Usage

SIWE provides a Message class which implements EIP-4361.

Creating a SIWE Message

Parsing a SIWE Message

To parse from EIP-4361 you have to use Siwe::Message.from_message

Verifying and Authenticating a SIWE Message

Verification and authentication is performed via EIP-191, using the address field of the SiweMessage as the expected signer. The validate method checks message structural integrity, signature address validity, and time-based validity attributes.

Serialization of a SIWE Message

Siwe::Message instances can also be serialized as their EIP-4361 string representations via the Siwe::Message.prepare_message method:

Example

Parsing and verifying a Siwe::Message:

Last updated