A framework for participation of prosumers in peer-to-peer energy trading and flexibility markets. (15th May 2022)