MysteryCoin: A look under the hood of a decentralised VPN Application.

MysteriumVPN is the client application of Mysterium Network, a project focused on providing security and privacy to web 3 applications.In this article, we will discuss the architecture of MysteriumVPN and how it integrates with Mysterium Client to ensure an encrypted end to end flow of data through Mysterium Network.Cross-platform architectureUsually, you need separate builds for each platform. Now that cross-platform technology has improved, this is no longer the case.For desktop:Electron is a framework which allows us to build cross-platform applications using common web technologies such as HTML, CSS and Javascript. We are using Electron which allows us to develop one application for two platforms for desktop — Windows and Mac OS. Linux coming soon. Download our alpha.Under the hood of an Electron application, sits a Chromium browser; A website, rendered by an embedded browser.For mobile:We are kicking off our mobile development for MysteriumVPN, with Android versions set to release shortly.For this, we are using React Native for cross-platform applications.Most of MysteriumVPN is written in Javascript, which is run in a separate process. Javascript generates the virtual structure of the user interface. This Javascript process communicates to native mobile processes which are responsible for rendering the actual user interface as you see it.The architecture of MysteriumVPN Desktop Client ApplicationHow MysteriumVPN works ondesktop:Since we are using Electron, we have two processes, MAIN and RENDERER.MAIN is the first process which is started when the application starts. It is a NodeJS process which is responsible for managing the following functions:Application state and internal operationsTrayKicking off the RENDERER processThe second process is RENDERER and it is responsible for displaying the graphical user interface for the application.Communication between processes:Both the MAIN and RENDERER processes need to communicate with each other to stay in sync. For this reason, we are using a standard approach of Inter-Process Communication (IPC).Javascript is not type-safe, which isn’t very reliable. We use Flow static type checker which adds type-safety for Javascript. This especially applies to syncing data between processes — it becomes less reliable when using out-of-the-box IPC. To improve that, with custom implementation on top to have type-safety.MessageTransport describes a single typed message which is sent between processes. It creates alignment between both processes by introducing sender and receiver objects, ensuring that both sides expect the same arguments of this message.Here is an implementation:class MessageTransport<T> { _channel: string _messageBus: MessageBusconstructor (channel: string, messageBus: MessageBus) { this._channel = channel this._messageBus = messageBus }buildSender (): MessageSender<T> { return new MessageSender(this._channel, this._messageBus) }buildReceiver (): MessageReceiver<T> { return new MessageReceiver(this._channel, this._messageBus) } }class MessageSender<T> { _channel: string _messageBus: MessageBusconstructor (channel: string, messageBus: MessageBus) { this._channel = channel this._messageBus = messageBus }send (data: T) { this._messageBus.send(this._channel, data) } }class MessageReceiver<T> { _channel: string _messageBus: MessageBusconstructor (channel: string, messageBus: MessageBus) { this._channel = channel this._messageBus = messageBus }on (callback: T => void) { this._messageBus.on(this._channel, callback) }removeCallback (callback: T => void) { this._messageBus.removeCallback(this._channel, callback) } }Here is an example of communication between both these MAIN and RENDERER processes:Example: communicating country proposal updates between processes:MAIN process is managing country proposals internally and it sends all updates:this._countryList.onUpdate(countries => { this._communication.countryUpdate.send(countries) })RENDERER process listens for country updates,this.rendererCommunication.countryUpdate.on(this.onCountriesUpdate) ... onCountriesUpdate (countries) { this.countriesAreLoading = false this.countryList = countries }Having such an abstraction layer ensures that communication is type-safe, reliable and features around it are simple to test.How do we integrate Mysterium Client with MysteriumVPN Application?Once we’ve rendered the application layer, we still need to connect MysteriumVPN to Mysterium Client. Mysterium Client is a software that connects you to Mysterium Network where you are able to exchange value for bandwidth.MysteriumVPN is a client application of Mysterium Network. The successful running of our dVPN on the network will attract other use cases from existing or future businesses that require end-to-end encryption of data, thereby expanding Mysterium Network’s ecosystem.We require specific information to ensure the successful running of our dVPN service.Operation System Service Since we are running Mysterium Client under the MysteriumVPN application we need to supervise the Mysterium Client to ensure that it works.Our Data Protection Policy We make a clear distinction between personal data and usage data. We do not collect information on who you are. We collect data on session and connection inputs and outputs. This is important data for us as it gives us visibility on how our technology fares against the realities of cyber oppression. Check out our privacy policy for more information.Logging Since we are integrating Mysterium Client into the MysteriumVPN application, the application itself gets quite complex. That’s why we have to be prepared to log errors from everywhere, — our application, Mysterium Client, and from Electron.That means that there are three sources of inputs. When we are inspecting something, we need to understand that these errors can happen in three different places. We need to synchronise those and collect all relevant data from these sources.Data management in the era of web 3 is complex and we hope to do so in an ethical and fair manner. Check out how our no logs policy protects your personal data.Build on Mysterium NetworkWe have an npm package that allows for you to connect to Mysterium Client easily. This is the same package that the MysteriumVPN uses to connect to Mysterium Network. This can be used for any application — it’s literally plug and play.Interested in contributing to Mysterium Network? We are an open source project focused on bringing privacy, security and freedom to web 3. Check out our Github.

Original article was created by: MysteryCoin at

Disclaimer: This article should not be taken as, and is not intended to provide, investment advice. Please conduct your own thorough research before investing in any cryptocurrency or ICO.

Interested in Cryptocurrencies and ICO's?

Follow our telegram channel for daily cryptomarket reports!

Join @cointrends

Related Articles

pubDate Newsline

Stay on top of Altcoins and ICO trends.

Subscribe to our free Weekly Cryptomarket report

Delivered once a week, strongly to your inbox.

Subscribe to our mailing list
November 27, 2018
October 22, 2018

We have exciting updates from Q3 2018.

We’re going to be doing quarterly updates moving forward. Please let us know if you’d prefer them in a video or Medium post format.Mysterium APIupdatesOpened the network for 3rd party node operators.This means that everybody can now start hosting nodes and sharing bandwidth. Find out how you...

From: MysteryCoin
July 20, 2018

Mysterium Network: Product Launches, 20+ mil USD a day LATOKEN Exchange Added

MYST token listed on LATOKEN exchangeThe Mysterium team is excited to announce that starting from Friday July 20, the MYST token will be added to the LATOKEN exchange. Trading and withdrawals will be open on Monday July 23. LATOKEN active users are expected to seize an opportunity to access...

From: Jaime Chacón
Upcoming ICO's
This week overview
Cryptocurrency rates
*Last hour average price&change
Coin Name Price Hour
Bitcoin logo BTC $3509.48631066 -0.6%
Ripple logo XRP $0.3019971257 -0.51%
Ethereum logo ETH $91.4814123604 -0.46%
Stellar logo XLM $0.1168249576 -1.07%
Tether logo USDT $1.0165882137 -0%
Bitcoin Cash logo BCH $106.510826127 -0.01%
EOS logo EOS $1.9783625088 0.11%
Litecoin logo LTC $24.7691839233 -0.82%
Tronix logo TRX $0.0132100472 -0.33%
Cardano logo ADA $0.0302286394 -0.62%
Monero logo XMR $44.7440546999 -0.56%
NEM logo XEM $0.072338529 -0.63%