Why Using It
Compared with Smart Contract
The existing smart contract solutions have many limitations:
- High latency with limited number of instructions to execute;
- No database support;
- No network access;
- Few libraries;
Phat Contract is meant to be the missing computational unit for existing smart contracts, so you do not need to deploy your backend programs to centralized cloud anymore.
The Phat Contract inherits the self-enforcing and tamper-proof nature of smart contract, while introducing more advantages including:
- Privacy-preserving with performance. It’s safe to store and process your secret data in Phat Contract since it’s backed by hardware-based encryption throughout its lifecycle;
- Zero latency, zero gas fee. The interactions with Phat Contract can involve no on-chain transactions, thus achieving millisecond-level read and write responses with no gas fee;
- Connectivity with HTTP requests. Phat Contract natively supports HTTP requests. Use it to connect any exiting Web2 services to store data and build Oracle, or an RPC node of other blockchains for easy and safe cross-chain operations;
- Freedom to use libraries in Rust ecosystem. Write your contract with Rust-based ink! language and use libraries with
no_stdsupport. We will support
stdin the future Phat Contract version then you can use any libraries you like.
Compared with Web2 Serverless Services
Phat Contract provides the same functionalities as our Web2 counterparts, but opens up more possibilities with its Web3 nature.
- Enforced execution of general-purpose programs. The enforcement of execution is the core feature of smart contract: the developers cannot tamper or stop their programs after deployment, which builds the trust base. With Phat Contract, we bring this to more general-purpose programs. Never under-estimate this since it’s why cryptocurrencies can have value;
- Decentralized and trustless infrastructure. Our infrastructure design is totally public and all its code is available for you to check. To process your sensitive data in Phat Contract implies no trust on the Phala team, but on the code and Secure-Enclave-based hardware;
- Easier integration with other blockchains. We provide contract templates for easy and safe interactions with existing blockchains. Also you can safely delegate your chain accounts to the trustless Phat Contract with no worry about privacy leakage;
- Open contract ecosystem. A most typical difference between contracts and Web2 programs is that they are naturally public: you are free to call any existing contracts to compose your own apps with little efforts.