Kaspa Improvement Proposal: A Breakdown of KIP-4
Improving Kaspa’s complexity adjustments and KIP-3
KIP-4
On Jun 12, 2023, Shai Wyborski, Michael Sutton, and Georges Künzli presented KIP-4, a proposal aimed at refining the Kaspa protocol — in an attempt to translate its complex mechanisms into a language more easily grasped by everyday enthusiasts.
Kaspa is continually undergoing improvements, known as Kaspa Improvement Proposals (KIPs), and the latest in this series is KIP-4. The community’s tireless drive for refinement brought this latest update to the forefront. To improve how Kaspa adjusts its mining process’s ‘difficulty.’
Shai ‘Deshe’ Wyborski breaks down KIP-4 in this Twitter thread.
Difficulty
Before we delve into the technical specifics of KIP-4, let’s first understand ‘difficulty.’ In the cryptocurrency world, ‘mining’ involves solving complex mathematical puzzles, and the difficulty level of these puzzles determines how easy or hard it is to mine a block. This difficulty is adjusted periodically to maintain a stable mining process, a mechanism that’s crucial for the network’s security and functionality.
At the heart of KIP-4’s proposal is a fundamental concern of the Kaspa network — managing its Block Per Second (BPS) rate. The BPS rate refers to the number of new blocks that get added to the network every second. On the surface, having a higher BPS rate may seem beneficial since more blocks can be added to the network in less time. However, there’s a catch.
With each new block added, the network must check or ‘verify’ the difficulty level of adding that block to maintain network integrity. This verification is a resource-intensive process and becomes more burdensome as the number of blocks increases. It’s a bit like juggling — handling a single ball (or block) is simple. Still, adding more balls into the mix makes the task increasingly challenging and complex.
The predecessor to KIP-4, KIP-3, had proposed a solution for this issue. It suggested using a subset of the blocks for the verification process, reducing the load on the network. If you ‘sample’ a portion of the blocks rather than using them all, the verification process would become less resource-intensive, and higher BPS rates would be feasible. But there was a flaw in this approach.
It was discovered that if a new miner joined the network and knew which blocks would be sampled, they could strategically withhold these blocks. This could lead to a situation where the network’s block rate increased, but the difficulty verification process didn’t account for these new blocks, leading to network instability. This vulnerability highlighted the need for an alternative approach, which paved the way for KIP-4.
The Solution of KIP-4
But, as it turns out, you don’t need to juggle all the balls to keep the show going. In Kaspa’s context, you don’t need to check all blocks to adjust the difficulty — you can pick a few at regular intervals. This is the genius behind KIP-4.
KIP-4 proposes a straightforward way around this. Rather than randomly ‘sampling’ blocks, Kaspa would instead consider every Cth block (for example, the 0th, 9th, 18th, and so on, if C=9). While this method was initially overlooked because it wasn’t ‘global’ — meaning that different blocks might end up using different data for their difficulty adjustment — the developers found that this method was surprisingly effective and efficient.
In a heartening instance of community contribution, KIP-4 was brought to life by @Tiram_88, a developer who rose from within the Kaspa community. Their familiarity and understanding of the protocol’s nuances enabled them to make significant contributions to the Kaspa network’s core functioning.
Having already undergone successful testing in a controlled environment, KIP-4 will soon be released to the testnet. A ‘practice’ network where users can trial new features without risking real assets. However, a hard fork will be needed to incorporate it into the mainnet, the ‘real’ network where actual transactions happen, implying more significant changes to the Kaspa network.
KIP-4 is an innovative stride toward optimizing the complexity adjustment process, thereby boosting the efficiency of the Kaspa protocol. It underlines the ongoing innovation in the crypto world, bringing a fresh chapter in the ever-evolving narrative of cryptocurrency technology.
KIP-4: https://github.com/kaspanet/kips/blob/master/kip-0004.md
Tip: Community developer @Tiram_88, has proven his skill by successfully implementing changes to the Kaspa protocol, understanding and setting a solid foundation Kaspa.