Election Blockchain - my own blockchain network
ASP.NET (.net 6.0), Docker, C#, Entity Framework, Dependency Injection, AutoMapper, MS SQL Server
What is it?
The project Election Blockchain is a part of my graduate work (master degree). The task was to create my own blockchain network and run it. I chose REST architecture and ASP.NET because I wanted to learn it more. I successfully ran my blockchain network on Docker. There were 3 nodes with their own MS SQL databases. Nodes successfully created blockchain with several valid blocks. The project from scratch, I didn't follow any tutorial to create this project. I used the knowledge I gained during my studies and my own research of modern blockchain implementations like Bitcoin or Solana.
The purpose of project
The purpose of the project is to hold presidential elections. Consensus method: Proof Of Authority (PoW too easy :)) There are citizens and nodes with their own key-pairs. Every node has public keys of all citizens and nodes. Citizens can vote for candidates by sending signed votes to leader node.The process of voting:
1. Citizen sends signed vote to leader node.
2. Leader node validates vote and add it to votes queue.
3. If there are enough votes in the queue, the leader initiate block creation: sends votes to other nodes.
3. Other nodes validate votes and if the votes are valid they send to leader their votes signature as confirmation.
4. If the leader get all signatures and successfully valid them, he creates block, add it to his local blockchain and sends all signatures to other nodes.
5. Other nodes validate signatures and if they are valid, they add block to their local blockchains.
Final result: all nodes have the same blockchain with the same blocks and votes. Nodes can't change the rules of network - they can't add block to blockchain if one or more nodes have malicious code. Every citizen can check every vote in the blockchain: the vote citizen signature, the nodes signatures of vote block, the block sequence. The application uses MS SQL Server database. The database is created with Entity Framework Code First approach. The application uses Dependency Injection to inject services.
There are several screenshots of code below.
Docker containers, 3 nodes and their databases:

Project structure:






There is a Setup.txt file with setup instructions in repository. You can download and see the code.