Generate Ravencoin and Evrmore addresses from a mnemonic phrase following the standards BIP32, BIP39, and BIP44.
Professional, lightweight, and easy-to-use library for handling hierarchical deterministic (HD) keys and addresses.
The easiest way to generate a new wallet with a random mnemonic:
import RavencoinKey from "@ravenrebels/ravencoin-key";
const wallet = RavencoinKey.generateAddressObject("rvn");
console.log(wallet);Output:
{
"address": "RKbP9SMo2KTKWsiTrEDhTWPuaTwfuPiN8G",
"mnemonic": "orphan resemble brain dwarf bus fancy horn among cricket logic duty crater",
"privateKey": "a5592434532a09a73350906f7846d272135a56b5a34d900659b31d2bb1aa6dfe",
"publicKey": "038949bfe6150838e253966636bf6dc374d8036cd699a81fbdd96b0042978145cb",
"WIF": "KyWuYcev1hJ7YJZTjWx8coXNRm4jRbMEhgVVVC8vDcTaKRCMASUE",
"network": "rvn",
"path": "m/44'/175'/0'/0/0"
}| Network Code | Description |
|---|---|
rvn |
Ravencoin Mainnet |
rvn-test |
Ravencoin Testnet |
evr |
Evrmore Mainnet |
evr-test |
Evrmore Testnet |
Derive standard BIP44 address pairs.
const mnemonic = "wrong breeze brick wrestle exotic erode news clown copy install marble promote";
const ACCOUNT = 0;
const POSITION = 0;
const addressPair = RavencoinKey.getAddressPair("rvn", mnemonic, ACCOUNT, POSITION);
// Returns custom objects for both internal (change) and external addresses
console.log(addressPair.external);If you need to derive thousands of addresses, reuse the hdKey object for maximum performance.
const hdKey = RavencoinKey.getHDKey("rvn", mnemonic);
const path = "m/44'/175'/0'/0/0";
const address = RavencoinKey.getAddressByPath("rvn", hdKey, path);Get public info from a private WIF key.
const WIF = "KyWuYcev1hJ7YJZTjWx8coXNRm4jRbMEhgVVVC8vDcTaKRCMASUE";
const addressObj = RavencoinKey.getAddressByWIF("rvn", WIF);
console.log(addressObj.address); // RKbP9...
console.log(addressObj.publicKey); // 03894...npm install @ravenrebels/ravencoin-keyThis library follows industry standards for HD wallets:
- BIP32: Hierarchical Deterministic Wallets.
- BIP39: Mnemonic code for generating deterministic keys.
- BIP44: Multi-Account Hierarchy for Deterministic Wallets.
m / purpose' / coin_type' / account' / change / address_index
For Ravencoin:
- Purpose:
44' - Coin Type:
175' - Account:
0'(Default) - Change:
0(External) or1(Internal/Change)
Generate distribution files:
npm run buildRun the test suite (requires build):
npm testMIT
Maintained by Raven Rebels / Dick Henrik Larsson