Skip to content

ProvableHQ/aleo-hd-key

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Aleo HD Key

⚠️ WARNING: This repository is no longer maintained. Active development moved to the ProvableHQ Aleo Dev Toolkit.

This package uses an outdated (legacy) Aleo derivation path: m/44'/0'/{index}'/0'.

The current Aleo coin type in SLIP-0044 is 683, so the current standard path is: m/44'/683'/{index}'/0'.


Seed Derivation for aleo

The goal of this library is to safely generate deterministic seeds for use with the Aleo SDK. Since BLS12_377 is not supported yet in BIP-32 or BIP-44, this attempts to ensure Aleo Keys are derived from a seed in a secure way.


SLIP-0010 - Specification

Installation

yarn add @demox-labs/aleo-sdk @demox-labs/aleo-hd-key

optionally, install Bip39: yarn add bip39

Usage

example:

import * as AleoSDK from '@demox-labs/aleo-sdk';
import { derivePath } from '@demox-labs/aleo-hd-key';
import * as Bip39 from 'bip39';

// Generate seed phrase using Bip39
const mnemonic = Bip39.generateMnemonic(128);
const hexSeed = Bip39.mnemonicToSeedSync(mnemonic).toString('hex');

// Generate new seed for account
const accIndex = 0;
const path = `m/44'/0'/${accIndex}'/0'`; // Path used by Leo Wallet
const { seed: childSeed, chainCode} = derivePath(path, hexSeed);

// Convert to PrivateKey using Also SDK
const privateKey = AleoSDK.PrivateKey.from_seed_unchecked(childSeed);

Tests

yarn test

References

SLIP-0010

BIP-0032

BIP-0044

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors