NEAR chat social app

Description:

NEAR chat is an idea of a social app, inspired from the development catalogue, that enables the following functionalities:

  • Encrypted content sharing between people.
  • Photo and video sharing service aka “NearGram”. Images are stored in decentralised storage, on chain just identity + latest image hash.
  • Signal-like private instant messenger that uses on-chain identity. Doesn’t use phone numbers and central server for discovery.

Technical challenges:

  1. Storage of messages on chain is expensive so the smart contract will only keep unread messages (possible for limited perioad of time such as 30 days)
    To solve this problem we can build a scraper that will save the transaction history related to the smart contract (the messages) into a database. NEAR chat app can use an API to load old
    messages.

  2. The NEAR account might have multiple access keys (public keys) , so we need to know which to use for encryption / key exchange. This can be solved by implementing a name registrar in the smart contract that will associate the account_id with the public_key used for registration.

  3. The contact list and the recipient of the message must be private. We can solve this by adding a friend request functionality:

    • This will work by getting the associated public keys of all the accounts registered in the smart contract.
    • Sending an encrypted friend request message that will contain the account_id and is encrypted with the public_key of the account that we’d like to be friends with
    • If the request is accepted, the communication channel is created between the 2 accounts.
    • When sending a message to a friend, will use as recipient the channel hash and not the recipient’s account id.
7 Likes

I’m keen to support an initiative like this using Verida for off chain storage and real time messaging, while anchoring identity to the blockchain. This ensures privacy preserving of data and low cost data storage.

Happy to chat offline and talk through how the architecture could work.