비트코인 공부
HD wallet usage
bitlog
2022. 11. 28. 07:00
니모닉으로 HD 지갑 만들기
from mnemonic import Mnemonic
import bip32utils
mnemon = Mnemonic('english')
words = mnemon.generate(128)
print(words)
from bitcoinlib.wallets import Wallet
w = Wallet.create("Wallet7", witness_type='segwit', keys=words, network='bitcoin')
WalletKeys = w.get_keys(number_of_keys=5)
for k in WalletKeys:
print(k.address)
# 지갑주소들의 모든 정보 확인(비밀키 포함)
w.as_dict(include_private=True)
# 바이트객체를 hex 포맷으로 변환
b'\x02\xcf\xddVA\x85|\x0fu\xf9H`\xd5u\x9d4\x9a\xa180vCi\xab\xf9\x9d\x1d=\xd2\xc3W\x9a\xf5'.hex()
02cfdd5641857c0f75f94860d5759d349aa13830764369abf99d1d3dd2c3579af5
Ref.
- bitcoinlib 라이브러리 문서
- Native segwit 주소 출금
- Native segwit 주소 생성
728x90
반응형