티스토리 뷰
먼저 Mnemonic 모듈 설치
pip install Mnemonic
like this
>>> from mnemonic import Mnemonic
>>> from bitcoin import sha256
>>>
>>> m = Mnemonic('english')
>>> priv = sha256('xxxx')
>>> priv
'2481a63c85a62cf889d2b149f1a52e985a9341750173fe01eff50cc27b5941b5'
>>> words = m.to_mnemonic(bytes.fromhex(priv))
>>> words
'cause artwork monkey area glare labor chef file enemy minor entry cost powder pass staff common wrap author wool book chicken protect almost plastic'
>>> priv2 = bytearray.hex(m.to_entropy(words))
>>> priv2
'2481a63c85a62cf889d2b149f1a52e985a9341750173fe01eff50cc27b5941b5'
>>> priv
'2481a63c85a62cf889d2b149f1a52e985a9341750173fe01eff50cc27b5941b5'
728x90
반응형
'비트코인 공부' 카테고리의 다른 글
니모닉을 클라우드에 안전하게 보관하기 (6) | 2023.03.20 |
---|---|
비트코인의 총 발행량은 왜 21백만개가 되었을까 (0) | 2023.03.09 |
Native Segwit 주소 생성 (2) | 2023.01.14 |
23개 니모닉에서 24번째 단어 계산하는 코드 (19) | 2022.12.25 |
파이썬) SegWit 주소 생성하고 출금하기 (28) | 2022.12.16 |
댓글