Introduction

Flexibility is one of the key characteristics in organic solar cells (OSCs), enabling them to be potentially applied into special fields, such as the internet of things, indoor photovoltaics, greenhouse, building integration, etc1,2,3,4,5,6,7. Nowadays, many studies focus on the bulk-heterojunction photoactive layers, in particular, with wide bandgap donor polymers and near-infrared electron acceptors, so that the power conversion efficiencies (PCEs) of OSCs on the rigid glass/ITO (indium tin oxide) have reached over 18%8,9,10,11,12,13,14. When these high-performance photoactive layers were applied into flexible OSCs (FOSCs), the PCEs could also be realized over 15%14,15,16,17,18,19,20,21,22,23. In FOSCs, researchers have mainly been involved in optimizing flexible electrodes by using silver nanowires (AgNWs) or highly-conductive PEDOT:PSS to replace the brittle ITO in order to improve the optical, mechanical and electrical properties, while there have been very few studies about flexible substrates, such as innovation of chemical structures/materials, and recyclability as well, for most of the flexible substrates can only be discarded at the end-of-life usage, leading to severe waste of resources and environmental problems.

Polymers are the optimal candidate as flexible substrates for FOSCs, such as transparent polyethylene terephthalate (PET) and polyimides (PIs). Although PET has been widely used in FOSCs on the laboratory scale, its poor tolerant at high temperatures due to the low glass transition temperature (Tg) and the high coefficient of thermal expansion (CTE) limits the application. The drawbacks of PET can be perfectly overcome by PIs with the merit of high Tg, low CTE and high light/thermal stability. Someya et al. demonstrated that the PI substrate could filter ultraviolet light and hence improve the stability of photoactive layers24. In this work, they used the precursor poly (amic acid) (PAA) solution to form thin films, following by a thermal imidization reaction at 270 °C to generate PI and then sputtering ITO as the electrode. Then, Zhou et al. developed semi-embedded AgNWs@PI electrodes by using a solution-processed PI (with unknown chemical structure) as substrate and AgNWs as conducting layers, in which the semi-embedded structure can effectively lower the surface roughness of AgNWs so as to prevent the leakage of photocurrent in solar cells25.

These two pioneered works inspire us to use semi-embedded AgNWs@PI to construct FOSCs. PIs can be obtained via thermal or chemical imidization. However, the high temperature of thermal imidization (usually above 300°C) will destroy the AgNWs electrodes. Therefore, in thermally imidized semi-embedded AgNWs@PI, special strategies via applying protective layers on AgNWs networks26 or incomplete imidization at relatively low temperature20 must be utilized. Thus, chemical imidization is the optimal choice for semi-embedding AgNWs due to the low processing temperature to protect AgNWs. In another aspect, non-conjugated units are usually introduced into PIs in order to prevent the intra- and intermolecular charge transfer complexes and hence obtain high transparency27,28,29. The non-conjugated designs make the PIs show good solubility in polar solvents, indicating that the PI substrate may be destroyed in the solution-processed layer-by-layer fabrication process. Therefore, the contradiction between transparency, solution-process and solvent-tolerance is the key issue that should be addressed to obtain embedded AgNWs@PI electrodes, and it is of great urgency to provide strategies on modifying the chemical structures of PIs.

To address the above issues, constructing the crosslinked PIs could be an effective strategy. Researchers have reported various methods to fabricate crosslinked PIs, such as introducing heat or UV light crosslinkable reactive groups and compounds or nanoparticles with multiple amino groups30,31,32,33,34,35,36. However, in most of the reported crosslinked PIs, yellowing is still serious and can not be used as optoelectronic device substrates with high transparency requirement. Besides, the reported crosslinked PIs is not compatible with the semi-embedding AgNWs strategy for the elevated temperature or UV light crosslinking of PIs will destroy the AgNWs electrodes. What’s more, the intrinsic insolubility and infusibility properties of permanently crosslinked PIs makes them unrecyclable. In this context, it is of great significance to fabricated crosslinked PIs that can both compatible with the semi-embedding AgNWs strategy and can be recycled by a simple and green method.

In this work, we constructed a robust recyclable crosslinked PI (RCPI) for application in high-performance FOSCs. The idea was initiated from the observation of ligand exchange of the cyclic Ti-oxo cluster (CTOC), in which the surface of CTOC has abundant -COOH labile ligands. These carboxyl ligands can be easily exchanged by other carboxylic compounds without adding extra reagents, which has also been used to design organic-inorganic hybrid electrolytes as cathode interlayers in OSCs37,38. With this strategy, we synthesized a linear and colorless PI (PI-COOH) with pendent carboxylic groups. The mixed solution of PI-COOH and CTOC in N, N-dimethylacetamide (DMAc) was found to form a gel within 20 min at 60 °C due to the crosslinking interactions. And surprisingly, the gel could be transformed back to the reprocessable PI-COOH and CTOC mixture solution if adding enough pivalic acid, showing a fully closed-loop recyclability. The crosslinked PI shows enhanced solvent resistance, mechanical properties and thermal dimensional stability compared with the PI-COOH. Moreover, the facial processing condition of the crosslinked PI make it possible to fabricate the embedded AgNWs@RCPI electrodes for FOSCs. The results demonstrated that AgNWs@RCPI electrodes with high mechanical robustness and low roughness could be obtained, providing a high PCE of 14.78% in FOSCs.

Results and discussion

Fabrication and characterization of the recyclable crosslinked PIs

The design mechanism of the recyclable crosslinked PIs (denoted as RCPIs) is schematically illustrated in Fig. 1a. Briefly, the carboxylic ligands at the periphery of CTOC (synthesis details of CTOC can be found in the “Methods”) can be exchanged with other carboxylic compounds, so that the intentionally designed PIs with pendent carboxyl groups (denoted as PI-COOH, Fig. 1b) could be crosslinked by CTOC. With adding of enough pivalic acid, the coordination crosslinking points can be gradually degraded via the carboxyl ligand exchange reactions, resulting in a reprocessable uniform mixture solution. PI-COOH was synthesized through a two-step process involving step growth polymerization and chemical imidization via using 2,2′ bis(trifluoromethyl)-4,4′-diaminobiphenyl (TFMB) and 3,5-Diaminobenzoic acid (DABA) as diamine monomers (the molar ratio of TFMB/DABA is 2 to guarantee enough pendent -COOH groups), 4,4′-(hexafluoroisopropene) diphthalic anhydride (6FDA) as dianhydride monomer and Ac2O/pyridine as dehydrating agents (Supplementary Scheme 1, preparation details of PI-COOH can be found in the “Methods”). The Fourier transform infrared spectra (FTIR) of PI-COOH (Supplementary Fig. 1) clearly show that the broad peak corresponding to -OH and -NH stretching at around 3300 cm−1 has completely vanished and characteristic peaks at 1787 cm−1 (asymmetric C = O stretching), 1724 cm−1 (symmetric C = O stretching) and 1364 cm−1 (C-N stretching) appeared after chemical imidization, confirming the complete conversion of PAA to PI. The solution 1H nuclear magnetic resonance (1H NMR) spectrum of PI-COOH (Supplementary Fig. 2) clearly shows the specific signals of different polymer segments and the molar ratio of TFMB/DABA is about 2, which further justifies the successful preparation of the desired -COOH group containing PI-COOH. PI-COOH can be dissolved in DMAc and has a number-average molecular weight (Mn) of 94.0 kg mol−1 as determined by gel-permeation chromatography (Supplementary Fig. 3). Then the RCPIs were prepared via mixing the solutions of PI-COOH in DMAc and CTOC in chloroform to obtain PI-COOH/CTOC solution, which was heated at 60 °C for 10 min to obtain a pre-crosslinked PI solution and then coated onto a clean glass substrate to form the RCPI thin films (here the ratio of the exchangeable carboxyl groups between CTOC and PI-COOH was 1:1). It should be noted that the heating time must be controlled, otherwise the mixture solution would gelate and be difficult to be processed into thin films, though which could also convert to solution with the adding of pivalic acid (Fig. 1c). As shown in Supplementary Fig. 4, after incorporating CTOC into PI-COOH, the sharp peak at 1538 cm−1 attributed to pivalic acid/titanium ion coordination is blue-shifted to ~1529 cm−1, which is due to the newly formed coordination between titanium ion of CTOC and -COOH groups of PI-COOH. This can confirm the formation of the ligand exchange reactions between PI-COOH and CTOC. The diffraction of x-rays (XRD) test were conducted on the PI-COOH and RCPI films to further clarify the crosslinking mechanism. As shown in Fig. S5, the broad reflection patterns of the PI-COOH and RCPI demonstrate that these films are essentially amorphous. The d-spacing values corresponding to the interchain packing could be calculated from the diffraction peaks (2θ) located at about 24.5° and 22.5° to be 3.62 and 3.93 Å for the PI-COOH and RCPI films, respectively. The slightly increased interchain packing distance after crosslinked may be arose from the large volume of CTOC which occupied the space between the polymer chains and the rearrangement the polymer chains via the crosslinking reactions.

Fig. 1: Fabrication and characterization of PI-COOH and RCPIs.
figure 1

a Schematic illustration of the principle of ligand exchange and recycling based on inorganic CTOC and organic carboxylic acid, where the “rising arrow” represents both the volatilization and removal of pivalic acid. b The chemical structure of the linear PI-COOH containing -COOH group. c Illustration of the crosslinking between CTOC and PI-COOH with the removal of pivalic acid and the recycling process by adding pivalic acid. The photographs present the reversible conversion between solution and gel.

Performance of the RCPIs

Since CTOC contains sixteen -COOH ligands, the molar ratios of the exchangeable carboxyl groups between CTOC and PI-COOH were systematically optimized from 1:4, 1:3, 1:2 and 1:1. It was found that, with the increasing content of CTOC, the solvent resistance, mechanical properties (including Young’s modulus and tensile strength) and thermal stability (Tg and CTE), were simultaneously improved, and the transmittance slightly decreased slightly (the details for the effect of CTOC content on the film performance can be found in the Supplementary Note 1 and Supplementary Fig. 6). Considering the comprehensive performance, we used RCPI with 1:1 carboxyl ratio for the following studies.

The RCPI thin films were characterized by several techniques, as shown in Fig. 2. Figure 2a shows the photograph of a square RCPI-4 film, which reveals that the hybrid substrate is almost colorless and highly transparent. UV-vis transmittance tests of the PI-COOH and RCPI thin films (with the thickness of about 20 μm) show that, the transmittance of the RCPI film decreases slightly, but still exhibits a high transmittance at 550 nm (T550) of about 88.5%, revealing that CTOC has little influence on the optical transmittance (Fig. 2b). The solvent resistance and swelling performance of the as-prepared PI-COOH and RCPI films are evaluated by immersing samples in various commonly used solvents for FOSCs at room temperature for 24 hours. As shown in Fig. 2c, the PI-COOH sample was readily dissolved in solvents with high polarity such as DMAc and 2-methoxyethanol (2-ME). After crosslinked by CTOC, RCPI thin films only swell but do not dissolve in DMAc and 2-ME, among which 2-ME is a widely-used solvent for the ZnO electron transporting layer in the inverted OSCs. The thermal stability and mechanical properties of PI-COOH and RCPI films are summarized in Fig. 2d. With the introduction of CTOC, the Tg value raised from 343 °C for PI-COOH to 379 °C for RCPI, and the CTE value decreased from 32.6 ppm K−1 for PI-COOH to 25.9 ppm K−1 for RCPI, revealing the enhanced thermal stability. The Young’s modulus and tensile strength increased by 31% and 21%, respectively, indicating that crosslinking PI-COOH by the inorganic CTOC can effectively enhance its mechanical properties.

Fig. 2: Performance of the RCPI films.
figure 2

a A photograph of an RCPI film (10 cm × 10 cm × 20 μm) on the top of a tree branch for demonstrating the high optical transmittance of the RCPI. b Optical transmittance of the PI-COOH and RCPI films (with a thickness of about 20 μm). c Residue weight of the dried PI-COOH and RCPI films after soaking in different solvents for 24 h. d The histogram containing values of Tg, CTE, Young’s modulus and tensile strength for the PI-COOH and RCPI films.

The recycling performance of the RCPI

The recyclability of the RCPI was evaluated by the swelling behaviors, optical transmittance and mechanical properties of the original and recycled RCPI films. The recycling of the RCPI was realized by degrading the crosslinking structure in the DMAc/pivalic acid mixture via ligand exchange (Supplementary Note 2), and then the recycled solution was used to fabricate the recycled films. The reason for selection pivalic acid in recycling is that, since pivalic acid was used in the synthesis of CTOC, the use of pivalic acid could maintain the structure stability of CTOC in the recycling process. Besides, thanks to the relatively low boiling point of pivalic acid (~164 °C), it can be removed in the subsequent annealing process and thus the crosslinked structure could be restored. This procedure was repeated for two times to verify the feasibility of this recycling strategy (Fig. 3a). As shown in Fig. 3b, both the 1st recycled and 2nd recycled films show a similar residue weight with the original films (both immersed in DMAc and CF), revealing that no evident degradation of the crosslinking structure occurred during the recycling procedure. The recycled films show almost the same T550 values as the original film (Supplementary Fig. 7). Moreover, the recycled films retain high mechanical properties with the modulus and strength recycling efficiency of about 90.2% and 89.6%, respectively (Fig. 3c). All these results demonstrate that the RCPI here possesses fully close-hoop recyclability, which is of great significance for a sustainable society.

Fig. 3: The recycling performance of the RCPIs.
figure 3

a The actual closed-loop recycling process of the RCPI. b Residue weight of the dried original and recycled films after soaking in DMAc and CF for 24 h. c The Young’s modulus and tensile strength of the original and recycled RCPIs.

Fabrication and characterization of the AgNWs@RCPI electrode

The solvent resistance and overall properties enable us to fabricate the semi-embedded AgNWs@RCPI electrodes for FOSCs. The detailed procedures were present in the Supporting Information and simply shown in Fig. 4a. AgNWs solution was spin-coated onto the glass substrate, and then the pre-crosslinked RCPI was drop-cast onto the AgNWs film. After thermal annealing, the AgNWs@RCPI electrode was peeled off from the glass substrate with the square resistance of 12.6 ± 2.2 Ω sq−1, which is comparable to the ITO/glass electrode. Figure 4b exhibits the transmittance of the AgNWs@RCPI electrode, which shows a slightly lower T550 of 83.6% compared to the bare RCPI substrate and ITO/glass electrode. The figure of merit (FoM, the ratio of direct current conductivity to optical conductivity), an essential parameter for evaluating the photoelectric properties of flexible transparent electrodes, of the AgNWs@RCPI electrode is calculated to be 16439, which can qualify the FoM requirement of FOSCs40. The roughness of the AgNWs@RCPI electrode measured by atomic force microscopy (AFM) is 0.96 nm (Fig. 4c), which is significantly lower than that of the AgNWs on top of PET (Supplementary Fig. 8). Since AgNWs were embedded into the RCPI films, they showed high thermal stability even when the AgNWs@RCPI film was annealed at 280 °C, as confirmed by the change of square resistance with annealing temperature (Fig. 4d). For comparison, the square resistance of the AgNWs/glass electrode increased by 85% at 180 °C (it should be noted that the square resistance decrease at 150 °C is ascribed to the thermal annealing welding of the AgNWs junctions41).

Fig. 4: Fabrication and performance of the AgNWs@RCPI electrode.
figure 4

a Schematic of the preparation of AgNWs@RCPI electrode. b Optical transmittance of RCPI film, ITO/glass electrode and AgNWs@RCPI electrode. c AFM topography image of AgNWs@RCPI electrode, where the inserted height profile is obtained from the dashed line in the corresponding image. d The thermal stability of AgNWs/glass electrode in air and AgNWs@RCPI electrode in both air and vacuum. e The investigation of adhesion force between the AgNWs and RCPI substrate via repeating sticking-peeling test by Kapton tape. f The normalized square resistance of the AgNWs@RCPI electrode after 1000 bending tests with different radii. g The normalized square resistances of the AgNWs@RCPI electrode during 10,000 bending cycles at a fixed bending radius of 1 mm.

