```python

from nostr_protocol import Keys, Nip19Profile

# OR `from nostr_sdk import Keys, Nip19Profile`

keys = Keys.parse("") # nsec or hex

public_key = keys.public_key()

profile = Nip19Profile(public_key, relays=["wss://relay.damus.io"])

print(f"NIP-19: {profile.to_bech32()}")

print(f"NIP-21: {profile.to_nostr_uri()}")

```

You can learn more here (NIP-19 and NIP-21 sections): https://rust-nostr.org/

Reply to this note

Please Login to reply.

Discussion

No replies yet.