lhartikk / naivecoin

A tutorial for building a cryptocurrency
https://lhartikk.github.io/
Apache License 2.0
531 stars 266 forks source link

Missing Proof of Work #20

Closed jfsuarezb closed 4 years ago

jfsuarezb commented 4 years ago

This blockchain would resemble real blockchains much more if it implemented a proof of work challenge whereby a node looking to add a block to the blockchain would have to find a nonce that could generate a specific hash. For instance, if a node wanted to add a block, and the previous hash was "abc", then it would have to find a number x such that when that number is appended to the byte-stream of the block it wants to hash, the hash of the block would begin with a zero, say "0ewbv". This would resemble bitcoin more closely.

jfsuarezb commented 4 years ago

Sorry I missread the article.