Skip to main content

Starling bitchain is a Spatial Python Framework

Project description

Bitchain: A Simple Blockchain Emulator in Python

Overview

Bitchain is a simple lockchain emulator written in Python. Aimed at fostering education and understanding of blockchain technologies, Bitchain provides a clear and easy-to-understand interface to interact with a blockchain.

Key Features

  • Block Creation: Easily create new blocks with customizable data.
  • Transaction Handling: Simulate transactions between parties in the blockchain.
  • Chain Validation: Verify the integrity of the blockchain through hash calculations.
  • Persistence: Keep a record of transactions until they are incorporated into a block.

Installation

Requirements

  • Python 3.6 or higher
  • Git (optional)

To install Bitchain, clone the repository using Git:

git clone https://github.com/username/bitchain.git
cd bitchain

You can also download the source code as a zip file and extract it.

Usage

Once you have the Bitchain code on your local machine, you can run it using Python:

python3 main.py

Bitchain includes a main function that creates a simple blockchain, adds transactions to it, and prints out the entire chain.

Example

Here's a quick example of creating a blockchain, adding transactions, and creating new blocks:

blockchain = Bitchain()

blockchain.new_transaction("Satoshi", "Mike", '5 BTC')
blockchain.new_transaction("Mike", "Satoshi", '1 BTC')
blockchain.new_transaction("Satoshi", "Hal Finney", '5 BTC')
blockchain.new_block(12345)

blockchain.new_transaction("Mike", "Alice", '1 BTC')
blockchain.new_transaction("Alice", "Bob", '0.5 BTC')
blockchain.new_transaction("Bob", "Mike", '0.5 BTC')
blockchain.new_block(6789)

print("Genesis block: ", blockchain.chain)

Documentation

Please refer to the docstrings in the Bitchain class for detailed information on the functionality of each method.

Contributing

We welcome all contributions to Bitchain! Whether it's bug fixes, feature additions, or documentation improvements, your input is greatly appreciated. Please check the CONTRIBUTING.md file for detailed instructions on how to contribute.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bitchain-0.0.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bitchain-0.0.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file bitchain-0.0.0.tar.gz.

File metadata

  • Download URL: bitchain-0.0.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for bitchain-0.0.0.tar.gz
Algorithm Hash digest
SHA256 f4387034ba2a3cab9849ce4f923a77ee87f912e5caa68046b5fa0c4810525aae
MD5 59ed8f5751ac641fc44a0a571d8917c9
BLAKE2b-256 567e9a98f4019e54ba63303fc4b9214f5f76a8c7f506d9b82140b91eef61e5b2

See more details on using hashes here.

File details

Details for the file bitchain-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: bitchain-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for bitchain-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9472fe2711e1d29f99f18394f2c22564455fea290fc8a7f83b3e3de7026fef94
MD5 60a5b8ed46866e046b5bdff340dda361
BLAKE2b-256 6bb8ada3619f0f2d63ddb3de02c2ae600ee5238d68a87d4a672a426b66296682

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page