We are excited to introduce our new “Spotlight Series” aimed at focusing on a different component of our ecosystem with each new article. Our first in the series begins with Trinity.
To view article in PDF:
In examining all the moving parts and distinct components that make up Elastos, it is easy to lose touch with just how massive this project is and how it ought to be defined. Elastos is first and foremost a DApp infrastructure, secondly a blockchain-based technology, and thirdly a decentralized ecosystem. But among its many components and forms – the Elastos blockchain, DID Sidechain, Token Sidechain, Ethereum Sidechain, NEO Sidechain, the peer-to-peer network of Elastos Carrier, and the storage network of Elastos Hive, to name a few – the most important of all may very well be Elastos Runtime – also known as the Trinity project or Elastos Browser. Until now, there have been very few articles and little documentation outlining Elastos Runtime, and this article intends to describe its utility, highlight what separates it from the pre-established browsers already in use, and carefully explain how it is an amalgamation of all Elastos infrastructure services wrapped up in a framework that developers can utilize to seamlessly build out their applications on Elastos.
Elastos provides a number of services that users can interact with individually using their respective APIs in Android or iOS applications. Trinity is truly a unique project because it is the browser that active users will interface with directly on a daily basis. Though the complete Trinity Browser with full Dapp lifecycle management is scheduled to be released at the end of the year, users will be able to access and engage it well before its final completion. That is, after all, the power of an agile project. Users can already use the Browser – albeit as a minimal viable product – and access some of its core features. That said, throughout 2019 Trinity is scheduled to undergo a variety of changes and augment a number of new features, so the finished product may not at all resemble Trinity Browser in its early stages. As of now, it has entered an open beta where community members can begin using the Browser and reporting bugs to the developers. Developers then play two major roles throughout the beta process: they provide fixes to reported bugs and continue to create new features as they build out the beta. While Elastos Browser is by no means prepared for mass production, it is nonetheless at a meaningful development stage where testing and trial runs have begun.
In order to explain the essence of Elastos Runtime, we must first understand the significance of its role. Although DApps can directly interact with the APIs of Elastos Carrier, Hive, or DID Sidechain independently, Runtime has a number of unique qualities and functions that cannot be supported by other components of the Elastos infrastructure:
- Versatility via Multi-Platform Support: Because Elastos Browser is supported on both Android and iOS, DApp developers only need to develop their application using one set of code in order to run on both platforms. In the future, if Elastos Browser will be supported on Windows, Mac, and Linux, it will provide tremendous versatility for DApp developers. In other words, developers can easily develop their DApps using the same set of APIs for Elastos Browser and their DApp will run on all platforms which Elastos Browser supports.
- Security via Sandbox Mechanism: Runtime provides a sandbox mechanism in which all DApps run. Most importantly, it provides sandbox isolation, network isolation, and digital rights management so DApp developers don’t have to deal with tedious issues on a day-to-day basis. From here, Elastos DApps interact with the outside world via Elastos Carrier, which by itself is an end-to-end encrypted peer-to-peer network without central servers, thus creating a completely secure ecosystem-wide DApp Runtime Environment.
- DApp Security and Data Integrity Via Decentralized DApp Distribution Channel: Much like Android or iOS, Trinity will manage its own distribution channel. Currently, developers submit to the Android and iOS Apps Stores to have their Apps deployed to the respective platforms. This process leaves Apps subject to the discretion of the App Stores and compromises the integrity of App data by storing it on centralized servers. The Elastos protocol is different: there is a dedicated DApp Sidechain that records the metadata for each DApp along with developer’s DID and signature while the actual DApp is stored on a decentralized storage. A DApp can only be installed on the Elastos Browser if it has been registered via the DApp Sidechain. Runtime verifies the integrity and the signature of the DApp and its developer before installing it on Elastos Browser, thus creating a decentralized process of DApp Distribution.
- Registry Facilitation via Toolchain: As part of the DApp management lifecycle, a Toolchain will be provided to developers to assist them in packaging their Trinity DApp using their DID and registering on the DApp Sidechain. The Toolchain represents the only DApp Trinity will let users install on their phones. This ensures that users don’t accidentally download a DApp from a developer they do not trust.
- Security and Data Integrity via User DIDs: All the user data and app data on Elastos Browser will be tied to a user’s DID and the data itself will be stored on a decentralized storage system or on the user’s Dropbox or personal cloud drive. Thus, when users install Trinity on a different device, they login using their DID and all their data populates automatically. This process parallels Apple’s use of the icloud drive to restore App settings and data to a new phone in a centralized format. For Trinity Browser, DIDs are used to conserve users’ data when they switch between devices without compromising the integrity of their data via decentralized data storage.
While there are many more advantages to using the Trinity Browser, of course no user is required to use it. There can still be other native Android, iOS, or Windows Apps that interact with various Elastos services and users can use those directly if they so choose. However, these types of Apps do not use Elastos Runtime, so the majority of DApp lifecycle management and security measures must be taken care of by individual developers and teams. This will very well be the case for some GPU-intensive applications such as games because it’s complicated to build a sophisticated game for devices using ionic framework. In such a case, the only option developers have is to directly interact with the Elastos core services APIs on their own without resorting to Trinity Browser.
One can think of Elastos blockchain as a secure channel to run code and store data that uses merged-mining to leverage the enormous hashpower of Bitcoin and protect its network. In that sense, any code that runs directly on the blockchain is super secure – be it for the purpose of sending ELA or running Ethereum smart contracts or NEO smart contracts on the respective Elastos sidechains.
However, what Trinity offers is one level above blockchain-based trust because it interacts with all of the above services while preventing applications from accessing any APIs or plugins that are not supported by the Runtime. In that way, users can utilize the blockchain or run smart contracts via the DApps that everyday users use on their devices without having to interface with the blockchain to begin with. Trinity hides away the infrastructure layer and provides a set number of APIs for DApp developers to use. In turn, users access the DApps with the trust and security of the blockchain without ever having to deal with it directly. Rather profoundly, Trinity combines on-chain and off-chain scalability solutions into one platform and packages data in such a way that developers don’t have to learn anything new to develop their DApps on its platform. It is a portal to the vast Elastos ecosystem that everyday users will interact with on a daily basis.
When development is completed – by Q4 2019 – this is what Elastos Browser will look like:
DAPP Lifecycle in Elastos Browser
- Use the toolchain scripts provided as part of the framework in order to convert your Ionic application to an elastos application that can be run inside Elastos Browser. This application will be signed using a developer’s own DID
- Once the .epk(elastos package) file is created using toolchain scripts, it’s ready to be deployed. The next step is to use the tools provided in order to register this .epk file(a Trinity app) on DApp sidechain. The app package itself can be stored on a decentralized storage such as Elastos Hive
- Once the elastos app is registered on the DApp sidechain, the DApp Center inside Trinity Browser will automatically display the registered application showing all the details of the app including the developer’s DID who developed the application
- Users are then free to download this app and install it inside Trinity Browser and can run the application after that
Below is a rough timeline of the Trinity project. This is not a set roadmap and things may change down the road but this is where Trinity is now and where it’s heading in the future going into the year 2020.
Check out the following demo video that explains in detail about what Trinity project is, where the repositories are located, how to build a trinity browser and run it on an android and ios device: