Skip to content

Liam-Samsit/Blockchain---python-simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Blockchain---python-simulation

A simple single page python code that simulates the creation and validation of blocks in a fake blockchain

Features

  • Genesis block creation
  • SHA-256 hashing
  • mining with adjustable difficulty
  • Block linking using previous block hashes
  • Chain validation that checks integrity and proof of work

Functionality

  • each block contains: data, a timestamp, hash, previous hash, and nonce
  • difficulty determains the number of "0" required at the start of a hash to validate a block
  • nonce loops through different values until valid hash is found
  • validation checks hash against previous hash, and calculated hash, and whether it starts with ("0" * difficullty)
  • output showcases the processess in the blockchain (mining, validation, chain display...)

Requirements

  • Python 3.x
  • A device with an OS (hopefully not windows XP) :p

About

A simple single page python code that simulates the creation and validation of blocks in a fake blockchain

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages