Memory seeds enable high structural phase purity in 2D perovskite films for high-efficiency devices

Two-dimensional (2D) perovskites are a class of halide perovskites offering a pathway for realizing efficient and durable optoelectronic devices. However, the broad chemical phase space and lack of understanding of film formation have led to quasi-2D perovskite films with polydispersity in perovskite layer thicknesses, which have hindered devices performance and stability. Here, we demonstrate a scalable approach involving dissolution of single-phase crystalline powders with homogeneous perovskite layer thickness in desired solvents, to fabricate 2D perovskite thin-films with high phase purity. In-situ characterizations reveal the presence of sub-micron-sized seeds in solution that preserve the memory of the dissolved single-crystals and dictate the nucleation and growth of grains with identical thickness of the perovskite layers in thin-films.

Here, we report on a phase-selective synthesis method involving a pre-crystallization step of 2D perovskite crystalline powders followed by single-step solution processing, to produce 2D perovskite thin-films principally formed from perovskite layers with a single-valued layer thickness (or n-value), with good crystallinity and desired orientation suitable for fabricating optoelectronic devices. Comprehensive in-situ X-ray diffraction and in-situ absorbance measurements with dynamic light scattering (DLS) analysis reveals the exact nature of 2D perovskite film formation where the growth is dominated by the nucleation of 200 nm homogeneous n-value seeds.

