
Decentralized Chat Prototype
The goal is to build a decentral and privacy protected chat application for the open marketplace. I’ve built a chat prototype with WebRTC and MAM in a previous post, which connects directly to two browsers via WebRTC. I did use MAM to get the connection between the browsers and we don’t need a middleman server anymore and can use the Tangle. In this article, I will test the messaging system Freighter, an open-source project developed by Peter Willemsen and Dennis Schouten from SKALY.
Let’s take a look into Freighter
Freighter: Grand-scale, stateless decentralized messaging channels.
It runs on top of IOTA and is a second-layer protocol.

We can easily import the lib directly in the project and use Freighter in my Nuxt application, an open-source framework that makes VueJS web development simple and powerful.
import { Freighter, FreighterCrypto, FreighterPolling } from 'freighter'
import { composeAPI } from '@iota/core'
const iota = composeAPI({
provider: "https://nodes.comnet.thetangle.org:443"
})
const freighter = new Freighter(iota, “MySecretChannelKey”)
const message = "Hey IOTA! Greets from Skaly"
await freighter.sendMessage("FREIGHTER9EXAMPLE", message)
That’s all — with this code snippet, you can send a message in a secret channel.
For a detailed explanation of how Freighter works, please watch this video.
https://medium.com/media/e901f7944042a5e144e716bcb8ff96c7/href
You can also test Freighter in an online demo

For the Chat prototype, I also want to build and test a command line styled frontend. I use this vue-command component, which brings some nice features. And this is how it looks:

