Skip to main content

Getting Started

The @lukso/eip191-signer.js package is used to sign any EIP191 data.

The following format is used to sign data :

0x19 <1 byte version> <version specific data> <data to sign>

In the case of an Ethereum Signed Message:

  • 1 byte version = 0x45
  • version specific data = thereum Signed Message:\n + len(message)

In the case of data with intended validator:

  • 1 byte version = 0x00

  • version specific data = validatorAddress

    This prefix is used so that a transaction cannot be inadvertently signed when signing an Ethereum signed message.

Install

npm install @lukso/eip191-signer.js

Setup

import { EIP191Signer } from '@lukso/eip191-signer.js';

const eip191Signer = new EIP191Signer();