Search via Plebnames, lookup npub in Bitcoin OP_RETURN #586 #589
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
implementation of #586
This is a draft and will need some improvements and everything is up for discussion.
The implementation is now that if you search and the input ends with ".btc" a cors call to bitcoin explorers are made (https://mempool.space/api, https://blockchain.info, https://blockstream.info/ or https://btcscan.org/). If the plebname is claimed and has a nostr npub attached it is added to the result list.
Example: If you search for "test.btc" the nostr OP_RETURN script of the owner is looked up and resolved:

Just as an idea I also added subHeaders to the search results to display the npub or nip05 to see unique identifiers:

Some improvements I can do:
To not ship the plebnames library on startup we could use a dynamic import that loads not until a search is requested.
We can use npm instead of jsr to not having to add jsr.
What do you think, dynamic import or npm?
I also can add the plebname lookup result to the FuzzySearch cache. What do you think about this?