<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hang Yin</title>
    <description>The latest articles on DEV Community by Hang Yin (@hangyin).</description>
    <link>https://dev.to/hangyin</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F346742%2Ff7ae82d5-b4f1-49e0-98df-580f6d63a455.png</url>
      <title>DEV Community: Hang Yin</title>
      <link>https://dev.to/hangyin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hangyin"/>
    <language>en</language>
    <item>
      <title>Should We Kick Hardware out of Blockchain?</title>
      <dc:creator>Hang Yin</dc:creator>
      <pubDate>Sun, 21 Jun 2020 22:54:49 +0000</pubDate>
      <link>https://dev.to/hangyin/should-we-kick-hardware-out-of-blockchain-1ga6</link>
      <guid>https://dev.to/hangyin/should-we-kick-hardware-out-of-blockchain-1ga6</guid>
      <description>&lt;p&gt;You may think blockchain has little to do with hardware. After all, from Bitcoin to Etherum, blockchains are all software-defined. The Hardware-based solution is usually more centralized. However, in the privacy-preserving blockchain world, by carefully combining software and hardware, we could design a solution with the best balance between scalability and confidentiality, while still keeping it trustless.&lt;/p&gt;

&lt;h2&gt;
  
  
  TEE based blockchain confidentiality
&lt;/h2&gt;

&lt;p&gt;Phala Network implements the confidential smart contract. It differs from traditional contracts because contracts run inside a special hardware enclave in CPU, i.e. Trusted Execution Environment. The program running inside TEE is highly isolated from the rest of the world. A malicious attack can neither read the data in the memory without authorization nor manipulate the program to produce any unintended behavior.&lt;/p&gt;

&lt;p&gt;In Phala Network, we call the supportive program running inside TEE "pRuntime". pRuntime is the runtime environment that maintains the basic TEE miner and Gatekeeper protocol inside the TEE. It handles the TEE remote attestation, on-chain registration, key management, and confidential contract execution.&lt;/p&gt;

&lt;p&gt;But how to convince a user the smart contract is running inside pRuntime, not an emulator that doesn't provide any data security? Here comes the core concept: Remote Attestation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Remote Attestation
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;"An application that hosts an enclave can also ask the enclave to produce a report and then pass this report to a platform service to produce a type of credential that reflects enclave and platform state. This credential is known as a quote. This quote can then be passed to entities off of the platform, and verified..."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Remote Attestation is the key to ensure the security of a TEE system. &lt;a href="https://software.intel.com/content/www/us/en/develop/documentation/sgx-developer-guide/top/attestation/remote-interplatform-attestation.html"&gt;Quoted from Intel&lt;/a&gt;, it proves that a certain code (measured by the hash of the code), optionally with some customized data generated by the code, is running inside an up-to-date genuine Intel SGX enclave.&lt;/p&gt;

&lt;h2&gt;
  
  
  Secret Provisioning
&lt;/h2&gt;

&lt;p&gt;Remote Attestation is a basic building block for confidential smart contracts. But it's not very useful if we cannot establish an end-to-end secure communication channel between a party to TEE. Intel SGX also provides a &lt;a href="https://software.intel.com/content/www/us/en/develop/documentation/sgx-developer-guide/top/secret-provisioning.html"&gt;Secret Provisioning&lt;/a&gt; protocol to solve the problem elegantly.&lt;/p&gt;

&lt;p&gt;By adopting the Secret Provisioning protocol, a chain of trust from the user to pRuntime can be established:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The blockchain has the hash of the canonical pRuntime code&lt;/li&gt;
&lt;li&gt;pRuntime runs the remote attestation protocol, gets a report with the data: hash of the attested code (pRuntime itself); and the public key of an ephemeral identity key pair&lt;/li&gt;
&lt;li&gt;The RA report is submitted to the blockchain and validated on-chain&lt;/li&gt;
&lt;li&gt;The blockchain compares the hash from the RA report (implies: the participant is a canonical pRuntime in TEE)&lt;/li&gt;
&lt;li&gt;The identity public key is registered on the blockchain (implies: only the current pRuntime has control over this identity key)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;As a result, as long as a message is signed by the identity key, it must be produced by the registered pRuntime. Users can further establish a TLS-like connection to a pRuntime with its registered public key.&lt;/p&gt;

&lt;p&gt;To communicate with TEE, the user can get the public key of a certain pRuntime from the blockchain (from TEE registration). Then the user can use the public key of his substrate account to run a Diffie-Hellman protocol. It derives a secret key for communication between the user and the pRuntime.&lt;/p&gt;

&lt;p&gt;As the chain-of-trust established, it also implies the identity key is sufficient to uniquely represent the identity of the pRuntime. So a single Remote Attestation can protect all the future communication with the pRuntime, if under the assumption of no TEE hardware breach (which will be discussed later).&lt;/p&gt;

&lt;h2&gt;
  
  
  How about upgrading?
&lt;/h2&gt;

&lt;p&gt;On-chain upgrading is a critical requirement as it greatly reduces the security risks exposed by a hard-fork upgrade. Substrate natively supports on-chain runtime upgrade. It’s done by the on-chain governance pallet. On the TEE side, the runtime is also upgradable.&lt;/p&gt;

&lt;p&gt;When upgrading pRuntime, we should submit the hash of the new pRuntime version to the blockchain. Then the community can review the code, discuss, and vote for the upgrade by an on-chain governance process similar to Substrate.&lt;br&gt;
Both Gatekeepers and miners have to upgrade pRuntime once a new version is accepted on-chain. Miners are easier because they can simply stop mining, do the upgrade, and resume mining. This is possible because miners are not required to be always online. Gatekeepers have high availability requirements. So they either run another TEE client with the newer version, and wait for a natural Gatekeepers switch in the next election period, or do an emergency encryption dump of the states, and recover it to the new pRuntime.&lt;/p&gt;

&lt;p&gt;Though there are risks to dump the state, it's still useful in case of an emergency. SGX provides a &lt;a href="https://software.intel.com/content/www/us/en/develop/documentation/sgx-developer-guide/top/sealing/software-sealing-policies/seal-to-the-current-enclave-enclave-measurement.html"&gt;“seal to enclave” feature&lt;/a&gt;, which can produce a cipher that can only be decrypted by the same enclave.&lt;/p&gt;

&lt;p&gt;To mitigate the risks for hardware security exploits, the keys in the Gatekeepers are distributed by a Shamir secret sharing scheme, which means that even the sealing is broken, the host still cannot get the original keys without massive collusion.&lt;/p&gt;

&lt;h2&gt;
  
  
  Attack and defense
&lt;/h2&gt;

&lt;p&gt;Our threat model partially assumes the TEE manufacturer can be trusted. This is reasonable. First, they don’t know how their hardware will be used and thus only can plan the attack ahead of time, reducing the risks. Second, if affected by zero-day attacks, the other applications running on this CPU are generally at risk.&lt;/p&gt;

&lt;p&gt;Though we have the above assumption, we see actual hardware exploits come in the past. Fortunately, the vulnerable can usually be mitigated in a few ways.&lt;/p&gt;

&lt;p&gt;It's common to think software vulnerabilities are patchable while hardware vulnerabilities are not. This is not always the case. CPU can be patched by microcode updates. With the special design of Intel SGX architecture, most of the vulnerabilities can be fixed. Recently there was an attack called &lt;a href="https://sgaxe.com"&gt;SGAxe&lt;/a&gt;, it was fixed by &lt;a href="https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00329.html"&gt;a microcode upgrade&lt;/a&gt; followed by a group key rotation. After the key rotation and revocation, all the out-of-date devices get rejected by the remote attestation.&lt;/p&gt;

&lt;p&gt;But you might ask, what if someone still finds zero-day hardware vulnerable? Suppose the vulnerability requires physical access to exploit it, miners will be possible to steal data from the confidential contract. In this case, can apply randomness to mitigate. The blockchain can randomly assign some miners to the confidential contracts in a period. The miners shuffle in every such period. As long as the malicious party doesn't have control over a great number of miners, the cost to do such an attack will be significantly high because it requires a massive control in a relatively long time.&lt;/p&gt;

&lt;p&gt;In the worst case where the enclave is fully cracked, exposing the confidential data available to the attacker and allowing the attacker to arbitrarily manipulate the execution, we still don't want to give up the correctness of confidential contract. Therefore we have the design that confidential contracts can require one or more replications.&lt;/p&gt;

&lt;p&gt;The replication number doesn’t affect how the contract is executed because all the inputs are from the blockchain and thus deterministic. However, if more than one replica exists, multiple TEEs will try to commit the states back to the blockchain. In this case, there will be a simple on-chain voting process. We require a simple majority to “finalize” the states.&lt;/p&gt;

&lt;p&gt;By having replications, it failed-back to a Polkadot's validator-like security model. The attacker must control a sufficient amount of miners to break the correctness, even if SGX’s security assumption is broken.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;In the past, blockchains are only software. The miss of confidentiality has long become a limitation for mass adoption. With the help of hardware and carefully designed protocol, we showed that it's possible to build a secure, scalable, and confidential-preserving blockchain.&lt;/p&gt;




&lt;h3&gt;
  
  
  About Phala
&lt;/h3&gt;

&lt;p&gt;A &lt;a href="https://www.substrate.io/"&gt;Substrate&lt;/a&gt;-based confidential smart contract blockchain on which you can develop confidential-preserving and privacy-first blockchain apps. Member of &lt;a href="https://www.substrate.io/builders-program/"&gt;Substrate Builders Program&lt;/a&gt; starting lineup. Recipient of &lt;a href="https://web3.foundation/"&gt;Web3 Foundation Grant&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://phala.network/"&gt;Website&lt;/a&gt; | &lt;a href="https://twitter.com/PhalaNetwork"&gt;Twitter&lt;/a&gt; | &lt;a href="https://github.com/Phala-Network"&gt;Github&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eOxoMF0e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://static01.imgkr.com/temp/27741a2dd70248dca055b563e3d6d585.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eOxoMF0e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://static01.imgkr.com/temp/27741a2dd70248dca055b563e3d6d585.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>hardware</category>
      <category>privacy</category>
    </item>
    <item>
      <title>Testnet PoC-1 Launched | Phala Updates v0.1.1 (3.30–4.5)</title>
      <dc:creator>Hang Yin</dc:creator>
      <pubDate>Sun, 05 Apr 2020 16:45:38 +0000</pubDate>
      <link>https://dev.to/hangyin/testnet-poc-1-launched-phala-updates-v0-1-1-3-30-4-5-28mo</link>
      <guid>https://dev.to/hangyin/testnet-poc-1-launched-phala-updates-v0-1-1-3-30-4-5-28mo</guid>
      <description>&lt;h2&gt;
  
  
  Mainnet
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Launched testnet PoC-1 which has private transfer and private token with 4 bounty quests. Until GMT 11:30, Apr.5th, there have been 209 privacy tokens and 305 contract innovations on testnet; 56 users have completed Quest I (to transfer and issue their own privacy tokens). For the full list of reward giving, you may refer to &lt;a href="https://github.com/Phala-Network/phala-docs/wiki/100.-Contribution-&amp;amp;-Rewards"&gt;the doc on our Github&lt;/a&gt; ;&lt;/li&gt;
&lt;li&gt;Added a search function on testnet; &lt;a href="https://github.com/Phala-Network/faucet-bot"&gt;faucetbot&lt;/a&gt;, Substrate update, and UX improvement is under development according to advice from the community;&lt;/li&gt;
&lt;li&gt;Fixed an error on &lt;a href="https://github.com/polkadot-js/common/pull/578"&gt;polkadot-js: Throws an error when signing with a locked keypair&lt;/a&gt;;&lt;/li&gt;
&lt;li&gt;Improved user experience on &lt;a href="https://forum.phala.network/"&gt;Phala forum&lt;/a&gt;; &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Web3 Analytics:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Almost completed all pages of frontend development;&lt;/li&gt;
&lt;li&gt;Improving the structure of backend to perform a better authorization design of data rental and standardized protocols. &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Community:
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Community&lt;/th&gt;
&lt;th&gt;Statistics&lt;/th&gt;
&lt;th&gt;Week-on-week change&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Chinese&lt;/td&gt;
&lt;td&gt;1037&lt;/td&gt;
&lt;td&gt;+6.80%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;English&lt;/td&gt;
&lt;td&gt;213&lt;/td&gt;
&lt;td&gt;+10.94%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Global Followers&lt;/td&gt;
&lt;td&gt;8,378&lt;/td&gt;
&lt;td&gt;+3.47%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;Launched the PoC-1 testnet bounty program on our forum, where over 100 topics have been created for event discussion. For the full list of reward giving, you may refer to &lt;a href="https://github.com/Phala-Network/phala-docs/wiki/100.-Contribution-&amp;amp;-Rewards"&gt;the doc on our Github&lt;/a&gt;;&lt;/li&gt;
&lt;li&gt;Had over 5,000 messages discussing testnet event in our community groups last week with an impressive activity rate of 45.47%. Harvested over 2,600 impressions and clicks on contents related to Phala testnet;&lt;/li&gt;
&lt;li&gt;Translated &lt;a href="https://www.ft.com/content/19d90308-6858-11ea-a3c9-1fe6fedcca75"&gt;Yuval Noah Harari: the world after coronavirus&lt;/a&gt; from English to Chinese. &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Activity:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Hang Yin, Chief Scientist of Phala Network, attended &lt;a href="https://www.zeroknowledge.fm/summit"&gt;zkSummit5&lt;/a&gt; online. &lt;/li&gt;
&lt;li&gt;Zhe Wang, COO of Phala Network, shared his experience as a serial entrepreneur on &lt;a href="https://mp.weixin.qq.com/s/1R7IxXJzeC9RrFqMpasSWg"&gt;CampusVC&lt;/a&gt;.
&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>PoC-1 Testnet Is Ready | Phala Updates v0.0.7</title>
      <dc:creator>Hang Yin</dc:creator>
      <pubDate>Thu, 02 Apr 2020 17:39:53 +0000</pubDate>
      <link>https://dev.to/hangyin/poc-1-testnet-is-ready-phala-updates-v0-0-7-228m</link>
      <guid>https://dev.to/hangyin/poc-1-testnet-is-ready-phala-updates-v0-0-7-228m</guid>
      <description>&lt;h2&gt;
  
  
  Mainnet:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Completed development of PoC-1 testnet (POA &amp;amp; Single Node TEE) which will be launched on March.30th! Candy program will start soon after the testnet launches;&lt;/li&gt;
&lt;li&gt;Configuration parameters of official mining hardware "Sentinel" are settled. &lt;/li&gt;
&lt;li&gt;Online sale and assembling service will be available next week;&lt;/li&gt;
&lt;li&gt;3 more motherboards passed our test. Now we have 17 types of motherboards tested in "The Privacy Awakens" program.&lt;/li&gt;
&lt;li&gt;Officially published Phala Token Economics Whitepaper on our website.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Product: Web3 Analytics
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Completed UI development of user client;&lt;/li&gt;
&lt;li&gt;Completed debugging of API;&lt;/li&gt;
&lt;li&gt;Completed 90% of frontend development.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Community
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gMDjksQO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/fcxqcgyhvqzr86z8ry7y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gMDjksQO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/fcxqcgyhvqzr86z8ry7y.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Rounded off our Twitter airdrop with Math Wallet as 200 KSM sent to all winners! We now have 3,224 followers on Twitter.&lt;/li&gt;
&lt;li&gt;Over 150 participants attended our "Token Economics Whitepaper Quiz Game" in the Chinese community and 73 winners won rewards for their speed and talent at last.&lt;/li&gt;
&lt;li&gt;Uploaded 5 episodes of "Learn Phala's Token Economics in 5 Minutes" videos and claimed over 900 clicks. English version will be uploaded to Youtube as well :)&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Everyone’s Phala Token Economics Whitepaper</title>
      <dc:creator>Hang Yin</dc:creator>
      <pubDate>Thu, 02 Apr 2020 17:32:26 +0000</pubDate>
      <link>https://dev.to/hangyin/everyone-s-phala-token-economics-whitepaper-hni</link>
      <guid>https://dev.to/hangyin/everyone-s-phala-token-economics-whitepaper-hni</guid>
      <description>&lt;p&gt;Phala’s token economics design has been one of the frequently asked questions since 2019. After weeks of discussion, composing and refining, we are proud to announce that we have officially published our Token Economics Whitepaper! &lt;a href="https://files.phala.network/phala-token-economics-en.pdf"&gt;Click to check →&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also, we composed a shorter and simpler version here — containing economic model, token distribution, governance, etc. — for everyone to quickly understand how our token works. Enjoy. :)&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Is mining available on Phala Network?
&lt;/h3&gt;

&lt;p&gt;Sure. All you need is an Intel pc or laptop, and all you have to do is keeping your node online. A detailed mining introduction would be published in June. Follow our Twitter or Medium, or &lt;a href="https://t.me/phalanetwork"&gt;join our Telegram group&lt;/a&gt; to receive the latest news!&lt;/p&gt;

&lt;h3&gt;
  
  
  2. What’s the name of Phala’s token?
&lt;/h3&gt;

&lt;p&gt;PHA. The total supply of PHA is 1 billion. 1% (100 million) of PHA will be distributed by the launch of testnest; for the rest, you may &lt;a href="https://phala.network/en/"&gt;check the full version whitepaper on our website&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. How does PHA function?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Network Utility: to trade or exchange network resources such as trusted computing resources, data trading settlement, security, and other services. To be specific, PHA mainly functions for TCPU (Trusted Computing Processing Unit), on-chain computing and storage resources, off-chain storage resources and other data value captured by a series of standardized protocols.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Governance: PHA works as a crucial identification of Gatekeepers and member of PhalaDAO. To be one of those important roles in Phala community, you have to stake a certain amount of PHA.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. What roles does Phala design in the network?
&lt;/h3&gt;

&lt;p&gt;We have 4 roles in Phala Network: Gatekeeper, Nominator, TEE Miner, and PhalaDAO.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Gatekeepers manage the distribution of keys and produce new blocks. Staking of PHA and one or more nominators are essential for one to be a nominator.&lt;/li&gt;
&lt;li&gt;Nominators are entitled to nominate one or more Gatekeepers with a certain amount of PHA staked for them.&lt;/li&gt;
&lt;li&gt;TEE Miners provide computing power for the whole network as they keep their mining hardware online (pcs or laptops)&lt;/li&gt;
&lt;li&gt;PhalaDAO is responsible for the growth of Phala Network and open to all kinds of roles: developers, GateKeepers, investors, miners, and normal members.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5. What consensus mechanism does Phala apply?
&lt;/h3&gt;

&lt;p&gt;Phala applies NPoS where nominators may nominate Gatekeepers they trust and gain returns from validators’ production by staking PHA for them.&lt;br&gt;
Phala expects 40% of PHA to be staked to NPoS while 60% PHA to be paid and traded in the markets. The annualized inflation rate and the annualized return rate of staking are expected to be 5% and 12.5% (in the circumstance that 40% of PHA are staked).&lt;/p&gt;

&lt;h3&gt;
  
  
  6. How does Phala distribute PHA?
&lt;/h3&gt;

&lt;p&gt;Base on the principle of “fair distribution based on contribution”. We hope the ones who paid efforts and time to our network could be rewarded respectively.&lt;br&gt;
Our distribution system is designed as bellow:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ut-kLvZf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1400/1%2Ak-Qj9Gdq9vGMTPJ5FtvY6g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ut-kLvZf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1400/1%2Ak-Qj9Gdq9vGMTPJ5FtvY6g.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  7. What is the releasing model of PHA?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--91meAnY---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1400/1%2Aoqnu6DxjxGn3v4LK2JuCwQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--91meAnY---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1400/1%2Aoqnu6DxjxGn3v4LK2JuCwQ.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The diagram of PHA Releasing Model&lt;/li&gt;
&lt;li&gt;The red diagonal line: the release of total PHA supply&lt;/li&gt;
&lt;li&gt;The dark green curve: the release of team PHA&lt;/li&gt;
&lt;li&gt;The light green curve: the release of financing PHA&lt;/li&gt;
&lt;li&gt;The orange &amp;amp; light blue Curve: Test Network Rewards &amp;amp; Target User Airdrops&lt;/li&gt;
&lt;li&gt;The grey curve: the release of Matrix mining rewards&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  8. How will Phala distribute PHA as mining rewards?
&lt;/h3&gt;

&lt;p&gt;Phala will distribute 700 million PHA through Matrix Mining. The total supply of mining rewards will be fixed without extra issuance and mining reward will dwindle as the time passes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7OkpLn_---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1400/1%2ARuYPsOB6lNdw-rC2U09dgA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7OkpLn_---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1400/1%2ARuYPsOB6lNdw-rC2U09dgA.png" alt=""&gt;&lt;/a&gt;&lt;br&gt;
Diagram of Matrix mining reward&lt;/p&gt;

&lt;p&gt;Participants can attend Matrix mining in 5 different ways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;to keep your node online&lt;/li&gt;
&lt;li&gt;to contribute your data to Phala Network&lt;/li&gt;
&lt;li&gt;to develop on Phala&lt;/li&gt;
&lt;li&gt;to trade data at Phala data market&lt;/li&gt;
&lt;li&gt;to complete computation missions&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  9. Are there any requests related to Matrix mining?
&lt;/h3&gt;

&lt;p&gt;Though it’s quite easy to start mining, still we suggest you pay attention to the following elements that will affect your mining rewards:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the performance of the mining hardware&lt;/li&gt;
&lt;li&gt;the length of average online duration&lt;/li&gt;
&lt;li&gt;the length of total online duration&lt;/li&gt;
&lt;li&gt;the number of successful executions&lt;/li&gt;
&lt;li&gt;the recorded penalty rate&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  10. Are there other ways to earn PHA?
&lt;/h3&gt;

&lt;p&gt;Other than mining, we also encourage users to join this fight against data breach by taking their control back on their data. Any app accessed to Phala would have to ask permission before collecting data, and users will gain returns after they authorize the utility of their information.&lt;br&gt;
Also, to realize the vision above, we encourage developers and enterprises to access their products and apps to Phala Network or our product W3A. We prepare rich bounties for the first 10,000 products willing to access.&lt;br&gt;
Or, you can choose to pay for the data others provided at our data exchange market. To pay is to recognize the value of information :).&lt;/p&gt;

&lt;h3&gt;
  
  
  11. Will there be airdrop events?
&lt;/h3&gt;

&lt;p&gt;Yes! We will have 3 waves of LockDrop airdrops, which, we think, will help us identify our believers who value the future of personal data control.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To stake KSM to Phala nodes to receive KSM interest rewards and PHA airdrops&lt;/li&gt;
&lt;li&gt;To attend the first parachain auction (IPO) (for users holding DOT)&lt;/li&gt;
&lt;li&gt;To lock FIL (or other decentralized data storage protocols) to receive airdrops&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  12. Does Phala apply any innovation on governance?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Anonymous voting: using confidential contracts to complete voting to guarantee democratic anonymity;&lt;/li&gt;
&lt;li&gt;Liquid Democratic Voting Mechanism and relevant algorithm: to fully increase the voting participation rate;&lt;/li&gt;
&lt;li&gt;Introduced DAO instead of Committee: to increase openness and combine staking with community and decision making.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Besides, all amendments to Phala protocol require a referendum to be validated.&lt;/p&gt;

&lt;h3&gt;
  
  
  13. How does Phala realize secret voting?
&lt;/h3&gt;

&lt;p&gt;As a confidential smart contract platform, Phala Network can make each election verifiable and trusted in system design as trust relationships could be calculated confidentially.&lt;/p&gt;

&lt;h3&gt;
  
  
  14. What is Liquid Democracy? How to implement it?
&lt;/h3&gt;

&lt;p&gt;Liquid democracy originates from Bryan Ford’s paper “Delegative Democracy” published in 1884 — for a certain issue, one can vote directly, or to delegate the right to a representative.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uQCziHBN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1400/0%2AQGMmO9Q-Gx6foO5G" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uQCziHBN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/1400/0%2AQGMmO9Q-Gx6foO5G" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In liquid democratic DAO, the delegation relationship is progressed as a dendrogram. To calculate and update the number of votes, it is necessary to process preorder traversal for postorder traversal when each vote occurs. The complexity of the time cost would be O(n).&lt;br&gt;
It is hard to achieve in traditional blockchains but achievable on Phala Network. Liquid democracy calculation requires a large pack of data which might not fit in one block; gas fee could be expensive as well. Yet with TEE technology, we can perform liquid democracy with efficiency and confidentiality.&lt;/p&gt;

&lt;h3&gt;
  
  
  15. What’s the function of Phala DAO?
&lt;/h3&gt;

&lt;p&gt;Phala’s governance will be managed through DAO instead of a representative committee system or the House of Lords system.&lt;br&gt;
The voting right of DAO is defined as “Share”. Share is non-transferable and can be issued indefinitely though, the total proportion is always fixed as 100%. DAO’s decision-making system follows the majority rule and output results as “approve” or “disapprove”.&lt;/p&gt;

&lt;h4&gt;
  
  
  About Phala
&lt;/h4&gt;

&lt;p&gt;The 1st &lt;a href="https://substrate.dev/"&gt;Substrate-based&lt;/a&gt; confidential smart contract platform on which you can develop secret-preserving and privacy-protecting blockchain apps. Member of &lt;a href="https://twitter.com/ParityTech"&gt;Parity&lt;/a&gt; Builders Program starting lineup. Winner of &lt;a href="https://web3.foundation/grants/"&gt;Web3 Foundation Grant&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Ekiden，An Oasis of Scalability Experiment</title>
      <dc:creator>Hang Yin</dc:creator>
      <pubDate>Fri, 06 Mar 2020 10:51:14 +0000</pubDate>
      <link>https://dev.to/hangyin/kiden-an-oasis-of-scalability-experiment-45o0</link>
      <guid>https://dev.to/hangyin/kiden-an-oasis-of-scalability-experiment-45o0</guid>
      <description>&lt;h2&gt;
  
  
  Before Starting
&lt;/h2&gt;

