Skip to content

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

Notifications You must be signed in to change notification settings

1Prototype1/BlockChain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published