{"id":3864,"date":"2023-03-01T22:42:34","date_gmt":"2023-03-01T13:42:34","guid":{"rendered":"https:\/\/matoken.org\/blog\/?p=3864"},"modified":"2023-03-01T22:42:34","modified_gmt":"2023-03-01T13:42:34","slug":"nostr-vanity-adress","status":"publish","type":"post","link":"https:\/\/matoken.org\/blog\/2023\/03\/01\/nostr-vanity-adress\/","title":{"rendered":"Nostr \u306e Vanity address \u3092\u6398\u308b"},"content":{"rendered":"<div id=\"preamble\">\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>Nostr \u3068\u3044\u3046\u5206\u6563\u578bSNS\u306e\u30d7\u30ed\u30c8\u30b3\u30eb\u304c\u3042\u3063\u3066\u6700\u8fd1\u826f\u304f\u898b\u304b\u3051\u307e\u3059\uff0e<\/p>\n<\/div>\n<div class=\"ulist\">\n<ul>\n<li><a href=\"https:\/\/nostr.com\/\">Nostr, a simple protocol for decentralizing social media that has a chance of working<\/a><\/li>\n<\/ul>\n<\/div>\n<div class=\"paragraph\">\n<p>\u3053\u306eSNS\u306e\u500b\u4eba\u8a8d\u8b58\u306b\u79d8\u5bc6\u9375\u3068\u516c\u958b\u9375\u306e\u30da\u30a2\u3092\u4f5c\u6210\u3057\u3066\u305d\u308c\u3092\u5229\u7528\u3057\u307e\u3059\uff0e\u9375\u30da\u30a2\u306f\u521d\u56de\u306b\u81ea\u52d5\u751f\u6210\u3055\u308c\u308b\u306e\u3067\u3059\u304c\uff0c\u516c\u958b\u9375\u306e\u6587\u5b57\u5217\u3092\u305f\u304f\u3055\u3093\u8a08\u7b97\u3057\u3066\u597d\u307f\u306e\u30a2\u30c9\u30ec\u30b9\u304c\u542b\u307e\u308c\u305f\u30a2\u30c9\u30ec\u30b9\u3092\u6398\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u3042\u3063\u305f\u306e\u3067\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\uff0e<\/p>\n<\/div>\n<div class=\"ulist\">\n<ul>\n<li><a href=\"https:\/\/github.com\/tonyinit\/nostrogen\">tonyinit\/nostrogen: simple nostr vanity address generator<\/a><\/li>\n<\/ul>\n<\/div>\n<p><!--more--><\/p>\n<div class=\"paragraph\">\n<p>\u3053\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306fbech32\u3067\u8868\u73fe\u3055\u308c\u308b\u516c\u958b\u9375\u306e <code>npub1<\/code> \u306e\u5f8c\u308d\u306e\u6587\u5b57\u5217\u3092\u4efb\u610f\u306e\u6587\u5b57\u5217\u304b\u3089\u59cb\u307e\u308b\u3082\u306e\u306b\u3057\u305f\u3044\u3068\u3044\u3046vanity \u30a2\u30c9\u30ec\u30b9\u3092\u5f6b\u308a\u305f\u3044\u4eba\u5411\u3051\u306e\u3082\u306e\u3067\u3059\uff0e<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_\u5c0e\u5165\">\u5c0e\u5165<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>cargo insrtall \u3067\u5c0e\u5165\u3067\u304d\u308b\u306f\u305a\u3067\u3059\u304c\uff0c\u624b\u5143\u306eDebian bookworm testing amd64 \u74b0\u5883\u3067\u306frustc \u304c 1.63 \u306b\u5bfe\u3057\u3066rana \u306f 1.64.0 \u4ee5\u4e0a\u304c\u5fc5\u8981\u3060\u3068\u3044\u3046\u3053\u3068\u3067\u53e4\u304f\u3066\u5931\u6557\u3057\u307e\u3057\u305f\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>$ cargo install rana\n    Updating crates.io index\n  Installing rana v0.5.1\n  Downloaded is-terminal v0.4.4\n  Downloaded clap_lex v0.3.2\n  Downloaded syn v1.0.109\n  Downloaded bip39 v1.2.0\n  Downloaded 4 crates (346.5 KB) in 2.86s\nerror: failed to compile `rana v0.5.1`, intermediate artifacts can be found at `\/tmp\/cargo-installvCF9z2`\n\nCaused by:\n  package `clap_derive v4.1.0` cannot be built because it requires rustc 1.64.0 or newer, while the currently active rustc version is 1.63.0\n  Try re-running cargo install with `--locked`\n$ dpkg-query -W rustc\nrustc   1.63.0+dfsg1-2<\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>Rust Forge \u3067\u65b0\u3057\u3044Stable(1.67.1)\u3092\u8cb0\u3063\u3066\u304d\u3066\u4f7f\u304a\u3046\u304b\u3068\u3082\u601d\u3044\u307e\u3057\u305f\u304c\uff0c\u30a4\u30f3\u30b9\u30c8\u30fc\u30e9\u30fc\u3092\u53e9\u304f\u5f62\u3067\u74b0\u5883\u304c\u6c5a\u308c\u305d\u3046\u3067\u5c11\u3057\u9762\u5012\u305d\u3046\uff0e<\/p>\n<\/div>\n<div class=\"ulist\">\n<ul>\n<li><a href=\"https:\/\/forge.rust-lang.org\/infra\/other-installation-methods.html\">Other Installation Methods &#8211; Rust Forge<\/a><\/li>\n<\/ul>\n<\/div>\n<div class=\"paragraph\">\n<p>Docker \u3092\u4f7f\u3046\u3053\u3068\u306b\u3057\u307e\u3059\uff0e<\/p>\n<\/div>\n<div class=\"ulist\">\n<ul>\n<li><a href=\"https:\/\/hub.docker.com\/_\/rust\">rust &#8211; Official Image | Docker Hub<\/a><\/li>\n<\/ul>\n<\/div>\n<div class=\"paragraph\">\n<p>\u516c\u5f0f\u30a4\u30e1\u30fc\u30b8\u3060\u3051\u3042\u3063\u3066\u6700\u65b0\u306e 1.67.1 \u3067\u3059\uff0erana \u3082\u3055\u304f\u3063\u3068\u52d5\u304d\u307e\u3057\u305f\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>$ script .\/nostr_vanity.log\n$ docker run --rm -it rust\n# rustc --version\nrustc 1.67.1 (d5a82bbd2 2023-02-07)\n# adduser matoken\n# su - matoken\n$ export PATH=\/usr\/local\/cargo\/bin:$PATH\n$ rustup default stable\n$ cargo install rana\n$ rana --help\nRana &#x1f438;\n\n      o  o\n     ( -- )\n  \/\\( ,   ,)\/\\\n^^   ^^  ^^   ^^\n\nA simple CLI to generate nostr vanity addresses\n\nFrancisco Calder\u00f3n &lt;negrunch@grunch.dev&gt;\n\nUsage: rana [OPTIONS]\n\nOptions:\n  -d, --difficulty &lt;DIFFICULTY&gt;\n          Enter the number of starting bits that should be 0. [default: 0]\n  -v, --vanity &lt;VANITY_PREFIX&gt;\n          Enter the prefix your public key should have when expressed\n          as hexadecimal. [default: ]\n  -n, --vanity-n-prefix &lt;VANITY_NPUB_PREFIXES_RAW_INPUT&gt;\n          Enter the prefix your public key should have when expressed\n          in npub format (Bech32 encoding). Specify multiple vanity\n          targets as a comma-separated list. [default: ]\n  -s, --vanity-n-suffix &lt;VANITY_NPUB_SUFFIXES_RAW_INPUT&gt;\n          Enter the suffix your public key should have when expressed\n          in npub format (Bech32 encoding). Specify multiple vanity\n          targets as a comma-separated list. [default: ]\n  -c, --cores &lt;NUM_CORES&gt;\n          Number of processor cores to use [default: 4]\n  -r, --restore &lt;MNEMONIC&gt;\n          Restore from mnemonic to public private key [default: ]\n  -g, --generate &lt;WORD_COUNT&gt;\n          Generate mnemonic using wordcount. Should be 12,18 or 24 [default: 0]\n  -p, --passphrase &lt;MNEMONIC_PASSPHRASE&gt;\n          Passphrase used for restoring mnemonic to keypair [default: ]\n  -q, --qr\n          Print QR code of the private key\n  -h, --help\n          Print help\n  -V, --version\n          Print version<\/pre>\n<\/div>\n<\/div>\n<div class=\"quoteblock\">\n<blockquote>\n<div class=\"paragraph\">\n<p>why can\u2019t we use characters b, i, o, or 1?<br \/>\nthe characters have to be in the bech32 character set.<\/p>\n<\/div>\n<\/blockquote>\n<div class=\"attribution\">\n\u2014 nostrogen<br \/>\n<cite>https:\/\/github.com\/tonyinit\/nostrogen#why-cant-we-use-characters-b-i-o-or-1<\/cite><\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>\u516c\u958b\u9375\u306f Bech32 \u5f62\u5f0f\u3067 <code>023456789acdefghjklmnpqrstuvwxyz<\/code> \u304c\u5229\u7528\u3067\u304d\u307e\u3059\uff0e\u4ee5\u4e0b\u306f Bech32 \u3067\u4f7f\u3048\u306a\u3044 <code>o<\/code> \u3092\u4f7f\u3063\u3066\u6012\u3089\u308c\u305f\u4f8b\u3067\u3059\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>$ rana --vanity-n-prefix matok\nthread 'main' panicked at 'The vanity npub prefix can only contain characters supported by Bech32: 023456789acdefghjklmnpqrstuvwxyz', \/usr\/local\/cargo\/registry\/src\/github.com-1ecc6299db9ec823\/rana-0.5.1\/src\/cli.rs:146:17\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace<\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>o\u30920\u306b\u7f6e\u304d\u63db\u3048\u3066\u52d5\u304b\u3057\u3066\u307f\u307e\u3059\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>$ rana --vanity-n-prefix mat0k | tee rana.log\nStarted mining process for vanity bech32 prefix[es]: 'npub1[\"mat0k\"]' (estimated pow: 20)\nBenchmarking of cores disabled for vanity npub key upon proper calculation.\nMining using 4 cores...<\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>\u3055\u3066\uff0c\u3053\u308c\u3067\u5f85\u3063\u3066\u3044\u308c\u3070\u9375\u304c\u6398\u308c\u308b\u306e\u3067\u3059\u304c\uff0c\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u65b0\u3057\u3044\u30e9\u30c3\u30d7\u30c8\u30c3\u30d7\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u901f\u5ea6\u3067\u6398\u308c\u308b\u3068\u306e\u3053\u3068\u3067\u3059\uff0e\u3042\u307e\u308a\u9577\u304f\u3059\u308b\u3068\u306a\u304b\u306a\u304b\u6398\u308c\u306a\u3044\u306e\u3067\u6c17\u3092\u3064\u3051\u307e\u3057\u3087\u3046\uff0e<\/p>\n<\/div>\n<div class=\"quoteblock\">\n<blockquote>\n<div class=\"paragraph\">\n<p>how fast will nostrogen find my addresses?<br \/>\nthis depends entirely upon how fast your machine is, but here are some rough estimates for a modern laptop or mobile phone:<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>1 character = usually less than a 0.1 seconds<br \/>\n2 characters = usually less than a 1 second<br \/>\n3 characters = usually less than a 30 seconds<br \/>\n4 characters = usually less than a 10 minutes<br \/>\n5 characters = usually less than a 1 hour<br \/>\n6+ characters = keep fire extinguisher handy<\/p>\n<\/div>\n<\/blockquote>\n<div class=\"attribution\">\n\u2014 nostrogen<br \/>\n<cite>https:\/\/github.com\/tonyinit\/nostrogen#how-fast-will-nostrogen-find-my-addresses<\/cite><\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u7d50\u679c\u304c\u8868\u793a\u3055\u308c\u307e\u3059\uff0eNpub public key \u306e npub1\u306e\u5f8c\u308d\u304c\u6307\u5b9a\u3057\u305fmat0k\u304b\u3089\u59cb\u307e\u3063\u3066\u3044\u307e\u3059\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>$ rana --vanity-n-prefix mat0k | tee rana.log\nStarted mining process for vanity bech32 prefix[es]: 'npub1[\"mat0k\"]' (estimated pow: 20)\nBenchmarking of cores disabled for vanity npub key upon proper calculation.\nMining using 4 cores...\n&lt;&lt;&gt;&gt;&lt;&lt;&gt;&gt;&lt;&lt;&gt;&gt;&lt;&lt;&gt;&gt;&lt;&lt;&gt;&gt;&lt;&lt;&gt;&gt;&lt;&lt;&gt;&gt;&lt;&lt;&gt;&gt;&lt;&lt;&gt;&gt;&lt;&lt;&gt;&gt;&lt;&lt;&gt;&gt;&lt;&lt;&gt;&gt;&lt;&lt;&gt;&gt;&lt;&lt;&gt;&gt;&lt;&lt;&gt;&gt;&lt;&lt;&gt;&gt;&lt;&lt;&gt;&gt;&lt;&lt;&gt;&gt;&lt;&lt;&gt;&gt;&lt;&lt;&gt;&gt;\nVanity npub found:         mat0k\nFound matching Nostr public key:\nHex public key:   df56fb6cce5a60eac0a55b09ff6d5fbb565b07da6f64a2578ae827d70a21873b\nHex private key:  7a1a088022c3110fabc445af28681c0d2c349a2123f38fe83fbc809d7c8ed6bb\nNpub public key:  npub1mat0kmxwtfsw4s99tvyl7m2lhdt9kp76daj2y4u2aqnawz3psuass9qwnz\nNsec private key: nsec10gdq3qpzcvgsl27ygkhjs6qup5krfx3py0ecl6plhjqf6lyw66as4gyfat\n26169409 iterations (about 2x10^7 hashes) in 3199 seconds. Avg rate 8180 hashes\/second<\/pre>\n<\/div>\n<\/div>\n<div class=\"admonitionblock warning\">\n<table  class=\" table table-hover\" >\n<tbody>\n<tr>\n<td class=\"icon\">\n<div class=\"title\">Warning<\/div>\n<\/td>\n<td class=\"content\">\n\u516c\u958b\u3055\u308c\u3066\u3044\u308b\u3053\u306e\u9375\u306f\u5229\u7528\u3057\u306a\u3044\u3067\u304f\u3060\u3055\u3044<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div class=\"paragraph\">\n<p>\u624b\u5143\u306e\uff0cNotePC\u306e Intel\u00ae Core&#x2122; i5-7300U CPU @ 2.60GHz \u3068 Oeracle Free Tier VPS Arm Ampere A1 \u5171\u306b8000\u301c8200 hashes\/secod \u3068\u3044\u3046\u611f\u3058\u3067\u3057\u305f\uff0e<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>3\u65e5\u307b\u3069\u8d70\u3089\u305b\u3066 mak0 \u304b\u3089\u59cb\u307e\u308b\u3082\u306e\u305f\u304f\u3055\u3093\uff0cmat0ke \u304b\u3089\u59cb\u307e\u308b\u3082\u306e\u304c2\u3064\u51fa\u3066\u304d\u307e\u3057\u305f\uff0e cpu fan \u3046\u308b\u3055\u3044\u3057mat0ken \u306f\u8ae6\u3081\u3066\u3053\u306e\u8fba\u306b\u3057\u3068\u3053\u3046\u304b\u306a?<\/p>\n<\/div>\n<div class=\"quoteblock\">\n<blockquote>\n<div class=\"paragraph\">\n<p>Npub public key:  npub1mat0kejpylctwszs3h0jcaw24vsmzvx0h44hl2qf3ghuz2ggekjqkwyeq5<\/p>\n<\/div>\n<\/blockquote>\n<\/div>\n<div class=\"paragraph\">\n<p>\u305d\u3046\u3044\u3048\u3070\u4ee5\u524d\u306fTor \u306e Vanity address \u3082\u6398\u3063\u3066\u3044\u307e\u3057\u305f\u2026\u2026\uff0e<\/p>\n<\/div>\n<div class=\"ulist\">\n<ul>\n<li><a href=\"https:\/\/matoken.org\/blog\/2020\/06\/12\/calculate-the-address-to-use-in-tor-hidden-service-vanity-addresses\/\">tor\u306ehidden service\u3067\u4f7f\u3046\u30a2\u30c9\u30ec\u30b9\u3092\u8a08\u7b97\u3059\u308b(Vanity Addresses) \u2013 matoken\u2019s meme<\/a><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Nostr \u3068\u3044\u3046\u5206\u6563\u578bSNS\u306e\u30d7\u30ed\u30c8\u30b3\u30eb\u304c\u3042\u3063\u3066\u6700\u8fd1\u826f\u304f\u898b\u304b\u3051\u307e\u3059\uff0e Nostr, a simple protocol for decentralizing social media that has a chance [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"webmentions_disabled_pings":false,"webmentions_disabled":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[739,7,517,6,90,63],"tags":[766,767],"class_list":["post-3864","post","type-post","status-publish","format-standard","hentry","category-bookworm","category-debian-linux","category-focal-fossa20-04","category-linux","category-testing","category-ubuntu","tag-nostr","tag-vanity-adress"],"_links":{"self":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/3864","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/comments?post=3864"}],"version-history":[{"count":3,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/3864\/revisions"}],"predecessor-version":[{"id":3867,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/3864\/revisions\/3867"}],"wp:attachment":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/media?parent=3864"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/categories?post=3864"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/tags?post=3864"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}