Page MenuHomePhabricator

[Cashtab Prototype] Social media functionalities
AbandonedPublic

Authored by emack on Jan 29 2022, 05:15.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Summary

Prototype for discussion only - as part of the overarching T2115 and T2017 tasks.

Frontend

  • new Social screen added to house the social media functions and public social feed
  • clicking on the Portrait next to the wallet name in the header opens an identity management drawer where the user can set their name, twitter handles...etc. Proposing for these to be stored offchain.
  • the 'Follow/Add to contacts' function will route the user to the upcoming Address Book/Contact List function in T2080, which will reside in the upcoming Advanced Tooling screen in D10758
  • emoji libraries are resource heavy but are quintessential to the social experience, we'll swap in a lighter version post prototype
  • Tipping in XEC and eTokens will leverage the existing sending UIs.
  • posts with dislikes over a certain threshold is hidden automatically
  • posts with likes over a certain threshold makes it into the 'Top' social feed
  • potential routing from the upcoming NFT screens (D10667) to the Social screen to enable embedding NFTs into social posts

Backend

  • proposed for a single address to be the central feed repository that social posts will be sent to in the form of OP_RETURN messages. The social feed will then query all inbound messages with the social prefix.
  • cashtab social prefix hex (73746162) to be embedded into outputs when posting to the central feed address
  • new sendSocialPost() created in useBCH.js which sends the post via OP_RETURN to the designated onchain message repository
  • new retrieveSocialFeed() to be added to useBCH.js which specifically retrieves the social feed based on the social feed mode selected (either latest posts, top posts, replies or own posts)
  • existing parseOpReturn() in cashMethods.js updated to recognize messages prefixed with 73746162. Further customized labelling in TxHistory will need to be made to both Tx.js and parseTxData() in useBCH.js
  • to facilitate tracking of replies, we'll need to embed the tx hash of the parent post as an additional prefix hex into the OP_RETURN output i.e. [OPRETURN]-[Cashtab Social]-[Parent hash]

Key considerations:

  • I avoided leveraging the existing sendXec() function in useBCH.js to post the social content because it would bloat the function too much and make it hard for new cashtab devs to understand the mvp sending mechanics
  • will need to mitigate people spamming the feed, potentially rate limit users to only be able to post x amount of messages within a time period
  • performance implications for Cashtab as a whole from refreshing the public feed
  • may need a separate server to host media uploaded in each post or simply render media urls hosted elsewhere or integrate with IPFS

Potential phased release:

  1. MVP with ability to embed media into posts and basic offchain identity management
  2. 'Like/Dislike' tracking and integration with T2080 Address Book function for 'Follow/Add to contacts' links
  3. XEC/eToken Tipping
  4. update NFT section to enable users to 'Set NFT as social profile'
  5. Social post categories (e.g. General, Dev, Price) as an initial social landing page
  6. Integrate with future ENS-like namespace solution for identity management
  7. IPFS integration for trustless media hosting
  8. Integrate with Wechat / WhatsApp APIs

social wireframe - Copy.PNG (891×636 px, 123 KB)

social wireframe2 - Copy.PNG (827×856 px, 124 KB)

@johnkuney FYI re: T2183

Test Plan
  • npm start
  • navigate to the Social screen
  • input a post and click 'Post', verify it's posted onchain successfully
  • click on avatar portrait in the head and ensure the identity management drawer is opened and closed correctly
  • (social feed retrieval yet to be implemented)

Diff Detail

Repository
rABC Bitcoin ABC
Branch
social
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 18068
Build 35958: Build Diffcashtab-tests
Build 35957: arc lint + arc unit

Event Timeline

emack requested review of this revision.Jan 29 2022, 05:15
emack added a subscriber: johnkuney.
bytesofman requested changes to this revision.Feb 1 2022, 21:03

Great demo!

  1. The memo protocol on BCH offers an extensive feature set. I don't think there is a great need to reinvent the wheel - we should work to emulate as many of those features as possible on XEC. For example, they have stuff like emoji parsing, link parsing, set profile picture, set profile text, following people, upvotes, tipping, token actions [ref: https://memo.cash/about]. Available JS libraries for this as well.
  1. Important to think about what the MVP is here. I think we can start first with a free-for-all open feed, like Twitter except what's posted is what's loaded, no random filtering algorithms. We would need to have it auto-refresh every 5 seconds or so.
  1. Good move to avoid the sendXEC function and keep social stuff separate.
This revision now requires changes to proceed.Feb 1 2022, 21:03

Chronik implementation and better dev tools have become higher priority than social media features. This is a good proof of concept, but should be abandoned as it will not land in this form.