psibase icon indicating copy to clipboard operation
psibase copied to clipboard

Integrate invite system with resource model

Open James-Mart opened this issue 3 years ago • 4 comments

Goal

Create a straightforward flow to allow users to invite new users to the blockchain and pay enough to give the user some initial resources and a premium name.

Design

As a user interacts with the chain, they consume CPU. Of the network tokens used to purchase that consumed CPU, 80% shall be burned, 20% shall flow into back to the user into a balance that can only be used to invite new users. This balance can be called "invite credits."

At any time, an account may interact with the Invite applet to create an "invite" for a dynamically calculated cost. The cost of the invite is 20% greater than the sum of the following on-chain metrics:

  • The current cost of the storage for a new account
  • The current cost for a premium name

An invite is an object that stores:

  • The user that invited the new member
  • The app that invited the new member (if a specific app was instrumental in facilitating the creation of the invite link)
  • The invite credits

This creates a unique link that the inviter may share with an invitee. After the invitee clicks the link, they may create their account, choosing between a basic name or a premium name, and any leftover funds get allocated into the new account's CPU budget.

As the new user users the blockchain, the network tokens used to purchase their consumed CPU will be directed to the regular liquid token balance of the inviter rather than the invitee's invite credit balance. This will continue until the inviter has been reimbursed 2x the cost of the invite, at which point the invitee's invite credits will start accumulating normally.

Questions

  • Should invite links expire?
  • How should we handle when the invite credits no longer cover the cost of the account creation + premium name, or if there are no credits leftover to add to CPU budget?

Proposals

  • What if, instead of the 2x repayment, invitees pay 5% of the cpu-consumed network tokens to the inviter in perpetuity?

Design artifacts

image

James-Mart avatar Jun 27 '22 21:06 James-Mart

Diagram should be updated with the more recent discussion on how resource credits & NFTs as account permissions works.

James-Mart avatar Jul 12 '22 20:07 James-Mart

For MVP, every account will simply get a fixed amount of invite credits. More invite credits can be fauceted to users upon request if needed.

James-Mart avatar Aug 10 '22 15:08 James-Mart

"Account Invite System" is too broad of a task. This task is therefore going to be restructured as the first sub-task required to get an account invite system in place: An invite contract with its own auth contract that knows how to store Invite objects.

James-Mart avatar Aug 10 '22 15:08 James-Mart

I'm thinking about the case where Bob who uses the chain a lot, becomes a bit annoyed at his large balance of invite credits and thinks "I've got $80 worth of invite credits, I'm gonna damn well use it for whatever way I can and however I can get a return". Because your average crypto guy does not have that many friends to blow $80 of invite credits on in a personal level (dapps / services have their own onboarding strategies and invite tokens), therefore he's more likely to accept some grey market dapp or off chain dealer who will create a deal where he'll pay $20 of liquid tokens to utilise Bobs $80 balance.

If there's that incentive, then over time we'd be creating more smurf accounts, pushing up the costs of account creation for the legitimate user account.

I'm wondering if we cap the amount of invites an account can stack, as there's only a limited amount of people in Bobs life for him to invite, and if he's desperate for more he can pay for it anyway, so it's never an amount that grows too large and tempting to use against it's intended purpose.

Velua avatar Jan 23 '23 21:01 Velua