## 1 Introduction  
Urbanization is increasing rapidly worldwide: in 2018, 55% of the world's population lived in urban areas, and it is predicted that this proportion will reach 68% by 2050 [1]. Two issues are directly related: the ever-increasing environmental impact of industrialization with the resulting use of fossil fuels and the global scarcity of resources. With the growing world population, the demand for resources is expected to increase rapidly, indicating an increasing consumption of natural resources. The total global material consumption is forecasted to reach around 90 billion tons by 2050 [2, 3]. As planet Earth's resources are limited, exponential economic and population growth demands cannot be met [4, 5]. Rapid urbanization and the depletion of resources have led to the traditional linear system of take-produce-use-dispose evolving into a circular system of resource conservation and reuse. The circular economy is a sustainable development approach based on a waste management strategy of reducing, recycling and recovering waste [6, 7, 8, 9, 10]. It could increasingly solve several problems, such as resource scarcity and waste generation, generating sustainable economic benefits towards a resource-efficient and environmentally friendly society [11, 12]. In this way, significant benefits can be achieved as waste-derived energy and fuels can replace fossil resources, limiting carbon dioxide (CO\({}_{2}\)) emissions and providing economic, social and environmental benefits. Considerable efforts have been made worldwide in various sectors, such as waste management, food production, the electronics industry, the construction sector, the automotive sector, etc., to achieve the objectives of the circular economy. Utilizing municipal wastewater's chemical and energetic potential is a topic of great interest. In industrialized countries, wastewater treatment plants (WWTPs) account for more than 1% of municipal electricity consumption [13; 14]. However, the energy content of incoming municipal wastewater is usually more than ten times higher than the energy required to operate the treatment plants [15; 16; 17]. This energetic evaluation clearly shows that raw wastewater should be regarded as a valuable resource and not as waste to be disposed of. Potentially, WWTPs could not only be energy self-sufficient but also act as net energy suppliers. Half of this energy is due to suspended biodegradable solids [18; 19], which can be easily recovered through inexpensive and simple physical separation. In this scenario, the recovery of valuable streams from raw wastewater can be achieved by utilizing the potential of the sludge in which most of the suspended solids have been concentrated. The management of sewage sludge according to the circular economy concept would be beneficial from several points of view. Firstly, sustainable energy or valuable products could be generated to replace an equivalent amount of materials/energy that would otherwise have to be produced from non-renewable resources with significant environmental impacts [20; 21; 22; 23]. It could also reduce the overall cost of sludge treatment, which accounts for about 50% of the total operating cost of wastewater treatment plants (WWTPs) [24; 25]. Finally, the environmental impact could also be reduced, as sludge disposal is responsible for 40% of total greenhouse gas emissions from WWTPs [26; 27; 28]. Different types of sludge are produced in a municipal WWTP, depending on the treatment stage. Primary sludge, which contains 2-9% by weight (%wt) of solids [29; 30], is produced during primary treatment (precipitation and sedimentation) to remove heavy solids and fats from raw wastewater [31; 32; 33]. It has a higher content of total and volatile solids than secondary biological sludge and is theoretically suitable for energy and materials recovery [34]. Sewage scum is a special waste produced in wastewater treatment plants.