We further conducted the repeating sticking-peeling test by Kapton tape (as illustrated in the inset of Fig. 4e) to investigate the adhesion force between the AgNWs and RCPI substrate. The average square resistance of the AgNWs@RCPI electrode increases by only about 2.0% after 40 cycles, revealing remarkable adhesion force between the AgNWs and RCPI substrate. The AgNWs@RCPI electrode also exhibits high mechanical robustness, in which the square resistance maintains almost unchanged at 1000 bending tests with different radii (Fig. 4f). The AgNWs@RCPI electrode was further applied into the bending tests at a fixed small bending radius of 1 mm up to 10,000 cycles, and the results reveal that the normalized square resistances of the electrode slightly fluctuate (increased by no more than 8%) during the 10,000 bending cycles (Fig. 4g).

Fabrication and performance of the FOSCs based on the AgNWs@RCPI electrode

The above measurements reveal that the AgNWs@RCPI electrode exhibits similar conductivity and transparency with ITO/glass electrode, and meanwhile has high mechanical robustness. Therefore, the electrode was further used to construct FOSCs with the configuration of AgNWs@RCPI/ZnO/PM6:BTP-4Cl/MoO3/Ag, in which the high-performance PM6:BTP-4Cl was selected as the photoactive layer (Fig. 5a). The detailed fabrication process was present in the Supporting Information. To verify the importance of crosslinking PI by CTOC for solution producing of FOSCs, we fabricated an AgNWs@PI-COOH electrode as a comparison to construct a FOSC device. As expected, once the ZnO precursor solution (processed from the widely used 2-ME) was spin-coated upon the AgNWs@ PI-COOH electrode, the PI-COOH substrate was quickly destroyed into fragments, while the AgNWs@RCPI electrode maintained intact (Supplementary Fig. 9). As shown in J-V characteristic in Fig. 5b and photovoltaic parameters in Supplementary Table 1, solar cells based on ITO/glass provided a PCE of 15.67% with an open-circuit voltage (Voc) of 0.818 V, short-circuit current density (Jsc) of 25.45 mA cm−2 and fill factor (FF) of 75.24%, while the PCE based on the AgNW@RCPI electrode was slightly reduced to 14.78% due to the relatively lower Voc of 0.794 V and Jsc of 24.53 mA cm−2 and meanwhile slightly higher FF of 76.30%. The minor Jsc variation between them should be attributed to the slightly low transmittance. The external quantum efficiency (EQE) spectra and integrated Jsc of the OSC devices have been obtained as shown in Supplementary Fig. 10. As expected, the integrated Jsc values of both the rigid and flexible OSCs agreed well with those obtained from the J-V measurements with a deviation less than 5%. Besides, the hole and electron mobilities based on the ITO/glass and AgNWs@RCPI electrode were measured by the space charge limited current (SCLC) method (Supplementary Fig. S11), and the AgNWs@RCPI based devices displayed a relatively more balanced charge transport for hole and electron. We also note that compared to the devices on ITO/glass, AgNWs@CPI based devices exhibit relatively low Voc, which would be possibly due to the relatively low conductivity of AgNWs electrode and the impurity of AgNWs, such as PVP and oxidation. These may be detrimental to charge injection and lower the Voc.

Fig. 5: Structure and performance of the FOSCs.
figure 5

a Device configuration of the FOSC based on the AgNWs@RCPI electrode, including chemical structures of PM6 and BTP-4Cl. b J-V characteristics of the obtained FOSCs. c The normalized PCE of the FOSCs after 1000 bending cycles at different bending radii. d The normalized Voc, Jsc, FF and PCE of the FOSC after different bending cycles at a bending radius of 1 mm.

The flexibility and mechanical robustness of the AgNWs@RCPI-based FOSCs were further investigated under various mechanical bending conditions (with the bending direction perpendicular to the bottom electrode). Figure 5c shows the normalized efficiency of FOSC devices with various bending radii (Supplementary Fig. 12) after 1000 bending cycles, which reveals outstanding flexibility and mechanical robustness and maintains above 96% of the initial PCE even with a bending radius of ~0 mm (i.e., folding of the device). The bending tests at a fixed small bending radius of 1 mm up to 5000 cycles were further conducted. As shown in Fig. 5d, after 5000 consecutive bending cycles, the PCE only drops by about 2.9% of the initial value, where the degradations in Voc (about 0.8%) and Jsc (about 0.5%) are negligible, and FF still retains 98.4% of the initial value.

