Skip to content

Instantly share code, notes, and snippets.

@brugeman
brugeman / nostr-todo.md
Created January 24, 2023 16:54
Nostr todolist

Some things I feel are needed in Nostr and could be build reasonably fast:

  • onboarding micro-app (so that the next Snowden would give a single link with proper UX) - a simple wizard that asks user proper questions and guides to create profile, choose client, LN wallet, etc
  • actual approved functional iOS/Android app, big question whether native apps will be approved even w/ 'block' buttons, maybe some hacky unobvious path is needed
  • upload media (audit/video/images) on major client on shared, hopefully decentralized infra
  • basic spam/profanity suppression in major clients, most probably by temporary switching to 'safe' relays
  • search built into major clients, supported by several relay implementations
  • custodial LN wallet built into your client to dramatically reduce friction for noobs
  • remote signing with a single (mobile) app for key-storage (not quite sure it's 'easy', but from proposed NIPs it seems doable)
  • embed-post widget so that people on the web could embed nostr posts like they do with twit
keyword search NIP:
- problems
- various languages, including ones w/o spaces btw words
- various kinds of search - CS/CI, prefix matching, etc
- various data formats - plain text, json, html, etc
- so, the meaning of 'search by keywords' at least depends on event kind
- so, keyword search query must include a kind filter, and if keyword search is not supported for at least one requested kind by relay then it replies with a EOSE and a NOTICE of "search:unsupported_kind"
- and, 'keyword' itself is only meaningful in the context of specific kind, here only kind:1 and kind:0 keyword search is defined
- new filter field "keywords" is added to the REQ message from clients
- filters with "keywords" field must also include "kinds" field, at least one of the mentioned kinds must be supported by relay, otherwise relay returns NOTICE w/ "search:unsupported_kind"
@brugeman
brugeman / wrp.hpp
Last active August 29, 2015 14:26
C++11 port of WriterReaderPhaser
// C++11 port of WriterReaderPhaser, see
// http://stuff-gil-says.blogspot.ru/2014/11/writerreaderphaser-story-about-new.html
// Ported by Artur Brugeman and released to the public domain,
// as explained at http://creativecommons.org/publicdomain/zero/1.0/
#include <atomic>
#include <limits>
#include <chrono>
#include <stdexcept>
#include <mutex>
@brugeman
brugeman / smrp.hpp
Created May 26, 2015 05:30
Pointer storage with safe memory reclamation
// based on http://www.research.ibm.com/people/m/michael/podc-2002.pdf
// also resembles RCU.
#ifndef SMRP_HPP
#define SMRP_HPP
#include <cassert>
#include <cstdio>
#include <atomic>
@brugeman
brugeman / smrp_test.cpp
Created May 22, 2015 07:59
SMR pointer storage checked with relacy race detector.
#include <cstdio>
#include "relacy/relacy_std.hpp"
namespace smrp_test
{
// Single Writer Multiple Readers pointer storage,
// both writers and readers are lock-free,
// writers wait for all readers to finish