Skip to content

Add documentation for Premium #25

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

Merged
merged 1 commit into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/premium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions docs/requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ The contract enables a contract administrator to register Products describing th
1. [Actors](#321--actors)
2. [Security](#322--security)
3. [Migration strategy](#33--migration-strategy)
4. [Premium Products and 3rd party subscriptions](#34-premium-products-and-3rd-party-subscriptions)

## 1. 📖 Terminology

Expand Down Expand Up @@ -207,3 +208,20 @@ The Migration API provides a batched method for migration, thus enabling flexibi
Here's a chart illustrating the migration process:

![migration](migration.png)

## 3.4. 💎 Premium Products and 3rd party subscriptions

As the Contract allows for the creation of Premium (protected) Products, the system can involve third parties to verify
whether a user is authorized to use these Products or impose penalties in case of violations of Premium Product terms.
In the case of $SWEAT, the third party is _Sweatcoin_, and a user is authorized to create Premium Products only when
they have a _Sweatcoin Premium Subscription_. Since this information is off-chain, an Oracle is essential for
verification. Numerous other scenarios, such as giveaways and rewards, can also enable access to Premium Products.

For these purposes, two mechanisms are provided:

1. Premium Products can be protected by [Ed25519 signing](#322--security). In this case, a user must obtain a signature to use Premium Products.
2. An Oracle can monitor the state of the third-party service. In the event of terms violations, it can act as an Admin and apply penalties for the user's Premium Jars.

Here's a chart illustrating the interaction of system Actors in the case of purchasing and canceling a Premium Subscription:

![premium](premium.png)