Phala Network: Confidential smart contracts for Polkadot

--

Phala Network is a PoS blockchain that aims to solve the problem of privacy of smart contracts running on an open blockchain. Phala plans to become a Polkadot parachain and thus benefit from the shared security of the Polkadot network and in return provide the ability to run private contracts for all other parachains.

Why we need confidential smart contracts?

As an example, let’s look at the currently most popular smart contract network — Ethereum. Ethereum is an open blockchain protocol, which means that not only all transactions are publicly recorded in the blockchain (as with BTC), but even smart contracts, all their data, and user interactions with these contracts. This itself opens up a wide range of possible applications (just look at what’s happening in DeFi at this moment), but there are many other projects that require confidentiality and the existence of smart contracts that do not disclose anything about their data.

There are several examples of such applications

  • Custom privacy coin for anonymous transactions
  • Referendums and elections in general (which in principle must be anonymous)
  • Ticket sales (would you like to be publicly bound, for example, with the purchase of tickets for the Erotic Fair?) :-)
  • Transmission of private messages

At the same time, it’s obvious that the vast majority of large market players have high demands on the confidentiality of their data — after all, one of the main goals of the baseline project (Ethereum extension built for corporate use) is to secure sensitive data on a blockchain.

Privacy vs confidentiality

Regarding to the secure smart contracts, we distinguish two properties — privacy and confidentiality.

Privacy means the right of an individual to hold his or her data without such data being processed or recorded without his or her knowledge. In the context of cryptocurrencies, it is mainly about anonymity (hiding your real identity), not storing sensitive information in a blockchain, or encrypting data with the help of, for example, zkSnarks.

Confidentiality, on the other hand, means the ability to make your sensitive data available to third parties. And it is the combination of these two features that today’s smart contract platforms lack, which is why Phala Network brings an alternative in the form of confidential smart contracts.

Technology

The building block for Phala Network is TEE technology — or Trusted Execution Environment. TEE is a special layer inside the processor that completely isolates the programs running in it from the rest of the system and thus makes them virtually invisible. No other process on the computer can access or read data from this area unless it has the appropriate permissions. At the same time, TEE has one more unique feature, and that is to guarantee the correct execution of the code — that is, any validator in the Phala network can check that the running contract was executed correctly, without knowing the data with which this contract worked.

Phala Network architecture

The project is interesting in that it contains both validators and miners. Let’s take a closer look at the division of roles.

Miner — This does not mean mining in the classic sense of the word, such as in the Bitcoin network, but rather the need to have specific hardware to run smart contracts. You may have guessed that this hardware is a processor with TEE technology. Such a computer then performs smart contracts in a secure and isolated TEE environment and receives a reward for its efforts.

Gatekeeper — Gatekeeper is basically a classic validator in the PoS network (which Phala is) and serves two main purposes. For validation and production of blocks, storing private keys used to decrypt smart contracts stored by miners. Miners, therefore, do not have the access to the smart contracts and their data, they receive the decryption key from validators within individual transactions.

Thus, the blockchain in Phala Network does not serve to perform smart contracts and check their correctness (that is the purpose of TEE) but ensures their availability. If the miner that runs certain contracts getsoffline, then thanks to blockchain and PoS, the encrypted contract is only moved to another miner that is able to replace it (and as we said, the key to decrypt the contract is held by the gatekeeper).

So it is unique that although Phala Proof of Stake is a network, it also uses a principle similar to mining for the actual running of private contracts. Thus, it separates computationally intensive tasks (such as encrypting and decrypting contracts and running them) from the consensus taking place on the blockchain itself.

Phala real applications

We like projects that already have some real results and people are already using them. Fortunately, Phala Network is such a project, so let’s take a closer look at them 🙂

pLIBRA — private transactions for Libra coin from Facebook and general privacy for smart contracts and decentralized applications running on Libra. Libra’s biggest problem is KYC, which is necessary for the use of Calibra (wallet) and users’ fear that it will then be possible to link transactions to their real identities. pLIBRA solves this problem with contracts that make personal data available only to their owners.

Web3 Analytics — a decentralized version of Google Analytics (an application for collecting statistics about users visiting your website). The application collects data about visited users, but this data is always encrypted and processed only if their user gives their consent — so users never lose control of their data, as is the case with traditional centralized services. Have a look at the demo yourself!

For both of these projects, Phala Network received a grant from the Web3 Foundation and therefore we believe that this project will become a succesful parachain in the Polkadot ecosystem.

Economy

The total supply of tokens will be 1 billion, with being distributed according to the following scheme

  • 70% will go to miners
  • 9% intended for stakedrop (which has already taken place) and parachain auction
  • 15% has already been sold in private sales
  • 5% support from developers and the community
  • 1% for incentives

It is expected that 40% of tokens will be locked for staking and the remaining 60% will be available on the open market for payments for resources used in the Phala network (such as running contracts).

The return on staking is 12.5% (if exactly 40% of tokens are stored) and validators will be rewarded based on token inflation in the network.

PHA tokens will also be used for voting in referendums, thanks to which network users will decide on its further development.

The project already has an ERC-20 token, which is listed on several exchanges (Huobi, Gate.io, Hotbit, and some others) and will migrate to its own token when the Parachain starts.

Parachain auctions

Phala Network have recently became just a 3rd Polkadot project to join the Rococo V1 testnet — which means that they are one of the most technologically advanced projects out there. Project is also about to launch its pre-mainnet and provide a bridge to convert ERC-20 PHA tokens to the native PHA. Phala have allocated 9% of their entire token supply for the parachain auction so we believe that will be more than enough to secure their spot.

Conclusion

Privacy and confidentiality are very important attributes of our personal and professional life and as such must not be missing on the blockchain. Phala Network is a project that, in our view, is absolutely necessary for the involvement of large companies and other entities in the decentralized economy — no company will ever store its sensitive data in a public database, which is a classic blockchain, and therefore we need a solution that processes sensitive data on a blockchain will allow.

If you like this article, consider to support us by changing your present Kusama validator to POLKADOTTERS

Stay tuned for further information about the Polkadot ecosystem projects here on Medium, our Twitter channel Polkadotters as well as in our Facebook Group Polkadot unofficial! If you are feeling really generous, you can send some DOTs to our donate address 🙂

16etYNuwvwbZYxy4FifqMq4KwZCMVSmTJ4XtE3WE3Cn1fQRQ

--

--

Polkadotters | Kusama & Polkadot validators
Polkadotters | Kusama & Polkadot validators

Written by Polkadotters | Kusama & Polkadot validators

Czech bloggers & community builders. We are validators of Polkadot, Kusama, Darwinia, Crab, Bifrost, HydraDX, StaFi, Centrifuge under the name: POLKADOTTERS

No responses yet