{"id":32,"date":"2026-03-21T22:47:14","date_gmt":"2026-03-21T14:47:14","guid":{"rendered":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/channels-nostr\/"},"modified":"2026-03-21T23:29:12","modified_gmt":"2026-03-21T15:29:12","slug":"channels-nostr","status":"publish","type":"post","link":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/channels-nostr\/","title":{"rendered":"Nostr"},"content":{"rendered":"<h1>Nostr<\/h1>\n<p><strong>\u72b6\u6001\uff1a<\/strong> \u53ef\u9009\u63d2\u4ef6\uff08\u9ed8\u8ba4\u7981\u7528\uff09\u3002<\/p>\n<p>Nostr \u662f\u4e00\u79cd\u7528\u4e8e\u793e\u4ea4\u7f51\u7edc\u7684\u53bb\u4e2d\u5fc3\u5316\u534f\u8bae\u3002\u6b64\u6e20\u9053\u4f7f OpenClaw \u80fd\u591f\u901a\u8fc7 NIP-04 \u63a5\u6536\u5e76\u56de\u590d\u52a0\u5bc6\u79c1\u4fe1\u3002<\/p>\n<h2>\u5b89\u88c5\uff08\u6309\u9700\uff09<\/h2>\n<h3>\u65b0\u624b\u5f15\u5bfc\uff08\u63a8\u8350\uff09<\/h3>\n<ul>\n<li>\u8bbe\u7f6e\u5411\u5bfc\uff08<code>openclaw onboard<\/code>\uff09\u548c <code>openclaw channels add<\/code> \u4f1a\u5217\u51fa\u53ef\u9009\u6e20\u9053\u63d2\u4ef6\u3002<\/li>\n<li>\u9009\u62e9 Nostr \u65f6\uff0c\u7cfb\u7edf\u4f1a\u63d0\u793a\u4f60\u6309\u9700\u5b89\u88c5\u8be5\u63d2\u4ef6\u3002<\/li>\n<\/ul>\n<p>\u5b89\u88c5\u9ed8\u8ba4\u884c\u4e3a\uff1a<\/p>\n<ul>\n<li><strong>Dev \u6e20\u9053 + \u53ef\u7528\u7684 git \u68c0\u51fa\uff1a<\/strong> \u4f7f\u7528\u672c\u5730\u63d2\u4ef6\u8def\u5f84\u3002<\/li>\n<li><strong>\u7a33\u5b9a\u7248 \/ Beta\uff1a<\/strong> \u4ece npm \u4e0b\u8f7d\u3002<\/li>\n<\/ul>\n<p>\u4f60\u59cb\u7ec8\u53ef\u4ee5\u5728\u63d0\u793a\u4e2d\u8986\u76d6\u8be5\u9009\u62e9\u3002<\/p>\n<h3>\u624b\u52a8\u5b89\u88c5<\/h3>\n<p>&#8220;`bash  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\nopenclaw plugins install @openclaw\/nostr<\/p>\n<pre><code>\n\u4f7f\u7528\u672c\u5730\u68c0\u51fa\uff08dev \u5de5\u4f5c\u6d41\uff09\uff1a\n\n```bash  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\nopenclaw plugins install --link &lt;path-to-openclaw&gt;\/extensions\/nostr\n<\/code><\/pre>\n<p>\u5b89\u88c5\u6216\u542f\u7528\u63d2\u4ef6\u540e\uff0c\u91cd\u542f Gateway \u7f51\u5173 \u7f51\u5173\u3002<\/p>\n<h3>\u975e\u4ea4\u4e92\u5f0f\u8bbe\u7f6e<\/h3>\n<p>&#8220;`bash  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\nopenclaw \u6e20\u9053s add &#8211;\u6e20\u9053 nostr &#8211;private-key &#8220;$NOSTR_PRIVATE_KEY&#8221;<br \/>\nopenclaw \u6e20\u9053s add &#8211;\u6e20\u9053 nostr &#8211;private-key &#8220;$NOSTR_PRIVATE_KEY&#8221; &#8211;relay-urls &#8220;wss:\/\/relay.damus.io,wss:\/\/relay.primal.net&#8221;<\/p>\n<pre><code>\n\u4f7f\u7528 `--use-env` \u53ef\u5c06 `NOSTR_PRIVATE_KEY` \u4fdd\u7559\u5728\u73af\u5883\u4e2d\uff0c\u800c\u4e0d\u662f\u5c06\u5bc6\u94a5\u5b58\u50a8\u5728\u914d\u7f6e\u91cc\u3002\n\n## \u5feb\u901f\u8bbe\u7f6e\n\n1. \u751f\u6210\u4e00\u4e2a Nostr \u5bc6\u94a5\u5bf9\uff08\u5982\u6709\u9700\u8981\uff09\uff1a\n\n```bash  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\n# Using nak\nnak key generate\n<\/code><\/pre>\n<ol start=\"2\">\n<li>\u6dfb\u52a0\u5230\u914d\u7f6e\u4e2d\uff1a<\/li>\n<\/ol>\n<p>&#8220;`json  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\n{<br \/>\n  &#8220;\u6e20\u9053s&#8221;: {<br \/>\n    &#8220;nostr&#8221;: {<br \/>\n      &#8220;privateKey&#8221;: &#8220;${NOSTR_PRIVATE_KEY}&#8221;<br \/>\n    }<br \/>\n  }<br \/>\n}<\/p>\n<pre><code>\n3. \u5bfc\u51fa\u5bc6\u94a5\uff1a\n\n```bash  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\nexport NOSTR_PRIVATE_KEY=&quot;nsec1...&quot;\n<\/code><\/pre>\n<ol start=\"4\">\n<li>\u91cd\u542f Gateway \u7f51\u5173 \u7f51\u5173\u3002<\/li>\n<\/ol>\n<h2>\u914d\u7f6e\u53c2\u8003<\/h2>\n<table>\n<thead>\n<tr>\n<th>\u952e<\/th>\n<th>\u7c7b\u578b<\/th>\n<th>\u9ed8\u8ba4\u503c<\/th>\n<th>\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>privateKey<\/code><\/td>\n<td>string<\/td>\n<td>\u5fc5\u586b<\/td>\n<td><code>nsec<\/code> \u6216\u5341\u516d\u8fdb\u5236\u683c\u5f0f\u7684\u79c1\u94a5<\/td>\n<\/tr>\n<tr>\n<td><code>relays<\/code><\/td>\n<td>string[]<\/td>\n<td><code>['wss:\/\/relay.damus.io', 'wss:\/\/nos.lol']<\/code><\/td>\n<td>\u4e2d\u7ee7 URL\uff08WebSocket\uff09<\/td>\n<\/tr>\n<tr>\n<td><code>dmPolicy<\/code><\/td>\n<td>string<\/td>\n<td><code>pairing<\/code><\/td>\n<td>\u79c1\u4fe1\u8bbf\u95ee\u7b56\u7565<\/td>\n<\/tr>\n<tr>\n<td><code>allowFrom<\/code><\/td>\n<td>string[]<\/td>\n<td><code>[]<\/code><\/td>\n<td>\u5141\u8bb8\u7684\u53d1\u9001\u65b9\u516c\u94a5<\/td>\n<\/tr>\n<tr>\n<td><code>enabled<\/code><\/td>\n<td>boolean<\/td>\n<td><code>true<\/code><\/td>\n<td>\u542f\u7528 \/ \u7981\u7528\u6e20\u9053<\/td>\n<\/tr>\n<tr>\n<td><code>name<\/code><\/td>\n<td>string<\/td>\n<td>&#8211;<\/td>\n<td>\u663e\u793a\u540d\u79f0<\/td>\n<\/tr>\n<tr>\n<td><code>profile<\/code><\/td>\n<td>object<\/td>\n<td>&#8211;<\/td>\n<td>NIP-01 \u8d44\u6599\u5143\u6570\u636e<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>\u8d44\u6599\u5143\u6570\u636e<\/h2>\n<p>\u8d44\u6599\u6570\u636e\u4f1a\u4f5c\u4e3a NIP-01 <code>kind:0<\/code> \u4e8b\u4ef6\u53d1\u5e03\u3002\u4f60\u53ef\u4ee5\u5728\u63a7\u5236 UI \u4e2d\u7ba1\u7406\u5b83\uff08Channels -&gt; Nostr -&gt; Profile\uff09\uff0c\u4e5f\u53ef\u4ee5\u76f4\u63a5\u5728\u914d\u7f6e\u4e2d\u8bbe\u7f6e\u3002<\/p>\n<p>\u793a\u4f8b\uff1a<\/p>\n<p>&#8220;`json  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\n{<br \/>\n  &#8220;\u6e20\u9053s&#8221;: {<br \/>\n    &#8220;nostr&#8221;: {<br \/>\n      &#8220;privateKey&#8221;: &#8220;${NOSTR_PRIVATE_KEY}&#8221;,<br \/>\n      &#8220;profile&#8221;: {<br \/>\n        &#8220;name&#8221;: &#8220;openclaw&#8221;,<br \/>\n        &#8220;displayName&#8221;: &#8220;OpenClaw&#8221;,<br \/>\n        &#8220;about&#8221;: &#8220;Personal assistant DM bot&#8221;,<br \/>\n        &#8220;picture&#8221;: &#8220;https:\/\/example.com\/avatar.png&#8221;,<br \/>\n        &#8220;banner&#8221;: &#8220;https:\/\/example.com\/banner.png&#8221;,<br \/>\n        &#8220;website&#8221;: &#8220;https:\/\/example.com&#8221;,<br \/>\n        &#8220;nip05&#8221;: &#8220;openclaw@example.com&#8221;,<br \/>\n        &#8220;lud16&#8221;: &#8220;openclaw@example.com&#8221;<br \/>\n      }<br \/>\n    }<br \/>\n  }<br \/>\n}<\/p>\n<pre><code>\n\u6ce8\u610f\uff1a\n\n* \u8d44\u6599 URL \u5fc5\u987b\u4f7f\u7528 `https:\/\/`\u3002\n* \u4ece\u4e2d\u7ee7\u5bfc\u5165\u65f6\u4f1a\u5408\u5e76\u5b57\u6bb5\uff0c\u5e76\u4fdd\u7559\u672c\u5730\u8986\u76d6\u9879\u3002\n\n## \u8bbf\u95ee\u63a7\u5236\n\n### \u79c1\u4fe1\u7b56\u7565\n\n* **pairing**\uff08\u9ed8\u8ba4\uff09\uff1a\u672a\u77e5\u53d1\u9001\u65b9\u4f1a\u6536\u5230\u4e00\u4e2a\u914d\u5bf9\u7801\u3002\n* **allowlist**\uff1a\u53ea\u6709 `allowFrom` \u4e2d\u7684\u516c\u94a5\u53ef\u4ee5\u53d1\u9001\u79c1\u4fe1\u3002\n* **open**\uff1a\u516c\u5f00\u63a5\u6536\u5165\u7ad9\u79c1\u4fe1\uff08\u8981\u6c42 `allowFrom: [&quot;*&quot;]`\uff09\u3002\n* **disabled**\uff1a\u5ffd\u7565\u5165\u7ad9\u79c1\u4fe1\u3002\n\n### \u5141\u8bb8\u5217\u8868\u793a\u4f8b\n\n```json  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\n{\n  &quot;channels&quot;: {\n    &quot;nostr&quot;: {\n      &quot;privateKey&quot;: &quot;${NOSTR_PRIVATE_KEY}&quot;,\n      &quot;dmPolicy&quot;: &quot;allowlist&quot;,\n      &quot;allowFrom&quot;: [&quot;npub1abc...&quot;, &quot;npub1xyz...&quot;]\n    }\n  }\n}\n<\/code><\/pre>\n<h2>\u5bc6\u94a5\u683c\u5f0f<\/h2>\n<p>\u63a5\u53d7\u7684\u683c\u5f0f\uff1a<\/p>\n<ul>\n<li><strong>\u79c1\u94a5\uff1a<\/strong> <code>nsec...<\/code> \u6216 64 \u5b57\u7b26\u5341\u516d\u8fdb\u5236<\/li>\n<li><strong>\u516c\u94a5\uff08<code>allowFrom<\/code>\uff09\uff1a<\/strong> <code>npub...<\/code> \u6216\u5341\u516d\u8fdb\u5236<\/li>\n<\/ul>\n<h2>\u4e2d\u7ee7<\/h2>\n<p>\u9ed8\u8ba4\u503c\uff1a<code>relay.damus.io<\/code> \u548c <code>nos.lol<\/code>\u3002<\/p>\n<p>&#8220;`json  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\n{<br \/>\n  &#8220;\u6e20\u9053s&#8221;: {<br \/>\n    &#8220;nostr&#8221;: {<br \/>\n      &#8220;privateKey&#8221;: &#8220;${NOSTR_PRIVATE_KEY}&#8221;,<br \/>\n      &#8220;relays&#8221;: [&#8220;wss:\/\/relay.damus.io&#8221;, &#8220;wss:\/\/relay.primal.net&#8221;, &#8220;wss:\/\/nostr.wine&#8221;]<br \/>\n    }<br \/>\n  }<br \/>\n}<\/p>\n<pre><code>\n\u63d0\u793a\uff1a\n\n* \u4f7f\u7528 2 \u5230 3 \u4e2a\u4e2d\u7ee7\u4ee5\u5b9e\u73b0\u5197\u4f59\u3002\n* \u907f\u514d\u4f7f\u7528\u8fc7\u591a\u4e2d\u7ee7\uff08\u5ef6\u8fdf\u3001\u91cd\u590d\uff09\u3002\n* \u4ed8\u8d39\u4e2d\u7ee7\u53ef\u4ee5\u63d0\u9ad8\u53ef\u9760\u6027\u3002\n* \u672c\u5730\u4e2d\u7ee7\u4e5f\u9002\u5408\u6d4b\u8bd5\uff08`ws:\/\/localhost:7777`\uff09\u3002\n\n## \u534f\u8bae\u652f\u6301\n\n| NIP    | \u72b6\u6001  | \u8bf4\u660e              |\n| ------ | --- | --------------- |\n| NIP-01 | \u5df2\u652f\u6301 | \u57fa\u7840\u4e8b\u4ef6\u683c\u5f0f + \u8d44\u6599\u5143\u6570\u636e  |\n| NIP-04 | \u5df2\u652f\u6301 | \u52a0\u5bc6\u79c1\u4fe1\uff08`kind:4`\uff09  |\n| NIP-17 | \u8ba1\u5212\u4e2d | Gift-wrapped \u79c1\u4fe1 |\n| NIP-44 | \u8ba1\u5212\u4e2d | \u7248\u672c\u5316\u52a0\u5bc6           |\n\n## \u6d4b\u8bd5\n\n### \u672c\u5730\u4e2d\u7ee7\n\n```bash  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\n# Start strfry\ndocker run -p 7777:7777 ghcr.io\/hoytech\/strfry\n<\/code><\/pre>\n<p><code>json  theme={\"theme\":{\"light\":\"min-light\",\"dark\":\"min-dark\"}}<br \/>\n{<br \/>\n  \"channels\": {<br \/>\n    \"nostr\": {<br \/>\n      \"privateKey\": \"${NOSTR_PRIVATE_KEY}\",<br \/>\n      \"relays\": [\"ws:\/\/localhost:7777\"]<br \/>\n    }<br \/>\n  }<br \/>\n}<\/code><\/p>\n<h3>\u624b\u52a8\u6d4b\u8bd5<\/h3>\n<ol>\n<li>\u4ece\u65e5\u5fd7\u4e2d\u8bb0\u4e0b\u673a\u5668\u4eba\u516c\u94a5\uff08npub\uff09\u3002<\/li>\n<li>\u6253\u5f00\u4e00\u4e2a Nostr \u5ba2\u6237\u7aef\uff08Damus\u3001Amethyst \u7b49\uff09\u3002<\/li>\n<li>\u5411\u8be5\u673a\u5668\u4eba\u516c\u94a5\u53d1\u9001\u79c1\u4fe1\u3002<\/li>\n<li>\u9a8c\u8bc1\u56de\u590d\u3002<\/li>\n<\/ol>\n<h2>\u6545\u969c\u6392\u9664<\/h2>\n<h3>\u672a\u63a5\u6536\u5230\u6d88\u606f<\/h3>\n<ul>\n<li>\u9a8c\u8bc1\u79c1\u94a5\u6709\u6548\u3002<\/li>\n<li>\u8bf7\u786e\u4fdd\u4e2d\u7ee7 URL \u53ef\u8bbf\u95ee\uff0c\u5e76\u4f7f\u7528 <code>wss:\/\/<\/code>\uff08\u672c\u5730\u5219\u4f7f\u7528 <code>ws:\/\/<\/code>\uff09\u3002<\/li>\n<li>\u786e\u8ba4 <code>enabled<\/code> \u4e0d\u662f <code>false<\/code>\u3002<\/li>\n<li>\u68c0\u67e5 Gateway \u7f51\u5173 \u7f51\u5173\u65e5\u5fd7\u4e2d\u7684\u4e2d\u7ee7\u8fde\u63a5\u9519\u8bef\u3002<\/li>\n<\/ul>\n<h3>\u672a\u53d1\u9001\u56de\u590d<\/h3>\n<ul>\n<li>\u68c0\u67e5\u4e2d\u7ee7\u662f\u5426\u63a5\u53d7\u5199\u5165\u3002<\/li>\n<li>\u9a8c\u8bc1\u51fa\u7ad9\u8fde\u63a5\u6027\u3002<\/li>\n<li>\u6ce8\u610f\u4e2d\u7ee7\u901f\u7387\u9650\u5236\u3002<\/li>\n<\/ul>\n<h3>\u91cd\u590d\u56de\u590d<\/h3>\n<ul>\n<li>\u4f7f\u7528\u591a\u4e2a\u4e2d\u7ee7\u65f6\u8fd9\u662f\u9884\u671f\u884c\u4e3a\u3002<\/li>\n<li>\u6d88\u606f\u4f1a\u6309\u4e8b\u4ef6 ID \u53bb\u91cd\uff1b\u53ea\u6709\u9996\u6b21\u6295\u9012\u4f1a\u89e6\u53d1\u56de\u590d\u3002<\/li>\n<\/ul>\n<h2>\u5b89\u5168\u6027<\/h2>\n<ul>\n<li>\u5207\u52ff\u63d0\u4ea4\u79c1\u94a5\u3002<\/li>\n<li>\u5bf9\u5bc6\u94a5\u4f7f\u7528\u73af\u5883\u53d8\u91cf\u3002<\/li>\n<li>\u5bf9\u751f\u4ea7\u673a\u5668\u4eba\u8003\u8651\u4f7f\u7528 <code>allowlist<\/code>\u3002<\/li>\n<\/ul>\n<h2>\u9650\u5236\uff08MVP\uff09<\/h2>\n<ul>\n<li>\u4ec5\u652f\u6301\u79c1\u4fe1\uff08\u4e0d\u652f\u6301\u7fa4\u804a\uff09\u3002<\/li>\n<li>\u4e0d\u652f\u6301\u5a92\u4f53\u9644\u4ef6\u3002<\/li>\n<li>\u4ec5\u652f\u6301 NIP-04\uff08\u8ba1\u5212\u652f\u6301 NIP-17 gift-wrap\uff09\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Nostr \u72b6\u6001\uff1a \u53ef\u9009\u63d2\u4ef6\uff08\u9ed8\u8ba4\u7981\u7528\uff09\u3002 Nostr \u662f\u4e00\u79cd\u7528\u4e8e\u793e\u4ea4\u7f51\u7edc\u7684\u53bb\u4e2d\u5fc3\u5316\u534f\u8bae\u3002\u6b64\u6e20\u9053\u4f7f OpenC [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-32","post","type-post","status-publish","format-standard","hentry","category-docs"],"_links":{"self":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/32","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/comments?post=32"}],"version-history":[{"count":2,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/32\/revisions"}],"predecessor-version":[{"id":850,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/32\/revisions\/850"}],"wp:attachment":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/media?parent=32"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/categories?post=32"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/tags?post=32"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}