DeciStream is a multiParticipates Streaming platform inspired by "Twitter Spaces" or "Joe Rogan Experience" streams. where streamers can participate in making content for the stream such as discussing an interesting topic.
DeciStream focuses on decentralized values. For example, each channel is an erc721 when a subscriber will be minted an erc721 token to be able to participate in that channel's DAO activities such as voting for the next stream participant. Besides the video is also the erc721 that owned by the content creator.
- Integrated ENS (Ethereum name service)
- Send and Receive notifications from Push protocol (Ethereum Push Notification Service)
- Streamer can create Channel
- Subscribe to interesting channels
- Create Stream
- Invite others to join the stream as participants (multiParticipates Streaming)
- Release that stream for others to join as spectators
- Export video to erc721
- Create channel's DAO ( 50% done)
- Add Chat feature using Push Protocol
- Release streams only for channel subscribers
- ...
Stream Platform ( LivePeer )
I use /room and /stream feature to be able to create multi-participant streams
Database ( tableLand )
I use 4 tables namely Channels, Steams, Videos, Subscriptions.
- The Channels table will store the user's address and the address of the smartcontract video and subscription.
- The Stream table will store the backplayId and streamId values that are needed by the livePeer to be able to watch the stream.
- Videos table to store Video NFT values including video_erc721_address, owner_address and tokenId
- Subscriptions table stores NFTs representing channel subscribers
To ensure the correctness of the data in the database i added functions to ERC721 so that whenever nft is minted or transferred, it updates their value in the table.
File: Master.sol
...
function insertSubcription(address erc721contract, address subscriberAddress ,uint256 newTokenId) external onlySubcriptions {
TablelandDeployments.get().mutate(
address(this),
_tables["Subscriptions"],
SQLHelpers.toInsert(
"Subscriptions",
_tables["Subscriptions"],
"subscription_erc721_address,subscriber_address,tokenId",
string.concat(
SQLHelpers.quote(Strings.toHexString(erc721contract)),
",",
SQLHelpers.quote(Strings.toHexString(subscriberAddress)),
",",
Strings.toString(newTokenId)
)
)
);
}
function updateSubcription(address erc721contract, address to, uint256 tokenId) external onlySubcriptions {
string memory setters = string.concat(
"subscriber_address=",
SQLHelpers.quote(Strings.toHexString(to)) // Wrap strings in single quotes
);
string memory filters = string.concat(
"subscription_erc721_address=",
SQLHelpers.quote(Strings.toHexString(erc721contract)),
"and tokenId=",
Strings.toString(tokenId)
);
TablelandDeployments.get().mutate(
address(this),
_tables["Subscriptions"],
SQLHelpers.toUpdate(
"Subscriptions",
_tables["Subscriptions"],
setters,
filters
)
);
}
...
File: Subcriptions.sol
...
function mint() external {
uint256 newTokenId = _tokenId.current();
_mint(msg.sender, newTokenId);
_tokenId.increment();
Master(_masterAddress).insertSubcription(address(this), msg.sender, newTokenId);
....
}
function _transfer(address from, address to, uint256 tokenId) internal override virtual {
super._transfer(from, to, tokenId);
Master(_masterAddress).updateSubcription(address(this), to, tokenId);
}
...
Notification ( Push protocol )
I am using notification feature from push protocol
Currently I'm using 2 notification templates
- Notice new subscriber to the channel
- Notice someone invited to join the stream
Naming ( ENS )
To make accounts more readable i use ens. If an account already owns ENS, it will display Ens avatar and Ens name instead of wallet address
Storage ( nft.storage )
I use storage video and metadata of Nft