encointer / encointer-wallet-flutter

Encointer mobile wallet flutter implementation
https://encointer.org
Apache License 2.0
22 stars 16 forks source link

in-app chat #993

Open brenzi opened 1 year ago

brenzi commented 1 year ago

problem statement

For communities, it is not easy to choose a suitable bidirectional communication channel. Most options nowadays are proprietary, centralized and require an account. And the worst thing is that the audience is scattered and there is just no common ground.

For Encointer communities, the single tool with 100% coverage is the Encointer Wallet App itself. So why not build a chat inside the app?

Nostr protocol

Building a chat application from scratch would be a defocus of resources, but the nostr protocol is already out there and it is very unopinionated about how it should be used. This makes it an interesting choicem with tools and libraries already available

Success Scenario

  1. one bootstrapper creates a channel (NIP-28) and defines title, about and picture
  2. the community adds the channel id to community metadata onchain (could be a file on ipfs, like the community icon. no strict need to extend metadata struct)
  3. the creator delegates signing to moderator accounts on nostr
  4. the wallet app looks up the channel id for the selected community onchain and applies moderation events and paywall on client side

Caveats:

Encointer Chat V0.1

A read-only view in the Encointer Wallet app that just subscribes to new events in hard-coded channels:

Requirements

Such an MVP nostr client would need to implement:

Encointer Chat V0.2

Allow content moderation. A tricky one, but lamentably indispensible.

Requirements

Approaches to moderation

paywall for spam prevention

reading is public and free, but writing to the chat could be paywalled to prevent spam. A user that would like to post should prove that he/she owns a minimal amount of the respective local currency by making a minimal payment. This could be a one-off payment with eternal membership afterwards, or yearly? There should be no linkability between encointer account and nostr identity. For privacy reasons (because people tend to de-pseudonymize with their chat profile), but also to avoid collusion (looking up who your fellow cycle gathering participants are and try to bend the protocol). A possible solution could be MMR PoR

representative moderation

One nostr account is elected by community on-chain democracy to be the moderator. the client checks for hide or mute events for every note before displaying it

caveats:

Every user can send kind 43 (hide message) or kind 44 (mute user). For each note, the client will check how many users voted to hide or mute and will do so if a threshold is reached

Extension: reputation needed to moderate

Encointer Chat V0.3

Allow people to post and customize their identities

Later

Implementation Options

There is a dart package, but it doesn't support the minimum NIPs for this https://pub.dev/packages/nostr We may need to contribute....

brenzi commented 1 year ago

unlinkable personhood badges could be done with this: https://github.com/encointer/encointer-node/issues/300

The wallet app would:

  1. either generate a new nostr privkey or ask the user to provide one
  2. request a badge from the oracle on behalf of the new nostr profile