Building the Theta Protocol: Part I
High-Level Architecture Overview
By Jieyi Long, CTO Theta Labs
This is the first of our series of technical blog posts, which aims to share our thinking on the Theta Network, ranging from high level design concepts to implementation details.
In the past two years we’ve seen an explosion of new blockchain proposals that aim to overcome critical roadblocks for mainstream acceptance of blockchain technology, including limited network throughput, ever growing storage requirements and high transaction fees.
The Theta Network faces similar challenges. However, Theta is designed specifically for solving video streaming problems. Theta’s mission is not necessarily to tackle all generic blockchain challenges, but to solve the ones most pertinent in the video streaming context. In the process of examining the ecosystem, we realized that many transactions in streaming use cases are independent and recurring. This could simplify some challenges, and help address the roadblocks mentioned above. Furthermore, we identified many unique challenges in the video streaming industry that blockchain technology can help resolve.
In this blog post, we’ll briefly review our recent thinking and provide a high-level architecture overview. Our subsequent blog posts will dive deeper into each of these topics.
Consensus Mechanism
In our original whitepaper, we presented the Theta protocol built on the PoW scheme. While having proven security, PoW has the disadvantage of high computational costs. Specifically in our original proposal, the caching nodes also play the role of the miner, hence they are responsible for solving hash puzzles. The viewer client, on the other hand, generates service certificates by constantly performing hash operations. Such requirements might be less friendly to devices with low computing power, such as smartphones and tablets.
As described in the “Future Work” section of the whitepaper, we’re also exploring PoS as an alternative. PoS has the advantage of lower computation costs and higher transaction throughput. In this model, caching nodes and viewer clients don’t need to conduct hashing computations, which lessens computational resource waste. Nonetheless, this approach has an important impact on the Theta protocol design, especially on the bandwidth sharing reward scheme discussed below.
Reward for Bandwidth Sharing
One of the unique challenges of applying blockchain technology to video streaming is designing a reward mechanism to encourage bandwidth sharing. The mechanism needs to be incentive-compatible in the game theory sense to prevent attackers from claiming undeserved rewards. The original whitepaper introduced the concept of a PoW “service certificate” as a probabilistic proof of the stream relaying service. The caching nodes collect and use service certificates to claim mining rewards.
In the PoS approach, a viewer can instead send a certain amount of tokens to the upstream caching node as collateral during a given streaming session. This increases the chance that the upstream caching node generates the next block since it has more stake during the streaming session. The caching node returns the same amount of tokens back to the viewer after the streaming session ends (enforced by the protocol). This way the viewer still gets the video stream for free, yet the expected mining reward of the upstream caching node increases.
One issue with this approach is that the number of token transactions could be prohibitively high. Imagine a live streaming event where millions of concurrent viewers are pulling streams from different caching nodes. This could result in tens of millions of token transactions within hours. In later blog posts, we’ll discuss how to address this issue in more detail.
Separation of the Miner and Cacher Role
To further reduce the computational burden of the caching nodes, we’re investigating the possibility of separating the role of miner (or validator in the PoS setting) and cacher. Miners/validators are dedicated nodes for verifying transactions and assembling new blocks. With such separation, caching nodes and viewers don’t need to perform extra computations aside from the usual video stream encoding/decoding tasks. This is an approach that we’ll delve further into in upcoming blog posts.
Scalability
Support for high transaction throughput is a must for a video streaming focused blockchain. Above, we’ve mentioned a scenario where a live streaming event could generate numerous token transactions for caching node rewards in a short amount of time. Further examples include virtual gifting, where a shoutout from a popular streamer can lead to a surge in token donations, possibly thousands of transactions per second. ERC-20 implementations simply cannot support this level of performance — this is our view, which has also been echoed by many other projects.
Fortunately, for many streaming use cases, the transactions are independent of each other. This unique characteristic makes techniques like sharding very appealing. Proper sharding could potentially execute all the independent transactions in parallel, thus greatly increasing network throughput. Sharding also reduces the data storage requirement for the validators since a validator only needs to work on one shard at a time.
Further, many of the token transactions are recurring (e.g. a viewer might make many micro token transactions to the same upstream caching node). Techniques like payment networks and probabilistic payment could be applicable for reducing transaction count. These techniques could also reduce the transaction fee significantly.
Copyright Protection
Our whitepaper addresses the concept of Decentralized Entertainment Networks (DEN), where Netflix, Amazon Prime or Hulu can be be built on top of our decentralized video streaming network to distribute their original content. Copyright protection will be a central issue for such distribution platforms. It’s possible to utilize blockchain technology for digital content and IP ownership and tracking. More on this topic in subsequent posts.
More Unique Challenges?
Of course there are! Video streaming is such a huge space where blockchain technology has tremendous potential. As we move forward, more interesting problems will surface and we’ll continue to share our thoughts and design patterns. Stay tuned!