A central authority, in a conventional centralized energy trading market, superintends energy and financial transactions. The central authority manages and controls transparent energy trading between producer and consumer, imposes a penalty in case of contract violation, and disburses numerous rewards. However, the management and control through the third party pose a significant threat to the security and privacy of consumers’/producers’ (participants) profiles. The energy transactions between participants involving central authority utilize users’ time, money, and impose a computational burden over the central controlling authority. The Blockchain-based decentralized energy transaction concept, bypassing the central authority, is proposed in Smart Grid (SG) by researchers. Blockchain technology braces the concept of Peer-to-Peer (P2P) energy transactions. This work encompasses the SolarCoin-based digital currency blockchain model for SG incorporating RE. Energy transactions from Prosumer (P) to Prosumer, Energy District to Energy District, and Energy District to SG are thoroughly investigated and analyzed in this work. A robust demand-side optimized model is proposed using Genetic Algorithm (GA) and Particle Swarm Optimization (PSO) to maximize Prosumer Energy Surplus (PES), Grid revenue (GR), percentage energy transactions accomplished, and decreased Prosumer Energy Cost (PEC). Real-time averaged energy data of Australia are employed, and a piece-wise energy price mechanism is implemented in this work. The graphical analysis and tabular statistics manifest the efficacy of the proposed model.