-
Notifications
You must be signed in to change notification settings - Fork 0
Add chain validation and consensus mechanism #2
Copy link
Copy link
Open
Description
Summary
Implement functionality to verify blockchain integrity and allow choosing the longest valid chain in multi-node environments.
Tasks
- Create
IsValid(chain Blockchain) boolto verify:- All blocks are correctly linked (PrevHash == previous.Hash)
- All hashes are valid given the difficulty
- Implement a method to compare two chains and pick the longest valid one
- Optionally log validation errors for debugging
Notes
This will be used during peer-to-peer sync to determine which chain is canonical.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels