You want to play?

We need you to have a safe place to store your armies and soldiers. The perfect place is in a secure wallet like MetaMask. This will also act as your login to the game (no password needed).

Note: A digital wallet like MetaMask acts like a bank account—treat it with respect and make sure you don’t forget your password or the seed words.

Install Metamask Learn more about KryptoWar

Oops, you’re on the wrong network

Simply open MetaMask and switch over to the Main Ethereum Network.

Image 01 Image 01 Image 02 Image 03 Image 01 Image 02 Image 03 Image 01 Image 02 Image 03 Image 01 Image 02 Image 03 Image 01 Image 02 Image 03

← Back to the blog

The Beauty of the Ethereum Blockchain, Web3.js and Decentralized Applications

Published on: January 8, 2018

Yes, the incredible growth of the ETH price is great but I feel like we are talking to much about it and not enough about the technology itself which, as a developer, I find fascinating.

In this article, I would like to talk about how decentralized applications using Web3.js and the Ethereum Blockchain could change the way developers and companies manage data and interact with each others.

For those who don't know about KryptoWar, it's a war game based entirely on the Ethereum Blockchain. KryptoWar is 100% decentralized, which means that all of the data we use to run the game is stored on the Blockchain (we don't have any database). We grab the army names, soldiers count, battles results directly from the Blockchain using Web3.js (the Ethereum Javascript API).

If you want to build a website or an app right now and want to store some data like usernames or recipes you will need to have your own database that will let you store and retrieve data. This is very effective but it has some drawbacks:

  • You can be hack and get all of your data stolen
  • You can lose your data because of simple mishandling, a bug, an hack
  • It is centralized which means that you can be the only person/company accessing those data (makes collaboration difficult)

If you build a similar website or app on the Ethereum Blockchain:

  • You won't be hacked, it's impossible for a hacker to delete data from the Blockchain (if you don't allow it in your smart contract)
  • Anyone could build services on top of your smart contract (which could open up a new era of innovation and interactions between companies)
  • You can create a true ownership of data for your users

Let's take the example of KryptoWar. Since we built our game on the Blockchain, any decentralized app could connect to our smart contract with Web3.js and create another game for the owners of our armies.

Here are a few Web3.js lines of code that would let anyone detect if its current user owns one of our a KryptoArmies:

KryptoWar.getSenderArmyCount(function(error, resultCount){
    if(!error) {
       // The result of this query will return the count of armies owned by the users currently connected with Metamask
       UserKryptoArmyCount = resultCount;

       // You can then use the 'UserKryptoArmyCount' variable however you want.

Following the same logic, they could then grab more data about the KryptoArmy and build their own game on top of this ownership.

Building on an open system like the Ethereum Blockchain allows a new form of collaboration between companies. It also makes anything that is built on the blockchain much more valuable, for example our armies are not limited to KryptoWar but could possibly be used in hundreds of games!

There are still a few things that needs to be addressed for decentralized apps to really take off:

  • We need more people using tools like Metamask or Cipher (for iOS) which are required to communicate with the Ethereum Blockchain
  • The Gas cost required to write on the blockchain needs to be lowered

I feel incredibly inspired by this technology and I'm really excited to see where decentralization will take us.