{"id":890,"date":"2022-01-11T05:02:00","date_gmt":"2022-01-11T05:02:00","guid":{"rendered":"https:\/\/262235.xyz\/?p=890"},"modified":"2022-01-11T05:02:00","modified_gmt":"2022-01-11T05:02:00","slug":"890","status":"publish","type":"post","link":"https:\/\/lyvba.com\/index.php\/2022\/01\/11\/890\/","title":{"rendered":"\u5c0f\u660e\u7684\u94b1\u5305"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2022\/01\/49238687.webp\" alt=\"xmseed.webp\" title=\"xmseed.webp\"><\/p>\n<h2>\u6211\u4eec\u6765\u624b\u52a8\u6253\u5f00\u5c0f\u660e\u7684\u94b1\u5305<\/h2>\n<ul>\n<li>\n<p>\u9996\u5148\u6211\u4eec\u8981\u6709\u4e00\u4e2a\u89e3\u91ca <code>python3<\/code> \u865a\u62df\u73af\u5883\uff0c\u4f7f\u7528\u4e0b\u9762\u90e8\u7f72\u548c\u8fdb\u5165<\/p>\n<pre><code>docker run --name xmseed -itd hongwenjun\/xmseed sh\ndocker exec -it xmseed  bash\nsource .venv\/bin\/activate<\/code><\/pre>\n<\/li>\n<li>\n<p>\u8f93\u5165 <code>python3<\/code> \u8fdb\u5165\u547d\u4ee4\u884c\u4ea4\u4e92\u754c\u9762\uff0c\u6211\u76f8\u4fe1\u4f60\u5df2\u7ecf\u80fd\u6b63\u786e\u8fdb\u5165\u865a\u62df\u73af\u5883\u4e86<\/p>\n<pre><code>from monero.seed import Seed\nXM_XMR = u\"\u5c0f \u660e \u7684 \u94b1 \u5305 \" * 5\nseed = Seed(XM_XMR, \"Chinese (simplified)\")\nseed.public_address()\nseed.secret_view_key()<\/code><\/pre>\n<\/li>\n<li>\n<p>\u5206\u522b\u8f93\u5165\u4e0a\u97625\u884c\uff0c\u5c0f\u660e\u7684\u94b1\u5305 \u7684\u6837\u5b50\u6211\u4eec\u5c31\u53ef\u4ee5\u770b\u5230\u600e\u4e48\u6837\u4e86<\/p>\n<pre><code>(.venv) root@b0083644ddcc:\/app# python\nPython 3.9.2 (default, Feb 28 2021, 17:03:44)\n[GCC 10.2.1 20210110] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n&gt;&gt;&gt; from monero.seed import Seed\n&gt;&gt;&gt; XM_XMR = u\"\u5c0f \u660e \u7684 \u94b1 \u5305 \" * 5\n&gt;&gt;&gt; seed = Seed(XM_XMR, \"Chinese (simplified)\")\n&gt;&gt;&gt; seed.public_address()\n45E72aRWCHQjSQG8Eaw83wTar47F2ohMDfnNuFwCaqSVeUe8CMev1a1HbNJbPd1b1Lg6X9A6iNkGyVrhQasi4MbJDQ7gjp8\n&gt;&gt;&gt; seed.secret_view_key()\n'64090b5f713860b7715757aa951b942be899fb4a7976dca67eef1dfb6e3cc904'\n<\/code><\/pre>\n<h2>\u4f7f\u7528 <a href=\"https:\/\/hub.docker.com\/repository\/docker\/hongwenjun\/xmseed\">DockerHub<\/a> \u955c\u50cf\uff0c\u53ef\u4ee5\u6709\u66f4\u52a0\u65b9\u4fbf\u7684\u529e\u6cd5<\/h2>\n<pre><code>$   docker run --rm -it hongwenjun\/xmseed\n\n$   docker run --name xmseed -itd hongwenjun\/xmseed sh\n$   docker exec -it xmseed  bash run.sh<\/code><\/pre>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2022\/01\/135903487.png\" alt=\"xm.png\" title=\"xm.png\"><\/p>\n<h2>\u5c0f\u660e\u7684\u94b1\u5305.py [\u6e90\u7801]<\/h2>\n<pre><code>from monero.seed import Seed\n\n# define Color\nGreen = '\u000033[32m'; Red = '\u000033[31m'; GreenBG = '\u000033[42;37m'; RedBG = '\u000033[41;37m'\nYellow = '\u000033[0;33m'; SkyBlue = '\u000033[0;36m'; Font = '\u000033[0m'\n\nXM_XMR = u\"\u5c0f \u660e \u7684 \u94b1 \u5305 \" * 5\nseed = Seed(XM_XMR, \"Chinese (simplified)\")\n\ndef display_info():\n    s =['Seed.Hex: ', 'Seed\u79cd\u5b50: ', '\u94b1\u5305\u5730\u5740: ', 'view\u5bc6\u94a5: ', 'spend\u5bc6\u94a5:', '\n']\n    print(s[5] + Green + s[1] + Red , seed.phrase)\n    print(s[5] + SkyBlue + s[0] + Yellow, seed.hex)\n    print(s[5] + Red + s[2] + Font, seed.public_address())\n    print(Yellow + s[3] + Font, seed.secret_view_key())\n    print(SkyBlue + s[4] + Font , seed.secret_spend_key())\n    print()\n\ninfo = GreenBG + '\u662f\u5426\u5236\u4f5c\u4e2a\u6027Seed\u79cd\u5b50\u52a9\u8bb0\u8bcd?(y\/n)' + Font\ninfo1 = Yellow + '\u8bf7\u8f93\u516512\u621624\u4e2a\u6c49\u5b57, \u7a0b\u5e8f\u5e2e\u4f60\u8ba1\u7b97\u7b2c13\u621625\u4e2a\u6821\u9a8c\u6c49\u5b57! \u4e5f\u53ef\u4ee5\u8f93\u5165 Seed.Hex \u8ba1\u7b97 Seed \u79cd\u5b50\u52a9\u8bb0\u8bcd. \u76f4\u63a5\u8f93\u5165 &lt;Enter&gt; \u952e\u5c06\u65b0\u5efa\u968f\u673a\u79cd\u5b50\u3002\n'\ninfo2 = Red + 'Seed \u79cd\u5b50(\u7a7a\u683c\u95f4\u9694): ' + Font\n\nprint(info, end = '')\nyes = input()\nif yes == 'y' or yes == 'Y' :\n    print(info1 + info2, end = '')\n    XM_XMR = input()\n    seed = Seed(XM_XMR, \"Chinese (simplified)\")\n    seed = Seed(seed.hex, \"Chinese (simplified)\")\n\ndisplay_info()\n\n# monero.seed \u5f00\u6e90\u5e93:  https:\/\/github.com\/monero-ecosystem\/monero-python\n# \u6d4b\u8bd5\u7ed3\u679c\u662f\u5426\u6b63\u786e, \u53ef\u4ee5\u4f7f\u7528\u5728\u7ebf\u8f7b\u94b1\u5305\u68c0\u67e5\uff0c\u6ce8\u610f\u5b9e\u9645\u5bc6\u94a5\u79cd\u5b50\uff0c\u4e0d\u8981\u968f\u4fbf\u7f51\u4e0a\u6d4b\u8bd5\n# https:\/\/wallet.mymonero.com\/<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6211\u4eec\u6765\u624b\u52a8\u6253\u5f00\u5c0f\u660e\u7684\u94b1\u5305 \u9996\u5148\u6211\u4eec\u8981\u6709\u4e00\u4e2a\u89e3\u91ca python3 \u865a\u62df\u73af\u5883\uff0c\u4f7f\u7528\u4e0b\u9762\u90e8\u7f72\u548c\u8fdb\u5165 doc [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[45,62],"class_list":["post-890","post","type-post","status-publish","format-standard","hentry","category-learn","tag-python","tag-xmr"],"_links":{"self":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/890","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/comments?post=890"}],"version-history":[{"count":0,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/890\/revisions"}],"wp:attachment":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/media?parent=890"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/categories?post=890"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/tags?post=890"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}