Skip to content

Proof of Work Algorithm for Blockchain - #11699

Open
anurags10 wants to merge 11 commits into
TheAlgorithms:masterfrom
anurags10:master
Open

Proof of Work Algorithm for Blockchain#11699
anurags10 wants to merge 11 commits into
TheAlgorithms:masterfrom
anurags10:master

Conversation

@anurags10

@anurags10 anurags10 commented Oct 3, 2024

Copy link
Copy Markdown

Describe your change:

The algorithm implements the Proof of Work (PoW) consensus mechanism used in blockchain to validate blocks. PoW ensures that participants (miners) must perform a computational task to create a valid block and add it to the blockchain. The difficulty of the task is defined by the number of leading zeros required in the hash of the block.

  • Add an algorithm?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms include at least one URL that points to Wikipedia or another similar explanation.
  • If this pull request resolves one or more open issues then the description above includes the issue number(s) with a closing keyword: "Fixes #ISSUE-NUMBER".

@algorithms-keeper algorithms-keeper Bot added the tests are failing Do not merge until tests pass label Oct 3, 2024
@algorithms-keeper algorithms-keeper Bot added the require type hints https://docs.python.org/3/library/typing.html label Oct 3, 2024

@algorithms-keeper algorithms-keeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Click here to look at the relevant links ⬇️

🔗 Relevant Links

Repository:

Python:

Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.

algorithms-keeper commands and options

algorithms-keeper actions can be triggered by commenting on this PR:

  • @algorithms-keeper review to trigger the checks for only added pull request files
  • @algorithms-keeper review-all to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.

NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.

Comment thread blockchain/pow_algorithm.py Outdated
Comment thread blockchain/pow_algorithm.py Outdated
Comment thread blockchain/pow_algorithm.py Outdated
Comment thread blockchain/pow_algorithm.py Outdated
Comment thread blockchain/pow_algorithm.py Outdated
Comment thread blockchain/pow_algorithm.py Outdated
Comment thread blockchain/pow_algorithm.py Outdated
Comment thread blockchain/pow_algorithm.py Outdated
@algorithms-keeper algorithms-keeper Bot added the awaiting reviews This PR is ready to be reviewed label Oct 3, 2024
@algorithms-keeper algorithms-keeper Bot removed the tests are failing Do not merge until tests pass label Oct 3, 2024
@algorithms-keeper algorithms-keeper Bot removed the require type hints https://docs.python.org/3/library/typing.html label Oct 3, 2024
@algorithms-keeper algorithms-keeper Bot added the tests are failing Do not merge until tests pass label Oct 3, 2024
@algorithms-keeper algorithms-keeper Bot removed the tests are failing Do not merge until tests pass label Oct 3, 2024
@anurags10

Copy link
Copy Markdown
Author

@tianyizheng02 can you please check and approve it

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

Labels

awaiting reviews This PR is ready to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant