user127815: Faced a problem, I have a crypto wallet written in Python, there is a code that creates a wallet address from a mnemonic phrase (In this case, BTC address). But if I enter this mnemonic phrase into the Trust Wallet mobile app, it will give me a completely different Bitcoin address. Why? How to fix it? Here is the code:
from bipwallet import wallet
from bipwallet.utils import *

Seed = wallet.generate_mnemonic()

WalletBTC = wallet.create_wallet(network="BTC", seed=Seed, children=0)

AddressBTC = WalletBTC.get("address")

print("BTC Address: ", AddressBTC)


user127815: Thank you.
I independently found libraries that generate the same address as Trust Wallet, as well as Cryptoneed (Mobile Apps).
Who needs my code, copy and customize for yourself:
from hdwallet import BIP44HDWallet
from hdwallet.utils import generate_mnemonic
from hdwallet.derivations import BIP44Derivation
from hdwallet.cryptocurrencies import BitcoinMainnet, EthereumMainnet
from bip_utils import Bip84, Bip84Coins, Bip44Changes, Bip39SeedGenerator


LanguageInMnemonic = "english"

Mnemonic = generate_mnemonic(language = LanguageInMnemonic, strength = 128)
    Seed = Bip39SeedGenerator(Mnemonic).Generate()

    print(Mnemonic)

    if IsCheckBTC == "+":
        if IsCheckBTCBip44 == "+":
            CheckedWalletBTCBip44 = BIP44HDWallet(cryptocurrency=BitcoinMainnet)
            CheckedWalletBTCBip44.from_mnemonic(mnemonic = Mnemonic, language = LanguageInMnemonic, passphrase = None)
            CheckedWalletBTCBip44.clean_derivation()
            CheckedWalletBTCBip44Derivation = BIP44Derivation(cryptocurrency = BitcoinMainnet, account = 0, change = False, address = 0)
            CheckedWalletBTCBip44.from_path(path = CheckedWalletBTCBip44Derivation)

            CheckedAddressBTCBip44 = CheckedWalletBTCBip44.address()
            print(CheckedAddressBTCBip44)

        if IsCheckBTCBip84 == "+":
            CheckedWalletBTCBip84 = Bip84.FromSeed(Seed, Bip84Coins.BITCOIN)
            CheckedWalletBTCBip84Step1 = (CheckedWalletBTCBip84.Purpose().Coin().Account(0)).Change(Bip44Changes.CHAIN_EXT)
            CheckedWalletBTCBip84Step2 = CheckedWalletBTCBip84Step1.AddressIndex(0)

            CheckedAddressBTCBip84 = CheckedWalletBTCBip84Step2.PublicKey().ToAddress()
            print(CheckedAddressBTCBip84)

    if IsCheckETH == "+":
        CheckedWalletETH = BIP44HDWallet(cryptocurrency = EthereumMainnet)
        CheckedWalletETH.from_mnemonic(mnemonic = Mnemonic, language = LanguageInMnemonic, passphrase = None)
        CheckedWalletETH.clean_derivation()
        CheckedWalletETHDerivation: BIP44Derivation = BIP44Derivation(cryptocurrency = EthereumMainnet, account = 0, change = False, address = 0)
        CheckedWalletETH.from_path(path=CheckedWalletETHDerivation)

        CheckedAddressETH = CheckedWalletETH.address()
        print(CheckedAddressETH)

(P. S. I used google translate)

user13866: I assume both the Python library and Trustwallet implement BIP32 to create hierarchical deterministic (HD) wallets.
The address you get depends on the derivation path. If your Python library and Trustwallet use different derivation paths, you will get different addresses.
An HD wallet will produce multiple addresses, a different one each time you request an address. So you must be careful not to compare the 1st address from one wallet with the 2nd address from another.

