Module: Bip44
- Defined in:
- lib/bip44.rb,
lib/bip44/utils.rb,
lib/bip44/wallet.rb,
lib/bip44/bitcoin.rb,
lib/bip44/version.rb,
lib/bip44/ethereum.rb
Defined Under Namespace
Modules: Bitcoin, Ethereum, Utils
Classes: Wallet
Constant Summary
collapse
- VERSION =
"0.2.10"
Class Method Summary
collapse
Class Method Details
.create_mnemonic_wallet ⇒ Object
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/bip44.rb', line 13
def self.create_mnemonic_wallet
words = BipMnemonic.to_mnemonic(bits: 128)
puts words
seed = BipMnemonic.to_seed(mnemonic: words)
ethereum_wallet = Bip44::Wallet.from_seed(seed, "m/44'/60'/0'/0")
puts 'ethereum xprv: ' + ethereum_wallet.xprv
puts 'ethereum xpub: ' + ethereum_wallet.xpub
bitcoin_wallet = Bip44::Wallet.from_seed(seed, "m/44'/0'/0'/0")
puts 'bitcoin xprv: ' + bitcoin_wallet.xprv
puts 'bitcoin xpub: ' + bitcoin_wallet.xpub
end
|
.from_mnemonic(words) ⇒ Object
25
26
27
28
29
30
31
32
33
|
# File 'lib/bip44.rb', line 25
def self.from_mnemonic(words)
seed = BipMnemonic.to_seed(mnemonic: words)
ethereum_wallet = Bip44::Wallet.from_seed(seed, "m/44'/60'/0'/0")
puts 'ethereum xprv: ' + ethereum_wallet.xprv
puts 'ethereum xpub: ' + ethereum_wallet.xpub
bitcoin_wallet = Bip44::Wallet.from_seed(seed, "m/44'/0'/0'/0")
puts 'bitcoin xprv: ' + bitcoin_wallet.xprv
puts 'bitcoin xpub: ' + bitcoin_wallet.xpub
end
|