ripple-keypairs
Cryptographic key pairs for the XRP Ledger
Last updated a month ago by intelliot .
ISC · Repository · Original npm · Tarball · package.json
$ cnpm install ripple-keypairs 
SYNC missed versions from official npm registry.

ripple-keypairs NPM Build Status Codecov

An implementation of XRP Ledger keypairs & wallet generation using elliptic which supports rfc6979 and eddsa deterministic signatures.

NPM

API Methods

generateSeed({entropy?: Array<integer>, algorithm?: string}) -> string

Generate a seed that can be used to generate keypairs. Entropy can be provided as an array of bytes expressed as integers in the range 0-255. If provided, it must be 16 bytes long (additional bytes are ignored). If not provided, entropy will be automatically generated. The "algorithm" defaults to "ecdsa-secp256k1", but can also be set to "ed25519". The result is a seed encoded in base58, starting with "s".

deriveKeypair(seed: string) -> {privateKey: string, publicKey: string}

Derive a public and private key from a seed. The keys are represented as 33-byte hexadecimal strings.

sign(messageHex: string, privateKey: string) -> string

Sign an arbitrary hex-encoded message with a private key. Returns the signature as a hexadecimal string.

verify(messageHex: string, signature: string, publicKey: string) -> boolean

Verify a signature for a given hex-encoded message and public key. Returns true if the signature is valid, false otherwise.

deriveAddress(publicKey: string) -> string

Derive an XRP Ledger classic address from a public key.

deriveNodeAddress(publicKey: string) -> string

Derive a node address from a public key.

Generate a random XRP Ledger address

const seed = generateSeed();
const keypair = deriveKeypair(seed);
const address = deriveAddress(keypair.publicKey);

Current Tags

  • 1.0.2                                ...           latest (a month ago)

30 Versions

  • 1.0.2                                ...           a month ago
  • 1.0.1                                ...           5 months ago
  • 1.1.0-beta.0                                ...           8 months ago
  • 1.0.0                                ...           9 months ago
  • 1.0.0-beta.6                                ...           9 months ago
  • 1.0.0-beta.5                                ...           9 months ago
  • 1.0.0-beta.4                                ...           9 months ago
  • 1.0.0-beta.3                                ...           9 months ago
  • 0.11.1                                ...           9 months ago
  • 1.0.0-beta.2                                ...           9 months ago
  • 1.0.0-beta.1                                ...           9 months ago
  • 1.0.0-beta.0                                ...           9 months ago
  • 0.11.0                                ...           2 years ago
  • 0.10.2                                ...           2 years ago
  • 0.10.1                                ...           3 years ago
  • 0.10.0                                ...           5 years ago
  • 0.9.0                                ...           5 years ago
  • 0.8.0                                ...           5 years ago
  • 0.7.3                                ...           5 years ago
  • 0.7.2                                ...           5 years ago
  • 0.7.1                                ...           5 years ago
  • 0.7.0                                ...           5 years ago
  • 0.6.0                                ...           5 years ago
  • 0.5.2                                ...           5 years ago
  • 0.5.1                                ...           5 years ago
  • 0.5.0                                ...           5 years ago
  • 0.4.0                                ...           5 years ago
  • 0.2.0                                ...           5 years ago
  • 0.1.1                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
Downloads
Today 16
This Week 70
This Month 202
Last Day 4
Last Week 77
Last Month 435
Dependencies (5)

Copyright 2014 - 2016 © taobao.org |