The recycling of the RCPI from the FOSCs

To investigate whether the RCPI in the FOSCs could still retain the recyclability, we conducted the recycling experiments of the RCPI after being manufactured into the FOSCs. As shown in Fig. 6a, firstly, the FOSC devices were immersed in CB and sonicated for 3 h (I to II), during which time, the active layer, hole transport layer, top electrode and most of the electron transport layer (ZnO) were removed, due to the good solubility of the active layer in CB, the fact that the hole transport layer and top electrode are located above the active layer, and the relatively weak interaction between the ZnO layer and the AgNWs@RCPI electrode. Since the RCPI has robust solvent resistance to CB, this process nearly did no damage on the RCPI substrates. Second, the AgNWs@RCPI electrodes with possible residual ZnO were washed several times with CB and immersed in a mixture of pivalic acid and DMAc (III). After heated at 60 °C for 30 min, the AgNWs@RCPI electrodes were completely dissolved, and the AgNWs and ZnO were removed by centrifugation, obtaining a transparent and homogeneous solution (IV). Thirdly, the RCPI films or AgNWs@RCPI electrodes were reobtained via the similar methods described earlier in this work (V). Subsequently, the FOSCs were manufactured based on the reobtained AgNWs@RCPI electrodes (VI), which showed a comparable PCE of 14.12% with the original FOSCs (Fig. 6b), justifying that the recyclability of the RCPI still retains after being manufactured into the FOSCs. Moreover, this excellent recyclability of the RCPI enables its applications in other area after being recycled, not limited in the FOSCs.

Fig. 6: The recycling of the RCPI from the FOSCs.
figure 6

a The recycling procedures from the original FOSCs to the recycled FOSCs. I: the original FOSCs; II: the FOSCs in CB before and after sonicated for 3 h; III: immersing the AgNWs@RCPI electrodes in a mixture of pivalic acid and DMAc; IV: the obtained transparent and homogeneous solution after removal of AgNWs and ZnO by centrifugation; V: the recycled RCPI films and AgNWs@RCPI electrodes; VI: the FOSCs based on the recycled AgNWs@RCPI electrodes. b The J-V characteristics of the original FOSCs and FOSCs based on the recycled AgNWs@RCPI electrodes.

In conclusion, we successfully introduced a new ligand exchange strategy to obtain mechanical-robust and meanwhile recyclable transparent PI substrates. The inorganic CTOC contains -COOH ligands, which can be replaced by other R-COOH compounds, so that PI containing -COOH groups can react with CTOC to form crosslinked structures. Meanwhile, the process is also reversible if using excess pivalic acid, enabling the crosslinked PI to show recyclable properties. The PI-CTOC composite was then used to construct embedded AgNWs@RCPI electrodes, exhibiting good transparency, solvent tolerance and mechanical robustness. Furthermore, FOSCs based on the AgNWs@RCPI electrode provided a high PCE of 14.78% and maintained above 97% of the initial PCE after 5000 bending cycles at a small bending radius of 1 mm. Moreover, the RCPI still retains the recyclability even after being manufactured into the FOSCs. These results demonstrate that the recyclable crosslinked PIs through CTOC have great potential application in large-area devices, which is also in progress in our lab.

Methods

Materials

4,4’-(Hexafluoroisopropylidene)diphthalic anhydride (6FDA), 2,2’-bis(trifluoromethyl)benzidine (TFMB), 3,5-diaminobenzoic acid (DABA), anhydrous N, N-dimethylacetamide (DMAc), acetic anhydride (Ac2O), pyridine, pivalic acid and tetrabutyl titanate were all purchased from J&K scientific. 6FDA and TFMB were purified by sublimation before using. DABA was purified by silica chromatography (ethyl acetate/petroleum ether = 2/1). PM6 and BTPBO-4Cl were purchased from Solarmer Materials Inc. Zinc acetate dihydrate and ethanolamine were obtained from Acros. The AgNWs ethanol dispersion was provided by Zhejiang kechuang advanced materials Co., LTD (10 mg mL−1, with an averaged diameter and length of about 25 nm and 30 µm, respectively).

