lnbits / nostrrelay

One click nostr relay
MIT License
35 stars 7 forks source link

Add support for nip-01 subscription to key prefixes of arbitrary length #15

Closed BrunswickBTC closed 1 year ago

BrunswickBTC commented 1 year ago

Add support for pubkey prefixes (truncated key) in subscription requests.

motorina0 commented 1 year ago

Add support for pubkey prefixes (truncated key) in subscription requests.

@BrunswickBTC can you please provide here some examples of "pubkey prefixes (truncated key)"

BrunswickBTC commented 1 year ago

@motorina0 I don't understand your request. Can you be more specific?

motorina0 commented 1 year ago

@motorina0 I don't understand your request. Can you be more specific?

Yes:

Add support for pubkey prefixes (truncated key)

  • I do not know what these (pubkey prefixes) are, can you please provide some examples
  • in what NIP are they defined?
BrunswickBTC commented 1 year ago

It is defined in NIP-01. Pubkey is the same as npub. What kind of detail are you looking for?

motorina0 commented 1 year ago

It is defined in NIP-01. Pubkey is the same as npub. What kind of detail are you looking for?

This is nip-01: https://github.com/nostr-protocol/nips/blob/master/01.md Please paste here what part of this spec the PR solves/fixes.

BrunswickBTC commented 1 year ago

Since I submitted this PR they changed the spec.

https://github.com/nostr-protocol/nips/commit/72bb8a128b2d7d3c2c654644cd68d0d0fe58a3b1?diff=split#diff-39307f1617417657ee9874be314f13aabdc74401b124d0afe8217f2919c9c7d8L79

The `ids` and `authors` lists contain lowercase hexadecimal strings, which may either be an exact 64-character match, or a prefix of the event value. A prefix match is when the filter string is an exact string prefix of the event value. The use of prefixes allows for more compact filters where a large number of values are queried, and can provide some privacy for clients that may not want to disclose the exact authors or events they are searching for.

I don't know how they can do that without breaking all the clients, but at this point I wash my hands of it.