• Stars
    star
    333
  • Rank 126,175 (Top 3 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created almost 5 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The Phala Network Blockchain, pRuntime and the bridge.

Phala Blockchain

Funded by the web3 foundation

Rust

Phala Network is a decentralized offchain computing protocol aiming to build the Web3 Cloud. This repo includes:

  • node/: the main development blockchain built on Substrate
  • standalone/pherry/: the message relayer to connect the blockchain and pRuntime
  • standalone/pruntime/: the contract execution kernel running inside TEE enclave

Overview

The blockchain is the central component of the system. It records commands (confidential contract invocation), serves as the pRuntime registry, runs the native token and on-chain governance modules.

pherry is the message relayer. It connects the blockchain and pRuntime. It passes the block data from the chain to pRuntime and passes pRuntime side effects back to the chain. A multi-client version of the runtime bridge is being developed here and now in alpha version.

pRuntime (Phala Network Secure Enclave Runtime) is a runtime to execute confidential smart contracts, based on confidential computing.

Native Build

Dependencies

Expand
  • System dependencies

    • Ubuntu (tested with 22.04)
    apt install -y build-essential pkg-config libssl-dev protobuf-compiler
    • macOS
    brew install protobuf
    • See here for more protobuf installation options
  • Rust

    curl https://sh.rustup.rs -sSf | sh
  • Substrate dependencies:

    git submodule update --init
    sh ./scripts/init.sh
  • LLVM 14

    wget https://apt.llvm.org/llvm.sh
    chmod +x llvm.sh
    ./llvm.sh 14

Build the blockchain and bridge

Make sure you have Rust and LLVM-10 installed.

Note for Mac users: you also need llvm and binutils from Homebrew or MacPort, and to add their binaries to your $PATH

Run git submodule update --init to fetch submodules before build if you haven't add option --recursive when clone code.

cargo build --release

The build script enforces LLVM-10 or newer is used. LLVM-10 is needed because of the wasm port of rust crypto library, ring. We have to compile the C code into wasm while keeping the compatibility with the current rustc.

Run

Please refer to the run scripts

Sub-pages

  • RPC: RPC documentations
  • Test: How to test the components

External Resources

More Repositories

1

ai-agent-template-openai

AI-Agent Contract Template with OpenAI
TypeScript
85
star
2

solo-mining-scripts

Shell
32
star
3

khala-parachain

Khala parachain
Rust
26
star
4

runtime-bridge

JavaScript
24
star
5

phala-docs-old

Documentations and wiki for Phala Network
23
star
6

awesome-phat-contracts

A curated list of awesome projects and resources relating to Phat Contracts
23
star
7

growth-program

21
star
8

phat-offchain-rollup

Phat Contract Offchain Rollup implementation
Rust
18
star
9

apps-ng

Yet another UI for Phala Network.
JavaScript
17
star
10

fat-contract-workshop

Rust
16
star
11

js-sdk

Phala JavaScript SDK.
JavaScript
15
star
12

apps

Monorepo for apps in phala.
TypeScript
14
star
13

framehub-template

TypeScript
13
star
14

prelaunch-token

The PHA ERC20 Prelaunch Token
JavaScript
13
star
15

phala-pruntime

pRuntime is the execution kernel running inside TEE enclave
Rust
11
star
16

oracle-workshop

Rust
10
star
17

index-contract

A crosschain execution engine build in Phat Contract
Rust
9
star
18

phala-wiki-next

Phala Wiki
HTML
8
star
19

phat-contract-examples

Rust
7
star
20

phala-docker

Dockerfiles for deployment
Dockerfile
6
star
21

Encode-Hackathon-2021

Phala x Polkadot Encode Club Hackathon
6
star
22

phala-wiki

Shell
6
star
23

phala-polka-apps

WebUI for interacting with Phala Network.
TypeScript
5
star
24

chainbridge-operator

(deprecated) ChainBridge Prototype Web UI
TypeScript
5
star
25

swanky-plugin-phala

Phala swanky plugin for an all-in-one developer environment for WASM ink-based phat contracts.
Handlebars
5
star
26

phat-quickjs

QuickJS engine running in phat contract
JavaScript
5
star
27

phala-blueprint-proposals

Phala Blueprint Proposals (PBPs)
3
star
28

phat-function-cli

CLI for Phat Functions
TypeScript
3
star
29

ETHDenver-2022

3
star
30

khala-docker

Dockerfiles for deployment
Dockerfile
3
star
31

phala-parachain.old

Phala parachain
Rust
3
star
32

phat-dashboard

Rust
3
star
33

safe-vest-module

A Gnosis Safe module that vest tokens periodically
JavaScript
3
star
34

runtime-bridge-monitor

JavaScript
3
star
35

pdiem-relayer

The pDiem Relayer
Rust
3
star
36

slot_crowdfunding

Ruby
3
star
37

phat-pod-tools

TypeScript
3
star
38

wapo

Rust
2
star
39

runtime-bridge-walkie

JavaScript
2
star
40

phala-docs

Phala Docs synced with Gitbook.
2
star
41

pink-sgx

Rust
2
star
42

near-bridge

Simple NEAR-Phala bridge
JavaScript
2
star
43

phat-frame-gateway

TypeScript
2
star
44

wiki-website

JavaScript
2
star
45

phat-contract-starter-kit

Send data from any API to your smart contract with Javascript
TypeScript
2
star
46

phala-bounty-tracker

2
star
47

crowdloan-ui

TypeScript
2
star
48

mining-data-server

TypeScript
2
star
49

website-nextjs

The Phala Network website, rebuild with Next.js
TypeScript
2
star
50

ink-validator

An tool to check whether a compiled ink contract is valid to be upload to the chain
Rust
2
star
51

chainbridge-subquery

TypeScript
2
star
52

phat-hello

Rust
2
star
53

substrate-evm_account_mapping

Enable Substrate blockchain to verify transactions signed by EIP-712 signatures. It allows users to interact with a Substrate chain with Metamask or any EVM wallet.
Rust
2
star
54

lensapi-oracle-consumer-contract

A Phat Contract starter kit for the LensAPI Oracle
TypeScript
1
star
55

computation-squid

TypeScript
1
star
56

substrate-upgrade-workshop

Rust
1
star
57

website-ng

TypeScript
1
star
58

rfcs

1
star
59

chainbridge-guardian

TypeScript
1
star
60

stakedrop-polka-apps

Phala x Kusama Stakedrop Web UI
TypeScript
1
star
61

wpcap

Phala frontend packages
TypeScript
1
star
62

open-node-charts

Smarty
1
star
63

closed-beta-submission

1
star
64

hello-world-by-polkadot

1
star
65

phat-contract-ui

TypeScript
1
star
66

khala-ops-healthcheck

special script for monitoring khala nodes
JavaScript
1
star
67

pink-drink

A drink runtime implementation for Phat Contract.
Rust
1
star
68

dcap-qvl

Rust
1
star
69

ai-agent-template-langchain

AI-Agent Contract Template with LangChain
TypeScript
1
star
70

chainbridge-subgraph

TypeScript
1
star
71

solidity-contracts

TypeScript
1
star
72

subbridge.js

SubBridge Javascript SDK for make and query crosschain transactions
TypeScript
1
star
73

phala-world-website

TypeScript
1
star
74

apps-nng

Next next generation app for Phala
TypeScript
1
star
75

mining-subsquid

TypeScript
1
star
76

confidential-contract

Track the progress of Phala Network Confidential Contracts
1
star
77

lens-v2-momoka-collect-ui

TypeScript
1
star
78

ethglobal-paris-smart-cookies

JavaScript
1
star