Welcome to BitCoin Networks, a project that implements a blockchain-based transactional system, enabling two full nodes (F1 and F2) and two clients (A and B) to transfer funds seamlessly while ensuring all transactions remain valid and secure.
- Initial Balances:
- Each client (A and B) starts with 1000 BC (BitCoin).
- Each full node (F1 and F2) starts with 0 BC.
- Transaction Process:
- Clients can record transactions and send them to their respective full node.
- Block Mining:
- Full nodes mine blocks once they accumulate 4 transactions.
- F1 mines odd-numbered blocks; F2 mines even-numbered blocks.
- Blockchain Update:
- After mining, the mined block is stored and shared between the full nodes.
- Transactions are confirmed and sent to clients.
- Balance Update:
- Clients append confirmed transactions and update their balances accordingly.
- Python 3.7+
- Clone the repository:
git clone https://github.com/nihalnihalani/BitCoin_Networks
- Install the requirements:
pip install -r requirements.txt
-
Start Full Node F1:
python full_node_f1.py
-
Start Full Node F2:
python full_node_f2.py
-
Start Client A:
python client_a.py
-
Start Client B:
python client_b.py
Pull requests are welcome! For major changes, please open an issue first to discuss the changes you'd like to make.
Make sure to update tests where necessary.
This project is licensed under the MIT License.