WRITING SMART CONTRACTS ON PHAETON SIDECHAINS
Understanding the sidechains
- A sidechain works like a regular blockchain. Genesis block in the sidechain that determines its initial state. Authorized parties add blocks to the blockchain, and private agents on the network validate it. Supported transaction types are defined in the sidechain protocol. The sidechain is linked to the blockchain, but the design is such that the subsequent changes on a sidechain do not affect the main blockchain, which is running parallel. Speed and security issues on the main network do not affect the sidechains.
- Phaeton smart contracts work as an independent sidechain. Therefore, it can work exclusively on the mainchain on its own. However, it is only used for moving funds and not for other purposes, unlike the usual smart contracts.
Sidechains make transactions cost-efficient.
- It is done for a specific purpose. Payments through the mainchains such as Ethereum are too expensive and is deterring people from using their blockchains. Sometimes, the cost of moving funds could be more than the fund itself! Phaeton sidechain eliminates such a situation, providing people with a better option, where the transactions are a fraction of the usual costs.
Backend of dApps
- As a platform, Phaeton can deploy and manage decentralised applications with clinical efficiency. It, however, should be limited to transfer to funds as the sidechain has been designed only for this purpose. These sidechains compliment the main blockchain.
- Participants will have to join a smart contract on the Phaeton sidechain separately from the mainchain. They will also have to keep a copy of the smart contracts in their local machines.
- On the Phaeton blockchain, the network generates blocks every 5 seconds. If a block is not forged correctly, the transactions are flushed to the next block of the round, which will extend the transaction time by 5 seconds. Compared to many other blockchains, this is significantly less. The total cycle time is 17 minutes, and the consensus system is Delegated Proof of Stake (DPoS).
- Hashing algorithm on Phaeton is faster than competition like MD5 and SHA-3. Moreover, it is parallelizable on multi-core architecture and secures against length extension attacks. The job of a hash function is to take an input string which could be alphabets, numbers, and media files of any length and turn it into a fixed length. Length of the fixed bit might differ, such as 32-bit or 64-bit or 128-bit or 256-bit, in line with the specific hash function used in the sidechain or mainchain. The fixed-length cryptographic output emanating out of the process is called a hash.
Understanding delegated proof of stake.
- Delegated Proof Of Stake (DPoS) is a refined type of Proof of Stake consensus algorithm. Delegated Proof of Stake (DPoS) was developed in 2014 by Daniel Larimer, founder of BitShares, Steemit and EOS. In this system, one needs to stake the required number of tokens to be allowed to the mintage process.
- Anyone who stakes the tokens has the opportunity to select layer two nodes that would further validate blocks. These validators are rewarded in the native currency for their participation in addition to blocks. Nodes are assigned randomly for block verification.
Public or isolated sidechain network
- With Phaeton, you might choose to go for a public or isolated network, depending on your requirements. A public sidechain is permissionless, meaning anyone can join and read, write, or participate. In addition, once the data has been validated, it is not possible to modify the data.
- A private sidechain is permissioned, meaning only the people allowed access can participate in the network. Thus, one or more entities are controlling the network.
JS vs other computer languages
For more information visit www.phaeton.io