2.0.0 • Published 3 months ago

ripple-keypairs v2.0.0

Weekly downloads
15,381
License
ISC
Repository
github
Last release
3 months ago

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);
@tyz-wallet/tyz-wallet-core-cryptoalebusse@coinspace/cs-ripple-walletcrypto-wallet-core-vitonode-blockchain-sdk@infinitebrahmanuniverse/nolb-rip@tequ/xrpl@everything-registry/sub-chunk-2670@chainz/moca-lib@bitgo/sdk-coin-xrp@bitgo-beta/sdk-coin-xrp@blockcore/crypto-wallet-core@bitrupee/crypto-wallet-core@arkecosystem/platform-sdk-xrp@aqfr/aqfr-ripple-lib@ardenthq/sdk-xrp@crossmarkio/xrpl-amm@crossmarkio/xrpl-sidechain@ducatus/ducatus-crypto-wallet-core-rev@ducatus/ducatuscore-crypto@ducatus/crypto-wallet-core@gatehub/ripple-lib@futureverse/react@ledhed2222/ripple-libscript-ripple-libsavour-snowsavourlabs-wallet-sdksequisintsh-coinssh-coins-testsilalvadotest-evernode-js-clientsologenic-ripple-lib-1-10-0-patchedsologenic-nft-conversion-verifierverify-xrpl-signatureutexvoluptasvoluptas@o0o2022sg/crypto-wallet-core@o0o2022/crypto-wallet-corewanchain-cross-sdkwanchain-js-sdkwallet-common-dx-tokenizexrplxrpl-accountlibxrp-providerxrp-replxrp-wallet-clixrpl-hooksxrpl-secret-numbersxrpl-sign-keypairsxrpl-toolsxrpl-validator-domainsxrpsignxpring-common-jsvipay-multichain-walletzc-ripple-lib@abcpros/crypto-wallet-core@adora-wallet/crypto-wallet-core@aloe2/sdk-coin-xrp@kava-labs/ilp-plugin-xrp-asym-client@kava-labs/ilp-plugin-xrp-paychan@kava-labs/switch-api@klyntar/valardohaeris@lnssh/hwal@lnssh/xrpl@ln1778/hwal@quantnetwork/overledger-dlt-ripple@quantnetwork/overledger-dlt-xrp-ledger@quantnetwork/overledger-sdk@ryan-bitgo/bitgo@payburner/keyburner-core@payvo/sdk-xrp@oigrwhsoi/ripple@poro-wallet/core@nescampos/ilp-sdk@sh-coins/xrp@tatsujoestar/sdk-coin-xrp@therootnetwork/extrinsic@swipechain/platform-sdk-xrp@swtrse/crypto-wallet-coreblockstarter-ripplebitrock-wallet-ripple-lib@web3auth-mpc/xrpl-provider@web3auth/xrpl-provider@toruslabs/xrpl-controllers@xrplkit/wallet@xrplf/secret-numbers@xmrd-labs/ilp-plugin-xrp-paychan@xmrd-labs/switch-api@xrpl-snap/snapautemsapientebeataenequeadipisciexercitationemcentavo-libdev-test-evernode-js-clientdebitisametcrypto-wallet-core-hexcrypto-wallet-core-ltpcrypto-wallet-core-quras
2.0.0

3 months ago

1.3.1

7 months ago

2.0.0-beta.1

5 months ago

2.0.0-beta.0

7 months ago

1.3.0

11 months ago

1.2.0

1 year ago

1.1.5

1 year ago

1.1.4

2 years ago

1.1.1

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.0.4-storm.1

2 years ago

1.0.4-storm.2

2 years ago

1.1.0

2 years ago

1.0.3

3 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.1.0-beta.0

4 years ago

1.0.0

4 years ago

1.0.0-beta.6

4 years ago

1.0.0-beta.5

4 years ago

1.0.0-beta.4

4 years ago

1.0.0-beta.3

4 years ago

1.0.0-beta.2

4 years ago

0.11.1

4 years ago

1.0.0-beta.1

4 years ago

1.0.0-beta.0

4 years ago

0.11.0

6 years ago

0.10.2

6 years ago

0.10.1

6 years ago

0.10.0

9 years ago

0.9.0

9 years ago

0.8.0

9 years ago

0.7.3

9 years ago

0.7.2

9 years ago

0.7.1

9 years ago

0.7.0

9 years ago

0.6.0

9 years ago

0.5.2

9 years ago

0.5.1

9 years ago

0.5.0

9 years ago

0.4.0

9 years ago

0.2.0

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago