What is a Smart Contract
Creating a smart contract is one of the basic ways you can utilize the Partisia Platform. A smart contract is a program you run on the blockchain. The conditions of the contract are present across the blockchain. This ensures that actions of the smart contract will happen only once, are trackable and irreversible. In this way a smart contract works independently, without any need for outside authority to facilitate the change in state. So, you do not need a bank or a lawyer to set up a binding agreement anymore, since you have ultimate control over the conditions necessary to make the change happen.
Why use Partisia Platform for your smart contracts
What makes the smart contract on Partisia Platform different from contracts on other blockchains is that we allow you to add a privacy layer parallel with the immutable ledger. Specifically you can through your contract allocate nodes to handle Multi Party computation. If you for example want to create an auction, you can keep the identity of the current bidder and account information secret and off the record, while the identity of the winner and seller will be added to the immutable record. This will secure a record of change in ownership while at the same time preserving the privacy of all interested parties that don’t give the winning bid. This principle of a combination of a privacy layer and a ledger is what Partisia Platform provides.
The different contract types and their life on the blockchain
There are three types of smart contracts on Partisia Platform:
-
System smart contracts: The permanent contracts orchestrating the node behavior, they are involved in the deployment and eventual destruction of the smart contracts and MPC smart contracts as well as a larger number of other essential duties, such as preprocessing of data for MPC contracts.
-
Smart contracts: Smart contracts are written in the Partisia smart contract language which is based on Rust. A contract has a state which include the variables subject to change. When a user deploys a contract it is sent as a WASM file to a system contract which check the content for type and format validity. Then the contract is initialized. It is now deployed on the chain and the state of the contract can be changed by the available actions made stipulated in the contract. Actions cannot only change the state of their own contract, but also affect the actions and state of other smart contracts. An action of a contract affecting an action in another contract is called an interaction (also referred to as event transaction). A Smart contract will be destroyed by a system contract when it hits the expiration date set by the contract creator.
-
MPC smart contracts: Are just like smart contracts except that the contract stipulates some actions of the contract using MPC technology to create zero knowledge calculations. Famously Partisia Platform supports secure Multi Party Computation also referred to as MPC.