Skip to content

Mining implies the block will be added? #5

@lbragile

Description

@lbragile

When mining, shouldn't the solutionHash be compared to a targetHash and the block only be added if solutionHash <= targetHash?

Otherwise, what stops a miner from having a list of predefined hashes that meet the criteria of having 4 leading zeros and just submitting them.

On that note, it would also make more sense to have a variable number of leading zeros in the mining process' expected solution hash for each block that needs to be added to the chain.

I am currently working on a project similar to this to get a better understanding in the cryptocurrency space.
Feel free to have a look and let me know if the above is indeed correct and I will make a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions