Skip to content

Mining implies the block will be added? #5

Open

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

Activity

  1. NYC00kie commented on Jun 19, 2021

    @NYC00kie

    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.

    Other miners will need to confirm that the submitted hash is actually the correct hash.
    That is how the Blocks are confirmed in a decentral manner.
    If the hash cannot be confirmed with the submitted solution then it wont get integrated into the Blockchain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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