Polkadot Eco AMA 丨Phala.Network : Web3 Analytics, a New Privacy Protected Analytics Tool

Polkabase
18 min readFeb 18, 2020

--

Q: CryptoSky, CryptoSky Community AMA & Airdrop Acitivity Leader

A: Hang Yin (h4x3rotab)
Phala.Network
Co-Founder
Chief Scientist
Polkadot China Ambassador

At UTC 13:00 on February 15th, This time, we have brought together the two-month Polkadot Ecosystem Project AMA series, which has been launched to the 2nd AMA. We have invited the Polkadot Ecosystem Project — “Phala.Network“.

LianDu, CryptoSky Community and PolkaBase invited the co-founder and chief scientist of “Phala.Network” and the Polkadot China Ambassador “Hang Yin” to share with everyone, “Google Challenger, time to talk about privacy and smart contract”.

Phala.Network (hereinafter referred to Phala) was founded in 2018 and has always been committed to the implementation of trusted computing technology. The founding teams all have rich experience in Internet industry and cutting-edge technology research support (Fudan University System Software and Security Lab). Previously the pLibra project also won the Grant support from Web3 Foundation.

Phala will become a parachain to Polkadot, and through the TEE blockchain hybrid architecture, it will be the first time that a true universal privacy smart contract will be realized. Phala adopts layered consensus on-chain and off-chain to achieve contract-level high-performance sharding.

As a new brand, Phala.Network not only participated in the Polkadot ecosystem project AMA series, but also cooperate wth LianDu and PolkaBase to create the First Online Brand Conference in year 2020.

At the brand press conference, Phala released their network structure diagram and full version of the white paper. (Https://phala.network)

Phala has also made a big move recently, and is currently applying for a new W3F Grant. A never -seen decentralized application data analysis tool: Web3 Analytics (W3A).

Yin Hang stated that Phala’s W3A will achieve to beta phase in March this year and is expected to be officially launched in April. At that time, all developers and users can experience the convenience brought by blockchain encrypted smart contracts.

Until April, Phala will prepare for the work of testnet and the team will conduct open testing. Yin Hang said that he welcomes the developers of Web2.0 and Web3.0 to integrate W3A in their products, and also welcomes users to experience personal data management apps. reward.

Finally, Yin Hang hopes to open the W3A data trading market during the time the main network of Phala Network is launched, “to allow the collected data to be used to break the data silos and generate greater value.”

Conference content is as follows:

Host:

This time, we have brought together the two-month Polkadot Ecosystem Project AMA series, which has been launched to the second phase. We have invited the Polkadot Ecosystem “Phala Network” project.

Phala Network, founded in 2018, has always been committed to the implementation of trusted computing technology. The founding teams all have rich Internet experience and research support of cutting-edge technology (Fudan University System Software and Security Lab), and have also won the ecosystem support of the Web3 Foundation.

Phala Network’s detrusting is achieved by connecting the Polkadot network through a bridge, which can achieve TEE + remote authentication.

Tonight is not only the second ama of our ama series , but also the first online brand launch event on Phala Network.

First of all, we will have an in-depth AMA with Yin Hang, co-founder of Phala.Network. Phala brand conference will launch new product, we will take a look at the latest development of Phala. There will be our free question and answer time at the end, everyone can communicate with each other.

Hang Yin:

I am particularly honored to cooperate with CryptoSky to do this online conference.

Host:

Hang Yin is one of the few official Polkadot Ambassadors in China. Can you share with us your work as Polkadot Ambassador and your role in the project Phala.Network?

Hang Yin:

It is an honor to be one of the Chinese Ambassadors of Polkadot. Phala.Network’s goal is to become a parachain in the Polkadot ecosystem, because not only do we implement confidential smart contracts on our own chain, but we also want to provide the capabilities of confidential contracts to other chains. Polkadot can just play our best.

Now that Phala.Network is of Polkadot Ecosystem, of course it wants Polkadot. As the ambassador of Polkadot, in addition to the online community to do technical communication with you, we mainly hold technical sharing sessions from time to time. We have done three workshops in Beijing and shared a lot of ecosystem development experience to help everyone avoid our step-pits.

As the chief scientist of Phala.Network, I am mainly responsible for the design of the protocol and solving the core technical problems, so compared to the specific development, I pay more attention to the performance and security aspects of the protocol. Of course, the code must also be written.

Insert an ad, if you are interested in Web3.0 / Rust / letter computing, welcome to join us to play! 😂

Host:

Phala.Network is the same team of pLibra project that we are more familiar with. We know that pLibra is a privacy computing project derived from facebook’s libra, including the domestic libra community. You also organized the community LibraChina. Then you can talk about the relationship between Phala and pLibra. What relationship?

Hang Yin:

Before I answer this question, I want to introduce what Phala.Network is and what kind of team we are, and then you will know.

In fact, the Phala team was established in the middle of 18 years. At that time, we found that the smart contract of the Web3.0 ecosystem can be detrusted, but the price paid is that all data must be open and transparent. This is obviously a big obstacle for many applications There is no way to “decentralize”. We want to solve this problem, so the purpose of the Phala team was to develop smart contracts that can be kept secret.

Over a year, Phala has evolved from concept to white paper. But as I said just now, the protocol is something that is difficult to feel directly, so we have to create an application to give everyone a practical experience that our core capabilities can only be achieved by Phala, and other developers might cannot.

So in the middle of 2019, we proposed pLIBRA, which uses the capabilities of Phala.Network to provide privacy protection for Libra users. We also perfected the Phala infrastructure during the development of pLIBRA. Until now, pLIBRA is about to complete Milestone2, and most of the code has been open source.

So back to the previous question, what is the relationship between pLIBRA and Phala,

Phala is the underlying protocol we have developed for more than a year, and pLIBRA is the first DApp to be implemented on top of it.

Host:

Thank you, Phala is also a project that Polkadot won an official grant (I heard that it is about to apply for the next round). What are the characteristics of building a contract on Polkadot and are there any technical problems?

Hang Yin:

Yes, pLIBRA is also our first project to get a W3F Grant.

On the surface, the development and application on the polkadot is the “one-click chain” that everyone likes. The chain must have a lot more freedom than contract development. There gonna be a lot of discussion in this area, and I will not repeat it today.

What I want to say is that the technology and ideas behind Polka are really profound.

If you pay attention to polkadot official, you will find that they have been repeatedly mentioning the concept of “shared security”, which is a very, very important feature. It can be said that without shared security, the function and meanning of cross-chain will be greatly reduced.

Polkadot allows parachains to call each other. For example, the token issued on my chain can be used by another DEX chain. Everyone has used the exchange, deposit and withdrawal of coins need to wait for several blocks to confirm, this is to ensure the security of the transfer.

If you do not wait and the transaction has not been settled, then once the chain rolls back and other problems, the exchange will lose money. The design of polkadot solves this problem, and transactions of all chains are executed synchronously and verified by polkadot validators.

This secure cross-chain capability is the main reason we choose Polkadot. At present, polkadot’s parachain is open source and will be launched soon. Details of cross-chain communication will also be launched soon.

Host:

So we will apply for the next round of grants soon?

Hang Yin:

Yes, our pLBIRA project has received a funding plan from the Web3 Foundation, and is currently applying for a new W3F grant. The specific new project will announce a little bit soon.

In addition to adding a bit, in addition to W3F Grant, we currently have an angel round of financing from Candaq.

Host:

Thank you. Phala is an Internet platform that mainly provides privacy calculations. The characteristic of the blockchain is that it has a high degree of privacy. Why are privacy contracts so important?

Hang Yin:

I think I have already mentioned in the above question. The confidential smart contract implemented by Phala is because of the smart contract of the Web3.0 ecosystem. Although it can be detrusted, the price paid is that all data must be open and transparent, allowing many applications, No way to let applications to land.

Host:

Okay hope the next round of grant goes well.

How is that specific credibility implemented on Phala? How is it different from previous smart contracts such as Ethereum?

Hang Yin:

Phala is a confidential smart contract based on trusted hardware (currently Intel).

I think this question is very good, I will explain it in details…

Bitcoin is the first and most widely known to trust currency. Bitcoin mainly uses the blockchain to solve the double spend problem. Ethereum extends transaction scripts to execute arbitrary logic to trust smart contracts.

But as long as the blockchain is used, the data must be made public, which results in many applications that need data confidentiality cannot be trusted.

Phala is not Byzantine. We detrust are guaranteed by trusted hardware, but separate hardware cannot solve two problems: availability and state consistency. Separate hardware can’t provide service when unplugged, it just doesn’t satisfy the availability. Multiple trusted computing nodes need to interact, and the sequence of code execution is unknown will lead to double spend, which does not meet state consistency.

So we have returned to the same problem with Bitcoin, we need to use the blockchain to solve these two problems. The stored data encryption is stored on the chain, and anyone can not be available without having to be permission to assign the node to be consistent.

In addition to data confidentiality, we have two other advantages. The first is contract-level parallelism, because non-Byzantine, we do not need to implement detrusting through each node consensus once, so we can achieve extremely high performance. The second one is born to support cross-chain. Phala’s contracts are executed in parallel, and they need to cooperate with the interoperability agreement between smart contracts to achieve mutual calls. This interoperable protocol can be used not only between contracts, but also compatible with multiple cross-chain methods (transponder bridges on Phala, XCMP protocol from Polkadot, etc.)

Hang Yin:

This is an architecture diagram of our chain, where the Phala.Network blockchain is the core, and the exterior is composed of Gatekeeper and miners.

The execution of the contract is completed on the miner node, which can achieve complete parallelization.

So to sum up, Phala contains a main chain and a network of trusted hardware miners. In the future, it will strive to become a parallel chain of Polkadot. The contract is executed in parallel on the trusted node, and the developer deploys the bridge and DApp on the network in the form of a contract. Among them, the main chain provides cross-contract and cross-chain calls, miners provide computing power, and the transfer bridge realizes communication with external blockchains.

Host:

Thank you,

Suppose a developer wants to switch from an Ethereum smart contract to a Phala contract. How should it proceed, what are the costs, and what are the benefits?

Hang Yin:

In short, Phala is an Ethereum where contract data can be kept secret. Many things that could not be done on Ethereum became possible on Phala.Network.

we support WASM smart contracts, like Polkadot. Any language that supports WASM can be used to develop Phala contracts. In particular, for existing Solidity code, you can use Solidity to WASM compiler to migrate.

So we strive for the lowest cost developer migration.

Origo is a zero-knowledge proof-based privacy contract chain that can achieve more general privacy calculations. In fact, we have sorted out various existing privacy protection technologies.

There are multiple privacy protection technologies, each of which can achieve different levels of protection. We often divide privacy protection technology into three generations.

The first generation of technology: typical representatives of Zcash and Monero. They have realized the privacy protection of transactions through technologies such as zero-knowledge proof, ring signature, and confidential transfer.

Second-generation technology: A typical representative is Aztec, a privacy protocol on Ethereum that uses technology similar to Zcash to achieve transaction privacy for any ERC20 token. The second generation technology is an extension of the first generation, but they can only achieve transaction privacy. If Turing complete smart contracts are involved, there is nothing they can do.

The third generation technology, we hope to expand the concept of “privacy protection” to “confidential protection”. Privacy not only refers to the user’s transaction privacy, but also to protect any confidential data in smart contracts from being leaked. With the current smart contract technology, all data must be fully disclosed, and we hope that the “Confidential Smart Contract” can perform general calculations like Turing’s complete smart contract on Ethereum, but does not need to expose confidential data.

and current confidential smart contract technology can be implemented through multiparty computing (MPC) and trusted execution environment (TEE).

The former is based on pure cryptographic technologies such as homomorphic encryption and zero-knowledge proof, and does not rely on hardware. It can be applied in specific fields with high efficiency, such as verifiable random numbers and distributed key generation, but in general computing. There is an average performance loss of one million times.

The latter is based on trusted computing hardware (mainly Intel’s CPU), but can already achieve very efficient general-purpose computing. Phala.Network has chosen a trusted computing solution and is committed to implementing a universal Turing-complete smart contract for protecting confidential data.

Then let ’s take a look at the TEE-based solution:

In the TEE-based scheme, Easiden of OasisLabs is one of the more complete protocols, but all such TEE protocols cannot implement mutual calls between contracts, that is, combination ability.

If you pay attention to the Ethereum and its ecosystem, I think everyone has heard of the premise of the existence of the DeFi ecosystem on Ethereum.

Because different projects are deployed on Ethereum in the form of smart contracts, they can seamlessly call each other. With MakerDAO, Uniswap, and Compund and dYdX, a complete ecosystem.

Composability is a big shortcoming of the current TEE project, and Phala has realized the composability between contracts and even across chains through innovative design.

Host:

We should now have a preliminary idea of Phala. At the same time, Hang Yin just said that he is currently applying for a new W3F funding. Can we reveal the new product now?

Hang Yin:

Yes we go

Host:

Okay now let’s enter the part of new project announcement.

Hang Yin:

Our upcoming project is Web3 Analytics.

I want to ask two questions first: Will Web 3.0 products be decentralized? Must big data violate user privacy?

Everyone can think about it. These issues express the fragmentation of the two generations of networks and have always troubled us: we don’t think that decentralized, privacy-protected and easy-to-use Internet products must be distinct. We also don’t think that the product of the blockchain world is enough web3.0. In fact, countless blockchain DApps and official websites are using centralized Google Analytics products.

Therefore, we hope to provide an analysis tool with low access costs and an experience similar to the Google Analytics used by everyone. It can help developers and enterprises analyze product data under the premise of protecting user privacy. Anyone with user authorization can use long tail data for analysis.

Our solution is Web3 Analytcis (referred to as W3A): a decentralized application data analysis tool. Based on the TEE blockchain technology, the product can realize the ownership of data and management rights to users, and on the basis of this, it can implement functions such as data embedding, reporting statistics, and visual analysis panel.

W3A is targeted at three types of users: common users, developers, and data analysts.

The W3A-integrated website does not leak data when users visit it. Users can fully control how their private data is used, and they can even delete data that they do not want to collect at any time.

The data analyst can use the data deposited on W3A to create more value, of course, if the user allows it.

As a senior software engineer at Google, why do you think this product will be more acceptable to developers and users than Google Analytics? In addition to privacy, can you reach Google’s standards in terms of data volume or experience?

OK, but I want to be sure that many people are interested in what W3A has done, and how it works

so I started with what problems it can solve

In fact, the main problem we solve is: decentralized management of off-chain data.

Web3 developers are forced to use Google Analytics and forced to believe in centralized companies. An interesting statistic is that more than 70% of Internet applications use Google Analytics.

The problem here is that Google Analytics holds user data, users cannot delete or download their own data, and cannot guarantee that a centralized company can completely erase their own data, so users will naturally not be able to freely manage the rights of third party services to use data and method.

Finally, the ownership of the data is actually the user, but neither the user nor the developer can be reasonably allocated from the value of the data.

So we created W3A in order to solve these problems completely:

  1. W3A provides Web and mobile SDKs:
  2. Decentralized user data management: users can manage data and its access rights through the console
  3. Developer data panel: complete data analysis through templated W3A contract and display to developers
  4. Data Market: market-oriented data buying and selling, providing data joint analysis function, generating more value

Hang Yin: This is a diagram of W3A architecture

Among them, the data reporting of the Web3 Analystics SDK is end-to-end encrypted. Data is stored in a decentralized storage service after encryption.

Only the user and the W3A confidentiality contract own the data key. As a result, users can manage, authorize, and delete data. Confidentiality contracts operate within the TEE environment and only perform authorized data analysis.

Data analysts need to code the use of data, that is, to generate W3A smart contracts. W3A smart contracts are executed only after being authorized by the user. Authorization of the contract is entirely managed by the user.

Host:

This is really a win-win for both our users and data engineers.

Hang Yin:

Only authorized smart contracts can analyze encrypted data in the TEE environment and output the analysis results. The analysis results can be displayed in the W3A visualization data panel.

Finally, every analysis request leaves a log on the chain. For the analysis tasks from the Web3 data market, the transaction amount is clearly visible, and the profits can be reasonably distributed to the data owners.

Since the data must be kept secret and can be jointly calculated, W3A, as a completely decentralized data management protocol, must also be built on a confidential smart contract network such as Phala Network.

Let’s return to the topic just now.
W3A mainly does two things: let users take back their own data ownership, and break down the data silos while allowing users to use data.

For users, W3A can not only give users maximum privacy control, but also potentially profit for users. The latter is similar to Brave / BAT.

For developers, the promise of privacy protection can reflect their responsibility to the user, and when the data is profitable, they can also have an extra income.

So someone will ask, does it require complicated development to integrate W3A?

The answer is no. You only need to embed a few lines of code in the existing application. Our confidentiality contract will complete all the remaining work, as simple as integrating Google Analytics. We will provide a user-oriented personal data management app. And a data analysis backend for developers.

This is a demo screenshot of the data visualization background. Basically, the analysis capabilities provided by the familiar buried point tools are all realized. The cost of migration is extremely low.

Host:

Several friends just asked for concern because we are still a relatively new project: how is Phala’s subsequent node settings designed and how do developers join? Are there incentives for early developers?

Hang Yin:

In the Phala network, the core roles are Gatekeeper, trusted miner, nominee, and Phala DAO.

As a Polkadot ecosystem project, we also use Polkadot-like NPoS to implement node election and community governance.

Miners are responsible for implementing confidentiality contracts and providing trusted computing capabilities to the network.

Phala DAO is a decentralized organization composed of core development, Gatekeeper, investors, and miners. It will be responsible for community governance, core development and financial decision making, and will be responsible for the value growth of the Phala network.

friends here might be interested to ask just now what consensus we use. The simple answer is NPoS (Babe + Grandpa of Boca), plus the consensus of TEE off-chain environment.

In our first product W3A, the main role users and developers can be motivated from our product.

Developers can participate in chain mining and mining, and we will provide generous rewards for the first developers to access W3A.

For developers, as long as they access W3A, we will divide several batches, the sooner they access, the higher the airdrop reward.

On the other hand, in order to promote ecological construction, we are not a simple airdrop for developers. Developers need to complete certain tasks to get more rewards, such as whether the access time is complete, the number of visits, the number of users , Number of active Phala users and proportion of data size.

As well: ordinary users: can participate in data mining
Users provide data for the W3A network and can participate in data mining, that is, when visiting the website equipped with W3A, they can get rewards based on the amount of usage.
If you have experienced Brave, you should be more impressed.

In addition, we also have corresponding incentive plans to provide rewards for participants who contribute to W3A promotion.

The specific incentives for this plan will be given to Phala DAO for formulation, and we will announce them one after another.

Host: Great 👍

Hang Yin:

What is the progress of the first product W3A, when will it be officially launched, and what are the ways to participate?

Our first product launch is W3A.

We are about to test it in March.

It will be open to ordinary developers and users in April.

We will find the first batch of developer partners for internal testing in March, and at this time we can start the first batch of reward programs.

In April, Phala will also usher in the test network. We will conduct open testing. We welcome developers of Web2.0 and Web3.0 to integrate W3A in their products. Users are also welcome to experience our personal data management App for you all to get rewards.

Last, We hope to open the W3A data trading market right near the time that the main network of Phala Network is launched, so that the collected data can be used to break the data silos and generate greater value.

👏👏👏

Host:

Appreciate you , Mr. Yin~~ I hope Phala Network is all well. This is all content of tonight’s conference. Appreciate everyone here !!!!!!

Free Q&A Essentials:

Q: There were some TEE exploits (Cache, BPU and etc) in recent years, are there any concerns?

A:

Yeah, so there are a few ways to defend. First of all, TEEs are patchable. So the network will reject any TEE with known issues to participate the network until it gets patched. Besides that we also have a few measures to protect the network.

We put the confidential smart contracts in a sandbox inside TEE. So it will be much harder to exploit the TEE by side channel attacks.

Also, confidential contracts run in parallel, which means even in the extreme case when you exploit a single hardware, it’s still not possible to compromise the entire system.

We also have forward secrecy design. So an old exploit can’t affect future computation tasks.

Q: How does Phala Network ‘s revenue system work?

A:

I’m not sure what the revenue system is precisely. However, if you refer to the new user reward program, we offer early bird participatoin rewards in our first Dapp Web3 Analytics. Developers who integrate W3A in their website will get rewarded. Users who contribute data to the system also get rewarded.

If you refer to the economic design, it’s a bit hard to answer it in a few sentences. We will have miners, Gatekeepers, token holders, and the Phala DAO members. The native token is used as the gas fee of the contract execution just like ETH. So it captures the value inside the network. The token is also used for governance (i.e. the Phala DAO).

Thanks evertone. Anyone interested in the project join tele group! And free to ask questions anytime!

Source:

https://t.me/CryptoSkyAMA

https://t.me/phalanetwork

https://t.me/skyio_EN

--

--

Polkabase

Leverage avant-garde scientific researches to empower developers and end users of the Polkadot ecosystem.