Skip to content

A simple implementation of a blockchain in Python, complete with proof of work, transactions, and hashing. It can be used as a starting point for building more complex blockchain applications.

License

Notifications You must be signed in to change notification settings

bit-by-bits/PyBlockChain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

PyBlockChain

This is a simple implementation of a blockchain in Python, called PyBlockChain.. It provides a basic framework for creating a blockchain and adding new transactions to it. The code uses proof-of-work to validate new blocks and ensures that each block is linked to the previous block in the chain.

Features

  • Simple and easy-to-use Python code
  • Proof-of-work validation for new blocks
  • Transactions can be added to the blockchain
  • Each block is linked to the previous block in the chain

Getting Started

To get started with this blockchain, clone this repository to your local machine:

$ git clone https://github.com/your-username/PyBlockChain.git

Prerequisites

This project requires Python 3.6 or higher.

Usage

To start the blockchain, run the pyblockchain.py script:

$ python pyblockchain.py

This will start the blockchain on your local machine.

You can add new transactions to the blockchain using the new_transaction method of the Blockchain class:

blockchain.new_transaction(sender='Alice', recipient='Bob', amount=2)

To mine a new block and add it to the blockchain, you can use the mine method:

blockchain.mine()

Contributing

Contributions to this project are welcome. To contribute, please fork this repository, make your changes, and submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE.md file for details.

Acknowledgments

This project was inspired by Daniel van Flymen's article on building a blockchain from scratch.

About

A simple implementation of a blockchain in Python, complete with proof of work, transactions, and hashing. It can be used as a starting point for building more complex blockchain applications.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages