Feature and its Use Cases
1. Project Goal
- Build a minimal, fully functional blockchain in Python
Core Features
- Account-Based Ledger
3. State Transition Logic
Block validation:
-
Verify signatures
-
Apply transactions sequentially
-
Check invariants (balance ≥ 0, correct nonce)
-
Deterministic state update
4. Block Structure
-
Minimal block fields:
-
Previous block hash
-
List of transactions
-
Nonce
-
Difficulty
-
Timestamp
-
Block hash
5. Proof of Work (Consensus)
6. Mempool
-
Store pending valid transactions
-
Remove transactions once included in a block
-
Reject invalid or duplicate transactions
7. Peer-to-Peer Networking
Broadcast:
-
Transactions
-
New blocks
-
Sync chain between peers
-
Bonus Feature
8. Smart Contracts (Optional)
Basic Project Structure (Minimal)
minichain/
│
├── blockchain.py # Block & chain logic
├── state.py # Accounts & state transition
├── transaction.py # Transaction structure & signing
├── consensus.py # Proof of Work
├── mempool.py # Pending transactions
├── network.py # P2P logic
└── main.py # Node entry point
Additional Context
hi @Zahnentferner can we start with the above propsed structure and prototype?
Please feel free to assign
Code of Conduct
Feature and its Use Cases
1. Project Goal
Core Features
Use accounts model (not UTXO)
Each account has:
3. State Transition Logic
A simple function:
new_state = apply_tx(state, tx)
Block validation:
Verify signatures
Apply transactions sequentially
Check invariants (balance ≥ 0, correct nonce)
Deterministic state update
4. Block Structure
Minimal block fields:
Previous block hash
List of transactions
Nonce
Difficulty
Timestamp
Block hash
5. Proof of Work (Consensus)
6. Mempool
Store pending valid transactions
Remove transactions once included in a block
Reject invalid or duplicate transactions
7. Peer-to-Peer Networking
Broadcast:
Transactions
New blocks
Sync chain between peers
Bonus Feature
8. Smart Contracts (Optional)
Use Python as contract language
Execute in a controlled/sandboxed environment
Basic Project Structure (Minimal)
Additional Context
hi @Zahnentferner can we start with the above propsed structure and prototype?
Please feel free to assign
Code of Conduct