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.
keystore-manager
├── keystore-checker.ts
└── keystore-lib.tsClone:
git clone https://github.com/0xkoiner/keystore.gitInstall:
npm init -y
npm i --save @chainsafe/bls-keystore @noble/bls12-381
npm i -D ts-node typescriptRun the CLI to interact with the keystore manager:
sh keystore-cli.shTo check the native balance on the Sepolia Network, configure your .env.example:
RPC_URL=https://Sepolia- Paste a seamless Private Key in the prompt, and set a Password.
- Enter the Password again to decrypt the private key.
// 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!