ecc

ecc

Methods

(static) generateKeyPairByMnemonic(mnemonic)

regenerate key pair by mnemonic

Example
import {generateKeyPairByMnemonic} from "u3.js/src";
const u3 = createU3(config)
u3.generateKeyPairByMnemonic({
    "mnemonic": "ben john tony jack bob tom jerry alice"
})
Parameters:
Name Type Description
mnemonic String

words that help memory

(static) generateKeyPairBySeed(seed) → {Object}

generate key pair by seed

Example
import {generateKeyPairBySeed} from "u3.js/src";
const u3 = createU3(config)
u3.generateKeyPairBySeed({
    "seed": "ultrain12345"
})
Parameters:
Name Type Description
seed String

a seed can regenerate the same key pair

Returns:
Type
Object

(static) generateKeyPairWithMnemonic() → {Object}

generate key pair with mnemonic

Returns:
Type
Object

(static) privateToPublic(wif) → {string}

transfer private key to public key

Example
import {privateToPublic} from "u3.js/src";
const u3 = createU3(config)
u3.privateToPublic({
    "wif": "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"
})
Parameters:
Name Type Description
wif String

private key

Returns:
Type
string