A curated list of awesome projects and resources relating to Phala's Phat Contracts.
Phat Contract is the programming model adopted by Phala Network. Phat Contract is NOT a smart contract. Instead, it aims to provide the rich features that ordinary smart contracts cannot offer, including:
- CPU extensive computation: exclusive off-chain execution at the full CPU speed
- Network access: the ability to send the HTTP requests
- Low latency: non-consensus-sensitive operations may not hit the blockchain at all, removing the block latency
- Strong consistency: consensus-sensitive operations remain globally consistent
- Confidentiality: contract state is hidden by default unless you specifically expose it via the read call
Phat Contract is 100% compatible with Substrate’s pallet-contracts
. It fully supports the unmodified ink! smart contracts. Therefore, you can still stick to your favorite toolchain including cargo-contract
, @polkadot/contract-api
, and the Polkadot.js Extension.
- Learning
- Phat Contract's Tutorial Wiki - tutorial to demonstrate how to use Phat Contract’s HTTP request capability to associate a Phala account with a Github user. For the video tutorial checkout Phala Phat Contract's Workshop.
- Frontend SDK - frontend SDK for building UI for Phala Phat Contracts.
- Ink! Smart Contracts Docs - ink! is an eDSL to write smart contracts in Rust for blockchains built on the Substrate framework. ink! contracts are compiled to WebAssembly.
- Awesome Ink! - A curated list of awesome projects related to Parity's ink!.
- Articles/Blogs/Papers
- Substrate Off-Chain Workers - An post on secure and efficient computing-intensive tasks written by Phil Lucsok in 2019.
- Phala's Phat Contract - A Medium post about the introduction of off-chain computation to smart contracts written by Phala's Lead Researcher Dr. Shelven Zhou.
- Off-chaining Models and Approaches to Off-chain Computations - A paper written by Jacob Eberhardt & Jonathan Heiss describing off-chaining models using verifiable off-chain computation (zkSNARKS, Bulletproofs, zkSTARKS), enclave based off-chain computation (TEEs), secure multiparty computation based off-chaining (sMPC) & incentive-driven off-chain computing (IOC).
- Tools
- Phala Contract's UI - UI frontend to deploy Phat Contracts.
- Phala Swanky Integration - Phala Swanky integration for an all-in-one development environment for WASM ink-based Phat Contracts.
- DevPHAse - Run a Phala local testnet and compile/test Phat Contracts in a development environment.
- PhaPass - a password manager on Phala
- Darkpool DEX - a proof-of-concept Darkpool Decentralized Exchange as a dApp/smart contract on top of Phala.
- RMRK Ghost Auction - a simple ghost auction that would allow RMRK NFT artists to run automated auctions while not available on Singular using HTTP requests on Phala Phat Contracts.
- SecretMD - a rich markdown editor which allows users to store and share any plain markdown file onto a distributed and confidential Phala blockchain in Polkadot ecosystem.
- Phat 2FA - an application achieves two-factor authentication on chain, without leaking any sensitive data.
- Privacy Preserving Voting - a simple account based voting mechanism using Phat Contracts.
- Sub0 2022 Oracale & Off-Chain Rollup Workshop - an upgrade from the Oracle Workshop that implements the off-chain rollup pallet in the Phala testnet chain for the Phat Contract to respond with price feed information from the Phat Contracts to the Phala testnet chain.
- Oracle Workshop - an extensive workshop demonstrating how to write an Oracle with Phat Contracts.
- Phat Contract Examples - boilerplate examples of various Phat Contracts.
- Phat Storage - how to connect Phala's Phat Contract to external storage services, both centralized (Amazon s3) and decentralized (Arweave/Filecoin through 4everland, Storj, Filebase).
- ETH Holder - derive an ETH ECDSA account in the Phat Contract then fund the account w/ ETH and send a raw transaction to a configured RPC Node with the
eth_sendRawTransaction
RPC method. - Phat RPC - a Phat Contract that can interact with OnFinality RPC nodes through HTTPS requests.
- Secret File - secret file implementation using Phat Contracts.
- Github Attestation - a workshop demonstrating how to write a Phat Contract with its HTTP request capability on Phala.
- X-Chain HTTP Request: Subgraph NounsDAO - demonstrate how to make a HTTPS request to an indexing service Subgraph to query information about the NounsDAO collection in a Phat Contract.
- Roshambo - a game of Roshambo (Rock, Paper, Scissors) in a Phat Contract.
- Parity's Ink! - Parity's ink! to write WASM smart contracts.
- Astar's Swanky CLI - The all-in-one developer environment for Parity WASM smart contracts!
- OpenBrush Library - OpenBrush is a library for smart contract development on ink!
- Candle Auction - an Ink! smart contract implementing a candle auction logic.
- Dead Man Switch - a dead man's switch written using ink! smart contracts.
- Nested Structs Example - a boilerplate example of using nested structs for ink! smart contracts.