Skip to content

0xkoiner/keystore

Repository files navigation

ERC-2335: BLS12-381 Keystore

ERC-2335 defines a secure and interoperable keystore format for BLS12-381 private keys. This standard, based on EIP-2335, enables safe storage, import, and export of Ethereum 2.0 validator keys, ensuring encrypted key files are portable, auditable, and compatible across tools.

📂 Project Structure

keystore-manager
├── keystore-checker.ts
└── keystore-lib.ts

⚡ Quick Start

Clone:

git clone https://github.com/0xkoiner/keystore.git

Install:

npm init -y
npm i --save @chainsafe/bls-keystore @noble/bls12-381
npm i -D ts-node typescript

Run the CLI to interact with the keystore manager:

sh keystore-cli.sh

🌐 Environment Example

To check the native balance on the Sepolia Network, configure your .env.example:

RPC_URL=https://Sepolia

🔐 Usage Instructions

  1. Paste a seamless Private Key in the prompt, and set a Password.
  2. Enter the Password again to decrypt the private key.

🧩 bls-keystore Examples

// keystore is an `object` that follows the EIP-2335 schema
const keystore: IKeystore = await create(password, privateKey, publicKey, path);

// verify password
await verifyPassword(keystore, password); // true | false

// decrypt private key
const decryptedPrivateKey: Uint8Array = await decrypt(keystore, password);

// convert decrypted private key to hex
const privHex = `0x${Buffer
  .from(await decrypt(keystore, pwd))
  .toString("hex")}` as `0x${string}`;

Integration This package is compatible with ChainSafe/bls-keygen.

Feel free to contribute or customize the project for your validator and keystore management workflows!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors