티스토리 뷰

먼저 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
반응형
댓글
250x250
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함