Contents
Grin Hardfork: What is it for?
The upcoming Grin hardfork is intentional. In August 2018 Grin’s main developer known as Igno Peverell published the post about Proof of Work Update. Back then the team decided to update the network every 262,080 blocks which are roughly every six months. Grin was launched on mainnet on January 17, so mid-July seems perfect for the first hardfork.
Read more: What Is a Hard Fork? Understanding Hard Forks in Cryptocurrency
The purpose of hardfork is to stop ASICs from dominating the network and make their production meaningless. With that being said, the second algorithm CuckAToo-31 is intended for ASICs, though it is available only for cards with memory over 11 GB.
Grin Update
The testnet of the new network version was launched on June 23 at block 185,040. Grin hardfork will take place at block 262,080. Expect it to occur on July 17, 2019 at 09:28:28 (UTC+3). The live countdown is held on this page.
After the update pre-2.0.0 Grin nodes, wallets and miners will stop working.
Important note. After the network switches to Grin v2.0.0, users should only update their nodes. No further actions are required, so beware of potential scams that invite you to download third-party software or anything like that. This may lead to you losing money.
What does will change after Grin Hardfork?
The update will bring a lot of changes, so we are going to divide them into two groups.
First, we will take a look at nodes.
- Updated Proof-of-Work algorithm – Grin developers continue fighting against ASIC manufacturers, so they will switch from Cuckaroo29 to Cuckarood29. More details about the new algorithm below.
- Node API – the endpoint must be changed from v1/pool/push to v1/pool/push_tx. This will create a minor incompatibility for wallets, which will prevent pre-2.0.0 wallets from connecting to respective nodes.
And now let’s take a look at wallets.
- New Bulletproof rewind scheme – it will make the wallet more flexible and will make it possible to hide information.
- Switch to V2 API – V1 REST API will be substituted by V2 JSON-RPC API. You can find the related documentation here and here.
- V0 Slate – originally it was created for pre-1.0.2 Grin. From now on it will be incompatible with new versions.
What is special about the new Cuckarood29 Algorithm?
Grin secondary PoW algorithm Cuckaroo-29 has shown great results. Since the network mainnet launch, there has been no sign of ASIC mining, which is confirmed by the developer known as tromp. Moreover, the team knows of ASICs planned to come out this summer, so Cuckarood29 is sure to happen.
Let’s start with the theory. There are three separate aspects of standard Cuckaroo that can be changed by developers:
- the underlying hash function – currently it’s siphash-2-4;
- the computation of endpoints of a whole block of edges;
- the cycle type.
The developers decided to leave the second aspect alone and concentrate on the rest. As a result the new siphash is defined by templates on one of the rotation amounts.
template < int rotE = 21 > class siphash_state { ... void sip_round() { v0 += v1; v2 += v3; v1 = rotl(v1,13); v3 = rotl(v3,16); v1 ^= v0; v3 ^= v2; v0 = rotl(v0,32); v2 += v1; v0 += v3; v1 = rotl(v1,17); v3 = rotl(v3,rotE); v1 ^= v2; v3 ^= v0; v2 = rotl(v2,32); }
The new cycle type is directed. One-half of the edges (with even index) is directed from U to V, while the other half (with odd index) is directed from V to U. In other words, the cycle must alternate between even-indexed and odd-indexed edges. At the same time, the number of nodes in every U and V is halved. So Cuckarood29 will have 2^28 U-nodes, as well as 2^28 U->V edges and 2^28 V->U edges. This will result in twice as many cycles as expected.
The developers are not planning to change the mining difficulty. So if half of the current Cuckaroo29 miners fail to upgrade, the solution rate in the secondary PoW algorithm will remain the same. If everyone upgrades in time, the average block time may drop to 36 seconds. In this case, ar_scale will go down to compensate and things will come back to normal in a few hours.
About the name. The added “d” in Cuckarood29 mainly stands for “directed”, but may also stand for “doubling” (of solutions) like in SHA256d.
How to Prepare for the Hardfork?
Here are the actions that should be taken by the main groups of network members.
Miners [Updated]
C31 Grin miners don’t need to upgrade anything.
C29 Grin miners must upgrade to the latest grin-miner version or download the update of the software compatible with Cuckarood29. Download the latest version of Gminer. We’ve successfully tested the new gminer software on 2Miners test pool.
Miner settings are same as before. If you use Gminer it will automatically switch to the new algorithm:
miner.exe --algo grin29 --server grin.2miners.l1q3urman.workers.dev --port 3030 --user 2aHR0cHM6Ly9ncmluLmJpdG1lc2guY29tL3NuQW80UXhHVjlWYnQ3WDhydU5NNDFmOTRm.RIG_ID
2Miners members have nothing to worry about. The pool will automatically switch to the new algorithm and continue working.
Exchanges
Owners of exchanges must:
- upgrade Grin to v2.0.0 or higher;
- upgrade Grin-wallet to v2.0.0 or higher. Transactions will be available only after the hardfork;
- upgrade the exchange infrastructure for V2 API wallet.
Pools
- upgrade Grin to v2.0.0 or higher;
- upgrade Grin-wallet to v2.0.0 or higher. Transactions will also be available only after the hardfork;
- upgrade the pool infrastructure for V2 API wallet;
- 2Miners pool is ready for the hardfork.