In this paper, we propose a blockchain-based platform for decentralized energy marketplaces where prosumers and grid operators can directly exchange flexibility. The proposed platform facilitates the exchange of excess electricity for compensation while ensuring privacy for prosumers and verifiability for grid operators. Specifically, we use digital machine identities (dMIDs) to enable prosumers to verifiably communicate the provision details, ensuring that grid operators can trust the provided flexibility. We use zero-knowledge proofs (ZKP) to verify sensitive data from dMIDs to ensure the privacy of prosumers. Flexibility is represented as a digital certificate written as a smart contract that facilitates the communication and exchange of information about flexibility. This implementation seeks to uncover potential cost savings, create new value streams, and enhance operational efficiency in the renewable energy sector. © The Author(s), under exclusive license to Springer Nature Switzerland AG 2024.