NiftySubs is a pay-as-you-use decentralized livestreaming platform.
Stage
Under Development
1st Place under Protocol Labs HackMoney 2021
How does it work?
-
Creators create livestreams using the NiftySubs interface in return they get a Voodfy stream key which they can use in OBS for livestreaming.
-
The livestream is locked using the Unlock Protocol.
-
To view the livestream users need to start a SuperFluid Flow at a specified rate currently 10 USDCx/month.
-
Until the money stream is flowing USDCx to the creator the viewer has the key to the lock and hence can view the livestream.
Technicals
-
In addition to just the stream key NiftySubs also creates a lock using Unlock Protocol to lock the content of the stream.
-
The key of the lock has a maximum expiration time permitted by Unlock Protocol (i.e 100 years).
-
This is because when NiftySubs issues keys to the viewers they should have access to it until the stream is live and we are not sure how long itβs going to take
-
During the creation of the lock, we also specify that it has 0 keys associated with it. This is because we donβt want people to buy keys directly from the lock instead NiftySubs will issue the keys.
How does NiftySubs issue keys?
- Every time a lock is created NiftySubs SuperApp contract is made the Lock Manager for that lock.
How is it Pay-as-you-use?
-
The issuing of the keys to the viewers depends on whether their money stream is on or not.
-
We use the SuperApp contract of SuperFluid which includes hooks that can react to the state change of the flow (eg:- afterFlowCreated, afterFlowUpdated, afterFlowTerminated)
-
Using the hooks we can determine based on state change whether to expire a key or issue a new one.
-
The frontend listens to Transfer and CancelKey events and accordingly locks and unlocks the stream.
How does SuperApp know to whom to redirect the stream?
- When making a transaction to start the money stream we also pass the lock address with it. The SuperApp then gets the beneficiary of the lock and then redirects the money stream to that address.
Checkout NiftySubs