středa 28. března 2018

Blockchain? Can do!

Blockchain is the new sexy. Everybody is talking about it, people in lines in grocery stores are discussing Bitcoin price, big companies are pouring tons of money in research. Everybody just wants to be a part of it. And from now on, so are we! It turns out, it's just another young technology that we can handle.



Not that hard


The thing is, that blockchain itself is basically just a distributed ledger that holds an undeniable and unchangeable history of transactions. That sounds pretty boring, but you can actually do many things on top of it. Take for example Ethereum. Its prominent feature is a thing called smart contracts - an executable Turing-complete code that runs on top of the distributed network. And that's where the fun begins.

By using a programming language called Solidity, you can create your own crypto-tokens, fully distributed games and virtually anything you can imagine. Everything running solely in a distributed network, you don't have to own any servers. Sounds good? Well, slow down, because there is a lot, and I mean a LOT, of issues.
So is it a time to walk away? Definitely not. Every single problem can be dealt with and many of them are being dealt with as we speak. And yes, some of them might take a lot of time to get solved, but in the meantime, we can use what we have or figure out some workaround with other tools and services.

Endgame? Web 3 and Dapps


The grand vision that motivates people to solve all of the undeniable problems the concept has, is called Web 3, for some reason. A fully distributed and open network of nodes serving everything necessary for a distributed application (called Dapp for short). Be it an application code itself or its data. Pretty ambitious, right?

And the solution is based on - wait for it - Javascript. What? How? A picture is worth a thousand words, they say:


During smart contract compilation and deployment to the blockchain, an ABI (Application Binary Interface) is produced. And that is nothing else than a JSON object with method signatures. You can use these signatures to produce bytecode that can be executed over the JSON-RPC protocol directly on any of the network's nodes.

That's why web3.js (and others such as ethers.js) was born. It is a library that contains everything you need to interact with an Ethereum node from the world of Javascript. And since you can build client-facing applications with Javascript (using Angular, React, vue.js or anything else you know), you can build the whole Dapp with Javascript.

So the idea is to serve application code from a distributed environment like IPFS or Swarm and use blockchain for all client to client interactions, such as payments or anything else that needs to be tracked. Of course, you are not limited to Javascript, you can use whatever speaks JSON-RPC. But the beauty of this solution is that almost every device has a browser that can interpret Javascript. And therefore, run your Dapp.

Entering the real world


Apparently, in spite of every problem the technology stack currently has, it attracts many investors and even big, traditional companies, such as Lufthansa, J. P. Morgan or Walmart. So there might be some future here.

That's why we started to work with Winding Tree on their product that will try to change the traveling industry forever. The core idea is to cut the middleman and thus save money. This platform, powered by Ethereum blockchain, should allow any hotel, airline or car rental company, to simply list their inventory and accept bookings directly. And it should even simplify the growth of the middlemen themselves by providing a well-structured data of every member of the platform.

This cannot work


Well, we think it can and will. The idea might seem farfetched and there are a lot of issues along the way, such as the very small throughput of any blockchain. But there are very smart people already working on these problems and in the near future, we might actually book hotels and flights over a decentralized and open network.

Do you like this idea, do you have any questions? Come join us on GitHub, Telegram or Rocket Chat.

2 komentáře:

  1. Nice article. I especially appreciate lot of interesting links.
    Good luck with Winding Tree.

    Btw:
    "But the beauty of this solution is that almost every device has a browser that can interpret Javascript. And therefore, run your Dapp." Well you need either MetaMask extension installed (so browsers like Internet Explorer / Edge are out) or use ETH (web3.js) enabled browser like https://github.com/ethereum/mist

    OdpovědětVymazat
    Odpovědi
    1. That is true. Or you can actually bundle the web3 library into your app and use JSON-based wallet. Try opening https://demo.windingtree.com in an incognito mode. (We know it works in chromium, no other browsers guaranteed for now). It works without metamask. There are plenty of options how to get your account into the app, some safer than others.

      Vymazat