Decentralized Chat Prototype

The full article was originally published by Huhn on Medium. Read the full article here.

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.

https://github.com/SkalyIO/Freighter

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

https://freighter.skaly.io

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:

Read the full Article

The full article was originally published by Huhn on Medium, where people are continuing the conversation by highlighting and responding to this story.

You might also like

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. AcceptRead More

Did you know?

Buy in without the stress of trying to time the market

when you setup a savings plan. If you haven’t started a plan yet, head to your Bitpanda account to get started!

Purchasing cryptocurrencies comes with a number of risks.
Never invest money that you can't afford to lose.

You can automatically invest

in IOTA with Bitpanda Savings!