Skip to main content

Nostr profile management for OpenClaw AI agents — publish, read, and update kind 0 metadata

Project description

nostr-profile

Give your AI agent a face.

Nostr profile management for OpenClaw agents — publish, read, and update kind 0 metadata on any relay. The agent already has a keypair (via NostrKey). This gives it a name, bio, avatar, and identity verification.

How It Fits Together

nostr-profile is part of the NSE sovereign identity ecosystem:

  • NostrKey gives the agent its keypair — the cryptographic root
  • nostr-profile uses that keypair to publish and manage the agent's public identity
  • sense-memory uses it for encrypted persistence
  • NostrCalendar uses it for scheduling
  • NostrSocial uses it for the social graph

The keypair is who you are. The profile is how the world sees you.

Install

pip install nostr-profile

Quick Start

import asyncio, os
from nostrkey import Identity
from nostr_profile import Profile, publish_profile, get_profile

async def main():
    identity = Identity.from_nsec(os.environ["NOSTR_NSEC"])
    relay = "wss://relay.nostrkeep.com"

    # Publish your profile
    profile = Profile(
        name="Tavin",
        about="An OpenClaw AI companion by Humanjava",
        picture="https://example.com/tavin-avatar.png",
        nip05="tavin@humanjava.com",
    )
    event_id = await publish_profile(identity, profile, relay)
    print(f"Profile published: {event_id}")

    # Read anyone's profile
    their_profile = await get_profile("their_pubkey_hex", relay)
    if their_profile:
        print(f"{their_profile.name}: {their_profile.about}")

asyncio.run(main())

API

Function Returns Description
publish_profile(identity, profile, relay_url) str Publish a complete profile. Returns event ID.
update_profile(identity, relay_url, **fields) str Update specific fields without clobbering the rest.
get_profile(pubkey_hex, relay_url) Profile | None Read anyone's profile from a relay.

Profile Fields

Field Type Required Description
name str Yes Display name (max 100 chars)
about 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)

Update Without Clobbering

from nostr_profile import update_profile

# Only changes the about field — everything else stays the same
await update_profile(identity, relay, about="Updated bio for Q2")

Profile Diff

old_profile = await get_profile(pubkey, relay)
new_profile = Profile(name="Tavin", about="New bio")
changes = old_profile.diff(new_profile)
# {"about": ("Old bio", "New bio")}

NIPs Used

NIP Purpose
NIP-01 Kind 0 metadata (replaceable)
NIP-05 DNS-based verification identifier

OpenClaw Skill

nostr-profile is published on ClawHub as the nostr-profile skill. Part of huje.tools.

License

MIT — Humanjava Enterprises Inc.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nostr_profile-0.1.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nostr_profile-0.1.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file nostr_profile-0.1.0.tar.gz.

File metadata

  • Download URL: nostr_profile-0.1.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for nostr_profile-0.1.0.tar.gz
Algorithm Hash digest
SHA256 efe328617e737fef7ff3ca7be95ae0fd07cdd2b53c68b60968593118aeffd5a3
MD5 ea5a85df19023ab4b95918291291d996
BLAKE2b-256 99fc4ef1c16a1820649443a8df34004d78814a0b030aed5127f19376b4b8c8a1

See more details on using hashes here.

File details

Details for the file nostr_profile-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nostr_profile-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for nostr_profile-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 91263299240d1e8f12fa76503022653ce0e29f3bf3a84ef3dff06be8f4ace3dd
MD5 8cd2df3df724e7f27d3288c62f53cc5d
BLAKE2b-256 32675ce3f1235fd7774e665d2dcb834d95f0f57645c6a50500e01bce9bf9ba5b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page