Cryptographic key pairs for the XLA Ledger
Last updated 2 months ago by ripple-alpha .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install ripple-alpha-keypairs 
SYNC missed versions from official npm registry.


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

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 at least 16 bytes long. 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 a Ripple Alpha address from a public key.

deriveNodeAddress(publicKey: string) -> string

Derive a node address from a public key.

Generate a random Ripple Alpha address

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

Current Tags

  • 1.1.0                                ...           latest (2 months ago)

2 Versions

  • 1.1.0                                ...           2 months ago
  • 1.0.1                                ...           4 months ago
Maintainers (1)
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (5)
Dependents (1)

Copyright 2014 - 2016 © |