User Central Server Miners (M1, M2, ...)
| | |
|------ Add Transaction -------------| |
| | |
| | |
| 1. Broadcast Transaction -------------------|
| |--------- Receive Transaction --------|
| | |
| | |
| 2. Add transaction to txn pool |
| | |
| |--------- Broadcast new txns -------->|
| | |
| 3. Wait for block mining 3. Start mining
| | |---|
| | | |--> Do proof of work
| | |---|
| | |
| | |---|
| | | |--> Successfully mine a block
| | |---|
| | |
| | <----- Broadcast new block --------- |
| 4. Verify Block 4. Verify Block
| 5. Add Block to chain 5. Add Block to chain
| 6. Adjust difficulty 6. Adjust difficulty
| | |
| | |
| | ----- Broadcast new block ---------> |
| | to |
| | other miners |
| | |
| | |
|------- Notify users of success ----| |
-
Broadcast Transaction: When a user adds a new transaction, the central server broadcasts it to all connected miners.
-
Manage Transaction Pool: The server adds the transaction to its own transaction pool and removes transactions that are already included in a mined block.
-
Broadcast New Transactions: The server keeps miners updated by broadcasting new transactions regularly.
-
Verify and Add Block: Once a block is mined by any miner, the central server verifies it and broadcasts the new block to the rest of the miners.
-
Adjust Difficulty: After receiving each new block, the server adjusts the difficulty level to maintain a steady block time.
-
Receive Transactions: Each miner receives new transactions from the central server and maintains its own transaction pool.
-
Mine Blocks: Miners mine blocks at a fixed interval by performing Proof of Work (PoW). This involves finding a valid hash based on the difficulty level.
-
Broadcast Mined Block: After successfully mining a block, the miner broadcasts it to the central server, which further distributes it to all other miners.
-
Verify Block: Each miner verifies the received block and checks if the chain is valid. Smaller or erroneous chains are rejected.
-
Update Blockchain: The miner updates its local copy of the blockchain and adjusts the mining difficulty based on the central server’s broadcast.