Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Internals] Polymorphish data model for sat transfers #28

Closed
huumn opened this issue Aug 20, 2021 · 1 comment
Closed

[Internals] Polymorphish data model for sat transfers #28

huumn opened this issue Aug 20, 2021 · 1 comment

Comments

@huumn
Copy link
Member

huumn commented Aug 20, 2021

The only sat transfer mechanism we really have currently is the vote and boost (which is in the same db table but differentiated with a boolean). Even the dust cost of posting and commenting is kind of recorded as a vote.

We want to support many types of sat transfers on the site eventually. To name a few immediate ideas:

  • tips
  • referrals
    • e.g. every user who signs up with your referral link gets 20 sats and you get 20 sats
  • faucets/rewards
    • e.g. 10 free sats when you sign up, 100 sats if you visit every day this week, 1000 free sats if you post a story that gets to the front page, etc.

Eventually:

  • gating replies to your posts/comments with custom sat amounts
    • e.g. every reply to this thread must 'stake' 10 sats rather than 1 sat
  • Q&A bounties
    • e.g. the best answer to my question by Saturday gets 1000 sats and if I don't pick a winner it's distributed to all answerers
  • sub-stacker (read subreddit) economies, i.e. create subs with different sat-based unit economics
    • e.g. every post in this sub-stacker costs 100 sats (X amount goes to the sub mod, Y amount is airdropped on the sub users, Z goes to the site), comments cost 25 sats, etc.
  • Let users set a sat cost for mentioning them , i.e. charge users for consuming your attention
  • DM's gated with a sat cost
    • e.g. pay per message or pay to unlock a conversation with me

The sky is the limit IMO and we are going to the moon my plebs! These are naive examples. The incentives will have to be carefully examined before deploying of course.


Anyway, we don't want a DB table for all of these so we should probably have something more generic. The trick is making something intended to be generic also performant/correct so we should deliberately design such a system.

Off the top of my head it's probably best to have an xfer model with a sender id then we have a polymorphic receiver (e.g. an item (post/comment), a user for direct tips, a message for message hurdles) ... I'm not sure how well all of these will fit into this model so I'll probably attempt an exhaustive experiment to make sure any particular design fits.

@huumn huumn pinned this issue Sep 7, 2021
@huumn
Copy link
Member Author

huumn commented Sep 8, 2021

As I implement this, I'm coming to the conclusion that it's over-engineered. I should perhaps just rename and adapt the Vote model as features and use cases arise rather than attempt to anticipate all future needs. e.g. There are far future scenarios that I'd have to design into this if I want it to be truly generic, and it's questionable whether the intermediate generic forms (mostly supporting tips and referrals) would be better than iterating on Vote. Certainly I can get tips done faster by iterating on Vote.

Also, upon examination referrals fit poorly into this model.

On top of it all, stuffing all sat transfers into a single model is mixing too many concerns, let alone wholly anticipated concerns.

@huumn huumn closed this as completed Sep 8, 2021
@huumn huumn unpinned this issue Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant