Bitcoin Forum
December 14, 2017, 02:50:56 AM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: ★★ DigiByte ★★ What is DigiShield & How it Works to Retarget Difficulty  (Read 2430 times)
DigiByte
Legendary
*
Offline Offline

Activity: 1344


Official DigiByte Account


View Profile WWW
March 22, 2014, 10:10:41 PM
 #1

What is DigiShield & How it Works to Retarget Difficulty

After receiving countless messages asking us what exactly DigiShield is we decided to write a post and explain everything in greater detail.

DigiShield re-targets a coin’s difficulty to protect against multi-pools and an over-inflation of easily mined new coins. DigiShield was originally developed for DigiByte, but has since been implemented into Dogecoin and will soon be implemented into more coins.  DigiShield re-targets a coin’s difficulty between every block or in the case of DigiByte & Dogecoin, every 60 seconds.

We created DigiShield after seeing the threat that multi-pools pose to a crypto currency when they start mining a coin at a very low difficulty in relation to their net pool hash. This allows many coins to be quickly and easily mined before the difficulty increases. Once the difficulty increases the multi-pool leaves a coin, dumps the coins on the market, and then leaves the dedicated existing miners with a very high difficulty and very few new coins to be mined.  This leads to a drop in price and frustration among the committed community members  & miners of the affected coin.
DigiShield protects DigiByte against this threat and helps ensure greater confidence in any coin that implements it by allowing the difficulty to rise and fall almost perfectly in sync with increases or decreases in the net hash of a coin.  The secret to DigiShield is an asymmetrical approach to difficulty re-targeting. With DigiShield, the difficulty is allowed to decrease in larger movements than it is allowed to increase from block to block. This keeps a blockchain from getting "stuck" i.e., not finding the next block for several hours following a major drop in the net hash of coin. It is all a balancing act. You need to allow the difficulty to increase enough between blocks to catch up to a sudden spike in net hash, but not enough to accidentally send the difficulty sky high when two miners get lucky and find blocks back to back. The same thing occurs with difficulty decreases. Since it takes much longer to find the next block, you need to allow it to drop quicker than it increases.

The KGW (Kimoto Gravity Well) and Earthcoin approaches to difficulty re-targeting are not as effective as DigiShield in protecting against multi-pools.  We conducted extensive testing over a five day period and found that an asymmetrical approach was much more effective than the KGW approach. We found that the difficulty needed to be able to decrease by a larger magnitude than it was allowed to increase. When the difficulty was allowed to increase or decrease at the same rate with larger orders of magnitude, some very bad oscillations occurred along with some crazy high difficulties when two lucky blocks were found quickly back to back. The asymmetrical adjustments keep the difficulty from going too high too fast, but allow it to drop much quicker after a large hash down swing as it takes a much longer time to discover the next two blocks for the difficulty adjustment to occur.

Both the KGW and Earthcoin approaches to difficulty re-targeting still allow multi-pools a few minutes of easy mining.  For example, Earthcoin still gets hit my multi-pools for 11-12 minutes at time. Both approaches limit the amount the difficulty is allowed to change between blocks, which can become a big issue when a sudden hash decrease occurs.  While simulating a sudden 10-20 fold hash decrease, KGW can become "stuck" for several hours before the next few blocks are discovered and the difficulty evens out again.  The same issue exists with the Earthcoin approach.  It can get "stuck" for 20-40 minutes following an 11 minute hash increase from a multi-pool attack.  We know a 10-20 fold hash increase is unusual, but it is possible, especially as cryptocurrencies become better known.  More than likely, we will only ever see more than a 5-10 fold increase.  Nonetheless, we wanted to develop something that protected against even the most unlikely of hash jumps to ensure that we could handle sudden extremes very quickly.  

In summary DigiShield is a balanced asymmetrical approach to difficulty re-targeting. You don't want to let the difficulty go too high too fast, but you need to give it enough room to catch up quickly. The same thing goes with down swings, since it takes longer to discover new blocks you need to give it more room to go down, but not enough to send it to the floor. DigiShield is by no means the absolute "perfect" solution to the multi pool/ difficulty problem, but after testing dozens of different setups over a five day period including KGW and the Earthcoin approach, the current ratios/ settings in DigiShield out performed any other solution available at the moment.

The DigiShield code can be found here between lines 833 & 1007:
https://github.com/digibyte/DigiByteProject/blob/master/src/main.cpp

Take a look at the Dogecoin difficulty chart:
 http://www.coinwarz.com/difficulty-charts/dogecoin-difficulty-chart.  
You can see how multi-pools have really been mining most of the coins and leaving the dedicated Doge miners to pick up the slack and get the short end of the stick when it comes to new coins. You can also see when DigiShield took effect and that no longer occurs.

