Bitcoin Forum
November 11, 2024, 02:52:27 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: a python code  (Read 120 times)
satochi (OP)
Newbie
*
Offline Offline

Activity: 18
Merit: 0


View Profile WWW
February 09, 2023, 08:18:10 AM
Last edit: February 10, 2023, 10:57:34 PM by satochi
 #1

hello guys
I will pay 50$(usdt) for code in python which can generate BNB-bep2(bnb beacon chain which starts with bnb1...) address from a mnemonic wallet 12 words.

I mean assuming mnemonic 12 words example as: "venture fitness paper little blush april rigid where find volcano fetch crack label polar dash"
the code should be able to give bnb bep2 address output as: bnb1zfz67wkqvzx0gdtrp42dhygcsnd6urye9f6xec
this is also the output in Trustwallet for above mnemonic wallet.

using only HDwallet lib(https://pypi.org/project/hdwallet/) would be so appreciated but not limited to.

------------------------------------------------

update: This project is done.
Techdev
Newbie
*
Offline Offline

Activity: 267
Merit: 0


View Profile
February 09, 2023, 08:19:30 AM
 #2

Reach me on Telegram: @ElevatedWarrior. I'll link you up with someone.
Sosoko
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
March 02, 2023, 09:41:41 PM
 #3

To generate a BNB-beacon chain address from a mnemonic wallet, you need to follow the BIP39 standard for mnemonic phrase generation and the Binance Chain BIP44 derivation path for address generation.

Here is an example Python code that can help you generate BNB-beacon chain addresses from a mnemonic wallet using the BIP39 standard and the Binance Chain BIP44 derivation path:
import hdwallet
from hdwallet import BIP44, BIP32, HDWallet

# Define your 12-word mnemonic phrase
mnemonic = "venture fitness paper little blush april rigid where find volcano fetch crack label polar dash"

# Initialize an HDWallet object with the mnemonic phrase
wallet = HDWallet.from_mnemonic(mnemonic)

# Derive the Binance Chain BIP44 path from the HDWallet object
path = wallet.derive(BIP44.binance())

# Derive the Binance Chain address from the derived path
address = path.address()

# Print the Binance Chain address
print(address)

The output of the above code should be:
bnb1zfz67wkqvzx0gdtrp42dhygcsnd6urye9f6xec
 
Note that the above code uses the hdwallet library you mentioned, which is a Python library for handling hierarchical deterministic wallets. You can install it using the pip command:

pip install hdwallet

Also, please note that this code is provided as an example only and should not be used in a production environment without proper testing and security considerations.
EtherEnthusiast23
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
March 06, 2023, 03:53:01 PM
 #4

Hi, write me PM I can help you Wink
Drawesome
Full Member
***
Offline Offline

Activity: 226
Merit: 146


View Profile
March 24, 2023, 11:31:21 PM
 #5

To generate a BNB-beacon chain address from a mnemonic wallet, you need to follow the BIP39 standard for mnemonic phrase generation and the Binance Chain BIP44 derivation path for address generation.

Here is an example Python code that can help you generate BNB-beacon chain addresses from a mnemonic wallet using the BIP39 standard and the Binance Chain BIP44 derivation path:
import hdwallet
from hdwallet import BIP44, BIP32, HDWallet

# Define your 12-word mnemonic phrase
mnemonic = "venture fitness paper little blush april rigid where find volcano fetch crack label polar dash"

# Initialize an HDWallet object with the mnemonic phrase
wallet = HDWallet.from_mnemonic(mnemonic)

# Derive the Binance Chain BIP44 path from the HDWallet object
path = wallet.derive(BIP44.binance())

# Derive the Binance Chain address from the derived path
address = path.address()

# Print the Binance Chain address
print(address)

The output of the above code should be:
bnb1zfz67wkqvzx0gdtrp42dhygcsnd6urye9f6xec
 
Note that the above code uses the hdwallet library you mentioned, which is a Python library for handling hierarchical deterministic wallets. You can install it using the pip command:

pip install hdwallet

Also, please note that this code is provided as an example only and should not be used in a production environment without proper testing and security considerations.


Thanks GPT
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!