input-output-hk / js-cardano-wasm

various cardano javascript using wasm bindings
MIT License
31 stars 21 forks source link

Account public key derivation addresses #7

Closed NicolasDP closed 6 years ago

NicolasDP commented 6 years ago

add function to create account only public key derivation, useful for generating addresses without needing to keep a private key or the seed in memory somewhere, only the public key of the account.

How to use:

create a wallet

const wallet = CardanoCrypto.Wallet.fromSeed([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]).result;

create an account

const account = CardanoCrypto.Wallet.newAccount(wallet, 0).result;

generate addresses from the account

const addresses = CardanoCrypto.Wallet.generateAddresses(account, 'External', [0,1,2,3]).result;

ping @AlanVerbner , @mirkoAlic