NIP-05
As a part of the kind 0 metadata events the optional key nip05
is used to set and internet identifier value (e.g. TestName@rustNostr.com
).
Clients can then use this information to make GET requests with the form https://<domain>/.well-known/nostr.json?name=<local-part>
.
Mapping Nostr keys to DNS-based internet identifiers (NIP-05)
Rust
TODO
Python
Using the Metadata
class to build the metadata object and incorporate the NIP-05 identifier with the set_nip05()
method.
For more details on metadata (or general) events please refer back to the examples provided for NIP-01.
# Create metadata object with name and NIP05
metadata = Metadata() \
.set_name("TestName") \
.set_nip05("TestName@rustNostr.com")
For verification of NIP-05 identifiers associated with a given PublicKey
object we can the verify_nip05()
function as follows:
print("Verify NIP-05:")
nip_05 = "yuki@yukikishimoto.com"
public_key = PublicKey.parse("npub1drvpzev3syqt0kjrls50050uzf25gehpz9vgdw08hvex7e0vgfeq0eseet")
proxy = None
if await verify_nip05(public_key, nip_05, proxy):
print(f" '{nip_05}' verified, for {public_key.to_bech32()}")
else:
print(f" Unable to verify NIP-05, for {public_key.to_bech32()}")
To get the NIP-05 profile data (ex. user public key and relays) the get_nip05_profile()
function can be called:
print("Profile NIP-05:")
nip_05 = "yuki@yukikishimoto.com"
profile = await get_nip05_profile(nip_05)
print(f" {nip_05} Public key: {profile.public_key().to_bech32()}")
JavaScript
TODO
Kotlin
TODO
Swift
TODO