我们来手动打开小明的钱包
-
首先我们要有一个解释
python3
虚拟环境,使用下面部署和进入docker run --name xmseed -itd hongwenjun/xmseed sh docker exec -it xmseed bash source .venv/bin/activate
-
输入
python3
进入命令行交互界面,我相信你已经能正确进入虚拟环境了from monero.seed import Seed XM_XMR = u"小 明 的 钱 包 " * 5 seed = Seed(XM_XMR, "Chinese (simplified)") seed.public_address() seed.secret_view_key()
-
分别输入上面5行,小明的钱包 的样子我们就可以看到怎么样了
(.venv) root@b0083644ddcc:/app# python Python 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from monero.seed import Seed >>> XM_XMR = u"小 明 的 钱 包 " * 5 >>> seed = Seed(XM_XMR, "Chinese (simplified)") >>> seed.public_address() 45E72aRWCHQjSQG8Eaw83wTar47F2ohMDfnNuFwCaqSVeUe8CMev1a1HbNJbPd1b1Lg6X9A6iNkGyVrhQasi4MbJDQ7gjp8 >>> seed.secret_view_key() '64090b5f713860b7715757aa951b942be899fb4a7976dca67eef1dfb6e3cc904'
使用 DockerHub 镜像,可以有更加方便的办法
$ docker run --rm -it hongwenjun/xmseed $ docker run --name xmseed -itd hongwenjun/xmseed sh $ docker exec -it xmseed bash run.sh
小明的钱包.py [源码]
from monero.seed import Seed
# define Color
Green = ' 33[32m'; Red = ' 33[31m'; GreenBG = ' 33[42;37m'; RedBG = ' 33[41;37m'
Yellow = ' 33[0;33m'; SkyBlue = ' 33[0;36m'; Font = ' 33[0m'
XM_XMR = u"小 明 的 钱 包 " * 5
seed = Seed(XM_XMR, "Chinese (simplified)")
def display_info():
s =['Seed.Hex: ', 'Seed种子: ', '钱包地址: ', 'view密钥: ', 'spend密钥:', '
']
print(s[5] + Green + s[1] + Red , seed.phrase)
print(s[5] + SkyBlue + s[0] + Yellow, seed.hex)
print(s[5] + Red + s[2] + Font, seed.public_address())
print(Yellow + s[3] + Font, seed.secret_view_key())
print(SkyBlue + s[4] + Font , seed.secret_spend_key())
print()
info = GreenBG + '是否制作个性Seed种子助记词?(y/n)' + Font
info1 = Yellow + '请输入12或24个汉字, 程序帮你计算第13或25个校验汉字! 也可以输入 Seed.Hex 计算 Seed 种子助记词. 直接输入 <Enter> 键将新建随机种子。
'
info2 = Red + 'Seed 种子(空格间隔): ' + Font
print(info, end = '')
yes = input()
if yes == 'y' or yes == 'Y' :
print(info1 + info2, end = '')
XM_XMR = input()
seed = Seed(XM_XMR, "Chinese (simplified)")
seed = Seed(seed.hex, "Chinese (simplified)")
display_info()
# monero.seed 开源库: https://github.com/monero-ecosystem/monero-python
# 测试结果是否正确, 可以使用在线轻钱包检查,注意实际密钥种子,不要随便网上测试
# https://wallet.mymonero.com/
0 条评论