&lt;p&gt;Does trusted computing have to be combined with blockchain?&lt;br&gt;
Is privacy protection an artifitial demand? &lt;br&gt;
Is it political right to cling on "decentralization"?&lt;br&gt;
In what ways can we realize Multiple Party Computing (MPC)?&lt;/p&gt;

&lt;p&gt;I've been thinking about these questions since 2017. &lt;/p&gt;

&lt;p&gt;In discussions with my friends and peers, I found some questions are frequently mentioned and worth to elaborate, and decided to start writing a sery to study on similar projects, comparing their solutions, to try give answers for my friends and myself. &lt;/p&gt;

&lt;p&gt;Today, I am introducing a highlight in blockchain field : Ekiden of Oasis Labs.&lt;/p&gt;

&lt;h2&gt;
  
  
  I. Oasis Labs
&lt;/h2&gt;

&lt;p&gt;Oasis Labs is a smart contract network able to be confidential from computing to storage and application layer. Dawn Song, Founder and CEO of Oasis Labs, famed as "Godmother of Computer Security" by Chinese tech media, is well-known globally in data security and cryptology fields. She completed her Tsing-Hua B.S. at 1996, Carnegie Mellon M.S. at 1999, and UC Berckley Doctor's degree at 2002. Then she started to teach in computer science in CMU, later transferred to UCB.&lt;/p&gt;

&lt;p&gt;Decorated as the top-gun and medal harvester by peers and collogues, Professor Song has achieved legendary academic success. She won the MacArthur Fellowship, and enlisted in Innovators Under 35 by MIT Technology Review. During her research in CMU, she supervised the paper which established the Dynamic Taint Analysis in networking or computer security. This literature not only became the most frequently referenced article, but also enlightened the tide of the computer safety development in real world business.&lt;/p&gt;

&lt;p&gt;No wonder her team became a pearl in the palm in Silicon Valley. In April 2018, venture capital grapevines leak the news she was building a team and raising funds. On July 9th of the same year, Oasis Labs officially announced they completed an A round fund raising led by a16z, co-invested by Polychain and other 18 capitals. &lt;/p&gt;

&lt;p&gt;The mission of Oasis is to build a "cloud computing platform" based on block-chain technology. It would be able to balance privacy, stability and performance. By their technology integrating hardware and software, they made it come true that compute-intensive applications such as AI could be run on blockchains for the first time. Their vision is an organic bond between Ethereum and AWS from Amazon Cloud, breakingthrough scalability paradox and privacy protection issue long-existed on public chains.&lt;/p&gt;

&lt;p&gt;Oasis features for 4 characteristics: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Privacy: fixing transparency problem of public chains via a full-scale all staking privacy protection from the bottom layer to the application layer;&lt;/li&gt;
&lt;li&gt;Safety: ensuring both on-chain security and off-chain security via a hybrid architecture combing TEE technology and blockchain;&lt;/li&gt;
&lt;li&gt;Scalability: largely improving efficiency via a novo architecture deviding computation and consensus execution;&lt;/li&gt;
&lt;li&gt;Flexibility: easily building applictaions with numerous Built-in tools and SDKs; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And Ekiden was their debut. &lt;/p&gt;

&lt;h2&gt;
  
  
  II. Ekiden
&lt;/h2&gt;

&lt;p&gt;Ekiden is the pronunciation of posthouse relay race in Japanese: 10 people teamed up to finish runnig a half marathon. &lt;/p&gt;

&lt;p&gt;Professor Song and other 8 members of Oasis Labs published a 20 paged article in April 2018: &lt;br&gt;
《Ekiden: A Platform for Confidentiality-Preserving, Trustworthy, and Performant Smart Contracts》, in which they discussed about the bottlenecks, their solutions and challenges of current blockchain technology through 9 chapters.&lt;/p&gt;

&lt;p&gt;Before Ekiden, crux of blockchain and TEE was analyzed unfolded as below: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deficiencies of TEE:

&lt;ul&gt;
&lt;li&gt;Data lost or postpone in TEE caused by host transmission flaw&lt;/li&gt;
&lt;li&gt;Data leakage caused by external attack&lt;/li&gt;
&lt;li&gt;Trusted time source could be falsified&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Proof of publication problem on POW chains&lt;/li&gt;
&lt;li&gt;Key management in TEE&lt;/li&gt;
&lt;li&gt;Atomic delivery of execution results&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As Professor Song concluded, Ethereum is inefficient because it put consensus, storage and computation on the same layer, which is also the reason why Ekiden's structure is devided into 4 layers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Application Layer&lt;/li&gt;
&lt;li&gt;Computation Layer&lt;/li&gt;
&lt;li&gt;Storage Layer&lt;/li&gt;
&lt;li&gt;Consensus Layer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The decoupling of computation, storage and uniformity is vital to realize high performance and security. &lt;/p&gt;

&lt;p&gt;With such a divided structure, Ekiden solves throughput capacity and security problems by combing blockchain with off-line EVM expansion solution. Utilizing hardware-based Trusted Execution Environment (TEE) technology (say, SGX from Intel), Ekiden increases throughput capacity in a safe offchain environment. By increasing data security and throughput capacity to an utmost condition, Ekiden is aimed to build a valuble protocol for fields such as DeFi and health care, on which the features we mentioned are essential for Dapps.&lt;/p&gt;

&lt;p&gt;The application layer, namely, the smart contract layer, is designed for shceduling. Builders could schedule contract logics on chain, or use Oasis Labs tamplate contracts, storaging confidential codes in storage layer. In addition, Oasis Labs employed privacy data analysis and deep learning in programming framwork to protect sensitive input in contracts from leak. &lt;/p&gt;

&lt;p&gt;The computation layers executes smart contracts on nodes equipped with trusted hardwares. Developers could set a number of nodes to run his or her contracts, instead of using all of the nodes, to improve computation speed. &lt;/p&gt;

&lt;p&gt;The storage layer is designed for storage, as the name suggests. While designing, Professor Song uses IPFS as an reference, applying encrypted storage, data cutting and high redundancy to assure data security. This layer focus on the verifying of the fidelity of the data. Dawn had publish other papers for related algorithm.&lt;/p&gt;

&lt;p&gt;In Ekiden, it is ensured contents running in contracts are confidential and automatically encrypted with keys only known by related nodes. &lt;/p&gt;

&lt;p&gt;Ekiden network is composed by three parts: clients, computing nodes, and consensus nodes.&lt;/p&gt;

&lt;p&gt;Clients means users who can create new smart contract or execute existing ones.&lt;/p&gt;

&lt;p&gt;Computing node use multiple TEEs to execute smart contracts. Within TEE, the computing node executes protocol requests from clients and generate verifiable proof of validity. Computing nodes also manage keys via key manager which will generate or search keys according to requests. &lt;/p&gt;

