Building Trust in IoT Systems: Decentralised Consensus, Network Optimisation, and Hardware-Based Authentication