General measurements

Fourier transform infrared spectroscopy (FTIR) was performed on a Nicolet 6700 spectrometer. The X-ray diffraction (XRD) measurement was performed with a Bruker AXS D8 advance diffractometer with Cu Kα radiation. 1H Nuclear magnetic resonance (1H NMR) spectrum was recorded on a Bruker Avance III (400 MHz) instrument. Gel permeation chromatography (GPC, Shimadzu LC-20AD pump system) analyses of PI-COOH was performed using N, N-dimethylformamide (DMF) as the eluent with a flow rate of 1.0 mL min−1, and the system had been calibrated using narrow molecular weight distribution polystyrene standards ranging from 200 to 106 g mol−1. Modulus-temperature curves were performed on a DMTA-V instrument from 30 to 400 °C with a temperature ramping rate of 5 °C min−1 and a frequency of 1 Hz. The tested samples were rectangular in shape (20 × 5 × 0.03 mm3). Stress-strain tensile tests were conducted at room temperature on a dynamic mechanical analyzer (DMA, TA 850) instrument with a stain ramping rate of 0.1 min−1. The tested samples were rectangular in shape (20 × 5 × 0.03 mm3). The CTE values for simples were measured using a thermomechanical analyzer (TMA, Q400EM) in the range of 25–150 °C at a temperature ramping rate of 5 °C min−1. Surface morphologies were characterized by atomic force microscopy (Bruker-Fastscan, Bruker) in the tapping mode. The optical transmittance spectra were measured using a UV-vis-NIR spectrophotometer (UV-3900H). The square resistances of the electrodes were measured using an ST-300 multifunction digital four-probe tester. Current density-voltage (J-V) characteristics were recorded inside a N2-filled glove box under AM1.5 G (100 mW cm−1) illumination from a solar simulator (Enlitech model SS-F5-3A) with a standard silicon solar cell equipped with a KG5 filter (certificated by the National Institute of Metrology) and a Keithley 2400 source-measure unit. The active area of the cells was defined to be 0.0289 cm2 using a shadow mask.

Swelling experiments

The swelling experiments were performed with rectangular samples of around 10 mg and 4 mL different solvents, including DMAc, chloroform, 2-methoxyethanol (2-ME), chlorobenzene, isopropanol and methanol at 25 °C for 24 h. Then, the solvents were removed and the samples were dried under vacuum at 120 °C for 24 h. The residue weight was calculated by using the following below equation:

$${{{\mathrm{Residue}}}}\;{{{\mathrm{weight}}}}\;\left( \% \right) = \frac{{m_{{{{\mathrm{initial}}}}} - m_{{{{\mathrm{final}}}}}}}{{m_{{{{\mathrm{initial}}}}}}}{{{\mathrm{ \times 100}}}}\%$$
(1)

Synthesis of the PI-COOH

In a typical process (Scheme S1), 2.1326 g TFMB (6.66 mmol), 0.5082 g DABA (3.37 mmol) and 10 ml anhydrous DMAc were added into a 100 mL sealed bottle and then purged with N2. When TFMB and DABA were dissolved, 4.5312 g 6FDA (10.1 mmol) dissolved in 20 ml anhydrous DMAc was added in batches. Later, the solution was reacted under stirring in ice-bath for about 4 h, then transferred to room temperature to further react for 8 h, obtaining a light-yellow viscous polyamide acid (PAA) solution. The PAA was converted to polyimide (PI) via chemical imidization reaction with slowly adding the dehydration agents, a mixture of Ac2O/pyridine (7/3, v/v), to above PAA solutions with continuous vigorous stirring at room temperature for another 12 h. The homogeneous mixture was very slowly dripped into a large quantity of water as a poor solvent. Then, the granular white precipitate was formed and repeatedly washed with water, collected by filtration, and dried at 120 °C in vacuum for 12 h.

Preparation of the PI-COOH films

The above obtained PI-COOH powders were dissolved in DMAc with a solid content of 5 wt%. Then the homogeneous solution was coated on a clean glass substrate, dried typically with a step-like annealing procedure from 30 to 180 °C with an increase of 30 °C and holding 30 min for each step. At last, the PI-COOH film was peeled off by soaking in water.

