This paper introduces an innovative approach to designing a user-based Heating, Ventilation, and Air-Conditioning (HVAC) system management connected with the District Energy Management System. By classifying the users into dynamic energy consumption classes to reward energy efficiency and penalize excessive use, users can modify their behavior to pass to a less expensive and more virtuous consumption class. To this aim, a blockchain platform determines the rewards and penalties and, by a K-means clustering algorithm, categorizes users into respective groups. Then, a Class Follower Problem is formulated and solved by a Model Predictive Control (MPC) strategy integrated with a Long Short-Term Memory network as a predictive model. If the users follow the suggestions proposed by the controller, i.e., the thermostat set-points and the time intervals in which the HVAC system must be switched off or on, the users can be located in a more virtuous consumption class. A case study conducted within an energy district in Bari (Italy) shows how the proposed architectural framework tuned thermal regulation in intelligent buildings while concurrently achieving energy optimization.Note to Practitioners-This paper addresses the challenge of efficiently managing HVAC systems in smart districts through a novel blockchain-based framework and an optimization strategy solved by an MPC approach. The objective is to incentivize users to optimize their energy consumption by introducing dynamic Consumption Classes that reward energy efficiency and penalize inefficient utilization. For practitioners, this strategy translates to a granular level of energy management that not only adapts to individual behaviors but also aligns with broader sustainability goals. Integrating the blockchain platform ensures a transparent and secure method for managing and recording energy usage. At the same time, adopting MPC with Long Short-Term Memory Networks offers accurate forecasts and adjustments to enhance system responsiveness. Although the study focuses on HVAC systems, the principles may be extended to other energy-intensive applications, providing a comprehensive tool for energy management and user engagement in smart cities. Future research could integrate renewable energy sources and explore the implications of user-driven adjustments on the overall energy distribution and efficiency.