The address to check
Encrypts a secret key with a passphrase
The encrypted secret key
const encryptedSecretKey = cryptoUtils.encryptSecretKey(
'p2sk3T9fYpibobxRr7daoPzywLpLAXJVd3bkXpAaqYVtVB37aAp7bU',
'password',
);
The secret key
The passphrase to encrypt the key
The salt to apply to the encryption
Extract key pairs from a secret key
The extracted key pairs
cryptoUtils.extractKeys('edskRqAF8s2MKKqRMxq53CYYLMnrqvokMyrtmPRFd5H9osc4bFmqKBY119jiiqKQMti2frLAoKGgZSQN3Lc3ybf5sgPUy38e5A')
.then(({ sk, pk, pkh }) => console.log(sk, pk, pkh));
The secret key to extract key pairs from
Optional
passphrase: stringThe password used to encrypt the sk
Generate a new key pair given a mnemonic and passphrase
The generated key pair
cryptoUtils.generateKeys('raw peace visual boil prefer rebel anchor right elegant side gossip enroll force salmon between', 'my_password_123')
.then(({ mnemonic, passphrase, sk, pk, pkh }) => console.log(mnemonic, passphrase, sk, pk, pkh));
// Or generate keys given an HD derivartion path
cryptoUtils.generateKeys('gym exact clown can answer hope sample mirror knife twenty powder super imitate lion churn almost shed chalk dust civil gadget pyramid helmet trade', undefined, 'm/44h/1729h/0h/0h')
.then(({ mnemonic, passphrase, sk, pk, pkh }) => console.log(mnemonic, passphrase, sk, pk, pkh));
The mnemonic seed
Optional
passphrase: stringThe passphrase used to salt the seed
Optional
derivationPath: stringDerivation path if generating keys for an HD account
Generate a mnemonic
The generated mnemonic
Optional
numberOfWords: number = 15The number of words to include in the mnemonic
Optional
password: stringSign bytes
The signed bytes
import { magicBytes as magicBytesMap } from 'sotez';
cryptoUtils.sign(opbytes, keys.sk, magicBytesMap.generic)
.then(({ bytes, magicBytes, sig, prefixSig, sbytes }) => console.log(bytes, magicBytes, sig, prefixSig, sbytes));
The bytes to sign
The secret key to sign the bytes with
Optional
magicBytes: Uint8ArrayThe magic bytes for the operation
Optional
password: string = ''The password used to encrypt the sk
Verify signed bytes
Whether the signed bytes are valid
The signed bytes
The signature of the signed bytes
The public key
Generated using TypeDoc
Description
Check the validity of a tezos implicit address (tz1...)
Returns
Whether address is valid or not