Results and Discussion
Thin film fabrication and structural characterization. The 2D perovskite thin films were fabricated using solution-processing methods at low temperature (100°C or less) following the two protocols described in Fig. 1a; a classical one-step protocol and our method termed as the "phaseselective" method. The classic synthesis method involves dissolving (by stirring for 12 hours) precursor materials (for example, PbI2, BAI, and MAI, with BA and MA standing for butylammonium and methylammonium, respectively) in stoichiometric proportions corresponding to the desired n-value in solution, followed by spin casting on a substrate and annealing at 100°C. 23 This approach yields thin-films composed of a polydisperse mixture of 2D perovskite n-phase materials. For example, when precursors are mixed in stoichiometric proportions to fabricate BA2MA2Pb3I10 (i.e. Ruddlesden-Popper n=3 2D perovskite), the classic synthesis method produces films composed of a mixture of the n=2, n=3, and n=4 2D perovskite phases and often with evidences of the 3D halide perovskites. 23,34 These films are often referred to as quasi-2D and denoted as <n>=3 films. In order to promote phase selectivity during thin-film formation, we added an extra step in the synthesis protocol. First, we slowly crystallized 2D perovskite single crystal powders (micrometer to millimeter sizes) of a desired n-value from the precursor materials hereafter termed as parent-crystals (Fig. 1a). 25,26 These parent crystals exhibited a high degree of phase purity, typically around 90 to 95 % as validated using x-ray powder diffraction measurements. As illustrated in Fig. 1b for the BA2MA2Pb3I10 parent-crystal powders, the diffraction signal stems predominantly from the n=3 phase with less than 10 % of n=4 impurities.
The parent-crystals were then dissolved by heating at 70 ℃ in the optimized solvent for 6 or more hours and the resulting solution was spin casted and annealed.  Fig. 2 and 3). e, Angular-integrated diffraction patterns of the thin films prepared with the phase-selective and classic synthesis methods, and comparison to the parentcrystals. f, Corresponding optical absorbance spectra. Here, the star and hash symbols identify the n=4 and n=2 impurity phases.
After optimization of the solvent composition (5% MACl in DMF for the Ruddlesden-Popper BA2MA2Pb3I10) and dissolution process ( Supplementary Fig. 1), we synthesized thinfilms, which exhibited a narrow variation of phase distribution in comparison to the classical method as verified by grazing incidence wide-angle x-ray scattering (GIWAXS) and absorption spectroscopy. The GIWAXS pattern of the n=3 Ruddlesden-Popper 2D perovskite films synthesized with the phase-selective method is shown in Fig. 1c. Its spot-like diffraction pattern indicates high crystallinity and preferential orientation of the perovskite layers as explained below.
The experimental GIWAXS pattern was accurately reproduced and the diffraction peaks indexed from the 2D perovskite single crystal structure with vertically oriented perovskite layers (see the illustration of the structure in Fig. 1d and details of the analysis in the Supplementary Fig. 2 and 3). First, the simulated diffraction pattern and assignment of Miller indices to the experimental diffraction peaks yield a phase purity larger than 90% corresponding to a nearly homogeneous distribution of BA2MA2Pb3I10 throughout the films even after the films were scratched into power form (see details in Supplementary Fig. 3). The degree of phase purity observed in oriented films was confirmed in crushed powders made by abrasing the thin films ( Supplementary Fig. 4), which is opposite to the mixture of 2D perovskite phases with high n-value and 3D perovskites observed in crushed powders made from films prepared with the classis synthesis method. 35 Moreover, we note that there are six equally spaced, low intensity peaks indicated by white circles in the GIWAXS pattern in Supplementary Fig. 3c,d that cannot be assigned to the normal reflections of the n=3 2D perovskite phase or any other n-value phase, or to bulk halide perovskite. Based on the regular pattern formed by these peaks on the GIWAXS image, we infer that they correspond to the 003, 102, 203, and 104 Bragg reflections of the BA2MA2Pb3I10 lattice that are normally forbidden by perfect single crystal space group symmetry (cell centering, glide planes and screw axis). Here, they can be observed due to local distortions of the perovskite octahedra and corrugation of the interface between the organic cation and perovskite layers. The diffraction integrated over all azimuthal directions of the GIWAXS pattern in Fig. 1e and the absorbance spectra of the thinfilms in Fig. 1f, both confirm a phase purity of about 90% for the BA2MA2Pb3I10 films, which is largely determined by the degree of homogeneity in the perovskite layer thickness of the parentcrystals ( Fig. 1b and gray curve in Fig. 1f). We point out here that the small values of absorbance below 1.8 eV indicate a negligible amount of high n-value crystal phases or 3D-like perovskite in our films, and we attribute this small absorption to surface states and states resulting from the local distortions observed in the GIWAXS data. [36][37][38] Secondly, using the Debye Scherrer analysis on the (111) diffraction peak ( Supplementary Fig. 5), we extracted an average size of 31 nm for the grains forming the thin films. These values are comparable to those of the parent-crystals (average of 64 nm), thus confirming that the crystalline quality is well maintained in the phaseselective thin films. Thirdly, the diffraction peaks of type 0k0 (with k=2m and m is integer) related to the layer stacking direction in the 2D perovskite crystals are observed predominantly along the qr-direction in the GIWAXS pattern in Fig. 1c (>90 % based on the analysis in the Supplementary   Fig. 2 and 3), indicating preferential out-of-plane orientation (normal to the substrate) of the perovskite layers as sketched in Fig. 1d. Finally, we analyzed the x-ray diffraction and absorption data of the thin-films fabricated with the classic synthesis method and determined that the films have significant polydispersity of perovskite layer thickness. We estimate a distribution of n=3 and n=2 phases in almost equal quantity, as well as the presence of n=4 and phases with higher nvalue or 3D-like perovskite (blue dashed curve in Fig. 1e, f). To further confirm that our synthesis approach is applicable to 2D perovskite crystals with other compositions and structures, we performed measurements on the Dion Jacobson n=3 2D perovskite thin films (4AMP-MA2Pb3I10 where 4AMP is 4-Amino methyl piperidine, Supplementary Fig. 6, 7, and 8), which also demonstrated results consistent with those obtained for n=3 Ruddlesden-Popper thin-films.
Formation kinetics of the 2D perovskite thin films. The significant differences in the degree of phase purity and crystal orientation observed between the thin-films synthesized with the phaseselective and the classical method imply that the method of preparation of the solution before casting significantly affects the kinetics of formation of the 2D perovskite thin-films. For the classic synthesis method, Quintero-Bermudez et al. 23 [39][40][41]30,31 In order to improve the reproducibility of thin-films with high phase purity and tailored composition, it is critical that we understand the differences in the crystallization kinetics and film formation between the two synthesis methods. Therefore, we performed an in-situ x-ray diffraction and absorbance of the thin-films during its growth, as illustrated in Fig. 2, which has shown to be a powerful approach to identify the different phases (n values) during the thin-film formation. 23 These experiments were performed by spin casting the respective precursor solution on a glass microscope slide, which was kept at room temperature without annealing in order to slow down the kinetics of nucleation and film formation. We note that this process also yielded films like those obtained by post annealing (Supplementary Fig. 9). Fig. 2a and 2b illustrate the evolution of the diffraction pattern as a function of time from the moment the precursor solutions were spin casted up to eighty minutes of continuous monitoring of the x-ray diffraction pattern. The signature diffraction peaks of each 2D perovskite phase were identified and monitored as a function of time with respect to the total diffraction of the sample (Fig. 2c, d). Both methods showed diffraction at about q=1 Å -1 after one minute, indicative of the formation of the halide perovskite film, and after a few minutes most of the solution nucleated and formed 2D perovskite phases. We also observed a weak diffraction peak in the classic method around 0.57 Å -1 , which indicates the presence of intermediate phase complexes in the excess solution. 23 Recent work on the classical synthesis method has demonstrated the existence of an intermediate gel phase during growth. 42 This gel phase was identified as one of the processes that hinders the formation of homogenous 2D perovskite thin films. For film growths using the phase-selective method, the targeted n=3 2D perovskite phase formed relatively more quickly and continued growing over time as the amount of excess solution is consumed (Fig. 2 a,c). Based on these data, we infer that the phase-selective synthesis method bypasses the intermediate phase (absence of diffraction peak corresponding to intermediate phase complex), which promotes the formation of the desired layer thickness with negligible phase segregation. In order to verify the different phases of thin-film formation, we also performed in-situ optical absorbance measurements as illustrated Fig. 2e, which corroborated that after a couple of minutes the solution nucleates dominantly into the n=3 2D perovskite phase. The excess solution, which is not consumed initially, allows for further improvement of the purity of the n=3 phase at the expense of the n=4. The n=4 impurity phase decreased to a few percent after tens of minutes, as confirmed by both x-ray diffraction and absorbance data (Fig. 2a, c, e). On the other hand, analysis of the film formation in the classic synthesis method yields a mixture of n=1 and n=2 phases after a few minutes of nucleation (Fig. 2b, d, f). Subsequently, we observed the formation of the n=3 2D perovskite phase over a period of tens of minutes, accompanied by the dissolution of the n=1 2D perovskite crystals. The final film from the classic method at the end of the x-ray diffraction during film formation and comparison between our phase-selective synthesis method and the classic one. All peaks were identified to a 2D perovskite phase of defined n-value (or perovskite layer thickness), except for one peak assigned to the presence of an intermediate complex in solution. c, d, Corresponding evolution of the ratio of each phase relative to the fully integrated diffraction. e, f, Evolution of the optical absorbance spectra of the films during synthesis. Each peak in the spectra correspond to the ground exciton transition of a given perovskite layer thickness.
our experiment was composed of a mixture of n=2 and n=3 2D perovskites with little excess solution remaining. These in-situ experiments emphasize the important differences in film formation between the phase-selective method and the classic one. First, we note that in the phaseselective method, the desired 2D perovskites phase (n=3) is readily formed as the dominant phase from the initial nucleation of the solution. In contrast, the classic method initially yields phases with lower n value, followed by a subsequent slow growth of the expected phase. 43,44 Second, the rate of nucleation is significantly faster in the phase-selective method compared to the classic approach, as validated from the absorbance data. These observations suggest that despite their apparently identical clear yellow colour and similar viscosity ( Supplementary Fig. 10), there exist significant differences in the precursor solutions prepared for each synthesis method.

Direct visualization of 2D perovskite film growth and study of the precursor solution.
In pursuit of a deeper understanding of the differences between the precursor solutions prepared using the two different synthesis methods, we performed in-situ microscopy to directly image the precursor solutions during the formation of 2D perovskite thin-films ( Fig. 3a, b). We noticed striking differences in the nucleation and grain formation between the two synthesis protocols. In the case of the classic method, we observed a random nucleation of 2D perovskite grains with filament-like morphology, which grow to form the film (Fig. 3b). On the other hand, in the phaseselective method each grain nucleated at a single location and grew radially outward and independently from the other grains (Fig. 3a). These grain boundaries are formed either when two grains coalesced during the growth or when all reactants in solution are consumed and the growth terminates. The observation of nucleation and grain growth using the two protocols was captured in movies (Supplementary Movie 1 and Movie 2). The films synthesized with the phase-selective method featured relatively large (micron size) and ordered grains, whereas the classic method yielded disordered wire-like morphology ( Fig. 3a, b, right side images, and confirmed by characterization of the surface morphology of post annealed films in Supplementary Fig. 11). We note that although we use the same time scale in Fig. 3a and 3b, the resulting macroscopic growth of the films was in fact faster using the phase-selective method as observed during the in-situ experiments in Fig. 2. Here, we observe a large number of grains nucleated simultaneously in the phase-selective growth, whereas in the classic synthesis method, the film growth was slower and occurred at the interfaces between nucleated crystals and solution. These results support the

Figure 3 | Nucleation and grain formation from solution to thin films in the Ruddlesden-Popper n=3 2D perovskites. a, b,
In-situ visualization of the formation of grains in 2D perovskite thin films and comparison between the phase-selective synthesis method and the classic one. c, Optical absorbance of the precursor solutions obtained before spin coating and annealing. The gray region corresponds to the absorption of PbI2. d, Correlation function versus delay time derived from dynamic light scattering performed on the precursor solutions. Dashed lines are fit to the data. Gray and orange regions indicate small and large particle size in solution, respectively. e, Statistical distribution of the particle size in solution and comparison between our phaseselective synthesis method and the classic one. f, Schematics of the thin film formation. In the classic method solvated intermediates phases form first such as the one-dimensional nonperovskite compounds, which subsequently convert to mixtures of final 2D phases leaving the original crystal shapes of the intermediates as in imprint in the film morphology.
hypothesis that the precursor solutions in the phase-selective method contain a low-density of seeds for the nucleation of 2D perovskite grains as illustrated in the schematic of Fig. 1a. In addition, consistent with the analysis of the in-situ experiments in Fig. 2, we infer that the seeds in solution retain memory of the phase of the 2D perovskite parent-crystals, which were dissolved to form the precursor solution for film growth in the phase-selective synthesis method.
In order to determine the morphology and identity of these memory seeds, we performed dynamic light scattering and absorbance spectroscopy on the solutions before film casting ( Fig.   3c-e). For the classic synthesis method, the optical absorbance spectra reflects the presence of PbI2 ions (absorbance below 2.4 eV), in agreement with the recent report of Quintero-Bermudez and co-workers. 23 Using dynamic light scattering, we also confirmed that the typical size of these ions is approximately 1 nm. On the other hand, the phase-selective method yields precursor solutions that in addition to the PbI2 absorbance spectrum have a finite absorbance between 2.0 and 2.4 eV.
Moreover, the dynamic light scattering data indicate that in addition to the small ions (~1 nm), there exists a much larger size distribution with an average particle size ~200 nm (Fig. 3d,   In the classic one the nucleation initiates at the air-liquid interface and the nucleation front sweeps across the film as discussed in previous work, 45,46 . In comparison, the phase-selective method the nucleation takes place preferentially at the memory seeds that create grains with high phase purity. We note that our approach of creating precursors by dissolving single-crystalline powers has also been adopted in fabricating films of 3D perovskites, which result in thin-films with better morphology and enhanced crystalline quality. 47,48 More recently it was claimed that colloids identified as MA + /PbIx complexes promote the nucleation of mixed n-phase in 2D perovskite films. 31 The needle-shaped crystal film morphology reflects the initial formation of solvated intermediates phases such as the one-dimensional non-perovskite (CH3NH3PbI3ꞏDMF) as has been recognized in MAPbI3 film growth previously. 49 Then the final phase(s) form by subsequent reactions that accomplish the conversion. The phase-selective method avoids these solvated intermediates as the existing seeds act to grow the correct 2D phase. Indeed, our results are in sharp contrast to these past reports as we show that the seeds retain the memory of the parentcrystals, which upon nucleation lead to thin-films with high phase purity and crystallinity. It is apparent therefore that the two different methods have very different starting points and end up at very different destinations during the film formation process, with the phase-selective method affording purer single phase 2D films. Another advantage of the phase-selective method is that it facilitates a single step thin film deposition due to solvent independent seed assisted growth, thereby significantly improving film reproducibility critical for scaling-up in comparison to other deposition strategies like anti-solvent, hot casting, and sequential deposition. 23,31,50 In addition, the concentration of the solvent can be tuned in the phase-selective method to achieve different size of the memory seeds and achieve solvent independent phase selective growth adapted to user's requirements (see Supplementary Fig. 1, 3 and 13). with an open circuit voltage VOC= 1.11 V, short-circuit current density JSC= 14.00 mA.cm −2 , and fill factor of 83 % (Fig. 4b). Similarly, the best solar cell devices using Dion Jacobson 4AMP-MA2Pb3I10 films exhibited comparable performances: an efficiency of about 11.50%, VOC of 1.05 V, and JSC of 14.06 mA.cm −2 . For the photovoltaic devices with PEDOT:PSS as the HTL, we were unable to obtain a VOC exceeding 1.11 V. To test if the solar cells were limited by the energy level alignment of the PEDOT:PSS with the 2D perovskite film valence band, and to optimize the power conversion efficiency, we replaced the PEDOT:PSS with NiOx as the HTL and fabricated devices using BA2MA2Pb3I10 (n=3), BA2MA3Pb4I13 (n=4), and 4AMP-MA3Pb4I13 (n=4) phase pure thin-films prepared with the phase-selective method as active layer (Fig. 4c). The currentvoltage characteristics of the optimized BA2MA2Pb3I10 based device showed an increase in the overall efficiency from 12.60% to 14.3%, arising from an increase in the VOC from 1.11 V to 1. to the lower values observed in high phase purity films ( Fig. 1g and Supplementary Fig. 14) and achieves a balance between photoexcited electron-hole pair (or exciton) dissociation and material stability, however recent studies have demonstrated that a combination of the device field and lowdensity surface states can efficiently achieve exciton dissociation in 2D perovskite phases with low n-value. 24,36,56 By achieving high phase purity with the phase-selective method, 2D perovskite thin films naturally exhibit less structural defects, related to the polydispersity of classical films, which for example might result in stacking faults and dangling bonds between two adjacent layers of different thickness. 23,34,37 The superior phase purity of our 2D perovskite films is expected to benefit device stability and to test this hypothesis, we performed stability measurements during operation of our BA2MA3Pb4I13 solar cell devices. The cells were encapsulated and subjected to a constant 1-Sun illumination for up to 800 hours -under 60±5 % relative humidity in air (Fig. 4e). The solar cells exhibit no "burn-in" effect 57 and lost less than 3% of their initial performances over 800 hours as measured using a standard AM 1.5G source. On the contrary, our control solar cell prepared with the classic synthesis method shows a burn-in effect and started to degrade after 200 hours. To the best of our knowledge, these stability results are better than state-of-art 2D perovskite devices with similar performances. 21,51,53 These results pave a path for achieving dominantly phase pure thinfilms of 2D perovskites for realizing scalable, high-efficiency devices with long-term stability.
In summary, we developed a phase-selective synthesis method for fabricating 2D perovskite thin films with high phase purity, enhanced crystallinity and desired out-of-plane orientation. The in situ characterization indicates the absence of an intermediate phase complex and reveals a seed assisted nucleation and film growth process. The presence of these sub-micron-sized seeds in the solution which preserves the memory of the dissolved single-crystals was verified. The films fabricated by this method resulted in photovoltaic devices with an efficiency of 17.1%, and enhanced stability.

Methods
2D perovskite parent crystal synthesis. The 2D perovskite parent crystals were synthesized by mixing PbI2, MACl, and BAI (or 4AMPI in the case of the Dion Jacobson 2D perovskite) in appropriate ratios and dissolving these precursor materials in a mixture of HI/ H3PO2 according to our previous reports. 25,26 The solution was stirred at high temperature (>190°C) until all the precursors were dissolved, then allowed to cool down to room temperature during which time crystals are formed. The crystallized 2D perovskite powder was separated, dried, and characterized using x-ray diffraction and absorption.
2D perovskite thin film synthesis. For the classic method, the precursors, BAI, MAI, and PbI2 in appropriate ratios (with 5% of MACl additive) were dissolved in N, N dimethylformamide (DMF).
The solution was stirred overnight in an argon filled glove box. Then, the precursor solution was spin coated on the substrates and annealed at 100℃ on a hot plate. In the phase-selective method, the parent crystals were dissolved in DMF with an addition of 5% MACl. After stirring the solution for at least 6 h, it was spin casted on the substrates followed by annealing at 100℃ on a hot plate. In-situ X-Ray diffraction and absorption measurements. The precursor solutions were spin coated on glass substrates to obtain wet films and the samples were immediately transferred to the x-ray diffraction apparatus for measurements. The area of the diffraction peaks were monitored over time until the 2D perovskite films were fully formed. The same approach was used to probe the evolution of the optical density of the films during formation. Solar cell Characterization. The solar cells were characterized by measuring the current-voltage curves while the cells are exposed to the light from a Newport ABB solar simulator (AM 1.5 G light). The external quantum efficiencies were collected by illuminating the device using the monochromatic light obtained from a quartz-tungsten-halogen source modulated at 2 kHz. The

Memory seeds enable high structural phase purity in 2D
perovskite films for high-efficiency devices

Thin films synthesis
Classic synthesis method: The precursor solution of two-dimensional (2D) Ruddlesden popper perovskite BA2MA2Pb3I10 was prepared by mixing lead Iodide (PbI2, Sigma Aldrich, Perovskite grade), methylammonium iodide (MAI, GreatCell Solar, ≥99.9%), and n-butylammonium iodide (BAI, Sigma Aldrich, ≥98%) in an appropriate stoichiometry (3:2:2) to attain a concentration of 0.5-1 M in N,N-dimethylformamide (DMF, Sigma Aldrich, ≥99.9%, anhydrous). A 5% of methylammonium chloride (MACl, Lumtec, ≥99.9%) with respect to the weight of PbI2 was introduced as an additive in the solution. Further, the prepared solution was left stirring at 70°C for overnight inside an argon-filled glovebox. After cooling down, 100 µl of the prepared solution was dropped at the center of a 1'x1' substrate and spin coated at 4000 rpm for 30 sec followed by annealing at 100 o C for 10 min. All spin coating was performed in an inert atmosphere.
Phase-selective synthesis method: This synthesis approach comprises the two steps described below.
Step 1: Parent-crystal powder synthesis: Following our previously reported method, 25 the 2D Ruddlesden popper perovskite parent-crystals of BA2MA2Pb3I10 were synthesized by combining lead oxide (PbO, Sigma Aldrich, 99%), methylamine hydrochloride (MACl, Sigma Aldrich, ≥98%) and butylamine (BA, Sigma Aldrich, 99.5%) in appropriate ratios in a mixture of hydroiodic acid (HI, 57 wt% in H2O) and hypophosphorous acid (H3PO2, 50% in H2O). The solution was stirred at a temperature of 190°C until all the precursors materials were dissolved, and the solution starts boiling. Then, the precursor solution was left to cool down to room temperature that led to the crystallization process of flat single crystals with micrometer to millimeter characteristic size. The quality and phase purity of each batch of parent-crystals synthesized were characterized by a combination of x-ray diffraction and absorbance measurements. The Dion Jacobson perovskite parent-crystals of (4AMP)MA2Pb3I10 were prepared by combining PbO, MAI, and 4-Aminomethyl piperidine (4AMP, Sigma Aldrich, 96%) in appropriate ratios in a HI/ H3PO2 solvent mixture. The solution was stirred at a high temperature of 240 O C until all the precursors were dissolved, and the solution starts boiling. Then, the solution was left to cool down to room temperature that led to the crystallization process. A detailed synthesis procedure is reported in ref. 26 .
Step 2: Solution processing and film fabrication: To fabricate the thin films, we prepared the precursor solution by dissolving the 2D perovskite parent-crystal powders synthesized above into a solvent solution (see below for details about the different types of solvent tested). The prepared solution was left on the hotplate at 70 o C for 6 h. After cooling down, 100 µl of the prepared solution was instantly dropped and spin coated over substrates at 4000 r.p.m for 30 s followed by heating at 100℃ for 10 min resulting in the formation of the 2D perovskite thin films. In order to achieve thin films with the best phase purity and desired crystal orientation, we tested a range of solvent in which the 2D perovskite parent-crystals were dissolved:

Solar cell devices fabrication
We used an inverted planar architecture ITO/HTL/2D-perovskite-film/ETL/Al for the solar cells as depicted by the schematic diagram in Fig. 4a, and fabricated two types of devices to achieve the best performances. One type of solar cell combines PEDOT:PSS (Clevios TM PEDOT:PSS, Heraeus Epurio) as the HTL (hole transporting layer) and [6,6]-phenyl-C61-butyric acid methyl ester (PCBM, Sigma Aldrich, 99.9%) as the ETL (electron transport layer). In the second case, nickel oxide (NiOx) was used as the HTL and PCBM as the ETL with a ~1 nm passivating layer of bathocuproine (BCP, Sigma Aldrich, 96%).
Here we detail the device fabrication procedure. First, we prepared the top part of our solar cells consisting of the patterned indium doped tin oxide (ITO, Thin Film Device Inc.) substrates and the hole transporting layer (HTL). The ITO substrates were washed in water, acetone, acetone/ethanol (50:50) and isopropyl alcohol by ultrasonication for 15 min, respectively. The substrates were further dried under argon airflow and treated with UV for 30 min. Then, a PEDOT:PSS or NiOx layer was spin-coated on the clean ITO substrates at 5000 revolutions per minute (r.p.m.) for 30 s (layer thickness was about 30 nm). The NiOX solution was prepared by dissolving Nickel(II) acetate tetrahydrate (Sigma Aldrich, 99.995%) in absolute ethanol (Sigma Aldrich, 200 proof) with monoethanolamine (MEA, Sigma Aldrich, ≥99%). The ratio of Ni 2+ and MEA was chosen to be 1:1. The solution was stirred at 60 o C for 1 hour until a clear and deep green solution was obtained. The ITO/PEDOT:PSS or NiOX substrates were subsequently transferred to an argon-filled glovebox for the rest of the solar cell fabrication process.
In the glovebox, the 2D perovskite thin films with about 250 nm thickness was fabricated onto the ITO/PEDOT:PSS substrates followed by deposition of the electron transport layer, PCBM. The PCBM solution was prepared by dissolving 25 mg PCBM in 1 ml of chlorobenzene, followed by overnight stirring at 60 o C. A 50μl of the PCBM solution was dropped on the ITO/PEDOT/2D-Perovskite samples and spin-coated at 1000 r.p.m. for 45 s to form a thin layer of ~30 nm. The solar cell devices were completed by evaporating a 100 nm layer of aluminum using a shadow mask yielding eight cells of 31.4 mm 2 per 1'x1' area of the sample device.

X-ray diffraction and in-situ x-ray diffraction measurements
X-ray diffraction of crystals: Batches of synthesized 2D perovskite crystals were characterized using one-dimensional X-Ray diffraction. The synthesized parent-crystal powders were extracted immediately after the crystallization process to be dried using a Whatmann filter paper. The measurement was carried out in the q-range between 0.2 and 1.6 Å -1 corresponding to 2 between 3 o and 15 o with a step of 0.01 o and a speed of 2 degrees per minute using a Rigaku SmartLab X-Ray diffractometer with Cu(Kα) radiation (λ = 1.5406 Å). The corresponding Bragg peaks were identified and compared with the simulated diffraction obtained from the 2D perovskite structures discovered previously. 25,26 In case of the presence of impurities or mixed phases, the synthesized crystals were discarded, and the experiment was repeated until obtaining a parent-crystal powder with high phase purity (i.e. >90% of a single n-value).
X-ray diffraction of thin films: The x-ray diffraction of the thin films was measured in the q-range between 0.2 and 2.25 Å -1 corresponding to 2 between 3 o and 32 o , with a step of 0.01 o and a speed of 2 degrees per minute, using a Rigaku SmartLab X-Ray diffractometer with Cu(Kα) radiation ( = 1.5406 Å).
In-situ x-ray diffraction: The in-situ x-ray diffraction measurements were carried out in the in the q-range between 0.2 and 1.6 Å -1 corresponding to 2 between 3°and 15° with a 0.03° step and speed of 4 degrees per minute under the operation conditions of 40 KV and 35 mA. For this experiment, the samples were prepared by spin coating the precursor solution onto glass at 2500 r.p.m for 1 s. The spin-coating conditions were optimized to obtain the most uniform substrate. The fabricated wet film was immediately transferred to the x-ray diffraction instrument. The film growth was monitored over time for up to 120 minutes. The diffraction measurements were continuously recorded until the film is dried and the diffraction peaks were saturated. The peaks in the obtained diffraction patterns were assigned Miller indices based on the simulated diffraction pattern from the structural data available from our previous work. 25,26

Grazing incidence wide angle x-ray scattering (GIWAXS)
Experimental methods: All GIWAXS diffraction spectra used in this paper were high-resolution synchrotron patterns measured at two beamlines: 8-ID-E at the Advanced Photon Source (APS) and 11-BM at the National Synchrotron Light Source-II (NSLS II). At beamline 8-ID-E, samples were placed on a Linkam grazing incidence x-ray-scattering (GIXS) stage (temperature controlled at 25°C) inside a vacuum chamber (10 -4 torr) with the sample 228 mm away from a Pilatus 1M (Dectris) area detector. The photon energy was 10.91 keV, and the beam size was 200 μm x 20 μm (H x V). At beamline 11-BM, samples were placed on a robotic stage inside a vacuum chamber (10 -2 torr) with the sample 267mm away from a Pilatus 800K (Dectris) area detector. The photon energy was 13.5 keV, and the beam size was 200 μm x 50 μm (H x V). GIWAXS analysis: The GIWAXS data were processed using the GIXSGUI package (version 1.7.3) running on Matlab 2018b (Mathworks). All patterns were corrected with conditions such as detector sensitivity, X-ray polarization, and geometrical solid-angle parameters. Sector-cut integration was taken from the GIWAXS map and used for general analysis. The diffraction patterns were analyzed using the structural characteristics of 2D perovskite crystals reported in our previous work. 33 The software SingleCrystal by CrystalMaker was used to simulate the x-ray diffraction of 2D perovskite crystals and assign Miller indices to diffraction peaks in the GIWAXS patterns (see example in Fig. 1b-d). The details of the procedure is described in Supplementary  Fig. 2 and 3 and involves simulating the diffraction of crystal with different orientation [uvw] with respect to the incident x-ray beam and ponder the weight of each pattern in the experimental data.

Extraction of the size of the particles in solution:
Detailed multi-angle DLS analysis of precursor solutions is provided below. For each solution, the angular dependence of the autocorrelation function was measured. Curves were fitted using a single-or bi-exponential decay model and the resulting correlation fitting residuals were plotted, followed by a linear regression of Γ vs q 2 between 30° and 150°. The scattered light correlation function, g (2) , 61 compares and average the intensity of received signal at time t with that of signal at later times later t+, , experiment we used a precursor solution with concentration of 0.4 M. Few microliters of the solution was dropped onto a glass slide and the imaging of the film formation was started directly afterwards. A 20X objective (Olympus UPLFLN 20X, Olympus Corporation, Tokyo) was used to image the thin film formation. The images were processed with ImageJ (ImageJ 1.8.0_112, NIH, MD).

Solar cell devices characterization
Solar cell performances: The performances of the fabricated solar cells were characterized by measuring the current-voltage (J-V) curves of each device illuminated by an ABB solar simulator from Newport (model 94011). The arc simulator modeled AM 1.5G irradiance of 100 mW/cm 2 and was calibrated using a NIST-certified Si solar cell (Newport 91150V, ISO 17025). The current was measured with a Keithley 2401 instrument at different voltage scan rate. External quantum efficiency: The external quantum efficiency of the solar cell devices was collected by first illuminating each device with monochromatic light modulated at 2 kHz coming from a quartz-tungsten-halogen light source fed into a monochromator (SpectraPro HRS 300, Princeton instruments). The photocurrent response of the solar cells was measured by a SR865 lock-in amplifier. The light source spectrum response was calibrated using a calibrated silicon diode (FDS1010, Thorlab). Stability tests: For stability test measurements, the perovskite devices were encapsulated with a UV-curable epoxy (Poland Inc.) and a glass coverslip as a barrier layer in an argon-filled glove box. The devices were blown with the argon gun in order to remove any contaminants or dust particles just before encapsulation. All the devices were tested under open-circuit (OC) conditions, under full-spectrum simulated AM 1.5G (100 mA cm −2 irradiance) in air using an ABB solar simulator (94011A, Newport) -ISOS-L protocol. The relative humidity was measured to be constant at 60±5 %RH.

Supplementary Figures and Related discussion
Supplementary Fig. 1 | Structural characterization of the Ruddlesden-Popper BA 2 MA 2 Pb 3 I 10 perovskite thin films prepared with the phase-selective synthesis method using different types of solvent. a to d present the GIWAXS results for the solvents DMF, DMSO, DMF-DMSO, DMF-DMSO-HI, respectively. Structure of the film synthesized with the solvent DMF-MACl is presented in Fig. 1c. In each panel, the top image graph is the GIWAXS pattern and the bottom plot is the diffraction derived from integration of the GIWAXS data over the full azimuthal angle. The Miller indices for the desired n=3 phase are indicated as hkl, while phase impurities (i.e. phases with different 2D perovskite layer thicknesses or n-values) are indicated as hkl(n). Fig. 3 | Configuration of 2D perovskite thin films in the GIWAXS apparatus and detailed assignment of the diffraction planes for the GIWAXS of the BA 2 MA 2 Pb 3 I 10 thin films. We set the direction of the x-ray beam along qx. The grains composing the films are formed of 2D perovskite crystal stacked along the b-direction. a, In the phase-selective films prepared with DMF-MACl solvent, most of the perovskite layers are oriented normal to the substrate as sketched here, however the stacking axis of each grain is randomly oriented in the plane of the substrate. b, Given the fixed direction of the x-ray beam, most of the diffraction intensity measured in our GIWAXS experiments stem from grains with stacking direction parallel to the beam (corresponding to the [010] crystal direction) and perpendicular to the beam (corresponding to the [101], [100], or [001] crystal directions), see also thin film crystal structure in Fig. 1e. c, GIWAXS pattern of the BA2MA2Pb3I10 thin films with all the Miller indices derived from the simulated data in the Supplementary Fig. 2. d, Corresponding diffraction pattern. The dashed circles indicate the peaks that cannot be reproduced as discussed in the main text.

Supplementary
The Miller indices for the desired n=3 phase are indicated as hkl, while phase impurities (i.e. phases with different 2D perovskite layer thicknesses or n-values) are indicated as hkl(n). The best combination of phase purity, crystallinity and preferential orientation in the 4AMP-MA2Pb3I10 are obtained with the DMF-DMSO-HI solvent condition. x-ray scattering patterns of the thin films synthetized with the phase-selective method. Labels indicate the Miller indices indexed from the 2D perovskite single crystal structure with principally vertically oriented perovskite layers as sketched in b. c, Optical absorbance spectra of the films as compared to the parent-crystals. The star indicate the presence of a small amount of n=4 impurity phase, which was already present in the parent-crystals.

Supplementary
correspond to the fit to the data. b, f, Residual of the fit functions. c, d, and g, Corresponding linear regression of the Gamma values (Γ) derived from the fit to the data. In the case of the phaseselective method, C and D correspond to the Gamma value of the small and large particles, respectively, as derived from the bi-exponential fit to the data in A. In the case of the classic synthesis method, the precursor solution contains only one type of particles of small size, thus the data in E were fitted with a single exponential function.