&lt;p&gt;Consensus nodes maintains status update and validity of decentralized ledgers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Superiority
&lt;/h2&gt;

&lt;p&gt;Ekiden is backward compatible with the Ethereum network and will support contracts coding on Ethereum with EVM: ERC20 smart contract automatically inherits the protocol guarantee, including the status of the confidential contract and the high performance of offline operations on the compute nodes.&lt;/p&gt;

&lt;p&gt;Any Ethereum-based Dapps could apply Ekiden as a capacity expansion solution. It is more convenient for devs to develop on Ekiden for its compatibility with Rust and EVm. That's why Ekiden owns obvious advantages in the amount fo developers and users than other high-throughput blockchains.&lt;/p&gt;

&lt;p&gt;In the preliminary tests of Ekiden network, the team reported a 600-fold increase in throughput, 400-fold reduction in latency, and 1000-fold reduction in cost compared to the Ethereum network. Though performance could be diluted when it's serving the whole system, Ekiden will be able to adjust itself to the best by integating the incredible performance mantioned. Initial testing has also proved that Ekiden supports computationally intensive cases, such as costly machine learning applications on Ethereum network.&lt;/p&gt;

&lt;p&gt;Its value created by scalability, security, and low-cost transactions could be applied to thousands of uses, which is not yet achievable on Ethereum at this stage. Also, Ekiden's team combines its theory and expertise. When still working at Uber, they found a startup (later acquired by Yahoo and FireEye), designed a few other products which were all successfully adopted in practicle uses. &lt;/p&gt;

&lt;h2&gt;
  
  
  A Flaw
&lt;/h2&gt;

&lt;p&gt;World-known "Godmother of Computer Security" and her team who have worked in the privacy and security field for decades chose TEE as their solution,  for it effectively relieves computation presssure on consensus layer from transaction computing which could be run on computing nodes and storage nodes. It results in increase of scalability as consesus layer focusing on results. "Scalability" is a hot issue facing by all public chains; As for Oasis Labs, though featured by confidentiality using TEE, it seems scalability is the main dish, privacy protection is yet a dessert.&lt;/p&gt;

&lt;p&gt;Still, A flaw exists: application value is reduced due to weakened "composability". While emphasizing independent execution of contracts, Ekiden sacrifices mutual calls between contracts, for their confidential contracts can only be performed by local computation.&lt;/p&gt;

&lt;p&gt;Take Ethereum as an example &lt;del&gt;(again)&lt;/del&gt;. In the traditional smart contract chains, each node will sequentially execute all transactions in the block. The consensus protocol ensures that each node could easily cooperate with each other for they share a complete and consistent database.&lt;/p&gt;

&lt;p&gt;But in Ekiden, contracts are not allowed to call or access to each other, though it's efficient, secure, and robust. &lt;/p&gt;

&lt;p&gt;To step further, Phala uses blockchain as the consensus layer for confidential contracts calls, making composability possible and realizing security shared by all nodes. &lt;/p&gt;

&lt;p&gt;It is very similar to relay chain and parallel chain desigend by Polkadot. Data synchronization, state sequence, and communication protocols could be new challenges, on which we've been discussing with Parity team. A mature plan is about to be borned and we will share it in the near future:)&lt;/p&gt;

&lt;h2&gt;
  
  
  To Concluede
&lt;/h2&gt;

&lt;p&gt;Oasis Labs claims to be the next in blockchain. Indeed, compared with Ethereum, its advatage is obvious -- say, supporting ERC-20 protocol -- but developers could use languages compatible with Rust and EVM to write on Ethereum.&lt;/p&gt;

&lt;p&gt;Challenges does not exist only in development and theories. It's said their efforts on community building and product promotion are not enough to be known by the public to whom Oasis is only a name within investing news and academic papers. Fortunately, those problems could be fixed soon once they realized. &lt;/p&gt;

&lt;p&gt;Another issue we need to concern is, perfect protocols can be built on paper, but it would be another story when it comes to business and commercialization, which should be awared and prepared by both developers and clients. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Starting with Barbican, Sandbox and Trusted Computing</title>
      <dc:creator>Hang Yin</dc:creator>
      <pubDate>Fri, 06 Mar 2020 10:42:55 +0000</pubDate>
      <link>https://dev.to/hangyin/starting-with-barbican-sandbox-and-trusted-computing-4lgk</link>
      <guid>https://dev.to/hangyin/starting-with-barbican-sandbox-and-trusted-computing-4lgk</guid>
      <description>&lt;h2&gt;
  
  
  Barbican
&lt;/h2&gt;

&lt;p&gt;In 1268 A.D., Kublai Khan, emperor of Chinese Yuan Dynasty, sent two of his generals -- Liu Zheng and A Shu -- led their armies to attack Xiangyang, which marked the launch of the war against Song Dynasty. Their armies were famed as  "God's Whip", yet they failed, and struggled attacking Xiangyang for 6 years. In 1269, he sent his prime minister Shi Tianze to support, and started to build walls to blockage Xiangyang and the Han river channel. They then successfully repelled Song’s reinforcements for several times. Mongolia decided to seize Xiangyang at all costs, increasing armies to over 100,000 people in just one year .&lt;/p&gt;

&lt;p&gt;However, the defensive projects established by the Xiangyang’s castellan, Lv Wende, should not be underestimated. Building by the Han River, protected by steeps, rich with foods and reserves, Xiangyang stayed impregnable until 1274 for Mongolia’s continuous blockage. In 1279, the Southern Song Dynasty came into its end as the final emperor jumped into the sea with Lu Xiufu, his last loyal minister. &lt;/p&gt;

&lt;p&gt;Other than Mongo’s death, united people, solid spirit and Song’s support, the key reason why a small city Xiangyang could defend for 6 years is interesting: Xiangyang was built with the Han River as its natural moat and with a brilliant structure outside its each gate: a barbican. &lt;/p&gt;

&lt;p&gt;Some of you may feel confused about the design. Our ancients may lack technology and scientific knowledge, but they are as smart (or even smarter) as we are . They did so based on their hundreds years of battling experience combined with a comprehensive defensive system consisting of architectures and strategies. &lt;/p&gt;

&lt;p&gt;Once you broke into the fist gate you would find yourself caged, having nowhere to go but becoming a human target aimed by archers standing on the outside wall. &lt;/p&gt;

&lt;p&gt;The brilliance of Chinese Barbican could be concluded as:&lt;/p&gt;

&lt;p&gt;To set dual protection mechanism on weak and key sections;&lt;br&gt;
To restrict actions of untrusted objects;&lt;br&gt;
To build a structure facilitating recognizing and eliminating untrusted objects. &lt;/p&gt;

