Optimal scheduling of reconfigurable interconnected microgrids is a precious and critical task for the residential consumers especially with the integration of renewable energy sources, dispatchable units and energy storage systems. In this regard, not only the optimal scheduling of the microgrids in a realistic and correlated environment is a necessity, but also the guarantied security and the prevention of cyber-attacks are mandatory tasks for the operators. This article first addresses these issues by developing a novel framework based on blockchain for secured data transaction from the individual microgrids' components to the central control unit and then tries to find the optimal scheduling plan using stochastic programming based on point estimate method (PEM). Through such a hybrid PEM-blockchain based framework, the interconnected microgrids can supply the residential loads in a fully reliable, economic and secured structure. We also consider a social-economic framework to not only minimize the total operating cost of the microgrids, but also benefit the customers by enhancing the social factors through the optimal switching. Considering the complex and nonlinear nature of the problem, an effective corrected crow search (CCS) algorithm is deployed to find the most optimal operating point for the microgrids. The quality and capabilities of the proposed model are investigated using a practical residential interconnected microgrid. The results show that the optimal switching could reduce the total operation cost from $22,716 to $21,935 (3.56% reduction). Also, the average energy not supplied (AENS) has reduced from 1.4115 to 1.352 kWh/customer.yr (4.40% reduction), which are notable values. The results advocate the quality and functionality of the proposed framework.