Dissecting the Client — Halloween special

array.io
array.io
Published in
3 min readOct 31, 2018

Hell is empty. All the DApps are here.

In the next few minutes, we’re going to dissect one of our key components — the Array.IO Client. You’ll come dangerously close to its insides and understand the reasons for its existence.

Why you might need it in the first place

If you want to create an app that makes use of the blockchain, you’re thinking about building a decentralized application — a DApp. For example, you have an idea of a peer-to-peer game in which players place bets on tomorrow’s weather. To organize secure money transactions between the players and guarantee that the winner gets the bounty, the best option would be to wrap it all in a DApp. By the way, I’m sure you have a much better idea for a DApp.

Our Client is the environment for your DApps. It has a user-friendly interface which gives access to the DApp marketplace and runs the installed DApps in an isolated environment. It comes with a simple but comprehensive software development kit (SDK) and offers safe transaction signing via Keychain.

This is the beauty of it. Now prepare your scalpel. We’re going in.

What it is not

What lies right under the skin is that our client is NOT a web application, as Facebook, Twitter, and the like. This means that you don’t connect to a central server to exchange and store the data. This also means that your DApp wouldn’t ever be censored and shut down. Once you’ve created it, it remains in the blockchain universe forever or until you decide to put it out.

What it is

Once you cut a little deeper and open the client, you’ll see that it displays all of your DApps in a sandboxed (read: protected) BrowserWindow. You can easily navigate between them through the control panel on the left side.

When you create a DApp with us, you get the SDK. There you will find the manifest in which you can specify the features you wish your DApp to have. For example, to store data, the client has both local storage and IPFS (InterPlanetary File System) built in. This means that if you need to have access to your data without persistent Internet connection, you can use local storage. This also goes for keeping large amounts of data. But if you want to have a distributed secure storage, you should opt for IPFS.

To sign transactions, we’ve created our own Keychain. The client uses a connection bridge to pass the signing data in and out, so that the keys travel safely. If a system error comes along, we’ve got a solution — a Logger that intercepts this kind and saves the data about them in a database. This way you can have a finger on everything that goes on in your DApp life-cycle. But don’t worry — the Keychain uses elliptic curve cryptographic algorithms that ensure that nobody ever gets close to the private keys. The system locks them in and gives out only the mnemonic labels of the keys.

A really deep cut opens up that every action that you make in the client has a unique ID (called UUID), so that you could have a dozen DApps going around their own business and the software knows where each action belongs. To allow an action to be processed, the software (middleware, to be exact) makes a permission check, which guarantees that nobody else interferes with your DApp’s actions.

Now we’ve come seriously close to the most hidden parts of our Client. You can see the Client’s work with your own eyes if you download it from our website (it’s coming soon) and follow a simple instruction on how to build your first DApp.

Happy Halloween, folks.

May your day be filled with candy bugs and sparred of the software ones!

--

--