Synthesis of CTOC

The CTOC was synthesized by a previously reported method37. A typical procedure was as follows. 5 g pivalic acid, 5 mL tetrabutyl titanate and 20 ml ethylene glycol were added into a 100 mL round-bottom flask and stirred for 5 min, resulting in a turbid mixture solution. Then the solution was directly heated at 100˚C under stirring in air for 24 h. Colorless powder were formed and thoroughly washed with anhydrous ethanol for three times then dried under vacuum at room temperature.

Preparation of the RCPI films

As a representative example, we described the synthesis of RCPI with the molar ratios of the exchangeable carboxyl groups between CTOC and PI-COOH of 1:1 here. 0.1 g PI-COOH and 0.0184 g CTOC were dissolved in 2 ml DMAc (with a solid content of 5 wt%) and 0.4 ml chloroform, respectively. Later, the CTOC/chloroform solution was dropwise added into the PI-COOH/DMAc solution with continuous vigorous stirring at 60 °C. The mixture was allowed to react for 10 min to obtain a homogeneous viscous pre-crosslinked solution, during which period the carboxyl ligand exchange reactions occurred. To ensure a high-quality RCPI film, the pre-crosslinked conditions including heating temperature and time must be strictly controlled. Then the pre-crosslinked solution was coated on a clean glass substrate, annealed following the similar procedures as the PI-COOH film above and at last peeled off from the substrate with the aid of water.

RCPI films with different content of CTOC were prepared via the similar method above.

Preparation of the AgNWs/glass and AgNWs@RCPI electrodes

Firstly, rigid glass substrates were cleaned using sequential ultrasonication in deionized water, acetone, and isopropanol for 10 min, respectively. Then the cleaned glass was treated in UV-ozone chamber for 30 min. Secondly, the diluted AgNWs ethanol dispersion (3.3 mg mL−1) was spin-coated onto the glass substrates at the optimized rotation speed of 1200 rpm for 40 s, followed by annealing treatment at 150 °C for 10 min. This spin-coating of the diluted AgNWs dispersion was repeated once more to improve the coverage and conductivity of the randomly distributed AgNWs on the glass substrate. Selective patterning of the AgNWs film was conducted by simply ethanol wiping using cotton swabs, obtaining the AgNWs/glass electrode. Thirdly, the above pre-crosslinking RCPI solution was coated on the AgNWs/glass electrode, followed by the step-like annealing treatment similar as procedures of the PI-COOH film above. At last, the AgNWs@RCPI electrode was obtained by peeling off from the glass substrate with the aid of water.

Fabrication of the flexible organic solar cells

The FOSCs was constructed with an inverted structure (AgNWs@RCPI/ZnO/PM6: BTPBO-4Cl/MoO3/Ag). Firstly, the AgNWs@RCPI electrodes were attached to the cleaned glass substrates by using polydimethylsiloxane (PDMS) as adhesive films. The PDMS films (SYLGARD 184, Dow Corning Inc.) were prepared by spin-coating the mixture of the polymeric base and curing agent (20/1, v/v) on the cleaned glass substrates at 3000 rpm for 30 s, followed by curing at 100 °C for 3 min. Secondly, the AgNWs@RCPI electrodes were treated with plasma for 3 min to improve the surface wettability. Then ZnO sol-gel precursor solution was spin-coated on the electrodes at 3000 rpm for 40 s and annealed at 150 °C for 15 min to form the electron transporting layer (ETL). The ZnO sol-gel precursor solution was prepared by dissolving 0.1 g zinc acetate dihydrate and 0.028 ml ethanolamine in 0.937 ml 2-ME. Thirdly, the active layer solution of PM6:BTP-4Cl (w/w, 1:1.2, 22 mg ml−1 in total) in chlorobenzene with 0.4 vol% of 1,8-diiodooctane (DIO) was spin-coated on the surfaces of the ETL at 2400 rpm for 30 s, followed by thermally annealing at 80 °C for 10 min. Finally, the molybdenum oxide (MoO3, 10 nm) and silver slug (Ag, 80 nm) were thermally deposited onto the active layer to form the hole transporting layer (HTL) and top electrode.