Skip to content

Generate independent Mnemonic Phrase for address #86

@fj44dn

Description

@fj44dn

I want to generate a independent Mnemonic Phrase, but with the code generate the same Mnemonic Phrase:

import mnemonic
import threading
from hdwallet import BIP44HDWallet
from hdwallet.cryptocurrencies import EthereumMainnet
from hdwallet.derivations import BIP44Derivation
from hdwallet.utils import generate_mnemonic
from typing import Optional
from  etherscan import Etherscan
from requests import get
from matplotlib import pyplot as plt
from datetime import datetime
import time
import os
import sys

MNEMONIC: str = generate_mnemonic(language="english", strength=128)
PASSPHRASE: Optional[str] = None  # "meherett"
bip44_hdwallet: BIP44HDWallet = BIP44HDWallet(cryptocurrency=EthereumMainnet)
bip44_hdwallet.from_mnemonic(
mnemonic=MNEMONIC, language="english", passphrase=PASSPHRASE
)

bip44_hdwallet.clean_derivation()
for address_index in range(2): # Mnemonic Quantity to generate 
    bip44_derivation: BIP44Derivation = BIP44Derivation(
        cryptocurrency=EthereumMainnet, account=0, change=False, address=address_index
    )
    bip44_hdwallet.from_path(path=bip44_derivation)
    bip44_hdwallet.clean_derivation()
    print(f"{bip44_hdwallet.mnemonic()}")

    os.system(f'echo {bip44_hdwallet.mnemonic()} >> /home/mnemonic.txt')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions