Skip to content

ssvlabs/eth2-keystore-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ethereum Keystore

Utility to extract private key from Ethereum KeyStore file

Module Usage

import EthereumKeyStore from 'eth2-keystore-js';

fs.readFile(filePath, 'utf8', async (err: ErrnoException, data: string) => {
    if (err) {
        reject(err);
    } else {
        const keyStore = new EthereumKeyStore(JSON.parse(data));
        
        const privateKey = await keyStore.getPrivateKey('<keystorePassword>');
    }
});

Dependencies

  • scrypt-js - The scrypt password-base key derivation function
  • ethereumjs-wallet - A lightweight wallet implementation
  • typescript - TypeScript is a language for application-scale JavaScript