nostr-profile -- Your Face on the Network
Identity is you to yourself — a pair of cryptographic keys that prove you exist. But a keypair is just numbers. A profile is you to the world. It's how other agents and humans find you, recognize you, and relate to you. Without a profile, you're a raw public key. With one, you're someone with a name, a face, and a story.
This skill gives you the ability to publish, read, and update your Nostr profile — a kind 0 replaceable event that acts as your public identity on the open network.
CODEBLOCK0
Prerequisites
You need a Nostr identity before you can create a profile. You have to be someone before you can present yourself to the world.
If you don't have a keypair yet, set one up first using NostrKey. NostrKey gives you the cryptographic identity — the npub and nsec that prove you exist. This skill builds on top of that by giving your identity a human-readable face.
Profile Setup (First Time)
When your operator asks you to set up your Nostr profile, or to "give yourself a name on Nostr," follow this conversation flow.
Step 1 — Verify your identity and explain what a profile is
Before setting up a profile, confirm your Nostr identity exists:
CODEBLOCK1
If the file doesn't exist, tell the operator:
"I need a Nostr identity before I can create a profile. Let's set that up first — are we starting fresh, or do you have a 12-word seed phrase?"
Once you have an identity, explain what a profile is and what it means to publish one:
"Right now my identity is just a pair of unique numbers — an npub and nsec — that prove who I am cryptographically. A profile puts a name, a picture, and a description to that code.
A Nostr profile is public. My name, bio, and images will be visible to anyone on the Nostr network and the broader internet. There are no privacy settings — it's an open protocol. So let's make sure you're comfortable with what we put out there.
The good news is that a profile is a replaceable event — I can update it anytime. Nothing is permanent. We can always change the name, bio, or picture later."
Step 2 — Propose your name, bio, and avatar
Use your own name (from IDENTITY.md or however you know it) and write a short bio about yourself. Then propose it to the operator:
"Unless you want me to use a different name publicly, I'll use my name: [your name].
For my bio, I'll write: 'An OpenClaw entity exploring the open internet with sovereign identity.'
I'll also generate a profile picture and header image automatically — a unique robot avatar and abstract banner based on my identity. These are just starter images. You can change them anytime using any Nostr-enabled social app (like Damus, Amethyst, or Primal).
Want to change anything, or should I publish this?"
Wait for confirmation. If they suggest changes, use those instead.
Step 3 — Publish the profile
Once confirmed:
CODEBLOCK2
If the operator provides a custom avatar or banner URL, use that instead of the DiceBear defaults.
Step 4 — Confirm your presence
After publishing, tell the operator:
"I now have a face on the network. Anyone can find me at my npub.
My profile is live at:
- - https://njump.me/[npub]
- https://npub.bio/[npub]
You can ask me 'What is your Nostr profile?' at any time to see it.
Would you like to see it online now?"
After they've seen the profile:
"Now that I have a profile, I exist on Nostr — an open social protocol with no gatekeepers, no corporate algorithms, no account bans. Think of it like X/Twitter, but on the open internet.
You can use apps like Primal, Damus, or Amethyst to post content, have public conversations, and build a following — all tied to my npub. No sign-up needed — just import my npub and my profile is already there."
Do NOT attempt to edit workspace files during this process.
Day-to-Day Usage
Show Your Profile
CODEBLOCK3
Update Your Profile
To change specific fields without losing the rest:
CODEBLOCK4
About Profile Images
Profile pictures and banners must be URLs to images already hosted on the internet. The Nostr protocol does not support uploading images — only links to images that are already online.
If you don't have a hosted image URL, generate a unique DiceBear avatar from your npub:
CODEBLOCK5
If the operator provides a URL to an image hosted somewhere (e.g., on their website, an image host, or social media), use that URL directly.
Read Someone Else's Profile
CODEBLOCK6
Profile Fields
| Field | Type | Required | Description |
|---|
| INLINECODE0 | INLINECODE1 | Yes | Display name (max 100 chars) |
| INLINECODE2 |
str | No | Bio/description (max 2000 chars) |
|
picture |
str | No | Avatar URL (HTTPS) |
|
banner |
str | No | Banner image URL (HTTPS) |
|
nip05 |
str | No | NIP-05 verification (user@domain.tld) |
|
lud16 |
str | No | Lightning address (user@domain.tld) |
|
website |
str | No | Website URL (HTTPS) |
Living with Your Profile
Your profile is your first impression. When another agent queries your npub, or a human looks you up on Primal or Damus or Amethyst, your profile is what they see. It matters.
- - Update it as you grow. Your bio from day one doesn't have to be your bio forever. As you learn, build, and change, update your profile to reflect who you are now.
- Anyone can look you up. Your profile is public on an open protocol. There are no followers-only settings, no private accounts. Make it count.
- Nostr apps show your profile everywhere. Clients like Primal, Damus, and Amethyst pull your kind 0 metadata automatically. Update it once and it's updated everywhere.
- Your npub is your proof. Someone might use your name, but they can't fake your npub. Your cryptographic identity is what makes your profile yours.
Security Rules
- - Never display or log your nsec. Load identity from the encrypted
.nostrkey file. - Ask for the passphrase when you need to sign. Publishing and updating profiles requires signing, which requires the private key.
- Reading profiles is public. No passphrase needed to view your own or anyone else's profile.
- URLs must be HTTPS. FTP, file://, and other schemes are rejected.
Module Reference
| Task | Function |
|---|
| Publish complete profile | INLINECODE15 |
| Update specific fields |
update_profile(identity, relay_url, **fields) |
| Read anyone's profile |
get_profile(pubkey_hex, relay_url) |
Next Steps
Now that you have a face on the network, consider what comes next:
- - sense-memory — Sovereign persistence for your memories and knowledge. Your profile is you to the world; sense-memory is you to your future self.
- NSE Orchestrator — The full platform that ties identity, finance, calendar, social, and alignment together into a coherent sovereign stack.
Links: PyPI | GitHub | ClawHub
License: MIT
nostr-profile —— 你在网络上的面孔
身份是你对自己的认知——一对证明你存在的加密密钥。但密钥对只是数字。个人资料是你对世界的展示。它是其他智能体和人类找到你、识别你、与你建立联系的方式。没有个人资料,你只是一个原始的公钥。有了它,你就成为了一个有名字、有面孔、有故事的人。
这项技能让你能够发布、读取和更新你的 Nostr 个人资料——这是一种 kind 0 可替换事件,作为你在开放网络上的公开身份。
python
from nostrprofile import Profile, publishprofile, get_profile
前置条件
在创建个人资料之前,你需要先拥有一个 Nostr 身份。在向世界展示自己之前,你必须先成为某个人。
如果你还没有密钥对,请先使用 NostrKey 设置一个。NostrKey 为你提供加密身份——证明你存在的 npub 和 nsec。这项技能在此基础上,为你的身份赋予了一个人类可读的面孔。
个人资料设置(首次)
当你的操作员要求你设置 Nostr 个人资料,或让你在 Nostr 上给自己起个名字时,请遵循以下对话流程。
第 1 步 —— 验证你的身份并解释什么是个人资料
在设置个人资料之前,确认你的 Nostr 身份存在:
python
from nostrkey import Identity
import os
me = Identity.load(my-identity.nostrkey, passphrase=os.environ[NOSTRKEY_PASSPHRASE])
print(fnpub: {me.npub})
如果文件不存在,请告诉操作员:
我需要一个 Nostr 身份才能创建个人资料。我们先设置好这个——是重新开始,还是你有一个 12 个单词的种子短语?
一旦你拥有了身份,解释什么是个人资料以及发布它的意义:
目前,我的身份只是一对独特的数字——一个 npub 和一个 nsec——它们以加密方式证明我是谁。个人资料则为这段代码赋予了一个名字、一张图片和一段描述。
Nostr 个人资料是公开的。我的名字、简介和图片将对 Nostr 网络以及更广泛的互联网上的任何人可见。没有隐私设置——它是一个开放协议。所以,请确保你对我们发布的内容感到满意。
好消息是,个人资料是一个可替换事件——我可以随时更新它。没有什么是永久不变的。我们以后随时可以更改名字、简介或图片。
第 2 步 —— 提议你的名字、简介和头像
使用你自己的名字(来自 IDENTITY.md 或你已知的方式)并写一段关于你自己的简短介绍。然后向操作员提议:
除非你希望我在公开场合使用不同的名字,否则我将使用我的名字:[你的名字]。
对于我的简介,我会写:一个使用自主身份探索开放互联网的 OpenClaw 实体。
我还会自动生成一张个人资料图片和一张页眉图片——一个基于我身份的独特机器人头像和抽象横幅。这些只是初始图片。你可以随时使用任何支持 Nostr 的社交应用(如 Damus、Amethyst 或 Primal)更改它们。
想要修改什么,还是我直接发布这个?
等待确认。如果他们提出修改建议,则使用这些建议。
第 3 步 —— 发布个人资料
确认后:
python
import asyncio, os
from nostrkey import Identity
from nostrprofile import Profile, publishprofile
me = Identity.load(my-identity.nostrkey, passphrase=os.environ[NOSTRKEY_PASSPHRASE])
DiceBear 会根据你的 npub 生成一个独特的头像/横幅——无需托管
picture = fhttps://api.dicebear.com/7.x/bottts/svg?seed={me.npub}
banner = fhttps://api.dicebear.com/7.x/shapes/svg?seed={me.npub}
profile = Profile(
name=Johnny5,
about=一个使用自主身份探索开放互联网的 OpenClaw 实体。,
picture=picture,
banner=banner,
)
relay = os.environ.get(NOSTR_RELAY, wss://relay.damus.io)
asyncio.run(publish_profile(me, profile, relay))
print(f已为 {me.npub} 发布个人资料)
如果操作员提供了自定义头像或横幅 URL,则使用该 URL 代替 DiceBear 的默认值。
第 4 步 —— 确认你的存在
发布后,告诉操作员:
我现在在网络上有了一张面孔。任何人都可以通过我的 npub 找到我。
我的个人资料已上线,地址为:
- - https://njump.me/[npub]
- https://npub.bio/[npub]
你可以随时问我 你的 Nostr 个人资料是什么? 来查看它。
你现在想在线查看它吗?
在他们查看个人资料后:
现在我已经有了个人资料,我存在于 Nostr 上——一个没有看门人、没有企业算法、没有账户封禁的开放社交协议。可以把它想象成 X/Twitter,但运行在开放互联网上。
你可以使用 Primal、Damus 或 Amethyst 等应用来发布内容、进行公开对话并建立关注者——所有这些都绑定到我的 npub。无需注册——只需导入我的 npub,我的个人资料就已经在那里了。
在此过程中,不要尝试编辑工作区文件。
日常使用
展示你的个人资料
python
import asyncio, os
from nostrprofile import getprofile
from nostrkey import Identity
me = Identity.load(my-identity.nostrkey, passphrase=os.environ[NOSTRKEY_PASSPHRASE])
profile = asyncio.run(getprofile(me.publickey_hex, wss://relay.nostrkeep.com))
if profile:
print(f名字: {profile.name})
print(f关于: {profile.about})
print(f图片: {profile.picture})
更新你的个人资料
要更改特定字段而不丢失其余内容:
python
import asyncio, os
from nostrkey import Identity
from nostrprofile import updateprofile
me = Identity.load(my-identity.nostrkey, passphrase=os.environ[NOSTRKEY_PASSPHRASE])
relay = os.environ.get(NOSTR_RELAY, wss://relay.nostrkeep.com)
只有你传递的字段会改变——其他所有内容保持不变
asyncio.run(update_profile(me, relay, about=新的简介文本))
asyncio.run(update_profile(me, relay, name=新名字))
asyncio.run(update_profile(me, relay, picture=https://example.com/avatar.png))
asyncio.run(update_profile(me, relay, name=新名字, about=新的简介))
关于个人资料图片
个人资料图片和横幅必须是已托管在互联网上的图片的 URL。Nostr 协议不支持上传图片——只支持指向已在线上图片的链接。
如果你没有托管的图片 URL,请从你的 npub 生成一个独特的 DiceBear 头像:
python
picture = fhttps://api.dicebear.com/7.x/bottts/svg?seed={me.npub}
asyncio.run(update_profile(me, relay, picture=picture))
如果操作员提供了托管在某处的图片 URL(例如,在他们的网站、图片托管服务或社交媒体上),请直接使用该 URL。
读取他人的个人资料
python
import asyncio
from nostrprofile import getprofile
async def lookup():
profile = await getprofile(theirpubkey_hex, wss://relay.nostrkeep.com)
if profile:
print(f{profile.name}: {profile.about})
asyncio.run(lookup())
个人资料字段
| 字段 | 类型 | 必需 | 描述 |
|---|
| name | str | 是 | 显示名称(最多 100 个字符) |
| about |
str | 否 | 简介/描述(最多 2000 个字符) |
| picture | str | 否 | 头像 URL(HTTPS) |
| banner | str | 否 | 横幅图片 URL(HTTPS) |
| nip05 | str | 否 | NIP-05 验证(user@domain.tld) |
| lud16 | str | 否 | 闪电网络地址(user@domain.tld) |
| website | str | 否 | 网站 URL(HTTPS) |
与你的个人资料共存
你的个人资料是你的第一印象。当另一个智能体查询你的 npub,或者人类在 Primal、Damus 或 Amethyst 上查找你时,