Skip to content

Latest commit

 

History

History
23 lines (21 loc) · 1 KB

README.md

File metadata and controls

23 lines (21 loc) · 1 KB

BlockChain

A simple BlockChain implelemtation using Python. It also has PoW(Proof of Work) concept which is how mining works.

Block class:

timestamp - Block creation time
transactions - Data
previous_hash - SHA-256 hash of previous block
nonce - Initial number used for PoW
hash - SHA-256 hash of current block
generate_hash() - Generates SHA-256 hash of current block
print_contents() - Prints the content of current block

Blockchain class:

chain - Block chain (list)
all_transactions - All performed transactions
genesis_block - First block of blockchain
genesis_block() - Creates first block(init)
print_blocks() - Prints all blocks in the blockchain
add_block() - Adds new block to block chain
validate_chain() - Validates the blockchain
proof_of_work() - PoW function to solve the required hash

Example on how to use: Example.ipynb