https://github.com/dcarpintero/py-bck
Blockchain implementation in Python
https://github.com/dcarpintero/py-bck
blockchain hashcash proof-of-work python sha256
Last synced: 4 months ago
JSON representation
Blockchain implementation in Python
- Host: GitHub
- URL: https://github.com/dcarpintero/py-bck
- Owner: dcarpintero
- License: mit
- Created: 2020-05-22T10:21:35.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-07-16T08:05:47.000Z (12 months ago)
- Last Synced: 2025-01-21T10:50:59.909Z (6 months ago)
- Topics: blockchain, hashcash, proof-of-work, python, sha256
- Language: Python
- Homepage:
- Size: 53.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## PY-BCK
A naive blockchain implementation in Python. Consensus is based on proof-of-work as in the
[Bitcoin](https://nakamotoinstitute.org/static/docs/bitcoin.pdf "Bitcoin: A Peer-to-Peer Electronic Cash System; S. Nakamoto; October 31, 2008") and
[Hashcash](http://www.hashcash.org/hashcash.pdf "Hashcash - A Denial of Service Counter-Measure; A. Back; 2002") implementations.The chain is represented as an ordered back-linked list starting with the genesis block at the root.
Each block is identified by a hash, generated using the SHA256 algorithm on its block header which consists of the following metadata:- its position in the blockchain (height).
- a reference to the hash of the previous (parent) block in the chain.
- a cryptographic hash of the root of the Merkle-Tree.
- the approximate creation time of the block (seconds from Unix Epoch).
- a unique answer to a difficult-to-solve mathematical puzzle (CPU cost function).[](https://travis-ci.com/github/dcarpintero/py-bck)
[](https://codecov.io/gh/dcarpintero/py-bck)
[](https://www.codefactor.io/repository/github/dcarpintero/py-bck)
[](https://github.com/dcarpintero/py-bck/blob/master/LICENSE)