You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

ripple-keypairs

Package Overview
Dependencies
Maintainers
9
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ripple-keypairs

Cryptographic key pairs for the XRP Ledger


Version published
Maintainers
9
Install size
2.56 MB
Created

Readme

Source

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);

Keywords

FAQs

Package last updated on 01 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc