Towards Web3 Native DApps

There are already more than a dozen of great Web3 infrastructures who are constantly breaking the boundary of blockchain technology and trying to take our industry a step further toward the dream of Web3.

In this article you will find our vision regarding Web3.

Web3 Native DApp

Web3 Native DApp refers to the DApps that takes full advantage of decentralization provided by the blockchain technology.

The adjective "Web3 Native" comes from the term "Cloud Native (opens in a new tab)".

Below is the architecture of a Web3 Native Dapp we envision, comparing to a not-so Web3 App architecture which we call Hybrid Web3 App.

Hello

A Hybrid Web3 App usually adopts the same architecture of a Web2 App where the user send requests from the frontend to the backend server and the server does the computation and storage. The only difference it makes is that, in the backend server, there is a private key which operates tokens on a decentralized blockchain "on behalf of" the users.

To compare with, A Web3 Native DApp does not have a centralized private key controlling users' assets. The backend of the DApp is fully implemented in a smart contract runtime, which is open, transparent, permissionless and it is the logics defined by smart contracts that controls everything from the users' assets to the functionality of the DApp.

Breakdown with 6 Questions

Here are 6 questions that can help you understand our vision of Web3 native in details.

Does user own their data and state?

The first essential feature of a Web3 DApp that most people talk about is data ownership. But owning the value of data is a vague description, so I usually think about it from 2 angles: data attribution and data privacy.

  • Data Attribution - all data published by the user and all state transitions incurred by a user's in-DApp behaviors should be explicitly attributed to the user
  • Data Privacy - user can choose to only reveal data to designated parties and can update the data visibility

The value of the data comes from the trading of data atrribution and the data visibility towards specific parties in the trade. And in the era of Web3, with tokens being the representation of data atrribution and visibility, their value gets to be discovered in a much more free and frictionless market.

In a Hybrid Web3 App, users' data are published and recorded in a centralized server makes them unprovable to have clear attribution. The privacy is also tampered as the backend is a blackbox and you have no idea what's being recorded and what's not, let alone there's no way for you to utilize any cryptographic tools to conceal your key information.

However, with the Web3 Native model, users are identified with a single public key and all data are stored under a State Tree with the public key as key path, forming an explicit attribution to the user. No one will able to change it unless a transaction is signed with the according private key and use this transaction to trigger predefined contrat logics. The backend is a fully transparent environment where every single user can see what user behaviors are recorded. And if a user wish to hide some info they can use tools such as Zero Knowledge proof to do so.

E.g. Games can have trustless free market for players to trade in-game assets and fabricate unique new assets. When an in-game asset is created, it is directly stored as a piece of data under the user's address. The way how it can be fabricated is a piece of logics predefined by the smart contract. The user can freely trade this asset to others and no one else will be able to steal or destroy it, not even the first builder of the game.

E.g. UGC platform can be formed in a peer-to-peer network. All the content producers can keep the content in their local servers and viewers will access these server to access the content. A streaming payment channel can be established between the producer and the viewer where for every byte of the content the user download, they pay a penny of cryptos. The content itself can be encrypted and watermarked with viewers public key to prevent from piracy behabiors.

Can governance make actual changes?

Apart from the data published by users, the logics, rules and functionalities of the DApp defined by the DApp builder should be fully implemented with smart contracts, running in a provable smart contract runtime. The builder of the DApp shall be able to give the right of updating all the logics and functions to its users by defining a sustainable governance mechanism to make it fully community-driven.

This cannot be done with the Hybrid Web3 model, as all the logics are hard coded in a blackbox server. And even if the App operator wants to make it public and is open for making changes according to the voting result of community governance, the execution of the result won't be a trustless procedure for users to believe in it.

In a Web3 Native model, all smart contracts that compose the functions of a DApp can have a clear update rules, so that governance can change or delete them, as well as open API, so that governance mechanism can extend its functions. The governance mechanism shall be defined with a set of smart contracts that no one can change. The governance result are based on the voting towards some data that are published to the smart contract environment beforehand. The result of the governance wil directly lead to an upgrade to relevant smart contracts with no intervention from any centralized parties.

E.g. A DApp can be grown from a DAO by letting all the DAO members collective build all the functionalities of it from ground up. Each single functional component of this DApp will be decided directly by the DAO governance. No hidden functions.

E.g. Players of a game can design and launch their own adventure for other players to enjoy. This adventure can be ensured to be fair and square as all the rules of it are reviewed and agreed by the governance.

Are the assets secured by trust or verification?

Having ownership for all the data and functions of a DApp is a great first step, but being able to keeping them without trust but verification is also a key feature.

In the Hybrid Web3 model, the ownership of data, functions, and assets are totally in the hands of the server operator (sometimes the cloud server provider). So trust the App operator is the only security mechanism here.

In the Web3 Native model, the server runs a provable smart contract environment where every single execution of a operation code as well as every CRUD operation to any data are provable. I.e. a proof can be generated. Anyone can take the proof to verify the integrity and the correctness of everything happened on that server by sending the proof the blockchain. The blockchain will offer the result of verification and act as a court to do arbitration based on the proof. Any malicious behaviors, such as rejecting providing the proof or proving a wrong proof, will make this DApp losing its users once and for all.

E.g. In a casino game DApp, the process of the radonmness generation can be proven to be based on a set of rules, which are practically secured by a decentralized public blockchain.

Is it censorship resistant?

Just like the blockchain system, a DApp should be decentralized, permissionless and distributed so that anyone can keep a copy of the Dapp data.

In the Hybrid Web3 model, everything are contained in a centralized server. Once a user is rejected by the server or the server gets shutdown by its operator, the user losts all the data along with the value of the user's assets in that DApp.

In the Web3 Native model, the backend of the DApp is practically a network where each node in the network keeps a copy of all the latest data. So even if a few nodes goes down the DApp will still be operational and users will never lose their assets.

E.g. A player who cares about the game DApp can keep run a node to keep a copy of their latest data. If the game builder decides to shut down, all the players who have a node can still play it with the latest status of the game.

How's the user experience?

Due to the decentralized nature, A DApp can be facing chanlleges on its system performance which could cause an inferior user experience for its user. Usually the performance is measured by the system throughput rate (in TPS), storage capacity, transaction Gas fee, as well as the transaction confirmation latency. These performance metrics will eventually affect the end user experience.

Hybrid Web3 and Web3 Native applications have different level of decentralization.

In the case of the Hybrid Web3 App, all assets(i.e. tokens) are operated in a centralized off-chain environment which mainly relies on society consensus as its trust mechanism. These tokens can be withdrawn to a Layer1 blockchain if the authority permits it.

In the case of the Web3 Native DApp, assets are fully operated in a provable smart contract environment whose trust mechanism is based on a decentralized Layer1 blockchain. Being provable means all the assets can be freely withdrawn from the DApp into a Layer1.

However, although these 2 architectures have different level of decentralization, as the computation and storage are both done off-chain, their system performance are about the same level.

Building a Web3 Native DApp

As a developer, you may ask where should I start with building a Web3 Native DApp. Idealy this question should be answered by pointing to a good enough infrastructure solution that provides all the necessary tools and environment.

The solutoin of such an infrastructure has two challenges: the architecture and the programming language.

Solution Architecture

The architecture of the solution we are looking for is a smart contract execution runtime that can generate proofs to be verified on a Layer 1 blockchain. Ideally this runtime should acts as a DApp container that allow builders to throw their code in and spin off a DApp in no time. It also has to be compatible with all the existing Web3 infrastructures so that all the assets from different ecosystems can be integrated.

The idea of Modular Blockchain (opens in a new tab) architecture as well as Layer2 solutions such as Optimistic Rollup (opens in a new tab) and ZK-Rollup (opens in a new tab) offers the path towards the solution for this challenge.

Feel free to click in the links to learn details about these advanced technologies.

Smart Contract Programming Language

The programming language for Web3 Native DApps should be optimized for describing assets and composing functions, so that the data ownership and governance based upgrades can be better implemented. Along with that, the safety of the assets should be a prioritized design goal for the contract lanaguage as well. So finding the balance between flexibility and safety is the main challenge for a smart contract programming language.

Move Language (opens in a new tab) is a object-oriented programming language. It is designed to address this balance issue.

With Move, developers can use struct to define arbitrary types of assets. The assets can also be passed into functions as arguments, so that all the assets can be flexibly operated by different smart contracts. In the meantime, the creation, destruction, and ownership of the assets are explicity defined with language decorations, giving language level safety to all the assets defined by Move Language.

As a new programming language, Move is promoted by more than just one communities and projects. (See Awesome-Move (opens in a new tab) for a list of Move powered blockchains) This gives it great potential to grow into a much popular choice of language in the future.

Move Language also has built-in support for features such as contract upgradability and account abstraction, making it easier for DApp builders to eliminate pain points for their users.

Conclusion

In this article we have discussed 6 key questions regarding how do we achieve true Web3. Here's a back-to-back comparsion between Hybrid Web3 DApps and Web3 Native DApps in terms wether they could achieve these Web3 features.

Hello

Having these features as the final goal, we have also discussed what does it take to build an infrastructure solution for developers to design and build Web3 Native DApps.

Along with other pioneers, at Rooch project, we share the vision of Web3, and we are working on delivering the best product to all Web3 builders.

Feel free to checkout our documents to learn more details about the solution of Rooch.