Blockchain consensysPhpcoin blockchain tries to solve actual issues with traditional proof of work consensus (POW). As POW is often criticized as a very energy waste, PHP Coin utilizes its own lightweight version of POW, called EPOW - Elapsed Proof Of Work.
Basic principle of this algorithm is that valid hash is calculated minimum one per second for each miner in such a way that more time elapsed from target block time it will be easier to mine block.
Mining processMiners generate a new block on the network.
In order to do that, miners get work from a connected node. That work contains the latest block info and pending transactions from mempool.
Then the miner goes into a loop and calculates his elapsed times from the last block.
To prove his work, the miner hashes the base string with argon and its address.
Based on its address it calculates hit value which is changed every second elapsed from last block time.
With a given difficulty for the next block which is calculated from node, miner calculates the target and when its hit value becomes higher than target it mines a block.
Explanation of mining hash calculationhttps://docs.google.com/drawings/d/171dKeVOGB8NFwOtJyN_NqYpyxOWcVwOtad7r5DYatHg/editTarget is not fixed, it is calculated from difficulty and is lower as time passes from the previous block. It is centered to be optimal to mine blocks for given block time.
After finding the hash, the miner sends it to the associated node. Node checks miner hash, and if it is validated, node adds a new block to blockchain. For that block beside mempool transactions node adds two reward transactions.
First one is reward (90%) to miner who submitted targeted hash and second is reward to node (10%) who added block to blockchain. Amount for rewards are calculated from actual block reward.
If node is also a miner then the whole reward goes to it.
Difficulty adjustmentBased on a simple formula that calculates the last 10 blocks, difficulty is calculated and adjusted for every block. If a block is found faster than block target time, difficulty is increased by 5%, otherwise it is decreased by 5%.