DAPPCON 2018: Making a Decentralized Video Application - Eric Tang (Livepeer)
DappCon 2018 · July 2018 · 18:58
Eric Tang of Livepeer presents building a decentralized video application at DappCon 2018, walking through how the network coordinates transcoding and streaming work across independent node operators using Ethereum smart contracts for coordination and payment. The talk covers the technical challenges of decentralizing a bandwidth-intensive service like video, positioning Livepeer as infrastructure for streaming applications that don't depend on centralized cloud providers.
Speakers
Topics
From DappCon 2018, hosted by Dappcon Berlin.
Transcript
give it up for Eric thank you thank you for the intro and thank you for hosting this is a really awesome event I am one of the cords ever lived here and life here is a decentralized video streaming network before I get into it I want to see a show of hands of how many people have heard of life here or know what it is all right about half okay so I have 20 minutes so I'll go through this fairly quickly so we have some time at the end there's questions so so the thing about life here is that life here is open source and it's open access video infrastructure this is in fact something that's rare in the video world because unlike the blockchain world most of the video software that we use today
on the infrastructure level is alpha PI eteri and run by software license see the licenses and platforms that are owned by centralized companies so so before we get into how live pier works we have to kind of take a look at how video streaming works on the Internet today in the in the non decentralized world so usually we have a broadcaster could be you know a phone it could be these guys with cameras sending a video video stream in our TMT format into a cloud hosted media server now this media server takes the video stream in and it does this thing called transcoding which is really crucial for the video to be able to be dispersed around the world to
all the devices that people are watching them on to all kinds of video networking conditions imagine someone sitting at home with a high speed internet versus someone walking around outside with with a smartphone connection and and and what the transporting is doing is is it's turning that one video stream into many many different video streams that all look like the same video stream but with different bit rates so that different types of connections can read them and also different video codecs for video different video players that speak those codecs and the media server also can add DRM which is to preserve the privacy of the video they could also store it for later playback and then it outputs this
video into into the into a CD using an ALS or - format so the CD ends are the infrastructure that kind of runs the internet right they deliver a content from one one one location to all the users in the world so you hear here companies like Akamai or fastly or things like that they are basically in charge of taking one file replicating them around the world into millions of the same files and delivering them to to the people the people is on the right on the other side of the screen which are all the devices so so so that's that's kind of how video streaming works today and what you notice is all of these cloud hosted services that are doing the
work and it's and effectively there because there's not many of them effectively to create some sort of a cartel the keeps that artificially keeps the price really high so for example it costs $3 per stream per hour just to process the video if you have thousands of video at the same time it's $3,000 per hour per hour right so that adds up really high really quickly so what life beers trying to do is really turning all of this cloud-hosted soosh services into this open video network that's incentivized with crypto economics and using the tools like aetherium like swarm and some
of these decentralized projects in order to do that and library itself is a protocol that creates the incentives and the validations so that we can take the trust out of this whole equation and have a broadcaster just be able to trust a decentralized network to do the exact same work that it was doing today and there's a really important thing here is life fair is not only just trying to make things decentralized it's also trying to make things ten times cheaper than the current solution and I'm gonna get into how that happens so we already talked a little bit about why the synchronization is important here we're gonna talk about only the trance only the transporting piece which is a really
crucial piece in this in this whole workflow so let's let's go into how the protocol works there it's what what we do at the beginning is we have a transcoder a transcoder will advertise is is capability and price with the live spear smart contract that's running on the etherium Network now a lot of these transcoders can and can do it at the same time and they can be any you know computer running your garage to a big cloud hosted instance now when a broadcaster comes along it will ask the smart contract for a transcoder within its price range and a smart contract will then assign this job to a specific
transcoder and at this time because the broadcaster is looking at the blockchain in those when who the who the job is is is given to and the broadcaster will push will start pushing video into into the video storage now when the broadcaster is pushing the video out its signing every segment with this private key and what this saying to the world is I am the broadcaster and I prove that this is the video that I have published and not anybody else so now the broadcaster when they see the video and where they see the signature they can start doing the work and as they're doing the work they also create another signature and writes it onto the blockchain and what this is saying is I
have taken this specific input to create this specific output and I'm creating a hash and writing the hash on chain so that so that is temper proof now we don't have to do this for every single segment because we can just create a merkel route of thousands of segments at the end I'm writing a writing at once onto the blockchain now when the when the transcoder writes it writes the proof onto the blush in is also when they get paid so for every single segment that it writes it has a price and the broadcaster will pay the transcoder according to the amount of segments that are writes on to the to the blockchain and at the same time the transcoder will write the result back into the video storage and the broadcaster can use the result to
broadcast the transport video to to their viewers now now this is good but how can the how can the broadcaster trust the transcoder is doing the right work right because it can just be it's just a hash so now the when the when the transcoder writes the proofs on Shane the smart contract will sudo randomly send challenges to the transcoder and the transcoder will have to provide the proof that it has done the right work otherwise it will get slashed so so this so this gets into computation and verification right which we all know it's very expensive on change so we have all these different
off chain solutions to solve this problem life here has been working with a team called skroob hit for a while now in fact we have already built a prototype that does true--but using the live care protocol and what that does is it completely decentralizes the verification process so that we don't have to trust a single party to do the verification which means we can we can we can execute all of this transcoding heavy computation off chain and still trust that the computation is done correctly so not only do we have to decentralize the verification we also have to figure out how to do non-deterministic verification now this
is something that true beta does not do right but which is required for video transcoding because a lot of video transcoding is done for example on a GPU which has floating-point calculations and what that means is for every video segment that for the same video second segment that you get you transcode you could get different results on the bit level even though the picture looks the same to the human eye and here well to get around this problem we use video fingerprinting technology which is something for example YouTube uses for like content right takedowns so whenever you upload a video on to YouTube they're able to tell that even like even if you like slow the frame rate or change slightly change the picture a little bit
they can still tell it's from the same picture so we use the fingerprinting technology and we also use video quality scores so we can tell whether the work has been done the transcoding has been and well - to what quality has the has the transcoding been done and all of this because the verification technique is done in the deterministic way that means even though the transcoding is done in an undetermined aesthetic way we can still verify that on chain deterministically so so now that's all good so we can trust this network to do to do our computation and it can be trust less and can be done in a decentralized way but still we need to
make sure it's cheap right and the way to do this is we we do something called a video mining so we recently published a blog post and done some benchmarking and what we found is that we're able to cut down the price by 10x from something like a traditional cloud-hosted transcoding service like Amazon or Google and the way we do this is we plug in to the existing cryptocurrency info currency mining infrastructure because all the GPUs that are out there that are mining cryptocurrency all have a video transcoding ASIC sitting on those GPUs and because they're not utilizing those
GPUs right now we can plug into a huge a huge pool of unutilized resources and because the cost of doing transcoding so much higher than than doing cryptocurrency mining we have about a thousand x margin to play with here and that's how and that's how we're able to cut down the cost so much and to do that we create competition between the transcoders so we would do this thing called a transcoding race which is not dissimilar to how like the Bitcoin mining works so the transcoders are all racing to do the same to do the same video transcoding
for a specific stream and the first person who gets who gets the street to get the results back wins the small reward and this is how we're able to get it get high redundancy on a video stream and and and increase competition to push down the price and this kind of in this provide a scaling factor in the whole network and it provides incentives for computation efficiency it lowers the latency and it creates a massively paralyzed herbal video transcoding network and we're also planning to add geolocation here so that when the broadcasters are broadcasting a video they were able they're able to find the closest ingest source to push the video in so of course when we have this open
decentralized open access network some of the hard problems start to come in right what about codec licenses and and what we we will be offer people is that as open-source developers we encourage people to use open source video codecs so the traditional codecs and people use is x264 today which is which is actually closed source but there are open source alternatives to that for example vp8 and vp9 and there's a new source coming out called a v1 I will serve a lot of these problems another thing is content blocking right so as video is like a very powerful medium for storytelling and there's all kinds of video content out there from good to bad
to outright illegal how can we stop illegal content from getting out to the network and here similarly we put we give the choice to the note operators to the note operators can decide what kind of content what kind of sources they want to to be processed through their node and as a network as a network the network will provide choices to people who want to provide to process different types of content so for the last bit I want to talk about why we're using the blockchain in the first place right of course we can build video processing that's already a bunch of a bunch of technologies that we exist we can we can plug in to the crypts of mining world in
a centralized way as well but what we what we're trying to do here is to think about creating a long term project that has sustainability and what does that mean today when we're looking at creating software right well either we have to make a choice do we want to create a for-profit company so that we can use the profit from the company to continue to fund the project or we can create an open-source software so that people can use it for free and it's always out there and as long as the software is good it can be sustainable in the long term and what I think is that blockchain creates a new type of sustainability in software development by creating a token
economy right so in a token economy there are different types of contributors who are providing different different values into a network and if you create a token economy correctly and have the right design these actors can all work together to to create a to create a good market so that people's incentives are aligned and people are working together to grow the network so let me use life here as an example right life here is a is a delegation it's a delegation Network and what that means is token holders will delegate which it just means voting for the people who are doing the work right we talked about orchestrators so the
orchestrators are the ones that are getting the inflationary rewards from the fronton protocol now the now the the broadcasters are paying the fees in order to use orchestrators and the orchestrators are getting the transcoders to do the work for them and in exchange paying them fees right and the token holders here get some kind of payout based on who which Orchestrator they they they voted for because one of the one of the things that the work is straighter campaign with is a reward cut that they paid back to the people who delegate toward them so this is all nice right we have the token holders the workers traders the transcoders and the broadcast are all kind of helping each
other to grow the network but what about what about if you are an application developer how can you participate in this in this ecosystem in this economy so one thing you can do is you can create an advocate you can create an app right these token holders need an application interface in order to do the voting for example you know imagine when you have Casper already you need to see a list of Casper nodes validation knows in order to stake here ether tore one of those Casper nodes or something like that and you know if you maybe if you are a really good app developer you can get people to pay you to use your app right but in fact there's another way for an app developer to get paid and that is in
this inflationary token model right because all the inflation is going through that work the poor orchestrators first and the poor Orchestrator is taking a percentage of the cut in the reward before it's it's paying the rewards back to their to their voters so if you are if you're creating a really popular app you can campaign in your app to say hey I'm also running or workers trader why don't you vote for me and because a lot of people in the ecosystem are using your app an app developer has a has an unfair advantage in this sort of delegation scheme and they can use that advantage to get a lot to get long
term payout every single day from participating in the in this economy and that's how an app developer can can build a sustainable project and even a sustainable business in an economy like this another way to do that is to create an actual business on top of on top of the protocol that interfaces with the outside right so imagine if when we talked about cutting the price down by 10x when that's the case there's already a lot of video out there being transcoded today they all need to be they all they're all looking for cheaper prices but maybe not all of them are looking to pay with crypto so a business can easily be created to abstract the crypto layer out and still charge people
in fiat but but capturing a margin I'm using the live peer network to do a much cheaper transcoding service for other people in fact today everybody can participate in life here so we launched on the etherion main that about two months ago and since we have seen a lot of interesting activities on the on this delegation mechanism what so and what we've did what we've done is during the genesis blog for life here we have put about 65% out of the 10 million live pure tokens into a smart contract and in any one at that time with over 0.1 Eve in their address is
able to claim a portion of that 6.5 million tokens so all you have to do is to go to this website and and and if you are if you hold the key you can generate the merkel proof automatically in order to in order to claim that about two and a half tokens but what's more interesting is there's a there's a slow there was a slow start period but after this you can start claiming for other people and and you and and you into for your reward you're able to get a small percentage of their token to yourself and this percentage increases over time so that tomorrow if you call it they will get all the tokens you got nothing
but in eighteen months if you call it they'll get nothing at you got all the tokens so there's there's an interesting game that's about to start so that's all the time that i have thank you for being here