keyvenant
Version:
Keyvenant is a JavaScript tool to generate and export CovenantSQL keys to facilitate key management locally and in web extensions.
25 lines (24 loc) • 947 B
TypeScript
/**
* create CovenantSQL private key
* use ECDS(secp256k1) for private key generation
* @param keySize=32 default keysize is 32 bytes
* @return privateKey hex string
*/
export declare function createPrivateKey(keySize?: number): string;
/**
* create public key from private key
* use secp256k1 public key generation with compress enabled
* @param privateKey private key hex string
* @param compressed=true default compress public key
* @return publicKey hex string
*/
export declare function privateKeyToPublicKey(privateKey: string, compressed?: boolean): string;
/**
* convert address from public key
* 1. hash public key by THash
* 2. base58 encode hasedPubKey to filter out O 0, I i, + /
* @param publicKey public key hex string
* @param version version hex string to differ MainNet & TestNet
* @return address hex string
*/
export declare function publicKeyToAddress(publicKey: string, version: number): string;