Recent advances in control, communication, and management systems, as well as the widespread use of renewable energy sources in homes, have led to the evolution of traditional power grids into smart grids, where passive consumers have become so-called prosumers that feed energy into the grid. On the other hand, the integration of blockchain into the smart grid has enabled the emergence of decentralized peer-to-peer (P2P) energy trading, where prosumers trade their energy as tokenized assets. Even though this new paradigm benefits both distribution grid operators and end users in many ways. Nevertheless, there is a conflict of interest between the two parties, as on the one hand, prosumers want to maximize their profit, while on the other hand, distribution system operators (DSOs) seek an optimal power flow (OPF) operating point. Due to the complexity of formulating and solving OPF problems in the presence of renewable energy sources, researchers have focused on mathematical modeling and effective solution algorithms for such optimization problems. However, the control of power generation according to a defined OPF solution is still based on centralized control and management units owned by the DSO. In this paper, we propose a novel, fully decentralized architecture for an OPF-based demand response management system that uses smart contracts to force generators to comply without the need for a central authority or hardware.