• Stars
    star
    332
  • Rank 126,957 (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
113
star
2

solo-mining-scripts

Shell
32
star
3

khala-parachain

Khala parachain
Rust
26
star
4

runtime-bridge

JavaScript
24
star
5

growth-program

24
star
6

phala-docs-old

Documentations and wiki for Phala Network
23
star
7

awesome-phat-contracts

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

apps-ng

Yet another UI for Phala Network.
JavaScript
17
star
9

phat-offchain-rollup

Phat Contract Offchain Rollup implementation
Rust
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
10
star
18

phat-contract-examples

Rust
8
star
19

phala-wiki-next

Phala Wiki
HTML
8
star
20

dcap-qvl

Rust
8
star
21

dstack

Rust
8
star
22

phala-docker

Dockerfiles for deployment
Dockerfile
6
star
23

Encode-Hackathon-2021

Phala x Polkadot Encode Club Hackathon
6
star
24

phala-wiki

Shell
6
star
25

phala-polka-apps

WebUI for interacting with Phala Network.
TypeScript
5
star
26

chainbridge-operator

(deprecated) ChainBridge Prototype Web UI
TypeScript
5
star
27

swanky-plugin-phala

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

phat-quickjs

QuickJS engine running in phat contract
JavaScript
5
star
29

zk-sgx-attester

SGX remote attester built off RiscZero zkVM
Rust
4
star
30

phat-function-cli

CLI for Phat Functions
TypeScript
3
star
31

phala-blueprint-proposals

Phala Blueprint Proposals (PBPs)
3
star
32

ETHDenver-2022

3
star
33

khala-docker

Dockerfiles for deployment
Dockerfile
3
star
34

phala-parachain.old

Phala parachain
Rust
3
star
35

phat-dashboard

Rust
3
star
36

safe-vest-module

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

runtime-bridge-monitor

JavaScript
3
star
38

pdiem-relayer

The pDiem Relayer
Rust
3
star
39

slot_crowdfunding

Ruby
3
star
40

phat-pod-tools

TypeScript
3
star
41

wapo

Rust
2
star
42

runtime-bridge-walkie

JavaScript
2
star
43

phala-docs

Phala Docs synced with Gitbook.
2
star
44

pink-sgx

Rust
2
star
45

near-bridge

Simple NEAR-Phala bridge
JavaScript
2
star
46

phat-frame-gateway

TypeScript
2
star
47

ai-agent-template-langchain

AI-Agent Contract Template with LangChain
TypeScript
2
star
48

wiki-website

JavaScript
2
star
49

phat-contract-starter-kit

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

phala-bounty-tracker

2
star
51

crowdloan-ui

TypeScript
2
star
52

mining-data-server

TypeScript
2
star
53

website-nextjs

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

ink-validator

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

chainbridge-subquery

TypeScript
2
star
56

phat-hello

Rust
2
star
57

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
58

h100-llm-benchmark

TeX
1
star
59

lensapi-oracle-consumer-contract

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

meta-dstack

Shell
1
star
61

computation-squid

TypeScript
1
star
62

substrate-upgrade-workshop

Rust
1
star
63

website-ng

TypeScript
1
star
64

rfcs

1
star
65

chainbridge-guardian

TypeScript
1
star
66

stakedrop-polka-apps

Phala x Kusama Stakedrop Web UI
TypeScript
1
star
67

wpcap

Phala frontend packages
TypeScript
1
star
68

open-node-charts

Smarty
1
star
69

closed-beta-submission

1
star
70

hello-world-by-polkadot

1
star
71

phat-contract-ui

TypeScript
1
star
72

khala-ops-healthcheck

special script for monitoring khala nodes
JavaScript
1
star
73

pink-drink

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

chainbridge-subgraph

TypeScript
1
star
75

solidity-contracts

TypeScript
1
star
76

subbridge.js

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

phala-world-website

TypeScript
1
star
78

apps-nng

Next next generation app for Phala
TypeScript
1
star
79

mining-subsquid

TypeScript
1
star
80

confidential-contract

Track the progress of Phala Network Confidential Contracts
1
star
81

ai-agent-contract-viem

AI Agent Contract Viem Template to derive ECDSA keypair, sign/verify data, and send TX Onchain
TypeScript
1
star
82

lens-v2-momoka-collect-ui

TypeScript
1
star
83

ethglobal-paris-smart-cookies

JavaScript
1
star