&lt;p&gt;Such design was then applied to computer defense system, called the “Sandbox Model”. &lt;/p&gt;

&lt;h2&gt;
  
  
  Sandbox
&lt;/h2&gt;

&lt;p&gt;In the field of computer security, Sandbox is a security mechanism that provides an isolated environment for suspecisious programs. It first let the suspicious program to fully perform while recording its every move. If the program behaved as a virus, the Sandbox would “rollback”: erase the traces and actions of the virus and restore the system to a normal state.&lt;/p&gt;

&lt;p&gt;Similar to Chinese Barbican, its design theoretically guarantees the following:&lt;/p&gt;

&lt;p&gt;Dual protection:  system-level and container-level sandboxes can be enable through virtualized environments;&lt;br&gt;
Restriction: Sandbox provides disk and memory space that is recycled after use. Network access, access to real systems, and reading of input devices would be prohibited or strictly restricted.&lt;br&gt;
Restoration: once a virus is found in a Sandbox, files, registries, etc. would be restored at other places to protect them from unauthorized access or anonymous operation. &lt;/p&gt;

&lt;p&gt;The problem is, it relies on detection capabilities. If viruses cover themselves or evade security scanning in some way, they can infect users' devices and eventually invade company networks and business-critical systems.&lt;/p&gt;

&lt;p&gt;As the attack methods of malicious users change in more various ways, defenders have to write codes to build higher firewalls, run more complicated tests, which leads to more malicious data records, triguring more false alarms. As the cost of maintenance goes up and the system efficiency goes down, leaving rare efforts and time against new attacks, in security designs using detection-response mechanism, malicious programs could keep testing until they could fool the guards. &lt;/p&gt;

&lt;p&gt;Thus, a new security model -- TEE, Trusted Execution Environment -- came out. Contrary to the "Sandbox" model, trusted computing assumes that "trust" is the scarce resource. As a comprehensive technological innovation of logic verification, computing architecture, and computing modes, etc., TEE realizes “Defense Offense” by fixing logical defects, ensuring the logical combination of computing tasks to stay safe from tampering or attacking. &lt;/p&gt;

&lt;h2&gt;
  
  
  Trusted Computing
&lt;/h2&gt;

&lt;p&gt;Development of Trusted Computing&lt;br&gt;
In 1983, the United States Department of Defense formulated the world's first Trusted Computer System Evaluation Criteria (TCSEC), and for the first time proposed the concepts of Trusted Computing and Trusted Computing Base (TCB), and put the TCB serves as the basis for system security.&lt;/p&gt;

&lt;p&gt;In 1990, the International Organization for Standardization and the International Electrotechnical Commission ISO / IEC defined credibility based on behavioral expectations in the directory service series standards they published: If the second object acts exactly as the first object expected, the second one will be considered as “credible”. &lt;/p&gt;

&lt;p&gt;In 1999, well-known IT companies such as IBM, HP, Intel, and Microsoft initiated the establishment of the Trusted Computing Platform Alliance (TCPA, Trusted Computing Platform Alliance), which marks the entry of trusted computing into the industry.&lt;/p&gt;

&lt;p&gt;In 2003, In Advanced Trusted Environment v11.pdf, TEE was defined as “a set of software and hardware components that provide the necessary facilities for the application”, and one of two defined security levels needs to be met. The first is to defend software attacks, and the second is to defend both software and hardware attacks. &lt;/p&gt;

&lt;p&gt;Now let’s learn about some important concepts in TEE computer theory.&lt;/p&gt;

&lt;p&gt;Roots of Trust and Chain of Trust&lt;br&gt;
Trusted computing technology first set a root of trust in a computer system, gradually testing to trust layer by layer: from the root to the hardware platform, operation system, and applications. &lt;/p&gt;

&lt;h3&gt;
  
  
  Roots of Trust
&lt;/h3&gt;

&lt;p&gt;Roots of Trust (RoT) is a set of functions that is always trusted by the computer’s operating system (OS). The RoT serves as separate compute engine controlling the trusted computing platform cryptographic processor on the PC or mobile device it is embedded in.According to the classification of the security chip and the Trusted Software Stack running on it, there are currently three main trusted computing standards: Trusted Platform Module (TPM), Trusted Cryptography Module (TCM), and Trusted Platform Control Module (TPCM).&lt;/p&gt;

&lt;h3&gt;
  
  
  Chain of Trust
&lt;/h3&gt;

&lt;p&gt;In computer security, a chain of trust is established by validating each component of hardware and software from the end entity up to the root certificate. It is intended to ensure that only trusted software and hardware can be used while still retaining flexibility.&lt;/p&gt;

&lt;p&gt;The “trusted” components could be tested through detection or verification.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Detection: to collect data and status from a component;
Verification: Compare the results of detection with the reference value to see if they are consistent. 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;If a component passed both of them, it would be marked as trusted. &lt;/p&gt;

&lt;p&gt;There are 3 rules when establishing a chain of trust:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;All modules or components, except CRTM (the starting point of the chain of trust building, the first piece of code for trusted metrics), are considered untrusted until they passed the verification and classed into trusted boundary. 
Modules or components inside the trusted boundary can be used as verification agents to perform integrity verification on modules or components that have not yet completed verification.
Only modules or components within the trusted boundary have access to relevant TPM control rights. 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;TPM (Trusted Platform Module)&lt;br&gt;
Generally, the trusted computing platform uses the TPM chip machine key and its relevant software as the root of trust.&lt;/p&gt;

&lt;p&gt;Trusted Platform Module (TPM, also known as ISO/IEC 11889) is an international standard for a secure cryptoprocessor, a dedicated microcontroller designed to secure hardware through integrated cryptographic keys.&lt;/p&gt;

&lt;p&gt;The use of TPM, to some extent, reduces the risk of important data being stolen by malware such as Trojans, but it cannot prevent runtime attacks. If a hacker cracks while a legitimate application is running, he can read decrypted data directly in memory. &lt;/p&gt;

&lt;p&gt;To solve a problem like this, we should also find a way to prevent hackers from reading the memory space used by legitimate applications, which is the reason why Trusted Execution Environment (Trusted Execution Environment) is proposed.&lt;/p&gt;

&lt;p&gt;TEE (Trusted Execution Environment) &amp;amp; REE (Rich Execution Environment)&lt;br&gt;
In 2010, Global Platform announced for the first time a set of TEE system system standards. Global Platform's series of TEE specifications, which is also the current many commercial or open source products generally refer to this specification and implement it in accordance with its various functional interfaces. Global Platform defines part of the TEE from the interface and protocol implementation level, as well as the definition of typical application specifications. TEE owns characteristics as follow:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Cooperative software-hardware security mechanism: as its essential attribute, Isolation can be implemented through software or hardware.

