0.0.2 • Published 3 years ago

kelso v0.0.2

Weekly downloads
-
License
GPLv3
Repository
github
Last release
3 years ago

Kelso.js

Cryptographic signatures made easy, with some polymorphism. More coming soon.

Installation

npm install --save kelso

Usage

const { EthereumEntity } = require('kelso')

// Alice can sign *and* verify
const alice = new EthereumEntity('<some-mnemonic-string>', 'mnemonic')
// Bob can only verify (unless he loads a private key later)
const bob = new EthereumEntity()

// Have Alice sign a message
const signatureString = await alice.signMessageString('hi')
// Have Bob verify it
const [isValidSignature, recoveredAddress] = await bob.verifySignatureString(
  'hi',
  signatureString
)

// Bob makes sure that alice actually signed it
if (isValidSignature && recoveredAddress === alice.getAddress()) {
  console.log('Alice signed a message for Bob!')
}

Be mindful of the license.

LICENSE

Kelso.js Copyright (C) 2021 Gerald Nash

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.