127815: <p>Faced a problem, I have a crypto wallet written in Python, there is a code that creates a wallet address from a mnemonic phrase (In this case, BTC address). But if I enter this mnemonic phrase into the Trust Wallet mobile app, it will give me a completely different Bitcoin address. Why? How to fix it? Here is the code:</p>
<pre><code>from bipwallet import wallet
from bipwallet.utils import *

Seed = wallet.generate_mnemonic()

WalletBTC = wallet.create_wallet(network=&quot;BTC&quot;, seed=Seed, children=0)

AddressBTC = WalletBTC.get(&quot;address&quot;)

print(&quot;BTC Address: &quot;, AddressBTC)
</code></pre>
 127815: <p>Thank you.
I independently found libraries that generate the same address as Trust Wallet, as well as Cryptoneed (Mobile Apps).
Who needs my code, copy and customize for yourself:</p>
<pre><code>from hdwallet import BIP44HDWallet
from hdwallet.utils import generate_mnemonic
from hdwallet.derivations import BIP44Derivation
from hdwallet.cryptocurrencies import BitcoinMainnet, EthereumMainnet
from bip_utils import Bip84, Bip84Coins, Bip44Changes, Bip39SeedGenerator


LanguageInMnemonic = &quot;english&quot;

Mnemonic = generate_mnemonic(language = LanguageInMnemonic, strength = 128)
    Seed = Bip39SeedGenerator(Mnemonic).Generate()

    print(Mnemonic)

    if IsCheckBTC == &quot;+&quot;:
        if IsCheckBTCBip44 == &quot;+&quot;:
            CheckedWalletBTCBip44 = BIP44HDWallet(cryptocurrency=BitcoinMainnet)
            CheckedWalletBTCBip44.from_mnemonic(mnemonic = Mnemonic, language = LanguageInMnemonic, passphrase = None)
            CheckedWalletBTCBip44.clean_derivation()
            CheckedWalletBTCBip44Derivation = BIP44Derivation(cryptocurrency = BitcoinMainnet, account = 0, change = False, address = 0)
            CheckedWalletBTCBip44.from_path(path = CheckedWalletBTCBip44Derivation)

            CheckedAddressBTCBip44 = CheckedWalletBTCBip44.address()
            print(CheckedAddressBTCBip44)

        if IsCheckBTCBip84 == &quot;+&quot;:
            CheckedWalletBTCBip84 = Bip84.FromSeed(Seed, Bip84Coins.BITCOIN)
            CheckedWalletBTCBip84Step1 = (CheckedWalletBTCBip84.Purpose().Coin().Account(0)).Change(Bip44Changes.CHAIN_EXT)
            CheckedWalletBTCBip84Step2 = CheckedWalletBTCBip84Step1.AddressIndex(0)

            CheckedAddressBTCBip84 = CheckedWalletBTCBip84Step2.PublicKey().ToAddress()
            print(CheckedAddressBTCBip84)

    if IsCheckETH == &quot;+&quot;:
        CheckedWalletETH = BIP44HDWallet(cryptocurrency = EthereumMainnet)
        CheckedWalletETH.from_mnemonic(mnemonic = Mnemonic, language = LanguageInMnemonic, passphrase = None)
        CheckedWalletETH.clean_derivation()
        CheckedWalletETHDerivation: BIP44Derivation = BIP44Derivation(cryptocurrency = EthereumMainnet, account = 0, change = False, address = 0)
        CheckedWalletETH.from_path(path=CheckedWalletETHDerivation)

        CheckedAddressETH = CheckedWalletETH.address()
        print(CheckedAddressETH)
</code></pre>
<p>(P. S. I used google translate)</p>
 13866: <p>I assume both the Python library and Trustwallet implement BIP32 to create hierarchical deterministic (HD) wallets.</p>
<p>The address you get depends on the <a href="https://bitcoin.stackexchange.com/q/78993/13866">derivation path</a>. If your Python library and Trustwallet use different derivation paths, you will get different addresses.</p>
<p>An HD wallet will produce multiple addresses, a different one each time you request an address. So you must be careful not to compare the 1st address from one wallet with the 2nd address from another.</p>
