to their highly ordered nano-porous structure, large surface area, and diverse functionalization opportunities. For example, COFs can be tailored to incorporate redox-active groups that, in turn, affect their charge-storage properties, while it has also been shown that their porous structures can enhance ion diffusion. Most reports on COFs as battery electrode materials use an n-type redox activity of the COF, meaning that electrons are reversibly stored concurrent with an insertion of metal cations from the electrolyte for charge balancing. Such COFs have been explored predominantly in Li-based batteries with few examples of multivalent ion batteries. While n-type charge storage is relevant for such cation-rocking chair batteries, and allows for the production of high capacity electrode materials, the rate performance of n-type COFs as well as the obtainable cell voltages are often limited to values of up to 3 V vs. Li/Li + . With p-type organic electrode materials, on the other hand, cell voltages above 4 V vs. Li/Li + could potentially be obtained. Furthermore, the rate capability of p-type materials is often higher, as anion insertion during charge and oxidation of the organic redox-active groups is fast. Hence, the development of p-type redox-active COFs with high operating potentials as positive electrode materials is an attractive yet underexplored goal. The only reported examples use (2,2,6,6-tetramethylpiperidin-1-yl)oxyl (TEMPO) as side group to a COF linker, or a triarylamine as a COF linker, with both showing redox activity below 4 V vs. Li/Li + . As an alternative to Li-based batteries, cells using multivalent metals, such as Zn, Al, and Mg, are considered viable solutions as these metals are intrinsically safe for the use as negative electrode materials and are abundant in the Earth's crust. However, the development of positive electrode materials for such batteries, in particular Al and Mg batteries, is still in its infancy and faces severe challenges, ranging from identifying suitable electrolytes to finding electrode materials for reversible storage of multivalent ions. Recently, advanced electrolytes for Mg-based batteries have been developed that consist of noncoordinating (and non-nucleophilic) anions to the Mg salts, which can be used with such p-type organic electrode materials. One example is the magnesium tetrakis(hexafluoroisopropyloxy)borate (Mg[B(hfip)4]2) salt, which additionally has a high oxidative stability >4.3 V. Organic electrode materials are promising candidates for multivalent metal-based batteries where high cell voltages can be achieved, as they offer the opportunity to use an anion-storage mechanism through p-type redox-active groups. To date, there are only three reports on a p-type organic electrode in such a dual-ion Mg cell configuration, of which the most recent one employs a poly(triarylamine)-based cathode and an Mg[B(hfip)4]2-based electrolyte. There is no report yet on a COF used as electrode material in a Mg-based battery. Only a triazinebased amorphous porous organic polymer (POP) has been reported for use as n-type electrode material in Mg batteries for cation storage. Herein, we report the first example of a COF used in a Mg battery. The COF operates in an anion storage mechanism and is one of the first high-voltage p-type COFs used as electrode materials in general. As a redox-active building block, azatruxene is employed as a heterocyclic electron-rich scaffold with an efficient π-π stacking ability, a good prerequisite for COF formation. Such azatruxene-based derivatives have also been studied in supramolecular chemistry, especially in organic electronics. Regarding the application for charge storage, the azatruxene core features up to three reversible one-electron oxidations with potentials, depending on the substitution pattern, between 0-1.5 V vs. Fc/Fc + (Figure ). Azatruxene has previously been implemented into porous materials, for example, in a conjugated microporous polymer (TAT-CMP) for application in a supercapacitor with a capacitance of up to 183 F g -1 and high cycling stability during 10,000 cycles. These values are remarkable despite the low porosity and the absence of crystallinity in the reported materials. No application as battery electrode materials has yet been reported for azatruxene COFs to date. We present the synthesis of an azatruxene-based COF using a transamination protocol to achieve excellent crystallinity and high porosity of the material. We demonstrate the material's ability for reversible anion storage at high potentials in both Li-and Mg-based cells as the first report on a COF being used as electrode material in a Mg battery. At an average discharge potential of 2.9 V vs. Mg/Mg 2+ , 1000 cycles proceed with excellent cycling stability delivering specific capacities of up to 40 mA h g -1 . Tribromo-azatruxene 1 was synthesized according to the literature with an overall yield of 11% (see the Supporting Information, Section S1). To improve the crystallinity, the transamination approach by Vitaku and Dichtel was chosen. Hence, tribromo-azatruxene 1 was reacted with benzophenone imine in a Buchwald-Hartwig coupling to obtain 2,7,12-tris(Nbenzophenone imine)-5,10,15-triethylazatruxene 2 as a COF precursor. Trisimine azatruxene 2 was reacted with terephthalaldehyde TA under solvothermal conditions to form a 2D COF with a hexagonal lattice (Figure and Supporting Information). In brief, the monomers were dissolved in dioxane/mesitylene (1:1) with aqueous acetic acid (6 M) and heated at 120 °C for three days. Red insoluble flakes were obtained that were washed with chloroform and copious amounts of ethanol, and subsequently dried using supercritical CO2-drying to obtain TAT-TA COF as a voluminous dark red solid. Powder X-ray diffraction (PXRD, Figure ) showed several intense reflexes, which correspond to Bragg reflexes of the COF lattice indicating high crystallinity. A simulated periodic force-field model, as implemented in Materials Studio, was used for the Pawley refinement of the experimental PXRD (Figure ). It shows good agreement with a hexagonal P6/m space group representing an eclipsed AA stacking pattern (refined lattice parameters a = b = 37.5 Å and c = 4.0 Å). The insignificant deviation of the simulated and experimental reflex angles 2 can be explained by the slightly non-planar geometry of the azatruxene core, confirmed by DFT calculations, which cannot be modelled with the force field of Materials Studio accurately (Supporting Information, Section S12). The reflex at 2 = 2.88° is assigned to the (1 0 0) lattice plane of the unit cell. Additional reflexes at 5.00° and 5.77° represent the (1 1 0) and (2 0 0) planes, respectively. A broad reflex is centered at around 25°, corresponding to the (0 0 1) plane and confirming the π-π stacked two-dimensional structure at an interlayer distance of around 4 Å (Figure ). Nitrogen adsorption isotherms at 77 K indicate a mesoporous material by a type IV isotherm (Figure ). The surface area was evaluated employing the BETSI algorithm (Figure ) to 1546 m 2 g -1 (calculated theoretical surface area SBET,calc = 2144 m 2 g -1 ). The pore size distribution, extracted from the adsorption isotherm based on 2D non-local density functional theory (2D-NLDFT), shows a major peak at around 29 Å, in a good agreement with the experimentally obtained (1 0 0) reflex by PXRD (31 Å). Cross-polarization magic-angle spinning nuclear magnetic resonance (CP-MAS NMR) and Fourier-transform infrared spectroscopy (FT-IR) were used to examine the chemical composition of TAT-TA COF (Supporting Information, Figures ). The C=N imine stretch (2982 cm -1 ) and the absence of the C=O stretch (2864 cm -1 ) of TA confirmed the complete framework formation. Another indication is the absence of an aldehyde signal around 200 ppm in the CP-MAS NMR spectrum. Examination of the morphology using scanning electron microscopy (SEM) revealed highly uniform aggregates of spherical particles of ca. 2-3 µm diameter (Figure and). The azatruxene tris(imine) can undergo up to three reversible one-electron oxidations, making it attractive for charge storage in batteries. In derivative 2, these are centered at half-wave potentials of 0.21, 0.65 and 1.05 V vs. Fc/Fc + (Figure ). In the oxidized form, the charges are delocalized over the azatruxene core (Figure ), indicated by the calculated HOMO of the neutral azatruxene tris(benzylimine) model (Figure ) and in its various charged states (see Section S12, Supporting Information). In order to investigate the charge storage performance of TAT-TA COF, electrodes were fabricated with two different compositions: The conventional electrodes (named "TAT-TA COF" henceforth) contained TAT-TA COF, acetylene black and PVDF binder in a 30/50/20 wt% ratio coated on an Al current collector, while the second set of electrodes consisted of TAT-TA COF and single-walled carbon nanotubes (SWCNTs) in a 1:2 weight ratio (named "TAT-TA COF/CNT" in the following). With the latter case, free-standing films of the composite electrodes were obtained, which could be used in the coin cells without a current collector (Figure ). Scanning electron microscopy was used to characterize the morphology of pristine TAT-TA COF as well as the TAT-TA COF/CNT composite. TAT-TA COF has a morphology of spherical particles with an average particle size of ca. 2-3 μm, while the TAT-TA COF/CNT composite shows a uniform distribution of the COF into the SWCNT network (Figure ). The cyclic voltammograms (CVs) in Li half cells (as coin cells with 1 M LiPF6 in ethylene carbonate (EC)/dimethyl carbonate (DMC) 1:1 as electrolyte) measured in the potential range of 3.00-4.32 V vs. Li/Li + show two reversible redox processes centered at half-wave potentials of 3.78 and 4.07 V (Figure ). The third oxidation of the azatruxene units (see Figure ) could not be reversibly addressed in the battery electrodes. The galvanostatic cycling data in Figure and 4c clearly show a better performance for the TAT-TA COF/CNT-compared to the conventional TAT-TA COF electrodes. Reversible specific discharge capacities of up to 70.4 mA h g -1 are accessible for TAT-TA COF/CNT at 0.2C rate, corresponding to 82% of the theoretical specific capacity of 86.2 mA h g -1 , assuming a twoelectron transfer. This is paired with an excellent rate performance (Figure ), where even at the fast rate of 20C, 49 mA h g -1 are accessible. A long-term cycling at a rate of 2C over 500 cycles confirms the excellent suitability of the azatruxene COF as battery electrode material (Figure ). After stabilizing the cell at 0.2C for ten cycles, a specific discharge capacity of 68 mA h g -1 was obtained for the TAT-TA COF/CNT electrodes at 2C rate, of which 76% was retained after 500 charge/discharge cycles. The SWCNTs have only a minor contribution to the capacity of ca. 8 mA h g -1 (Figure ). In comparison, the conventional TAT-TA COF electrodes show a retention of only 27% of the initial specific discharge capacity (59 mA h g -1 obtained at 0.2C in cycle 11) after 500 cycles at 2C. The charge/discharge profiles (Figure ) show a plateau area with an average discharge potential of 3.9 V vs. Li/Li + . The better performance of the TAT-TA COF/CNT electrodes can be rationalized by the significantly lower charge-transfer resistance, as seen from the Nyquist plots obtained from electrochemical impedance spectroscopy (EIS, Figure ). Compared to the conventional TAT-TA COF electrodes (220 Ω), the TAT-TA COF/CNT electrodes show a significantly lower charge transfer resistance (80 Ω), indicated by the location of the semicircle, suggesting rapid charge-transport capability due to an enhanced conductivity through the presence of the CNTs. To further investigate the electrochemical kinetics of the TAT-TA COF/CNT electrodes, CVs at different scan rates were measured, showing that the redox processes are not limited by diffusion (Figure ). Galvanostatic intermittent titration technique (GITT) measurements confirmed that the porous structure of the COF improves ion transport through the electrode (Figure ). With values in the order of 10 -10 cm 2 s -1 , the diffusion coefficients indicate fast and efficient anion diffusion, showing that there is no diffusion limitation to the electrochemical redox reaction of the azatruxene COF. Next, the performance of the TAT-TA COF/CNT electrodes in Mg-based coin cells using metallic Mg as counter electrode was investigated. As electrolyte, we used a 0.3 M solution of Mg[B(hfip)4]2•3DME in 1,2-dimethoxyethane (DME, Figure ). The CV in the potential range of 2.0-3.5 V vs. Mg/Mg 2+ (Figure ) shows two redox events, similar to the Li-based cell. The half-wave potentials lie at 2.7 and 3.0 V, which are lower than the respective anodic and cathodic potential in the Li system; however, these values closely correspond to the standard reduction potential difference between Mg and Li (i.e. -2.37 V for Mg vs. -3.04 V for Li). This shows that the redox activity is also based in the azatruxene moieties in the Mg-based cells. Moreover, the second redox process in the CV is characterized by a large hysteresis between anodic and cathodic peak, which slightly decreases with increasing cycle number, implying relatively inferior electrochemical kinetics in the Mg cells. The Mg||TAT-TA COF/CNT cell shows excellent cycling behavior at fast C-rates (Figure ). In the charge/discharge profiles at 5C rate the two redox events merge into one with a plateau at an average voltage of 2.9 V vs. Mg/Mg 2+ . This is in accordance with the differential specific capacity plots (Figure ), which display broad peaks for both charge and discharge. These peaks indicate the (de)insertion of B(hfip)4 -anions into the TAT-TA COF/CNT electrode during (dis)charge. In agreement with the CV results, the high voltage hysteresis for the charging process leads to a relatively lower Coulombic efficiency. Nevertheless, the average discharge voltage of 2.9 V is higher than that of most reported Mg-cells with the exception of triarylamine-based dual-ion Mg batteries. At a fast rate of 5C, corresponding to a current density of 655 mA g -1 , an outstanding cycling stability is observed (Figure ). Of the initial 40 mA h g -1 specific discharge capacity, corresponding to an energy density of 112 W h kg -1 , 84% are maintained over 1000 cycles. This report shows the synthesis and characterization of an azatruxene COF, TAT-TA COF, with excellent crystallinity and high porosity (1546 m 2 g -1 ) that was employed as p-type electrode material in Li-and Mg-batteries. The active material shows high discharge potentials of 3.9 V vs. Li/Li + and 2.9 V vs. Mg/Mg + with a capacity retention of 76% (500 cycles at 2C) and 84% (1000 cycles at 5C), respectively, making this the first report of a COF used in a Mg battery. Rate capability, cycling stability, EIS, and GITT measurements show an improved performance using free-standing COF/CNT electrodes compared to conventional ones. This work demonstrates that organic p-type electrode materials based on COFs are competitive candidates for sustainable materials in energy storage applications.