Explaining the Purplecoin/XPU mining and emission mechanism and how it uses 50% less energy

Octavian Once
5 min readMar 25, 2023

--

The emission mechanism of Purplecoin/XPU is roughly based on that of Bitcoin, but modified to work for a sharded blockchain. In order to explore it, we will first have to understand how Bitcoin works. For information on the stateless nature of XPU, take a look here.

The emission of Bitcoin is distributed among these miner pools. If one mining pool achieves more than 51% of the share, it can reverse transactions.

In Bitcoin, miners repeatedly hash blocks using the sha256 algorithm until one of them matches the desired solution. The best way for non-technical people to understand this is that it is kind of like a lottery. And better hardware gives you more lottery tickets. If a mining pool reaches critical mass, it will win all the lottery rewards.

The Bitcoin Proof of Work algorithm

Decentralisation in mining is based on the assumption that there is enough competition at the hardware level such that the share is distributed among many different participants. As it can be seen in the diagram above, there are only a few mining pools found in Bitcoin which own massive shares of the emission.

Mining a sharded blockchain, the wrong way

Now, let’s imagine that instead of one Bitcoin, we had 16 Bitcoins. It would mean that all of the mining pools would be mining 16 chains at once. It is suddenly much easier to attack a single chain, as most of the hardware is concentrated on all the others. Instead of 51% we would need 51/16 = 3.1875% of the total hardware to reverse transactions on a chain. In the above diagram, this would mean one of the smallest dominant pools would be allowed to reverse transactions on any chain.

Mining a sharded blockchain, the right way

In order for a sharded blockchain to work via mining, we must make sure a single chain requires 51% of the total hardware, regardless of the number of shards.

In order to explain how XPU achieves this, we must first understand the Green Proof of Work model.

Green Proof of Work

The green Proof of Work model was invented as a way to reduce the overall electricity consumed in a mineable blockchain.

The Green Proof of Work mining algorithm

In the Green Proof of Work model, mining is performed in epochs, with each epoch lasting two blocks. The first block in an epoch is mined exactly like in Bitcoin: once the solution is found, the block is accepted by the majority. The difference is that the next block can only be mined by “runnerups”. These are miners who didn’t manage to find a solution first during the first round. They must continue mining the same block until they find a solution, which allows them to mine the next block.

As only a few miners will be able to achieve this, the number of miners in the second round is exponentially smaller. The other miners must wait for the runnerups to finish mining the second block. As the number of miners in the second round is less than 1% than that of the miners in the first round, it reduces the energy consumed overall from mining to 50%.

Figure from the Green Proof of Work whitepaper describing how mining works in each round

Modified Green Proof of Work

In the original model, a single runnerup is permitted. Since a runnerup block has the same difficulty as a normal one, and must be mined in order for the next block to be added to the chain, we can see that in this model, one would require twice the hashrate to successfully mine both the first round block and the runnerup.

Now remember that we said before that in order for a sharded blockchain to work via mining, we must make sure a single chain requires 51% of the total hardware, regardless of the number of shards.

If we have 16 chains, and we use the Green Proof of Work model, while requiring 15 runnerups instead of one, one would need 51% of the total hashrate in order to mine the first round block, all the runnerups, and the second round block.

This means that XPU is as safe as Bitcoin, while working as 16 independent blockchains. More blockchains = more transactions per second.

Equal token emission

In order for this model to work, each block, on every chain, must emit an equal amount of coins. If more coins are emitted on a chain than the other, there will be more hashrate dedicated to that specific chain. As such, the reward is equal on all chains in Purplecoin.

Multiple Proof of Work algorithms

As we mentioned before, in Bitcoin, you can only mine blocks using sha256. This is not the case in Purplecoin, where each mining epoch (2 successive blocks) are mined using a different algorithm.

Share of blocks mined in Purplecoin/XPU for each type of algorithm

Half of the epochs are mined using a CPU/GPU algorithm, and half of the epochs are mined using a random ASIC algorithm which cannot be determined prior. As such, an attacker would have to own 51% of the hardware of all algorithms to successfully be able to reverse transactions.

This also makes miners switch chains or wait for their desired algorithm to be required on a specific chain, further increasing security and miner distribution.

Example

  • Epoch 1: GhostRider
  • Epoch 2: Sha256
  • Epoch 3: GhostRider
  • Epoch 4: Fugue
  • Epoch 5: GhostRider
  • Epoch 6: JH

Coin emission

We can see that with this model, coins are more fairly distributed than in Bitcoin, where only large mining pools take the majority of emissions. As Purplecoin works with decentralised mining pools by default, mining on a smartphone is feasible.

While 16 times less coins would be emitted than if we didn’t employ sharding, they are highly distributed and no miner can successfully win all rewards at once. As coins are distributed more fairly, the chance of attacks decreases.

Learn more

--

--