On Sunday, 4 March 2018 15:55:41 UTC-4, an...@mycoralhealth.com wrote:
>
> Hi everyone, I wrote a blog post showing you how to write up your own 
> Proof of Work algorithm in Go. Feedback welcome! 
> https://medium.com/@mycoralhealth/code-your-own-blockchain-mining-algorithm-in-go-82c6a71aba1f
>

Difficulty is done as a value comparison and not a fixed number of leading 
zeros.  To do it in go you could use math/big to take the numeric value of 
the hash result and compare it to the target difficulty.  If the hash is 
less than the difficulty, then you've found a solution.
This allows the difficulty to be continuously variable rather than being 
limited to power of two steps.
 

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to