Hot answers tagged

59

Such a great question. Background Derivation paths are related to HD Wallets or HD Keys, a type of wallet where you have a single, human readable, seed phrase that unlocks a number of accounts / addresses / private keys across any supported network. These phrases typically look like brain surround have swap horror body response double fire dumb bring ...


7

Do it with ethers: const ethers = require('ethers'); const mnemonic = await ethers.HDNode.entropyToMnemonic(ethers.utils.randomBytes(16)); const wallet = ethers.Wallet.fromMnemonic(mnemonic); P.S. Here is a community you can find ask more questions about it:


4

I realized my error: https://github.com/vergl4s/ethereum-mnemonic-utils works, but the full derivation path I was looking for is m/44'/60'/0'/0/0 (note the extra /0 to select the first account). Here is a full example: #!/usr/bin/env python3 ''' MIT License Copyright (c) 2018 Luis Teixeira Copyright (c) 2019 Niklas Baumstark Permission is hereby granted, ...


4

Technically, there is an infinite number of addresses that can be created from a single mnemonic following BIP39. Practically, there is a per-wallet limit. Some wallets that use BIP39, such as MetaMask, will generate a large number of addresses. However, it is likely that they will not generate an infinite amount of addresses, as there will be other ...


3

Just in case someone comes here later, in the recent version of ethers, HDNODE has been moved to the utils method. So, in modification to @George's answer above; const ethers = require('ethers'); const mnemonic = await ethers.utils.HDNode.entropyToMnemonic(ethers.utils.randomBytes(16)); const wallet = ethers.Wallet.fromMnemonic(mnemonic);


3

In BIP-0044 they gave some recommendations you my want to follow in Account Discovery section. When the master seed is imported from an external source the software should start to discover the accounts in the following manner: derive the first account's node (index = 0) derive the external chain node of this account scan addresses of the ...


3

Entropy implies randomness. Using deterministic algorithms on a password is not entropy and SHOULD NOT be used! I would recommend researching how to gather entropic data from whatever programming language you're using.


3

If I'm understanding your question correctly, you are asking whether you can go from any key pair in the hierarchy back to the original seed. This is not possible since each step down the hierarchy is a HMAC-SHA512, which is a just a SHA512 hash with a little extra. SHA512 is a one-way function, so you can't reverse it aka go up in the hierarchy. Even the ...


2

For Bip44 wallets Web3j will use the derivation path m/44/60'/0'/0. The more commonly used path is m/44/60'/0'/0/0 (with an extra /0). The following code will derive the correct address given a valid mnemonic. String mnemonic = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"; String password = ""; byte[] seed ...


1

After a lot of research, I went with ethereumjs-util, bip39 and hdkey. A Installations Install Node.js (npm will also be needed but it is included in node.js) Then open a CMD and install the packages : You can do it in 2 ways: Method A: install via the install @ethereumjs/tx command. This will install the package in C:\Users\<iuser>\node_modules\ and ...


1

Use iancolman 44'/0'/0'/0 i hope you can find you Xpub key here if you can't find it i will answer again with more info


1

Ethers.js has a function that checks the validity of a seed phrase, HDNode.isValidMnemonic: https://docs.ethers.io/ethers.js/html/api-advanced.html#static-methods For example: import { utils } from 'ethers.js'; utils.HDNode.isValidMnemonic("action glow era all liquid critic achieve lawsuit era anger loud slight"); // returns true If you're using Ethers....


1

import Bip39 from 'bip39'; https://github.com/mottolini/ionic-ethereum/blob/master/src/providers/ethereum/ethereum.ts Verify you code!


1

You can use ethereumjs-wallet, from their unit tests var xpub = 'xpub661MyMwAqRbcGout4B6s29b6gGQsowyoiF6UgXBEr7eFCWYfXuZDvRxP9zEh1Kwq3TLqDQMbkbaRpSnoC28oWvjLeshoQz1StZ9YHM1EpcJ' var addr = Wallet.fromExtendedPublicKey(xpub).getAddressString() assert(addr, '0xb800bf5435f67c7ee7d83c3a863269969a57c57c')


1

I figured out an Answer, https://pypi.org/project/eciespy/, this library uses private/public key generated from Sep256k1 curve for encryption and decryption. from ecies.utils import generate_eth_key from ecies import encrypt, decrypt k = generate_eth_key() ##Instead of generating a new key, you can use sep256k1 keys generated with bip39 specifications. ...


1

You can use ethers Lib: https://www.npmjs.com/package/ethers import { ethers } from "ethers"; newWallet = async () => { let password = prompt("Password"); if (password) { var randomSeed = ethers.Wallet.createRandom(); console.log(randomSeed.mnemonic); console.log(randomSeed.address); function callback(progress) { ...


Only top voted, non community-wiki answers of a minimum length are eligible