Now take a look at the chart for DigiByte:
http://www.coinwarz.com/difficulty-charts/digibyte-difficulty-chart.  
You can see how we would get "stuck" after a multi pool left us and it would take several hours more than our 2.4 hour re-target before the difficulty came back down. Had we not implemented DigiShield when we were hit with the 1 GH - 8GH increase we might have been "stuck" for a day or more. See how quickly the pool hit us and left, and more importantly see how fast the difficulty decreased back to normal levels?  Since DigiShield went into effect, you can see how quickly multi-pools hit us and leave, whereby they mine considerably less coins now, upwards of 50-80% less.


Main DigiByte Thread: https://bitcointalk.org/index.php?topic=408268.0


1513219856
Hero Member
*
Offline Offline

Posts: 1513219856

View Profile Personal Message (Offline)

Ignore
1513219856
Reply with quote  #2

1513219856
Report to moderator
1513219856
Hero Member
*
Offline Offline

Posts: 1513219856

View Profile Personal Message (Offline)

Ignore
1513219856
Reply with quote  #2

1513219856
Report to moderator
1513219856
Hero Member
*
Offline Offline

Posts: 1513219856

View Profile Personal Message (Offline)

Ignore
1513219856
Reply with quote  #2

1513219856
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1513219856
Hero Member
*
Offline Offline

Posts: 1513219856

View Profile Personal Message (Offline)

Ignore
1513219856
Reply with quote  #2

1513219856
Report to moderator
1513219856
Hero Member
*
Offline Offline

Posts: 1513219856

View Profile Personal Message (Offline)

Ignore
1513219856
Reply with quote  #2

1513219856
Report to moderator
1513219856
Hero Member
*
Offline Offline

Posts: 1513219856

View Profile Personal Message (Offline)

Ignore
1513219856
Reply with quote  #2

1513219856
Report to moderator
DigiByte
Legendary
*
Offline Offline

Activity: 1344


Official DigiByte Account


View Profile WWW
March 22, 2014, 10:17:30 PM
 #2

Feel free to ask us any questions you may have here on this thread.

DigiByte
Legendary
*
Offline Offline

Activity: 1344


Official DigiByte Account


View Profile WWW
March 22, 2014, 11:15:23 PM
 #3

We also would like to hear if anyone has any ideas on how to improve upon this!

artik123
Full Member
***
Offline Offline

Activity: 156


View Profile
March 26, 2014, 07:08:02 PM
 #4

Excellent explanation. Thanks!
YarkoL
Legendary
*
Offline Offline

Activity: 978



View Profile
March 27, 2014, 11:32:50 AM
 #5

As it is an asymmetrical adjustment, wouldn't that make it vulnerable to time warp exploit?

dev blog https://yarkol.github.io
BTC 18kHb54jqcpWEkuAkCFsGMzR6BMgYnpi2T
Equate
Hero Member
*****
Offline Offline

Activity: 700


View Profile
March 27, 2014, 12:01:52 PM
 #6

Can you provide more statistical details how digishield is superior to KGW or other difficulty re-targeting  approaches ?
markm
Legendary
*
Offline Offline

Activity: 2002



View Profile WWW
March 27, 2014, 12:29:45 PM
 #7

As it is an asymmetrical adjustment, wouldn't that make it vulnerable to time warp exploit?

Yeah these assymetric systems are apparently really great for time-warpers.

They can get the difficulty low really fast, so as to insta-mine lots more coins really soon, then back down really fast to do it again, pow it is great for them.

-MarkM-

Browser-launched Crossfire client now online (select CrossCiv server for Galactic  Milieu)
Free website hosting with PHP, MySQL etc: http://hosting.knotwork.com/
kevorsen
Jr. Member
*
Offline Offline

Activity: 41


View Profile
March 27, 2014, 12:56:06 PM
 #8


I think a few coins will want Digishield added. Smiley

maybe you can charge them for a hardfork. Smiley  good biz.
DubFX
Sr. Member
****
Offline Offline

Activity: 434


View Profile
March 27, 2014, 12:57:58 PM
 #9

Thank you for the expaination and hopefully this could bring more people to DGB.
softron
Full Member
***
Offline Offline

Activity: 210


View Profile
March 27, 2014, 01:12:19 PM
 #10

Nice info. ive been looking for this

DigiByte
Legendary
*
Offline Offline

Activity: 1344


Official DigiByte Account


View Profile WWW
April 07, 2014, 11:28:45 AM
 #11

With all the recent attention to KGW exploits, we have been receiving many more questions about DigiShield. Bump.

Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!