Uniqys Kit preview version has been released!
You can try it right now!
This is translation of following article:
https://medium.com/uniqys/uniqys-kit-preview-c806e5918b98
Our Uniqys Project team announced the concept of Uniqys Network on July 25, and at the same time, we released the Uniqys Kit preview version.
In this article, I will introduce what you can do with the preview version of Uniqys Kit. Our goals and prospects for the whole project are described in the previous post, so please check it out!
What is Uniqys Kit?

Uniqys Network Project aims for DApps to be familiar to our lives, and Uniqys Kit is one of our approach to achieving that goal. Uniqys Kit is a product to support DApps from the perspective of development. The two components of Uniqys Kit are Chain Core which creates blockchains for each DApp, and Easy Framework which makes developing DApps easier. Both are currently under development, and our developers are now working to create a user-friendly tool for DApps development!
Chain Core will support P2P network, PBFT based consensus algorithm, and connection with Ethereum. This allows each DApp to have its own blockchain and therefore it solves the problem of scalability, while allowing developers to select transaction fees according to their own use cases.
Easy Framework aims to be a framework for developers to create DApps without any special skills for building a blockchain. Developers can utilize existing tools to create DApps, and they can concentrate on developing the interesting part of the application.
For details, please check our official website.
What can you do with the preview version?
The purpose of the preview version is to show how far we developed Uniqys Kit and how to create DApps using Easy Framework. If you look at our DApp sample, you may understand what building a DApp with Uniqys Kit would be like. (Now there is only one sample, but we will be adding more in the future!)
Uniqys Kit is still in an early stage of development. For Chain Core we already implemented a part of P2P network, but we haven’t implemented these things:
- Consensus algorithm
- Connection with Ethereum
- Management of stake
- Management of deploying and updating DApps
- Plasma-like security system
- Countermeasures for DoS attack
- Sandbox for DApps in each node
- Getting state’s Merkle proof
Please be aware that our sample application is running with chain-core-dev which does not have P2P network feature implemented yet.
For Easy Framework, it is already available for developers to create DApps, but please be aware that it may change its specification.
This is the first step of our long journey!
Trying the sample application
Now, let’s try running the sample application!
Here we will try running “Messages”, an message sharing application which you can send tokens to other accounts.
1. Setup Uniqys Kit
First, clone the repository.
$ git clone git@github.com:uniqys/UniqysKit-preview.git $ cd UniqysKit-previewNext, we need to set up the packages. Uniqys Kit is a monorepo built with npm and Lerna, and you can set up with two commands.
💡Make sure to use Node v10 or later versions. We recommend using ndenv.
$ npm install
$ npm run bootstrapniqys Kit is implemented with TypeScript, so you need to build.
$ npm run build2. Run Messages
With the previous setups, Messages will be built as well. So now all you have to do is to change directory and start!
$ cd packages/samples/messages
$ npm start3. Use Messages
Open the browser, and open http://localhost:8080. Let's try posting a message and sending a token.

3.1 Post a Message
In the text box, enter a message and click the post message button. Then, you will see a confirmation dialog, so click accept.
💡You can check what action will be executed in the confirmation dialog.

When the posting is successful, you can see your message on the timeline, and you receive one token.
3.2 Change to Another Account
The preview version of Easy Framework saves account information on client browser’s local storage. (This implementation is only for development.) So, you should use secret window for changing your account.
💡Address will be different and token balance will be 0.

3.3 Send Token
Submit a message with your new account, and receive a token. Click on the send token button on the message submitted by the previous address, and the token will be sent to that address.
How is it working?
Let’s look into how Messages is working! If you check the log shown when starting up the application, it will be easier to follow the operation.
Overall Structure
DApps using Uniqys Kit including Messages are composed of Easy Framework, Chain Core, application logic (hereinafter called App), and client-side logic.

App does not need to implement interactions with blockchains, and it is implemented as an simple HTTP server application.
https://github.com/uniqys/UniqysKit-preview/blob/632f79527a3fbd0a0547300aeb56f584b691ffd2/packages/samples/messages/server/src/app.ts
Also, client is implemented as a single page HTTP client application.
https://github.com/uniqys/UniqysKit-preview/blob/632f79527a3fbd0a0547300aeb56f584b691ffd2/packages/samples/messages/client/app.vue
HTTP Request and Proxy
When you access to the http://localhost:8080, the HTTP request will be received by the Easy Framework gateway. The gateway will check if the request is signed, and if it is, it sends the request to the blockchain as a transaction. If it isn't signed, the request will be directly sent to the App. In this case, the request is a simple GET / request without a sign, so it will be sent directly to the App, and the index page will be responded.
Application Database
Application state is saved in the DB provided by Easy Framework. App can manage data by using the Memcached Protocol. Inside the DB, Easy Framework constructs a Merkle Patricia Trie, and the root hash of it will be stored in the blockchain via Chain Core.
DB management with Memcached Protocol:
https://github.com/uniqys/UniqysKit-preview/blob/632f79527a3fbd0a0547300aeb56f584b691ffd2/packages/samples/messages/server/src/app.ts#L31-L36
const db = new Memcached(dbUrl)
...
const message = await new Promise<{ sender: string, contents: string } | undefined>((resolve, reject) => {
db.get(`messages:${id}`, (err, message) => {
if (err) return reject(err)
resolve(message)
})
})Creating Transaction
Every operation which updates the state of application will be stored in the blockchain. With Easy Framework, you can create a transaction by sending a simple HTTP Request from the client. Users will be able to see what action will be taken by the App with the confirmation dialog, and they can sign the transaction.
Creating transaction:
https://github.com/uniqys/UniqysKit-preview/blob/632f79527a3fbd0a0547300aeb56f584b691ffd2/packages/samples/messages/client/app.vue#L155-L166
easy.post('/messages', { contents: message }, { sign: true })
.then(({ data }) => {
this.resolves.postMessage = {
id: data.id,
content: data.contents,
}
return this.updateMessages()
})
.then(() => {
return this.updateAccount()
})
.catch((err) => this.rejects.postMessage = err.toString())How is Transaction Confirmed in Blockchain Executed?
Transactions created by clients will be sent to Chain Core and stored in the blockchain. When a consensus is taken in the blockchain network, an HTTP Request with sender information attached will be sent to the App. Then, the App will update the state with the Memcached Protocol as explained.
Checking if request is thrown via blockchain:
https://github.com/uniqys/UniqysKit-preview/blob/632f79527a3fbd0a0547300aeb56f584b691ffd2/packages/samples/messages/server/src/app.ts#L13-L18
function viaChain (ctx: Koa.Context): string {
const sender = ctx.header['uniqys-sender']
console.log(sender)
if (!(sender && typeof sender === 'string')) ctx.throw(403, 'access via chain required')
return sender
}The Uniqys Kit is still under development, but we will keep evolving its features and we hope that it will be supported by many DApps developers!
To achieve the future with many DApps in our hands, we will keep updating our information in this Medium. Please look forward to it!

