Generate deterministic keys based on a master seed passpharse, a private key or a public key.
Each derived key-pair are created based on a string that can be freely chosen (an incremented counter, an order id, user id, or just about anything)
When a private key (or a private key based on a passphrase) is used, the public key and the private key are returned.
When the matching public key is used, only the public key is returned - but its the same public key as the one created from the private key using the same string.
From seed passphrase:
keygen = deterministic seed: 'my very secret password'
keys = keygen 'payment-1' # { pub, priv, address }
From seed private key:
keygen = deterministic priv: [0xc0, 0x0f, 0xfe, ... (byte array)]
keys = keygen 'change-3' # { pub, priv, address }
From seed pubkey
keygen = deterministic pub: [0xc0, 0x0f, 0xfe, ... (byte array)]
keys = keygen 'order-998181' # { pub, address }
Get the public key of an passphrase:
master = make_master seed: 'my very secret password'
console.log Crypto.util.bytesToBase64 master.pub