A blockchain-based scalability solution for peer-to-peer (P2P) energy trading is proposed to address the trilemma of scalability, security, and decentralization in energy markets. This solution leverages blockchain technology to enable secure, transparent, and efficient P2P energy transactions, allowing prosumers (individuals who both produce and consume energy) to trade surplus energy directly with consumers. The study presents an empirical model based on a trial case study, demonstrating that the proposed blockchain-based approach outperforms traditional models in terms of scalability while maintaining the essential elements of security and decentralization. The solution provides a more secure and decentralized platform for P2P energy trading, which can help address issues of energy distribution inequality and promote the adoption of renewable energy. By utilizing blockchain technology, individuals and communities can take control of their energy usage and production, reducing reliance on traditional centralized energy systems. This not only has the potential to lower energy costs for consumers but also contributes to the overall goal of reducing carbon emissions and mitigating the effects of climate change. The combination of rooftop solar panel technology and blockchain applications has the potential to create a significant shift toward decentralized and sustainable energy systems. This will not only benefit individuals and communities but also have a positive impact on the environment and the global energy market. However, for this transition to occur, it is crucial that governments and energy companies continue to support and invest in these advancements. The study also explores the challenges and limitations of blockchain technology in P2P energy trading, including scalability, security, and decentralization. It highlights the need for further research and development to address these challenges and improve the efficiency and effectiveness of blockchain-based energy trading. The proposed solution includes a second-layer blockchain that allows for faster and more efficient processing of transactions, reducing costs and improving scalability. The study also presents a case study of a P2P energy trade in the Education City Community Housing (ECCH) compound, demonstrating the potential of blockchain-based energy trading to reduce transaction costs and improve the efficiency of energy markets. The results show that the proposed solution can significantly reduce transaction costs and improve the scalability of energy trading. The study concludes that blockchain technology has the potential to revolutionize the energy market by enabling secure, transparent, and efficient P2P energy trading. However, the successful implementation of blockchain-based energy trading requires collaboration between stakeholders, including energy companies, regulators, and technology providers, to address regulatory, legal, and economic challenges. The study also highlights the importance of developing regulatory frameworks and standards for blockchain-based energy trading to ensure the security and transparency of energy markets. Overall, the proposed blockchain-based scalability solution for P2P energy trading has the potential to transform the energy market by enabling more efficient, secure, and decentralized energy trading.A blockchain-based scalability solution for peer-to-peer (P2P) energy trading is proposed to address the trilemma of scalability, security, and decentralization in energy markets. This solution leverages blockchain technology to enable secure, transparent, and efficient P2P energy transactions, allowing prosumers (individuals who both produce and consume energy) to trade surplus energy directly with consumers. The study presents an empirical model based on a trial case study, demonstrating that the proposed blockchain-based approach outperforms traditional models in terms of scalability while maintaining the essential elements of security and decentralization. The solution provides a more secure and decentralized platform for P2P energy trading, which can help address issues of energy distribution inequality and promote the adoption of renewable energy. By utilizing blockchain technology, individuals and communities can take control of their energy usage and production, reducing reliance on traditional centralized energy systems. This not only has the potential to lower energy costs for consumers but also contributes to the overall goal of reducing carbon emissions and mitigating the effects of climate change. The combination of rooftop solar panel technology and blockchain applications has the potential to create a significant shift toward decentralized and sustainable energy systems. This will not only benefit individuals and communities but also have a positive impact on the environment and the global energy market. However, for this transition to occur, it is crucial that governments and energy companies continue to support and invest in these advancements. The study also explores the challenges and limitations of blockchain technology in P2P energy trading, including scalability, security, and decentralization. It highlights the need for further research and development to address these challenges and improve the efficiency and effectiveness of blockchain-based energy trading. The proposed solution includes a second-layer blockchain that allows for faster and more efficient processing of transactions, reducing costs and improving scalability. The study also presents a case study of a P2P energy trade in the Education City Community Housing (ECCH) compound, demonstrating the potential of blockchain-based energy trading to reduce transaction costs and improve the efficiency of energy markets. The results show that the proposed solution can significantly reduce transaction costs and improve the scalability of energy trading. The study concludes that blockchain technology has the potential to revolutionize the energy market by enabling secure, transparent, and efficient P2P energy trading. However, the successful implementation of blockchain-based energy trading requires collaboration between stakeholders, including energy companies, regulators, and technology providers, to address regulatory, legal, and economic challenges. The study also highlights the importance of developing regulatory frameworks and standards for blockchain-based energy trading to ensure the security and transparency of energy markets. Overall, the proposed blockchain-based scalability solution for P2P energy trading has the potential to transform the energy market by enabling more efficient, secure, and decentralized energy trading.