livepeer / research

Organization of the current open research tracks within the Livepeer Project
MIT License
7 stars 2 forks source link

Application specific Cosmos zone #8

Open yondonfu opened 6 years ago

yondonfu commented 6 years ago

One possible solution to reduce the costs of interacting with the Livepeer smart contracts is to create an application specific blockchain just for Livepeer that would be a zone connected to the Cosmos hub. Below are some notes summarizing my current understanding of what this might look like with some open questions just to kick off action around this research topic.

Background

Within the Cosmos network, the Cosmos hub is a blockchain that maintains the global invariance of the total amounts of various tokens across all zones, which are blockchains running Tendermint, "out of the box" blockchain infrastructure that includes things like networking and a BFT consensus algorithm (safety as long as >= 2/3 of nodes are honest). Users can transfer tokens that they own from one zone through the Cosmos hub to another zone connected to the hub. The Cosmos hub is secured by a set of validators that use Tendermint consensus with PoS economic incentives including delegation and slashing conditions overlaid on top. Zones have the option of using their own validator set OR relying on the shared security of the Cosmos hub by using the global Cosmos hub validator set. In the latter scenario, the Cosmos hub validator earns fees for validating blocks in the zone and if it violates a slashing condition in the zone (since the zone is presumably also using the same PoS consensus algorithm if it is using the shared security of the Cosmos hub validators) its staked Atoms in the hub will be slashed.

Another project in the Cosmos ecosystem is Ethermint which is a EVM based chain using the Tendermint consensus engine internally that is compatible with most Ethereum tooling (i.e. Truffle, block explorers, Metamask, etc.).

How would this work?

The Livepeer smart contracts could be deployed onto a Ethermint chain that represents a Livepeer zone connected to the Cosmos hub.

There are a number of options for migrating LPT to the Cosmos ecosystem

At the moment, ETH is the fee token in the Livepeer system. However, after the Cosmos launch and before the creation of an Ethereum peg zone, ETH will not be available in Cosmos. The closest alternative would be Photons which will be minted as block reward at a constant rate of 500 per hour for validators AND will be claimable by any Ethereum user after the Ethereum account balances are hard spooned into a zone created specifically for claiming Photons (all Ethereum users will be able to claim an amount of Photons equivalent to their ETH balance at the time of the hard spoon). The easiest solution here might just to be wait for the creation of an Ethereum peg zone before creating a Livepeer zone.

Under the shared security model, what fee tokens will be used to pay Cosmos hub validators? At the beginning, probably photons. Or maybe the existence of an Ethereum peg zone, maybe ETH - Cosmos hub validators would need to accept ETH first. The same choices probably apply to the self sovereign security model (define own set of validators for a zone) as well.

The easiest way to bootstrap an application specific zone is to use a shared security model and rely on the Cosmos hub validators to validate the chain. However, if many application specific zones use the strategy wouldn't the Cosmos hub validators be flooded with blocks that they must validate for each zone? As a result, I would think that given the limited set of validators especially at the beginning (100?), the fees that the validators accept for validation across zones would rise over time making transactions within zones more expensive over time. Is this just another version of the congestion problem on Ethereum except in this case, the individual zones are not congested with transactions (since unlike in Ethereum there might be only a single application running), but since the same validators are validating multiple zones, there would be consistently rising demand for a fixed supply of validation resources (at least until the Cosmos hub validation set grows in size, but even then it sounds like the size will always be limited)

dob commented 6 years ago

Here's the latest update on Cosmos project status.

So all of this is to say that if we go down the path of running as an Ethermint zone, then we will need to be prepared to do quite a bit of Ethermint development ourselves, or wait until Cosmos is launched and the surrounding tooling is more mature. I still think it's a very viable medium term option if we want to not make centralization tradeoffs. But if you're willing to make centralization tradeoffs then PoA may be a shorter term solution.