Under The Hood: Lightstreams Tech Review By Two Blockchain Developers
(If you want more ICO code/tech reviews by experienced blockchain developers..Join our ‘Under The Hood’ Telegram Channel)
Most of the information available on upcoming ICO’s is very shallow. In reality, the information investors need to make a sound investment decision simply isn’t available. A lot of the hype we see among ICO’s is largely founded on weak research and is the product of good marketing, rather than solid foundations.
There are some code reviewers out there digging a bit deeper, but most of the time they are only accessing public Github’s, but most ICO’s don’t push much code out publicly in the early stages of their raise so they can protect their IP.
We set out to change this. We searched for weeks to find the experienced blockchain coders to partner with who could review the quality of the tech being built, from the code up. Finally we met Radek Ostrowski and Maciek Zielinski two well experienced blockchain developers who have worked on some very well known projects. Their full bio’s are at the bottom of this article.
We put these two coders directly in touch with the Lightstreams CEO and their head developer, then we setup a call with a screenshare so we could grill them on their PRIVATE Github. The code that they haven’t yet made available to the public. We wanted to make sure it actually existed, and to check the quality.
What follows in this (unpaid) article is written by them…
And make sure you join our ‘Under The Hood’ Telegram Channel
Before we jump on the call with Lightstreams we did a comprehensive overview of their whitepaper so we get get a clear idea of what they are proposing to build, and how.
Marketing, marketing, marketing
First part (8 chapters) is written purely for the marketing purposes. It doesn’t add much value to the solution description and even makes some mistakes:
- According to reference no. 13, creating zk-snark proof takes from 20 to 40s, not like chapter 4.1 says — 40s.
- Document refers to Plasma as a sharding solution (again chapter 4.1). No one technical would write that statement. Plasma is a second layer solution child-chain. Sharding is a build in first layer solution that requires hard fork of Ethereum.
Once we get to the second part of the document, we finally see the work of real engineers.
Permissioned Blocks
The origin of Lightstreams Network is an idea called Permissioned Blocks which was developed by the Lightstreams CEO. Here’s an explanation from his original whitepaper:
“ At the core of the [Permissioned Blocks] protocol is a role based system that enables one or more parties who are the administrator(s) of the smart contract to give consent to authorised network nodes to share the confidential information with designated blockchain accounts.
The Permissioned Blocks design integrates the Ethereum blockchain with a distributed secure vault, which is an extension of IPFS, a content-addressed peer-to-peer file system.”
Simply put, this is “just” allowing a file system (IPFS) to read from an Ethereum node and verify if the user requesting the file has paid for data using a predefined smart contract.
This means that since IPFS is a peer-to-peer file sharing protocol, if you want to sell a file, you will need to run the Lightstreams node in order to seed the content to the first buyer. If you decide to turn your node before that happens then the file will be unavailable. Once the file has been bought a number of times, and is being distributed by other purchasers, you can turn off your node and still continue to earn money. However, since this could be an issue for some to run their own node, creators have specified services in their design where you can opt to authorize third parties to distribute the file for you.
Lightstreams is a fully decentralised p2p network. What we mean’t to highlight is that with direct p2p communication between buyer and seller, is that the seller can’t turn of their node before the first buyer downloads a file. However, this situation of turning a node off does not affect the operation of other participant’s nodes.
Some might say, everyone can build such a solution, yet no one built it before. This is just very, very clever trick.
Tendermint
One might say that Permissioned Block’s smart contracts could be deployed on Ethereum Main Chain and this modified IPFS could read directly from it. Limitation of this approach is time that needs to elapse to have confirmed transaction (6 blocks ~ 1 minute). Not very user friendly approach, to wait a minute for bought whitepaper or mp3. As a solution, creators decided to modify Ethereum and use one of the fastest consensus model — Tendermint. This is based on Proof of Authority, but improvements proposed in governance model could bring it more to be more like Proof of Stake model. It’s clear that creators wanted to make it as fair as possible. All this allow to have better user experience in terms of waiting for bought data (~2s) with relatively safe.
OK. We now have a better idea for what Lightstreams is trying to build and how they intend to build it. Now lets have the call..
Meeting the Team and Private Screen Share
At Under The Hood we often find that ICO’s want to keep their code private, particularly in the early stages. In order for us to review the code we arranged a time to call and they shared their screen with us as they went through the code, allowing us to get an exclusive insight to the progress they have made on the project.
First impressions matter, and our impression of them were very good. They have been working on this project for over a year and have commits to prove it. The code looks solid, modular and they are using Docker and scripting their environments to automate as much as possible.
What we learned and were pleased to hear, that they are considering running their platform first on the mainnet of Ethereum before running on any other network/sidechain (for cost and scalability reasons). We think that it’s important that the users have an option of doing so (even though it might be slow and expensive at the moment). It means that the token will be distributed as ERC-20 token and then moved to dedicated network (similar to what EOS did).
Contrary to what it may seem, they had to do a significant amount of changes in the code of IPFS. Adding a complex permission layer was a huge challenge for them, especially that architecture of IPFS is permissionless. It’s worth noticing, that they did it in a way, that allows them to follow changes from the original IPFS repository.
We inquired them about the initial complexity for the users to be running their own IPFS modified nodes if they want to sell any data on the platform. We were shown live demo of running Lightstream node, that includes IPFS node. It looked really easy. Team is also working on command line tool and SDK for node’s management. They know that low complexity is a key to the wide adoption.
Conclusion
Permissioned Blocks, Tendermint and governance model seems to be clever solution for all those who wants to sell data fast, like publishers or artists. As developers we can imagine having public blockchain layer for handling user accounts, payments and private content serving cloud, everything based on Lightstreams. It might be good model and we think it’s worth to have a project that will check it. Having Ethereum Virtual Machine is a huge advantage, because Polkadot is coming soon (late ’19) and will connect Lightstreams to the Ethereum Main Chain. So maybe, just maybe Lightstreams would be one of those specialized blockchains, that everyone is talking about, suited especially for one use case. We also like that they’ve found a technical solution to solve a problem, and not the other way around.
Make sure you stay up to date with code reviews by joining our ‘Under The Hood’ Telegram Channel
About the Authors
Radek Ostrowski — Blockchain Engineer particularly interested in the Ethereum ecosystem and Smart Contracts. Founder of StartOnChain.com. In the fiat world, experienced in Big Data/Machine Learning projects. Co-creator of PlayStation 4 backend. Successful hackathon competitor: https://devpost.com/radek1st. Speaker at several international conferences. His LinkedIn profile.
Maciek Zielinski — Maciek’s education, hobby, work and passion is Software Engineering. AI and Blockchain researcher. Now living as digital nomad, doing trip around Australia. Check out his LinkedIn.
Want to see the Solana code ripped apart by a blockchain developer? Checkout this article: https://medium.com/@drake.icoradar/under-the-hood-solana-code-review-by-a-blockchain-developer-39711dc481ba