Shared Computing: through which one computer can share computing and hardware for better performance.

Openness: TEE is necessary when REE exists.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now you might understand why TEE technology is different from the sandbox model: the former is guided by the presumption of guilt, and the former is guided by the presumption of innocence.&lt;/p&gt;

&lt;p&gt;In the model of presumption of guilt, TEE works when REE exists. Generally, TEE and REE could be recognized as Secure World and Normal World. For example, a system usually runs in Normal World, but when it needs to run requests with confidential needs such as face ID verification or private key signature for payments, it has to run in the Secure World. &lt;/p&gt;

&lt;h3&gt;
  
  
  Trust Zone
&lt;/h3&gt;

&lt;p&gt;In 2006, ARM introduced TrustZone technology which divides the working status of the CPU into Normal World Status (NWS) and Secure World Status (SWS) in ARMv6 architecture. &lt;/p&gt;

&lt;p&gt;TrustZone-enabled chips provide hardware-level protection and security isolation of peripheral hardware resources. When CPU is in a normal state, no application can access the secure hardware device, nor can it access the memory, cache, and other peripheral secure hardware devices that are in Secure World state.&lt;/p&gt;

&lt;p&gt;In specific application environments, users’ sensitive data can be stored in TEE, and the trusted application (TA, Trusted Application) uses important algorithms and processing logic to complete the data processing. When users’ sensitive data is required for identity verification, the verification result is obtained from the TEE side by defining a specific request number on the REE side.&lt;/p&gt;

&lt;h3&gt;
  
  
  Intel SGX
&lt;/h3&gt;

&lt;p&gt;In 2013, Intel introduced a TEE-based instruction set extension: SGX (full name Intel Software Guard Extension), which aims to provide mandatory guarantee through hardware security, does not depend on the security status of firmware and software, and provides a trusted execution environment for user space .&lt;/p&gt;

&lt;p&gt;SGX realizes isolated operation between different programs through a new set of instruction set extensions and access control mechanisms to protect the confidentiality and completeness of critical user code and data from malicious software.&lt;/p&gt;

&lt;p&gt;Different from the idea of ARM TrustZone, SGX would not identify and isolate all malware on the platform; instead, it encapsulates the security operations of legitimate software in an Enclave, protecting it from malware attacks. Neither of the privileged softwares or non-privileged ones could access Enclave. &lt;/p&gt;

&lt;p&gt;Once software and data are in Enclave, even the operating system cannot influence the code and data in Enclave. Enclave's security boundary includes only CPU and itself. This design avoids software-based TEE's defects in software security vulnerabilities and threats, which greatly improves system security.&lt;/p&gt;

&lt;p&gt;Currently, when it comes to utility in commercial level, Intel SGX is rather mature for it allows &lt;br&gt;
third parties to use the "remote authentication" mechanism to build their own trust certificates.&lt;/p&gt;

&lt;h2&gt;
  
  
  Shortcomings of SGX
&lt;/h2&gt;

&lt;p&gt;Still, Intel SGX has its shortcomings as following:&lt;br&gt;
Especially rely on Intel platform, namely, “centralized”, which is also the reason why TEE has been criticized among all MPS modes. &lt;br&gt;
Little enclave memory for high performance and multiple programs. &lt;br&gt;
Unable to defend side-channel attacks.&lt;br&gt;
Has to interact with untrusted areas for its enclave itself is in user mode and cannot execute system calls by itself. &lt;/p&gt;

&lt;p&gt;Yet Indeed, computer components are designed for different objects, just like we can’t send people to live in the Chinese Barbican. This is also the reason why we found TEE and blockchain could complement each other in proper application scenes. &lt;/p&gt;

&lt;p&gt;What Can Blockchian-TEE Structure Do&lt;/p&gt;

&lt;p&gt;Through the decentralized network and consensus mechanism, blockchain could highly reduce the security risks and malicious possibilities of manufacturers such as Intel, and ensure the availability of trusted chains (this chain is not a blockchain). Phala Network will be compatible with multiple TEE protocols in the future. Even if Intel were under a massive attack, the blockchain system would recover data by punishing malicious nodes by switching TPM nodes. &lt;br&gt;
The problem of Enclave interacting with untrusted areas could be solved for blockchain is a perfect technology of building trusted network. Therefore, letting TEE interact with blockchain smart contracts through the blockchain is a brilliant complementary combination. This is also the reason why Phala network values cross-chain capabilities.&lt;/p&gt;

&lt;p&gt;TEE’s function added to promote blockchain application: technological support on privacy protection&lt;/p&gt;

&lt;p&gt;When it comes to privacy protection, data leak events of Facebook might come into your mind. Confidentiality actually covers a wider field including business confidentiality. &lt;/p&gt;

&lt;p&gt;There are generally 3 generations of technologies on privacy protection:&lt;/p&gt;

&lt;p&gt;The 1st generation: Zcash and Monero. They realized privacy protection of transactions mainly through zero-knowledge proof, ring signature, and confidential transfer, which ensures they can encrypt transactions of original tokens.&lt;br&gt;
The 2nd generation: Aztex, a privacy protocol on Ethereum that uses technology similar to Zcash to achieve transaction privacy for ERC20 tokens. as an extension of the first generation, they can protect transaction privacy as well, yet faint in case if Turing-complete smart contracts are involved.&lt;br&gt;
The 3rd generation: networks like us. We hope to expand the objects from “privacy” to “confidentiality”. Not only users’ privacy, but also confidential datas in any smart contract. We want “Confidential Smart Contract” to calculate like any other Turing-complete smart contracts without data exposure.&lt;/p&gt;

&lt;p&gt;Currently confidential smart contract can be implemented through Multi-Party Computing (MPC) and Trusted Execution Environment (TEE).&lt;/p&gt;

&lt;p&gt;The former is based on pure cryptographic technologies such as homomorphic encryption and zero-knowledge proof without relying on any hardware. It can be applied in specific fields with high efficiency, such as verifiable random numbers and distributed key generation, but in general computing, they cause an average performance loss of one million times.&lt;/p&gt;

&lt;p&gt;The latter has to rely on trusted computing hardware (mainly Intel’s CPU) but can achieve very efficient general-purpose computing. Thus we chose the latter and are committed to realize an universal confidential Turing-complete smart contract.&lt;/p&gt;

&lt;p&gt;To conclude, if you read this article to this line, we are trying to make this world a little bit better by fixing privacy and confidential issues in a blockchain way. Our Testnet is on the way so we wrote this article to explain our vision and technological ideas. Hope it’s interesting :)&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
