sample2.rb
# Generate a set of keys from a parent wallet name and master key
Generate a set of keys from a parent wallet name and master key
Generate a set of keys from a parent wallet name and master key
def generate_keys(from_wallet_name, master_key)
  ks = { 'master' => master_key }
  %w(recovery money social memo).each do |role|
    private_key = Xgt::Ruby::Auth.generate_wif(from_wallet_name, master_key, 'recovery')
    public_key = Xgt::Ruby::Auth.wif_to_public_key(private_key, @address_prefix)
    ks["#{role}_private"] = private_key
    ks["#{role}_public"] = public_key
  end
  ks['wallet_name'] = Xgt::Ruby::Auth.generate_wallet_name(ks['recovery_public'])
  ks
end
def generate_keys ( from_wallet_name , master_key ) ks = { 'master' => master_key } %w( recovery money social memo ) . each do | role | private_key = Xgt :: Ruby :: Auth . generate_wif ( from_wallet_name , master_key , 'recovery' ) public_key = Xgt :: Ruby :: Auth . wif_to_public_key ( private_key , @address_prefix ) ks [ "#{role}_private" ] = private_key ks [ "#{role}_public" ] = public_key end ks [ 'wallet_name' ] = Xgt :: Ruby :: Auth . generate_wallet_name ( ks [ 'recovery_public' ] ) ks end
Generate a set of keys from a parent wallet name and master key
Generate a set of keys from a parent wallet name and master key
from_wallet_name
<not_specific>
master_key
<not_specific>