By Kiran Pachhai

What is Trinity?

Trinity is an Elastos browser project based on chromium engine that is integrated with the Elastos framework. It is an exit from the old internet and an entrance into the Elastos internet. We can also think of Trinity as an Elastos Virtual Machine that supports the lifecycle of decentralized applications (DApps) for development, packaging, installation and execution. Elastos is the official name of this app. Desktop is the internal name. Trinity is the name of the project.

What is its purpose?

This app is used to load and run DApps based on the Elastos SDK for Javascript, more specifically the Ionic and Cordova framework. In this app, the complete Elastos Runtime feature is implemented which realizes sandbox isolation between the host system and Elastos Runtime and sandbox isolation between DApps that in turn provides for a safe and reliable environment for digital assets. This app serves as an Elastos Virtual Machine that has process isolation, network isolation and digital assets protection where property rights are protected.

No but really, what does it contain?

Trinity is an HTML5 DApp development framework that contains the following:

  • DApp layer: Ionic development framework
  • Plugin layer: Cordova plugin, DID, Wallet CAR component, DApp lifecycle, Multi-DApp via Remote Procedure Call (RPC)
  • Engine layer: Chrome, Elastos Runtime, Carrier

What is the Elastos DApp Runtime within the browser?

This is the Elastos Runtime within the browser that does the major heavy lifting when calling different functionalities and features which is based on Component Assembly Runtime (CAR).

  • The executable Javascript code of DApp in Trinity: runs in the sandbox process, can’t access the system API, runs in the V8 virtual machine, and can only access the local device and the Carrier running in the Elastos Runtime process through the Cordova process for network access
  • The DApp key performance module can be developed through the local component CAR or the CAR component can be built on the existing native module
  • Compatible with Cordova plugin mechanism; Use the existing Cordova plugin to quickly develop the corresponding function
  • CAR interface Remote Procedure Call (RPC), 32/64 bit, Android and Ubuntu platform supported
  • iOS version is still under implementation
  • File System and Network Permission management
  • Local devices access APIs
  • Wallet APIs
  • Decentralized Identification (DID) APIs

What is a DApp on Trinity?

  • DApp consists of ownership and files
  • The ownership of DApp is registered on the blockchain which is put inside a personal wallet just like Bitcoin
  • Authors and Creators can sell DApp like they would sell Bitcoin
  • DApp files can be distributed

Technicalities

In Chromium, browser and render are designed to be different process models. Even when they are actually in single-process mode, they communicate through the IPC interface. The basic flow of loading a web page is as follows: after creating a Frame Tree for the web page in the Browser process, the URL of the web page is sent to the Render process for loading. After the Render process receives the web page URL load request, it will do some necessary initialization work and then request the Browser process to download the content of the web page. The URLs in CSS and JS are also parsed in Webkita and sent to the Browser process for download so we can intercept in the process of requesting Browser to download resources in Webkit.

Based on the existing permission management mechanism of the browser, combined with the DApp’s permission configuration file, the access management of the local device and data is realized.

The CAR components introduced by the DApp are limited to the DApp access and use. At the same time, in order for CAR to be called by Javascript, it is necessary to inject the JS object corresponding to CAR into chrome. We can add a CAR loader at the binding layer of the DOM layer and the V8 engine. The user loads the CAR into the current Window context through the Require method. Due to the isolation mechanism between the sites, different sites cannot access each other’s window objects, thereby realizing the isolation of the CAR component access.

A slightly less-technical summary

Elastos Browser can currently only be built for Android devices but it will be supported in other platforms in the future such as iOS, Windows, Mac, etc. After Elastos enters Beta phase by the end of this year or the beginning of 2019, you will be able to download this app from an app store or directly install it onto your phone. This app is used to load and run DApps written using Ionic framework. In this app, the complete Elastos Runtime feature is implemented that provides a safe and reliable environment for HTML5 apps to run. The Runtime is what enables the protection of digital assets and property rights.

On this browser, the open source Chromium project is used as the technical framework for rendering and running. Then, the Elastos framework, sandbox mechanism, access rights management, disabling of traditional internet communication methods (eg http/https) and Component Assembly Runtime (CAR) components are added. It also provides other functions to implement a standard Elastos Runtime where the HTML5 Elastos DApp is run.

Some of the features of Trinity browser are as follows:

  1. Virtual File System: Each app has an encrypted virtual file system built in. All DApp and DApp file data are stored in this virtual file system. This ensures that data cannot be accessed externally.
  2. Isolation between DApps: In the virtual file system, the access path permissions are set according to the ID of the DApp and the mechanism for setting file access rights is dependent on the user.
  3. Runtime isolation: It supports a separate process for each application, leveraging the natural isolation mechanism of the process along with access control.
  4. Disabling of http/https protocols: The browser completely disables http/https protocols so applications are not allowed to send any network packets out to the internet and instead will need to pass on their request to Elastos Carrier.

LEAVE A REPLY

Please enter your comment!
Please enter your name here