Hydrophobic nature of hole transporting layers commonly employed in inverted perovskite solar cells (iPSCs), such as PTAA, hampers the fabrication of compact and high quality perovskite films above. Moreover, the defects at perovskite interface and grain boundaries directly deteriorate the power conversion efficiency (PCE) and stability of solar cells. Hence, the realization of high quality perovskites with reduced defects on hydrophobic substrate is critical but still challenging to further enhance the performance of iPSCs. It has been succeeded in this work through rational approach of interface engineering. Metformin, a preferred medicine for diabetes mellitus, is introduced as a bifunctional interfacial layer on PTAA surface. It is revealed that metformin can substantially improve the wettability of PTAA, and facilitate the fabrication of compact perovskite films. In addition, as a biguanidine molecule, it can effectively passivate the defects at the interface. Consequently, iPSCs with a dramatic PCE enhancement from 16.54% to 19.73% have been succeeded. Moreover, metformin can promote the device stability by maintaining the 90% of the initial PCE after a 600 h storage. • Metformin can substantially improve the wettability of PTAA, and facilitate the fabrication of compact perovskite films. • Metformin can effectively passivate the defects at the interface. • Metformin can enhance the PCE of iPSCs from 16.54% to 19.73%. • Metformin can promote the device stability by maintaining the 90% of the initial PCE after a 600 h storage.