Author

Topic: Generate Address from Mnemonic (Read 302 times)

legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
September 05, 2019, 12:58:29 PM
#9
I don't really see the use of Mnemonics... I am a fan of keeping things simple. Just go with the key seed as is. You'll want to make sure your backup is solid in either case. Mnemonic or not.

The advantage of the mnemonic is that it has error correction built in (only certain words are valid) and it can be written down with fewer chances of error.

Additionally, you won't face any problem as long as first 4 characters of each word are present since AFAIK 4 first characters must be unique.
legendary
Activity: 4522
Merit: 3426
September 05, 2019, 04:16:20 AM
#7
I don't really see the use of Mnemonics... I am a fan of keeping things simple. Just go with the key seed as is. You'll want to make sure your backup is solid in either case. Mnemonic or not.

The advantage of the mnemonic is that it has error correction built in (only certain words are valid) and it can be written down with fewer chances of error.
legendary
Activity: 2268
Merit: 18771
September 05, 2019, 05:40:11 AM
#6
If your piece of paper becomes damaged, or the ink smudges, or similar, and you lose a couple of your words, you will need to brute force around 4 million combinations (2048^2) to regain access to your coins. If you are storing your private key in base58 wallet import format and lose say 10 characters of your key, you are looking at around 430 quadrillion combinations (58^10), meaning your coins are probably lost forever. (In reality these numbers would be slightly smaller as not all combinations of words are valid, but the principle is the same).

The same applies if you write down a few mistakes, mix up characters or words, or so forth. Not only is it harder to make a mistake writing down words than writing down random characters, but it is also easier to figure out or brute force any mistakes you have made.
legendary
Activity: 4522
Merit: 3426
September 01, 2019, 01:46:40 AM
#5
The methods for generating keys are described in several BIPs, especially BIP-32 and BIP-44

Address generation from mnemonic phrase is random. There is no guarantee that you'll end up creating the exact same address set as of Coinomi.

While the mnemonic phrase might be random, the addresses that are generated from it are always the same.
legendary
Activity: 3472
Merit: 10611
August 31, 2019, 10:35:06 PM
#4
Address generation from mnemonic phrase is random. There is no guarantee that you'll end up creating the exact same address set as of Coinomi.

the mnemonic phrase itself is generated at random not the addresses. they are in fact reproducible and that is the whole point of deterministic design, to be able to generate the same exact address from the same exact seed anytime you want.
legendary
Activity: 2268
Merit: 18771
August 31, 2019, 03:34:53 PM
#3
What is 'bx'?
BX is Bitcoin Explorer: https://github.com/libbitcoin/libbitcoin-explorer/wiki

I would like to write a test script that accepts a mnemonic phrase, and generates the same addresses that coinomi would produce from that phrase.
This page will guide you through all the steps you need to go from mnemonic to address: https://github.com/libbitcoin/libbitcoin-explorer/wiki/Wallet-Commands

Mnemonic to seed: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-mnemonic-to-seed
Code:
$ bx mnemonic-to-seed WORD1 WORD2 WORD3 ...

Seed to HD private key: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-hd-new
Code:
$ bx hd-new SEED

HD private key to public key: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-hd-to-public
Code:
$ bx hd-public HD_PRIVATE_KEY

HD public key to EC public key: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-hd-to-ec
Code:
$ bx hd-to-ec HD_KEY

EC public key to address: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-ec-to-address
Code:
$ bx ec-to-address EC_PUBLIC_KEY

You can use "-h" with all of these commands to display a help menu. You can also chain all these commands together as such:
Code:
% echo "WORD1 WORD2 WORD3 ..." | bx mnemonic-to-seed | bx hd-new | bx hd-public | bx hd-to-ec | bx ec-to-address

Assuming the Coinomi derivation path is 44'/0'/0'/0/0, then your command would look like this:
Code:
% echo "WORD1 WORD2 WORD3 ..." | bx mnemonic-to-seed | bx hd-new | bx hd-private -d -i 44 | bx hd-private -d -i 0 | bx hd-private -d -i 0 | bx hd-public -i 0  | bx hd-public -i 0  | bx hd-to-ec | bx ec-to-address


sr. member
Activity: 861
Merit: 423
August 31, 2019, 02:03:23 PM
#2
I would like to write a test script that accepts a mnemonic phrase, and generates the same addresses that coinomi would produce from that phrase.
Address generation from mnemonic phrase is random. There is no guarantee that you'll end up creating the exact same address set as of Coinomi.

using bx, how would this be one?
What is 'bx'?
newbie
Activity: 1
Merit: 1
August 31, 2019, 12:56:54 PM
#1
I am looking to understand how HD wallets work clearly enough to create one.

I would like to write a test script that accepts a mnemonic phrase, and generates the same addresses that coinomi would produce from that phrase.

using bx, how would this be one?

Jump to: