bitchain

Simple Blockchain emulator in Python for educational purposes.

https://github.com/block-foundation/bitchain

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.9%) to scientific vocabulary

Keywords

bitchain bitcoin block-foundation blockchain blockfoundation python
Last synced: 6 months ago · JSON representation ·

Repository

Simple Blockchain emulator in Python for educational purposes.

Basic Info
Statistics
  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
bitchain bitcoin block-foundation blockchain blockfoundation python
Created over 2 years ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog Contributing Funding License Code of conduct Citation Codeowners Security Support

README.md

[![GitHub License](https://img.shields.io/github/license/block-foundation/blocktxt?style=flat-square&logo=readthedocs&logoColor=FFFFFF&label=&labelColor=%23041B26&color=%23041B26&link=LICENSE)](https://github.com/block-foundation/bitchain/blob/main/LICENSE) [![devContainer](https://img.shields.io/badge/Container-Remote?style=flat-square&logo=visualstudiocode&logoColor=%23FFFFFF&label=Remote&labelColor=%23041B26&color=%23041B26)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/block-foundation/bitchain)

Block Foundation Logo

Bitchain

A Simple Blockchain Emulator in Python


Block Foundation Brand

Contents



[![Report a Bug](https://img.shields.io/badge/Report%20a%20Bug-GitHub?style=flat-square&&logoColor=%23FFFFFF&color=%23E1E4E5)](https://github.com/block-foundation/bitchain/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&projects=&template=bug_report.yml) [![Request a Feature](https://img.shields.io/badge/Request%20a%20Feature-GitHub?style=flat-square&&logoColor=%23FFFFFF&color=%23E1E4E5)](https://github.com/block-foundation/bitchain/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&projects=&template=feature_request.yml) [![Ask a Question](https://img.shields.io/badge/Ask%20a%20Question-GitHub?style=flat-square&&logoColor=%23FFFFFF&color=%23E1E4E5)](https://github.com/block-foundation/bitchain/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&projects=&template=question.yml) [![Make a Suggestion](https://img.shields.io/badge/Make%20a%20Suggestion-GitHub?style=flat-square&&logoColor=%23FFFFFF&color=%23E1E4E5)](https://github.com/block-foundation/bitchain/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&projects=&template=suggestion.yml) [![Start a Discussion](https://img.shields.io/badge/Start%20a%20Discussion-GitHub?style=flat-square&&logoColor=%23FFFFFF&color=%23E1E4E5)](https://github.com/block-foundation/bitchain/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&projects=&template=discussion.yml)

Introduction

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:

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

or:

sh pip install bitchain

see: https://pypi.org/project/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:

sh 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:

``` python blockchain = Bitchain()

blockchain.newtransaction("Satoshi", "Mike", '5 BTC') blockchain.newtransaction("Mike", "Satoshi", '1 BTC') blockchain.newtransaction("Satoshi", "Hal Finney", '5 BTC') blockchain.newblock(12345)

blockchain.newtransaction("Mike", "Alice", '1 BTC') blockchain.newtransaction("Alice", "Bob", '0.5 BTC') blockchain.newtransaction("Bob", "Mike", '0.5 BTC') blockchain.newblock(6789)

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

Building

py python3 -m pip install --upgrade build python3 -m build

Documentation

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


Colophon

Authors

This is an open-source project by the Block Foundation.

The Block Foundation mission is enabling architects to take back initiative and contribute in solving the mismatch in housing through blockchain technology. Therefore the Block Foundation seeks to unschackle the traditional constraints and construct middle ground between rent and the rigidity of traditional mortgages.

website: www.blockfoundation.io

Development Resources

Contributing

We'd love for you to contribute and to make this project even better than it is today! Please refer to the contribution guidelines for information.

Legal Information

Copyright

Copyright © 2023 Stichting Block Foundation. All Rights Reserved.

License

Except as otherwise noted, the content in this repository is licensed under the Creative Commons Attribution 4.0 International (CC BY 4.0) License, and code samples are licensed under the Apache 2.0 License.

Also see LICENSE and LICENSE-CODE.

Disclaimer

THIS SOFTWARE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.

Owner

  • Name: Block Foundation
  • Login: block-foundation
  • Kind: organization
  • Email: info@blockfoundation.io
  • Location: Netherlands

The Block Foundation mission is enabling architects to take back initiative and contribute in solving the mismatch in housing through blockchain technology.

Citation (CITATION.cff)

cff-version: 1.2.0
title: "Bitchain: A Simple Blockchain Emulator in Python"
abstract: "This is a simple, yet powerful blockchain emulator written in Python for educational purposes."
version: 0.0.1
date-released: 2023-08-02
url: "https://github.com/block-foundation/bitchain"
repository-code: "https://github.com/block-foundation/bitchain"
repository-artifact: "https://github.com/block-foundation/bitchain/releases"
license: "Apache-2.0"
message: >-
  If you use bitchain, please cite it using
  the metadata from this file.
type: software
authors:
  - given-names: Lars Bastiaan
    family-names: van Vianen
    email: lars@blockfoundation.io
    affiliation: Block Foundation
    orcid: "https://orcid.org/0000-0002-8790-8630"
keywords: 
  - Python
  - Blockchain
  - Emulator
  - Education

GitHub Events

Total
  • Watch event: 1
Last Year
  • Watch event: 1

Dependencies

.github/workflows/deploy_docs.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/python-app.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
.github/workflows/python_package.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
.github/workflows/python_publish.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
  • pypa/gh-action-pypi-publish 27b31702a0e7fc50959f5ad993c78deac1bdfc29 composite
.devcontainer/Dockerfile docker
  • ubuntu 22.04 build
.devcontainer/docker-compose.yml docker
pyproject.toml pypi
requirements.txt pypi