A curated list of awesome projects and resources relating to Phala's Phat Contracts.
If you're a dive in 🕳️ first type of builder, 🌪️ ENTER THE FUNNEL to start building your first cross-chain ⛓ dApp on Phat Contract with your choice of EVM chain.
Phat Contract is the program running off-chain on Phala Network that developers can use to implement a broad range of features for their dApps.
By combining on-chain verification with off-chain capabilities, Phat Contracts brings a plethora of features to decentralized applications.
- Connect your smart contract anywhere
- Universal compatibility across EVM and Substrate Blockchains means you can easily connect Phat Contracts to any blockchain without the need for a bridge, expanding your Smart Contract’s capabilities.
- Gain access to the internet
- Send HTTP/HTTPS requests directly from your Smart Contracts enabling seamless integration with any Web2 APIs, unlocking a world of possibilities for your dApps.
- Run arbitrarily Complex Logic
- Execute intense off-chain computations in real-time while bypassing transaction fees and network latency, enhancing your dApps' functionality and user experience at minimum cost.
- Computation is always verifiable
- Complex computation on Phala Network is provided by a Decentralized Network: Secure, Robust, and Trustworthy Infrastructure.
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.
- Resources
- Phat Bricks 🧱
- dApps
- Past Hackathon dApps
- Phat Contract Examples
- Ink Smart Contract Examples
- Phala Network Docs - Phala Network documentation.
- Phala Builders Program - The Phala Builders Program provides funding, guidance, and support to developers that want to build high-value projects with Phat Contract, and add functionality to Phat Contract itself.
- Rust Crates for
pink
- Storage Services Docs
- Cross-Chain Operations
pink-web3
- provides the basic cross-chain operation support for EVM-compatible chains.pink-subrpc
- provides the basic support for Substrate-based chains.pink-kv-session
- KV session primitives for phat off-chain rollup.
- Pink Extension
- Pink Extension Functions - All the unique capabilities of Phat Contract are implemented in pink-extension.
- Learning
- Phat Hello Tutorial - tutorial to demonstrate how to use Phat Contract’s HTTP request capability to query an ETH address via Etherscan API. For the video tutorial checkout Phala Phat Hello Tutorial.
- 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.
- Service Limits
- Service Limits Table - service limits for Phat Contracts and SideVM.
- Phat Bricks UI - Phat Bricks offers the ability to deploy applications without the need for coding. Phat Contract provides pre-defined components (Phat Bricks), and customizable templates (Blueprints) to effortlessly construct functional and efficient dApps.
- LensAPI Oracle - LensAPI Oracle blueprint that allows for Consumer Contract on Polygon to trustlessly get data from the Lens API.
- DeveloperDAO Workshop - DeveloperDAO Workshop with hashwarlock on how to deploy a LensAPI Oracle, connect a Consumer Contract on Polygon to the LensAPI Oracle, and finally connecting a UI to the Consumer Contract.
- LensAPI Oracle Consumer Contract Template - LensAPI Oracle Consumer Contract template that connects to the LensAPI Oracle blueprint deployed on Phala Network.
- How to Test Your First Function Locally - Learn how to test your custom JS function locally before deploying your LensAPI Oracle to PoC5 testnet or mainnet.
- Phala Blueprint Proposals - Repo to submit issues and new proposals for blueprints to be added to the Phat Bricks UI.
- Lens Treasure Hunt - Example of a Consumer Contract for the LensAPI Oracle to create a treasure hunt based on Lens Profiles.
- PrivaDEX - PrivaDEX is the cross-chain DEX aggregator native to Polkadot. As an example, you can swap from USDC (Wormhole) on Moonbeam to ARSW on Astar in one click.
- Phat Bricks - Phat Bricks offers the ability to deploy applications without the need for coding. Phat Contract provides pre-defined components (Phat Bricks), and customizable templates (Blueprints) to effortlessly construct functional and efficient dApps.
- Phat Offchain Rollup - Phat Offchain Rollup is an SDK designed to simplify the process of connecting Phat Contracts to a wide range of blockchains. Its primary focus is on providing transactional and atomic cross-blockchain operations for seamless integration and interaction.
- Phat Contract Tutorials by GuiGuo12358 - Phala tutorials written by community member and technical ambassador GuiGuo12358
- Deprecated Examples
- 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! WASM smart contracts examples repo.
- 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.
Note These are outdated versions that do not reflect the current native Phat Contract development stack. Let these serve as ideas of what is possible.
- 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.