# ripple-keypairs

> Cryptographic key pairs for the XRP Ledger

Latest version **3.1.0** (published 2026-09-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install ripple-keypairs
pnpm add ripple-keypairs
yarn add ripple-keypairs
bun add ripple-keypairs
```

## Health

**Score 60/100 (C)** — status: active.

Positive: no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 3.1.0 |
| Published | 2026-09-11 |
| First published | 2015-06-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 18 |
| Dependencies | 3 |
| Unpacked size | 170.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| Maintainers | vjkhannaripple, shichengripple001 |
| Keywords | ripple, xrp, xrp ledger, xrpl |

## Links

- npm: https://www.npmjs.com/package/ripple-keypairs
- Repository: https://github.com/XRPLF/xrpl.js
- Homepage: https://github.com/XRPLF/xrpl.js#readme
- Issues: https://github.com/XRPLF/xrpl.js/issues
- npm.io page: https://npm.io/package/ripple-keypairs

## Dependencies (3)

- [@noble/curves](https://npm.io/package/@noble/curves.md) ^2.0.1
- [@xrplf/isomorphic](https://npm.io/package/@xrplf/isomorphic.md) ^1.0.2
- [ripple-address-codec](https://npm.io/package/ripple-address-codec.md) ^5.0.1

## Recent versions

- 3.1.0 (latest) — 2026-09-11
- 1.4.0 (entropy-2.x-experimental) — 2026-10-02
- 2.1.0 (entropy-4.x-experimental) — 2026-10-02
- 2.0.0-beta.1 (beta) — 2023-11-30
- 1.0.4-storm.2 (storm) — 2021-12-01
- 3.0.0 — 2026-06-05
- 2.0.0 — 2024-02-01
- 2.0.0-beta.0 — 2023-10-20
- 1.3.1 — 2023-09-27
- 1.3.0 — 2023-06-13
- 1.1.5 — 2023-03-08
- 1.2.0 — 2023-02-23
- 1.1.4 — 2022-05-02
- 1.1.3 — 2021-12-18
- 1.1.2 — 2021-12-02
- … 34 more at https://npm.io/package/ripple-keypairs/versions

## README

# ripple-keypairs [![NPM](https://img.shields.io/npm/v/ripple-keypairs.svg)](https://npmjs.org/package/ripple-keypairs) [![Build Status](https://img.shields.io/travis/ripple/ripple-keypairs/master.svg)](https://travis-ci.org/ripple/ripple-keypairs) ![Codecov](https://img.shields.io/codecov/c/github/ripple/ripple-keypairs)

An implementation of XRP Ledger keypairs & wallet generation using
[noble](https://paulmillr.com/noble) which supports rfc6979 and
eddsa deterministic signatures.

[![NPM](https://nodei.co/npm/ripple-keypairs.png)](https://www.npmjs.org/package/ripple-keypairs)

## 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 "ed25519", but can also be set to "ecdsa-secp256k1". 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);
```

---
_Source: https://npm.io/package/ripple-keypairs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
