Skip to content

Implement Proof-of-Work (PoW) algorithm #1

@devduart

Description

@devduart

Implement a basic Proof-of-Work mechanism to simulate mining. Each block must compute a valid hash with a certain number of leading zeros.

Tasks

  • Add a Nonce field to the Block struct.
  • Implement a MineBlock(difficulty int) function that updates the hash until the difficulty is satisfied.
  • Integrate mining into the NewBlock function.
  • Make difficulty configurable via a global constant or config.
  • Write unit tests to validate mining output.

Reference

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions