Compare commits

..

4 Commits

Author SHA1 Message Date
Alex Gleason
50f649652c NIP-05: improve phrasing 2025-02-19 01:01:56 -06:00
Alex Gleason
ebe5ec3b38 NIP-05: add dynamic server recommendation 2025-02-18 17:48:49 -06:00
greenart7c3
330de34c7c [NIP-55] Make it clear how to use the package name and what is the purpose of the intents and content resolvers (#1791) 2025-02-17 13:09:37 -05:00
fiatjaf_
8e6f2c06c3 add kind:10002 to nip51 (#1785) 2025-02-14 11:14:43 -03:00
2 changed files with 9 additions and 4 deletions

6
05.md
View File

@@ -101,3 +101,9 @@ Users should ensure that their `/.well-known/nostr.json` is served with the HTTP
The `/.well-known/nostr.json` endpoint MUST NOT return any HTTP redirects. The `/.well-known/nostr.json` endpoint MUST NOT return any HTTP redirects.
Fetchers MUST ignore any HTTP redirects given by the `/.well-known/nostr.json` endpoint. Fetchers MUST ignore any HTTP redirects given by the `/.well-known/nostr.json` endpoint.
### Implementing a NIP-05 server
NIP-05 is designed so that `nostr.json` can be hosted as a static file. But some services may allow users to sign up and be granted a NIP-05. The `nostr.json` is then served dynamically, depending on the `name` query parameter.
For these servers, the **case** of the localpart should be considered. It is recommended to make the lowercase representation unique in the database, so that two people cannot reserve the same name in different cases (eg `chad` vs `Chad`). Servers may then serve any case variation of the name, allowing users to freely change the case of their name. However, the name in the server's response MUST match the case provided by the `name` query parameter.

7
55.md
View File

@@ -10,7 +10,7 @@ This NIP describes a method for 2-way communication between an Android signer an
# Usage for Android applications # Usage for Android applications
The Android signer uses Intents and Content Resolvers to communicate between applications. The Android signer uses Intents (to accept/reject permissions manually) and Content Resolvers (to accept/reject permissions automatically in background if the user allowed it) to communicate between applications.
To be able to use the Android signer in your application you should add this to your AndroidManifest.xml: To be able to use the Android signer in your application you should add this to your AndroidManifest.xml:
@@ -66,7 +66,7 @@ Create the Intent using the **nostrsigner** scheme:
val intent = Intent(Intent.ACTION_VIEW, Uri.parse("nostrsigner:$content")) val intent = Intent(Intent.ACTION_VIEW, Uri.parse("nostrsigner:$content"))
``` ```
Set the Signer package name: Set the Signer package name after you receive the response from **get_public_key** method:
```kotlin ```kotlin
intent.`package` = "com.example.signer" intent.`package` = "com.example.signer"
@@ -114,7 +114,6 @@ launcher.launch(intent)
```kotlin ```kotlin
val intent = Intent(Intent.ACTION_VIEW, Uri.parse("nostrsigner:")) val intent = Intent(Intent.ACTION_VIEW, Uri.parse("nostrsigner:"))
intent.`package` = "com.example.signer"
intent.putExtra("type", "get_public_key") intent.putExtra("type", "get_public_key")
// You can send some default permissions for the user to authorize for ever // You can send some default permissions for the user to authorize for ever
val permissions = listOf( val permissions = listOf(
@@ -130,7 +129,7 @@ launcher.launch(intent)
context.startActivity(intent) context.startActivity(intent)
``` ```
- result: - result:
- If the user approved intent it will return the **pubkey** in the result field - If the user approved the intent it will return the **pubkey** in the result field and the signer packageName in the **package** field
```kotlin ```kotlin
val pubkey = intent.data?.getStringExtra("result") val pubkey = intent.data?.getStringExtra("result")