The future is decentralized

Applications today

With the evolution of software we have reached the point when most of the services are online, mobile friendly and integrate social networks.

There are problems though, which haven’t been solved yet with the current technologies. Very often apps are slow and get unavailable because of the limitation of topology. Clients are connected to one central server and try to exchange information with it. If this server gets busy because of the high number of requests or a DDOS attack, you can’t use the application.

The other problem is privacy and trust. As an end user you can’t be sure that the given service does exactly what it promises.

Take as an example Google Search. It returns search results for your keyword but also tracks and compromises you in a lot of occasions.

A more obvious case is gambling applications. Customer needs a big pile of trust agains the provider to believe, the blackjack game really gives you the same chances to win as the bank has.

The third obstacle is online payment. In order to buy or sell anything on internet you need a provider and you have to share all your credit card data. Also any transaction with such a solution needs time to ensure security and a considerable fee to pay for the middleman’s service for currency changing and international transactions.

Applications tomorrow

Imagine an application which never goes down, provably fair and comes with a built in payment solution.
All of these are provided by design at low maintenance cost.

Decentralized Applications take software evolution to the next level with the help of blockchain technology. You can deploy your application to thousands of nodes through the world.

Blockchain is a database which stores transactions. The main difference to a traditional database is that it is not stored in central computer instead it is shared within its users (nodes). This decentralized nature makes the data always available.

The certain state of the database calculated by the full history of the resulting transactions. This makes it transparent and provably fair.

The most known implementation of blockchain technology is Bitcoin. The transactions in Bitcoin contains movements of virtual money between to members of a peer-to-peer network. This solution currently competes with traditional payments as its instant, low-fee and anonymous behaviours.

DApps take this idea to the next level and let you deploy your application on the blockchain.

The decentralized topology ensures that there are no central node for single point of failure. The information is distributed between all the nodes of the network so there is no chance to loose or manipulate data.

Under the hood

Imagine the current banking system. All your money registered on the central computer of the bank. There is a ledger of your account summing up all your spendings and incomes and results you current balance. Whenever you want to buy something you have to use the service of your bank to access money. For a transaction, you provide the amount and the target account and after a rather lengthy process, the bank verifies, you really have the money and creates the transaction.

Blockchain works under the hood very similarly. The main difference is that there is no central middleman to interact with. Nodes within the network talk to each other.
Transactions are movement of money/ownership/rights/etc between two parties. Every time someone wants to send something, he just simply creates a transaction specifying the amount and the receiver and broadcast it on the network.

In order to avoid someone sending money of another person, bitcoin uses a private key encryption for the transactions. Every account has a private and a public key pair what can be used to encode and decode data. The sender encodes the transaction with his private key and sends the transaction to an unconfirmed pool on the network. Nodes later pick up these transactions and verify the signature using the public key of the sender. This ensures that only the owner of the private key can create transaction from the given account.

In reality, on the blockchain there is no stored ledger. The nodes always sum up all the resulting transactions to get the current state. For a transaction being successful it has to reference one or more unspent input transactions and reference one or more target.

Nodes on the network continuously working to verify transactions whether the are from a valid sender and all the inputs are unspent. They do this effort in return for a certain fee for every transaction. Nodes are picking up transactions from the unverified pool with the highest fee. This is how sender can prioritise his transaction.

Every data on the network is encoded by a hashing algorithm. This function turns data to a fixed-size string code. It is also designed to be a one-way function, which means it is infeasible to invert. The only way to recreate the input is to do brute-force guessing of possible inputs.

In order to nodes agree on transaction order, they create blocks of transactions. Each block contains a list of transactions, timestamp, a nonce and the hash code of the previous block. Storing this hash ensures that the sequence of blocks build a chain. This creates an immutable history of the stored transaction what results a provably fair and transparent behaviour.

It’s a fair to expect that all the nodes on the network store the same transaction in the same order and it can’t be hacked. In order to ensure that the nodes always apply blocks on the longest block branch. To decide which is the longest they do a voting. The same chances ensured for all the nodes by a mathematical exercise required to to solve finding a certain hash code. The chance to find the correct hash is random and need a lot of computing power. This is called Proof-of-work consensus. Using this verification ensures that in order to hack the transaction history you need to control at least half of the computing power of the network which would be infeasibly expensive.

The best implementation candidates

Based on the technology advantages, the best areas to use DApp platform are the ones request high transparency, high and fast availability, low maintenance cost and high amount of money transactions.

The most obvious use case is voting system. The blockchain guarantees total transparency on the result history.

The technology is also highly applicable for gambling applications as it provides Trustless solution for both the players and the application itself.