Introduction

With rapid industrial and technological advancements, resource recovery, energy harvesting, and energy storage are crucial for sustainability1,2,3,4. Selective ion transport membranes play a central role in energy and environmental applications, including fuel cells5, redox flow batteries6,7, water electrolyzers8, osmotic power generators9,10, and water purification systems11,12. Among these, anion exchange membranes (AEMs)—functionalized with positively charged groups—enable selective anion transport while rejecting cations13,14,15. However, the performance of AEMs in applications such as seawater electrolysis16,17, dialysis18,19,20, or wastewater treatment21,22 depends on their ability to selectively transport anions in complex mixtures. Effective membranes must prevent unwanted ion crossover while facilitating desired ion transport for essential reactions23,24, yet fundamental ion transport mechanisms remain poorly understood25. Conventional AEMs indiscriminately block all ions to prevent side reactions, limiting their application range.

Achieving selective Cl transport is one of the key challenges in anion transport membranes. State-of-the-art AEM technology relies on selective Cl transport to facilitate ion exchange between the anolyte (methyl viologen) and catholyte (4-HO-TEMPO)26. Additionally, NO3 has also been used as a counter anion in methyl viologen synthesis, enhancing solubility and diffusion rates27. Research on supporting electrolytes has improved the energy capacity and temperature range of redox flow batteries, including Br, SO4², H2PO4, and NO3 in zinc/bromine batteries28, and sulfate-based mixed electrolytes29,30 in vanadium redox flow batteries. In osmotic energy harvesting, Cl transport through nanochannel membranes driven by salinity gradients generates diffusion currents, contributing to osmotic power generation31,32,33.

Synthetic membranes struggle with precise ion–ion selectivity due to the similar sizes and charges of ions34,35,36,37. In contrast, biological membranes achieve high ion selectivity via specialized membrane proteins, with Cl channels serving as the primary halogen ion pathway38. Inspired by nature, researchers have developed nanometer and sub-nanometer pores with binding sites to enhance anion selectivity31,33,39,40,41. Advances include 2D interlayer nanochannels (graphene oxide (GO)42,43,44,45, MXene46,47, vermiculite48), ordered sub-nanopores of porous crystalline materials (covalent organic frameworks49,50,51, metal-organic frameworks31,52), intrinsic nanochannels (Tröger’s Base microporous polymers35) and composites53,54. Furthermore, engineered geometries and cationic functional groups (e.g., quaternary ammonium35 and polyaniline32) have been introduced to improve Cl transport efficiency55,56. However, the precise interactions between anions and functional groups in confined nanochannels remain unclear, necessitating further studies to optimize anion-selective membranes.

This study integrates experimental and computational approaches to investigate ion-surface interactions and consider the three stages of ionic transport – absorption, diffusion, and desorption – in self-assembled polyethyleneimine-graphene oxide (am-GO) membranes. Transport occurs through heterogeneous 2D nanochannels decorated with positively charged amino groups and negatively charged carboxyl groups, creating multiple interfaces for exclusive ion transport control. A key contribution of this work is in understanding the simultaneous transport of Cl, NO3, SO42−, and PO43−, which compete for water molecules and diffusion pathways within the confined nanochannels. We demonstrate that while NO3 transport is enhanced by Cl through chemical transistor effect, SO42− and PO43− require high activation energies to transition, leading to negligible release. This mechanism enables regulated Cl and NO3 transport and simultaneously achieves ultrahigh rejection rates of 99.99% for SO42− and PO43−, even in complex ionic environments. This selective behavior makes am-GO membranes highly effective for anion extraction from seawater and wastewater57,58. Our intelligent membranes show strong potential for energy production and storage in complex saltwater environments.

Results

Structural and physicochemical engineering of am-GO membranes

By optimizing physicochemical parameters in the vacuum-assisted self-assembly of GO and polyethyleneimine (PEI), we precisely controlled the geometry and surface chemistry of the am-GO membrane. This allowed us to tune surface charge, regulate nanochannel size, and adjust the number of available nanochannels or layers for anion hopping within the membrane. To enhance anion transport, we designed a positively charged surface through pH-assisted ionization of functional groups in GO and PEI59 (Fig. 1a). At acidic pH, PEI’s amino groups protonate, acquiring a positive charge, while GO’s functional groups remain neutral. To achieve this, we mixed aqueous GO dispersions (0.5 mL, 0.1 mg mL−1) with PEI solutions (15 mL, 2 mg mL−1 in 0.1 M NaCl). pH 2 was adjusted with 1 M HCl and controlled potentiometrically. After shaking and centrifugation, excess bulk PEI was removed, ensuring single-molecule PEI assembly while preventing polymer aggregation (see “Methods” and ref. 60). X-ray photoelectron spectroscopy (XPS) (Fig. 1c and Supplementary Fig. 1) confirmed a strong NH3⁺ band at 401.5 eV in membranes prepared at pH 261,62. In addition, zeta potential of am-GO membrane surface was measured to be +31.8 mV in 0.001 M NaCl solution. This positively charged surface layer distinguishes the am-GO membrane from previously reported cation exchange membranes60, which featured a negatively charged top surface.

Fig. 1: Assembly and structural characterization of the heterogeneous multilayered am-GO membrane.
figure 1

a Ionization of GO, PEI, and am-GO dispersion as a function of pH, indicating maximum protonation of nanolayers at pH 2. b Photograph and cross-sectional scanning electron microscopy (SEM) image of the lamellar am-GO membrane. c X-ray photoelectron spectra (XPS) of C1s, N1s, and O1s peaks for the am-GO membrane prepared at pH 2. d X-ray diffraction (XRD) patterns showing interlayer distances in GO and am-GO membranes in dry and hydrated states. e Structural configurations of dry and wet am-GO membranes predicted by density functional theory (DFT) computations. In the hydrated state, the most stable configuration features a 7.5 Å aqueous transport channel formed between the PEI-functionalized GO surface and the upper GO sheet.

Scanning electron microscopy (SEM, Fig. 1b) reveals a layered morphology of am-GO membranes, and Attenuated Total Reflectance-Fourier-transform infrared (ATR-FTIR) spectroscopy (Supplementary Fig. 2) confirms the presence of the characteristic bands of GO and PEI. By adjusting the GO flake concentration, we can control the membrane thickness and, consequently, the number of layers within the membrane. Atomic force microscopy (AFM, Supplementary Fig. 3) confirms that increasing GO concentration leads to a monotonic membrane thickness increase, from 0.09 ± 0.02 µm (GO = 0.05 mg mL−1) to 1.14 ± 0.09 µm (GO = 0.4 mg mL−1).

Despite a decrease in Young’s modulus from 13.1 ± 1.7 GPa (pure GO) to 6.7 ± 1.1 GPa (am-GO composites, Supplementary Fig. 4), the membranes retain high stability in concentrated salt solutions (Supplementary Figs. 57). X-ray diffraction (XRD, Fig. 1d) shows an 8.9 Å interlayer spacing in dry GO nanolayers. Upon hydration, the am-GO membrane expands to 18 Å, demonstrating hydration-dependent structural adaptability.

Density functional theory (DFT) calculations (Fig. 1e, Supplementary Fig. 8) reveal that the most stable am-GO nanochannel configuration consists of a three-layer structure, where: a polymer chain is stacked onto a lower GO surface, and water molecule layers separate it from an upper GO surface. By subtracting the polymer backbone thickness (~2.7 Å) and twice the combined length of the C–O hydrogen bond (2.2 Å) and the van der Waals radius of oxygen (1.7 Å)63 from the 18 Å interlayer distance, an ion transport channel of ~7.5 Å is formed, facilitating precise anion selectivity and transport.

Mechanisms of ionic permeability and selectivity in am-GO membranes

The ionic permeability of am-GO membranes as a function of membrane thickness (Fig. 2a, Supplementary Fig. 9) was measured using a side-by-side diffusion cell, where osmotic pressure from a 2.5 M sucrose solution drives ionic flux. The membrane thickness of ~210 nm exhibits a significantly increased Cl permeability, making it several orders of magnitude higher than that for other ions. Despite the small size difference between hydrated Cl (3.32 Å) and NO3 (3.35 Å)64, the Cl permeability (399 ± 35 mmol h−1 m−2) is 5 times faster than NO3 (84 ± 23 mmol h−1 m−2) in nm-thick membranes. The μm-thick membranes exhibit ultrahigh rejection rates, reaching 99.76% for Cl and 99.87% for NO3, and exceeding 99.99% for SO42− and PO43− (Fig. 2b).

Fig. 2: Interactions between solvated anions and am-GO nanochannels.
figure 2

a Experimental permeability of Cl, NO3, SO42−, and PO43− as a function of am-GO membrane thickness. b Corresponding rejection rates of the anions at 1 M concentration, demonstrating selective transport behavior. c Gibbs free energy changes for the formation of solvated anion–am-GO membrane systems, highlighting the energy barriers governing ion transport. Density functional theory (DFT)-optimized geometries of PEI-NH3+…anion*[(H2O)n]Graphene-COO complexes, showing the most stable configurations for solvated anions: d Cl*(H2O)14, e NO3*(H2O)14, f H2PO4*(H2O)18, g HPO42−*(H2O)19, and h SO42−*(H2O)20.

This selectivity of Cl cannot be explained by size sieving alone. While GO membranes typically block solutes >0.9 nm in water65, Gibbs free energy calculations (Fig. 2c, Supplementary Table 1) show that anion interactions with -NH3⁺ and -COO binding sites in the 7.5 Å nanochannels determine ion transport behavior37,66. Specifically, Cl exhibits positive binding energy, allowing unhindered diffusion due to its small size and unstable solvation shell (Fig. 2d). In contrast, H2PO4, HPO42−, and SO42− are impermeable, as their strong negative binding energies prevent transport (Fig. 2f-h). NO3−zzzz (Fig. 2e) is trapped by a hydrogen-bonding network between -NH3⁺ and -COO67 but remains tunable due to its near-equilibrium complex formation energy (Fig. 2c). Thus, the combination of 2D geometry and functionalization creates heterogeneous channels with optimal interlayer spacing and a strategic distribution of binding sites, enabling precise anion selectivity.

The Cl selectivity over NO3 was absent in GO membranes (Supplementary Fig. 10) and in partially reduced am-GO membranes (Supplementary Fig. 11). The transport channel sizes of pristine GO and am-GO membranes are quite similar in the swollen state, which is 7.1 Å and 7.5 Å respectively, and hence the absence of Cl selectivity in the pristine GO membrane is attributed primarily to the lack of NH3+ functional groups. In reduced am-GO membranes, both ions were effectively blocked due to i) decreased interlayer distance, ii) increased hydrophobicity, and iii) fewer NH3⁺ binding sites. Furthermore, the Cl selectivity over NO₃ was the highest at pH 2, where the membrane is positively charged due to the protonation of carboxylic and amino groups (Supplementary Fig. 12). This highlights the critical role of surface charge modulation in tuning ion selectivity, demonstrating that precise control of surface charge significantly enhances Cl transport efficiency. Detailed experimental procedures are provided in the Methods section.

Physicochemical evidence of anion interactions with nanochannel surface

Z-potential measurements (Fig. 3a) confirm anion interactions with the positively charged membrane surface. As SO42− and PO43− concentrations increase from 0.005 M to 0.1 M, the z-potential decreases from 0.9 ± 2 mV to –19 ± 4 mV (SO42−) and 0.5 ± 2 mV to –21 ± 5 mV (PO43−), indicating strong multivalent anion affinity. A charge reversal at 0.1 M Cl (–38 ± 5 mV) suggests Cl accumulation on the membrane surface68. In contrast, NO3 maintain a positive z-potential, increasing from 19 ± 4 mV to 43 ± 4 mV as its concentration rises from 0.005 M to 0.1 M.

Fig. 3: Anion sorption properties of the am-GO membrane.
figure 3

a Electrokinetic zeta potential measurements of the am-GO membrane surface as a function of anion concentrations, illustrating surface charge variations with different ionic species. b Anion sorption capacity of am-GO membranes as a function of membrane thickness, highlighting ion-specific adsorption trends. c Arrhenius plots for salt partition coefficients at different temperatures using a 60-nm-thick am-GO membrane, demonstrating temperature-dependent ion sorption behavior. d Energy barrier for salt partitioning into am-GO membrane, providing insights into selective ion transport mechanisms.

ATR-FTIR spectroscopy confirms these findings: a strong 1294 cm−1 peak in the NO3-saturated am-GO membrane (Supplementary Fig. 13) provides direct evidence of NO3 presence69. The Cl-saturated membrane spectrum is identical to that of the pristine am-GO membrane, suggesting that NO3 preferentially occupies interior nanochannels, while Cl accumulates on the surface when exposed to the respective salt solutions.

Ion sorption kinetics in am-GO membranes

Understanding ion sorption kinetics in layered membranes is essential for optimizing transport properties in energy and environmental applications. Here, we investigate the sorption behavior of am-GO membranes using quartz crystal microbalance (QCM), where frequency shifts were converted into mass changes via the Sauerbrey relationship70. Rapid ion uptake occurs within 5 min, followed by equilibrium over 20 min (Fig. 3b, Supplementary Fig. 14). Cl adsorption (10.3 ± 1.4 nmol cm²) is ~10 times higher than NO3 (0.9 ± 0.6 nmol cm−2). Sorption densities of SO42− and PO43− increase slightly with membrane thickness, while Cl and NO3 exhibit steeper trends. Estimated ion content per 2D spacing: 0.19 ± 0.03 nmol cm−2 of Cl, 0.21 ± 0.02 nmol cm−2 of NO3, 0.11 ± 0.03 nmol cm−2 of SO42−, and 0.05 ± 0.03 nmol cm−2 of PO43−.

Temperature-dependent sorption behavior (Supplementary Fig. 15) enabled the determination of partition coefficients (K)71 (Fig. 3c) and sorption energy barriers (ΔEK) (Fig. 3d) using the Arrhenius-type equation66 (Eq. 5): 16.0 kJ mol−1 for NaCl, 14.8 kJ mol−1 for NaNO3, 19.7 kJ mol−1 for Na2SO4, and 30.8 kJ mol−1 for Na3PO4. These results demonstrate the ion-selective adsorption of am-GO membranes, where Cl exhibits enhanced permeability, while multivalent anions (SO42−, PO43−) require higher energy input for sorption.

Cooperative transport of anions in the mixed salt solutions

In salt mixtures containing Cl, the membrane maintains ultrahigh rejection (99.98%) of SO42− and PO43− in both binary and quaternary systems, though their permeability slightly increases compared to single-anion transport (Fig. 4a). Notably, Cl facilitates accelerated NO3 flux, as shown in Fig. 4b, where NO3 permeability rises from 113 ± 9 mmol h−1 m−2 to 258 ± 21 mmol h−1 m−2 after Cl addition. This gating effect is less pronounced for PO43− and SO42−, which remain size-excluded. QCM measurements (Fig. 4c, Supplementary Fig. 16) reveal that Cl sorption remains high (0.19 nmol cm−2 per 2D nanochannel) even in NO3-saturated membranes, whereas it is significantly impeded in membranes preloaded with SO42− and PO43−, highlighting the selective cooperative transport mechanism.

Fig. 4: “Chemical transistor” effect in anion transport under Cl gating.
figure 4

a Experimental permeability of anions mixtures with Cl: Cl and NO3, Cl and SO42−, Cl and PO43−, and quaternary anion mixtures (Cl, NO3, SO42−, and PO43−). b Cooperative transport of Cl with NO3, SO42−, and PO43− over time. Permeability of NO3, SO42−, and PO43− was monitored for the first 12 h, after which NaCl was added, triggering a change in ion transport behavior. c Cl sorption capacity of am-GO membranes after saturation with NO3, SO42−, or PO43−, plotted against membrane thickness, revealing anion-dependent adsorption dynamics. d Reaction pathway for anion interactions with am-GO membranes. (i) Empty membrane nanochannel, (ii) nanochannel with a single trapped anion, (iii) membrane nanochannel of (ii) transition state upon Cl addition, and, and (iv) Cl-trapped nanochannel with the release of another anion, illustrating Cl-mediated anion exchange.

DFT computations (Fig. 4d, Supplementary Table 2 and 3) reveal that Cl transport induces the release of trapped anions by forming unstable mixed-anion complexes within the membrane (Fig. 4d(iii)). These complexes exist in a transition state with specific activation energy barriers, eventually dissociating to release the initially trapped anions. The activation energy barrier (Fig. 4d, Supplementary Table 2) correlates well with the experimental permeability data (Fig. 4b). SO42− and PO43− require high transition-state energies, making their release negligible even in the presence of Cl, suggesting high selectivity in seawater. In contrast, the NO3–Cl complex has a lower activation barrier (~85 kJ mol−1), leading to enhanced NO3 release upon Cl addition.

Mechanistic insights into the transistor effect: hydration shell dynamics and ion dissociation

To further elucidate the transistor effect, we analyzed the underlying mechanisms governing ion motion within the membrane. Cl and Na⁺ have higher hydration energies and smaller water shells than NO3 72 and could disrupt the hydration shell of NO3, enhancing its mobility. Therefore, in solution, chloride ions “steal” water molecules from the nitrate shell, making NO₃ more mobile.

In contrast, SO42− and PO43− have larger hydration shells and stronger hydration73,74,75, leading to slower sulfate transport upon Cl addition. As a result, we observe that the sulfate moves slower when chloride is added. However, phosphate permeability remains unchanged likely due to its higher Arrhenius energy barrier in Fig. 3d, where energy limitations dominate over hydration effects. Since ion motion is limited by a high energy barrier instead of the hydration shell size, chloride does not significantly affect its permeability.

Another factor that might influence the process is the degree of dissociation, which affects the number of anions reaching the membrane. The degree of dissociation influences anion availability at the membrane interface. In 1 M solutions, Cl and NO3 exhibit ~80–90% dissociation72,76, though anion interactions can significantly modify this value, further affecting ion transport behavior.

In order to extract the permeation parameters of our membranes—a phenomenological model of anions hopping between the adsorption sites inside our membrane has been developed (Supplementary Fig. 17). The probability of ions entering our membrane is described by Donnan potential77. By modeling the experimental results on 0.21-µm-thick membrane (feed concentration: 1 M) are summarized both the diffusion coefficient and Donnan potential can be extracted (see Table 1), which are both in good agreement with the parameters found in literature77,78,79.

Table 1 Calculated donnan energies and effective out-of-plane diffusion coefficients for 4 types of anions. Experimental results for 0.21-μm-thick membrane are fitted

Discussion

The functionalization of 2D GO nanochannels with amino groups containing polymer provides a robust strategy for designing ionic channels with heterogeneous interfaces, that have protein-like transport properties. Our membranes with multiple layers differ from bulk polymeric membranes and allow for the consideration of all three steps of ionic transport separately.

We identified three key mechanistic features governing anion transport in mixed ionic solutions: 1) Selective Cl transport is driven by weak association with protonated amino groups. 2) NO3 immobilization within the 2D channel leads to its limited immobility. 3) Fast Cl hopping along functional polymer chains creates an electrochemical gradient, triggering ionic flux and producing the chemical transistor effect. Additionally, the size sieving properties of 2D channels enable ultrahigh rejection (99.99%) of large anions (SO42−, PO43). These mechanisms collectively define the selective anion transport properties of am-GO membranes, enabling high Cl and NO3 permeability while ensuring ultrahigh rejection rates (99.99%) for SO42− and PO43− even in complex ionic environments.

This precisely regulated anionic transport expands the potential applications of selective membranes across multiple disciplines, including physiology, synthetic cell membrane transporters for targeted anion therapies, electrochemistry, monovalent anion-exchange membranes for fuel cells and electrolysis, environmental science and ecology, advanced filtration for water treatment, and ion-selective separation.

Methods

Membrane preparation

Based on the electrostatic attraction between PEI and GO, the composite membrane was made via a self-assembly method. PEI (average Mw ~ 25000 g mol−1, branched, Sigma–Aldrich) was dissolved in 0.1 M NaCl solution (2 mg mL−1) and then adjusted to pH 2 using 1 M HCl solution. Then, 15 mL PEI solution was mixed with 5 mL 0.1 mg mL−1 GO (diluted from 4 mg mL−1 dispersion in water, monolayer content >95%, oxygen content 41–50%, Graphenea Inc.) and shaken for 10 min at 500 rpm (Vortex Mixer, Thermo Fisher Scientific) to allow sufficient interaction. After centrifuging at 4000 rpm, the GO/PEI composites precipitated at the bottom, and excess PEI supernatant was then removed. The composite flakes were dispensed in 0.1 M NaCl (pH 2) again and repeated centrifugation twice. Finally, the am-GO membrane (0.21-µm-thick) was made by vacuum filtrating such suspension through a polyethersulfone membrane filter (PES, 0.03 µm, 47 mm, Sterlitech Corporation, USA) and drying in the dry cabinet for further use. Am-GO membranes with different thicknesses were prepared in the same way with different concentrations of 5 mL GO solutions.

Reduction of am-GO membrane

Am-GO membrane was immersed in 30 mg mL−1 ascorbic acid for 0 h, 24 h, 48 h, and 72 h, respectively, and then washed with DI water to achieve reduced am-GO membranes. The water contact angle was measured by dropping 5 μL of DI water on the membrane surfaces (KRÜSS DSA25E drop shape analyzer) at room temperature.

Ionization degree of GO, PEI, and am-GO composite

The suspension of GO (0.1 mg mL−1) was first adjusted to pH 11 and titrated using 0.1 M HCl from pH 11 to pH 2. DI water was also titrated in the same way as the blank sample. The difference between the volumes of added HCl solution is due to the protonation of GO and was then used to calculate the number of protons consumed by GO. The degree of ionization was achieved after normalizing it from 0 to 1. PEI (2 mg mL−1) and am-GO composite suspensions (0.1 mg mL−1) were first adjusted to pH 2 and then titrated using 0.1 M NaOH from pH 2 to pH 11. The results were analyzed using the same method.

Characterization of am-GO membrane

The XPS of am-GO membranes prepared at pH 2 and pH 10 was measured by the Kratos Amicus X-ray spectrometer. The spectra were deconvoluted to analyze their chemical states. The SEM image of the 3 mg am-GO membrane cross-section was captured by ZEISS Sigma 300 FE SEM system after sputtering with 10-nm-thick gold. The AFM images and height profiles of am-GO membranes were measured in 10 µm × 10 µm by Bruker Dimension Icon AFM using tapping mode (probe: SCANASYST-AIR and SCANASYST-FLUID +). The XRD was performed by Bruker D8 ADVANCE with steps of 0.02° (Cu Kα radiation, λ = 1.54056 Å). For the measurement of salt-saturated membranes, these samples were immersed in different concentrations of NaCl and 0.5 M other anion solutions for 2 h, respectively. Then XRD was performed right after the membranes were taken out from the solutions. The interlayer distance was calculated from Bragg’s Law. The mechanical properties of membranes were examined by a single screw film tension clamp (DMA 850, TA Instruments) under the strain rate of 1% min−1. The ATR-FTIR spectra were measured by IRTracer−100 (Shimadzu Corporation) in the range of 800–4000 cm−1. The anion-saturated membranes were prepared by immersing the freestanding am-GO membranes in 0.5 M NaCl or NaNO3 for 2 h, respectively. SurPASS 3 Electrokinetic Analyzer (Anton Paar GmbH) was employed to measure the electrokinetic z-potential of am-GO membrane surfaces. Different concentrations (0.005 M to 0.1 M) of sodium salt solutions at pH 6.5 were used as electrolytes. By applying pressure and monitoring the streaming current, the zeta potential was calculated by SurPASS 3 software.

Ion sorption by am-GO membrane

A thin am-GO membrane was coated on the gold sensor and then oscillated in the flow of water and 1 M sodium salt solution (50 µL min−1) in sequence. The uncoated gold sensor was also exposed to the same solution as the controlled sample. The frequencies of these sensors were recorded by quartz crystal microbalance (QSense Explorer, Biolin Scientific), and the mass change of membrane in salt solutions relative to water was calculated using the Sauerbrey equation:

$$\Delta f=-\frac{2{f}_{0}^{2}}{A\sqrt{{\rho }_{q}{\mu }_{q}}}\Delta m$$
(1)

where f0 is the resonant frequency (Hz), Δf is the frequency change (Hz), Δm is the mass change (g), A is the area between electrodes (cm2), ρq is the density of quartz (2.648 g cm−3) and μq is the shear modulus of quartz crystal (AT-cut, 2.947 × 1011 g cm−1 s−2). Consequently, the density of anion sorption ρ was calculated as:

$$\rho =\frac{\Delta m}{A\times {molecular\; weight\; of\; salt}}$$
(2)

For the study of the density of anion sorption vs. membrane thickness, a linear fitting was performed. The density of anion sorption between interlayers was calculated as:

$${\rho }_{{interlayer}}={slope}\;{of}\;{the}\;{linear}\;{fit}\times 0.89\,{nm}\;{per}\;{layer}$$
(3)

by taking 8.9 Å as the ideal interlayer distance. The anion sorption on the membrane surface was calculated by the y-intercept of this linear fitting subtracted by the mass change of uncoated gold sensor.

The QCM measurements for a 60-nm-thick am-GO membrane and uncoated gold sensor were also performed at different temperatures from 25 °C to 40 °C with a salt concentration of 1 M. The partition coefficient K of salt represents the ratio of the molar concentration of salt permeated into the membrane to that in the bulk solution:

$$K=\frac{\rho /{membrane\; thickness}}{{c}_{{bulk}}}$$
(4)

Based on the Arrhenius-type equation, the energy barrier (ΔEK) for sorption was fitted using:

$${ln}\left(K\right)=A-\frac{\Delta {E}_{K}}{R}\frac{1}{T}$$
(5)

where A is a constant and R is the ideal gas constant.

Ionic permeability measurement

The ionic permeability was measured using a side-by-side diffusion cell with the membrane fixed between two compartments: the feed compartment and the draw compartment. The feed compartment was 20 mL sodium salt solution, while the draw compartment was filled with 20 mL 2.5 mol L−1 sucrose solution to induce the osmotic pressure between the two cell compartments. Note that the pair of HPO42− and H2PO4 were used to study the permeability of phosphate to establish neutral pH. The concentration of Clminus;, NO3, SO42−, and PO43− ions in the feed compartment varies from 0.05 M to 1 M. For the measurement with different pH of feed solution, NaOH and corresponding acids (HCl, HNO3, H2SO4, and H3PO4) were used to adjust the feed solution (0.5 M) to a certain pH. After permeating for 24 h, the concentration of anions in the sucrose solution was analyzed by ion chromatograph (Metrohm AG) to calculate their permeabilities:

$$\text{Permeability}=\frac{\text{Moles}\,{of}\,{permeated}\,{anion}}{\text{Time}\times \text{Area}}$$
(6)

The rejection rate R is calculated by:

$$R=1-\frac{{C}_{p}}{{C}_{f}}$$
(7)

where Cp is the anion concentration in the permeate cell and Cf is the anion concentration in the feed cell.

All permeation experiments with anion mixtures are performed with 0.21-μm-thick membrane. For the measurement of anion mixtures with NaCl as feed solution, 1 M solutions are mixed at 1:1 (binary anions) or 1:1:1:1 (quaternary anions) respectively. The permeability vs. time measurements were conducted by analyzing the permeated anions in the sucrose solution every 3 h, with a feed concentration of 1 M. After 12 h, 10 mL of the original 1 M feed solution was replaced with 10 mL of NaCl solution, and the permeability was monitored for an additional 12 h.

DFT calculations on the am-GO membrane conformations and hydrated anion-membrane complexes

DFT calculations were performed to investigate the correlation between permeability and Gibbs free energy change of complex formation between the solvated anions and membrane channel. Initially, the solvation shells of anions were optimized, and the number of water molecules in the solvation shells was taken from previous papers80,81,82,83. For the simulation of membrane channel, one graphene (C54H18) sheet with additional deprotonated carboxyl group (COO) and PEI oligomer with protonated amino group (NH3+) were taken. The amount of water molecules placed inside the membrane is optimized in accordance with XRD interlayer distance data and membrane composition optimized by previous calculations. The final water shell consists of 11 molecules. 5 water molecules form the shell around COO group and 3 water molecules form the shell around NH3+ group. The other 3 water molecules form a secondary shell inside the channel. This secondary shell is replaced by a solvated anion during the substitution reaction (Supplementary Table 1). The change of Gibbs free energy was calculated in order to estimate the favorability of complex formation between the membrane channel and solvated anion. All calculations were produced via B3LYP method and 6-31 G(d) basis set. Structure optimization was performed in two steps – optimization of interlayer distance with fixed solvation core of anion inside the channel and optimization of inner structure with fixed graphene sheets. The geometry optimizations were performed via the Berny algorithm (standard Opt)84. The calculations were carried out with the Gaussian 16 software package with the default tight SCF, ultrafine integration grid85. Freq command was used for the computation of force constants and vibrational frequencies to correct the Total energies to Gibbs free energies. The final Gibbs free energy changes of the reactions and Cartesian atomic coordinates are provided in Supplementary Tables 1 and 3.

DFT calculations on the am-GO membrane conformations

To study the anions’ interaction with am-GO membrane, the position of PEI and water molecules between the graphene oxide sheets should be revealed. For this purpose, three models (Supplementary Fig. 8) were proposed. In these models, PEI may be fully separated from two GO sheets by water layers Supplementary Fig. 8a, partially separated from both sides of GO (Supplementary Fig. 8b), or stacked with GO from one side and fully separated by water layers from another GO sheet (Supplementary Fig. 8c). To reveal the most stable conformation, the Gibbs free energy for formation (Gf298) was calculated. The composition in Supplementary Fig. 8c is the most stable one with Gf298 lower than 110 kJ mol−1. Presumably, the reason for this is partial compensation of charges between positively charged PEI and negatively charged carboxyl groups of GO.

DFT calculations on the hydrated anions exchange transport in membrane channel

To understand the mechanism of cooperative anion transport under the flux of hydrated Cl, the additional reaction steps were simulated. Initially the Cl anions interact with anions trapped by functional groups with the formation of transition complex. This unstable transition complex is formed by hydrated Cl-anion couple which occupy functional groups of GO and PEI. This complex is unstable and dissociates with the repulsion of one of the anions whenever the second one remains in the membrane. The release of Cl is more favorable; however, the second anion could also release with negative Gibbs free energy change. The final Gibbs free energy changes of the anion mixture reactions and Cartesian atomic coordinates of associates are provided in Supplementary Tables 2 and 3.

Mathematical model of membrane transport process

In order to extract the Donnan coefficient (which describes the entry barrier of ions into the membrane) and the diffusion coefficient inside of our membranes – a simple, phenomenological model of ions hopping between adsorption sites inside the membrane is used. We used membranes with N = 100 anion adsorption sites to balance computational cost and obtain adequate rejection rates. Two parameters are used in the model: 1-\(\,\alpha\) is the robability for an ion to enter membrane and \(\beta\) is the hopping parameter between the adsoption sites inside of the membrane. The probability for an ion to leave membrane at the exit side was modeled as \(\beta \cdot {e}^{-\frac{\Delta G}{{kT}}}\), where \(\Delta G\) is the Gibbs free energy from DFT calculations, \(k\) is Boltzmann constant and \(T\) is temperature. With these parameters our system can describe as a stochastic motion process during the reverse osmosis.

The average intensity of anion flows through the membrane \(T\) is used to determine their transmission properties. The average amount of anions inside the membrane \({I}_{N}\) is used to determine its absorption properties. To compare the results of this model with experiments, two fitting parameters are required. The first one is the effective number of modeled nanochannels per surface area, which is obtained by fitting the adsorption. Next, knowing this number, the transmission properties may be fitted by choosing the timestep size. With them, we can calculate the diffusion coefficient \(D\) by the formula \(D=2\beta \frac{{(\Delta {x}_{{\rm{step}}})}^{2}}{2\Delta {t}_{{\rm{step}}}}\), where \(\triangle {x}_{{\rm{step}}}\) is a length of one step and \(\triangle {t}_{{\rm{step}}}\) is a timestep86.

Donnan potential is a potential difference between the inside and outside (feeding surface) of the membrane. It is calculated by the formula \({V}_{D}=\frac{{kT}}{{z}_{i}e}{ln}\frac{{\gamma }_{i}^{s}{C}_{i}^{s}}{{\gamma }_{i}^{m}{C}_{i}^{m}}\), where \({z}_{i}\) is the valence of the ion, \(e\) is the electron charge, \(k\) is the Boltzmann constant, \(T\) is the absolute temperature, \({\gamma }_{i}^{s}\) and \({\gamma }_{i}^{m}\) are the ion activity coefficients, and \({C}_{i}^{s}\), \({C}_{i}^{m}\) are ion concentrations in solution and membrane respectively. For high-concentrated solutes, ion activity coefficient determination is challenging, and the classical Donnan approach with \({\gamma }_{i}^{s}={\gamma }_{i}^{m}\) provides reasonable results which was used in our case16,77.

The transmission flows \(T\) are calculated for different \(\alpha\) and \(2\beta\) for 4 anion types (Supplementary Fig. 17a-d). It is found that higher exit probability \(\alpha\) always decreases flow and higher motion probability \(2\beta\) commonly increases it. For the sorption test, the possibility to exit membrane at the exit side is switched off. The result (Supplementary Fig. 17e) shows that for the large part of parameters space the \({I}_{100}\) is almost solely controlled by \(\alpha\). Moreover, for \(\alpha > 80 \%\), higher \(2\beta\) decreases absorption. The data of anion permeability for 0.21-µm-thick membrane (Fig. 2a of the main text) and anion sorption capacity of membranes vs. membrane thickness (Fig. 3b of the main text) are fitted with chosen parameters\(\,\alpha\) and \(2\beta\).

The used approach is applicable for a single particle, but in our system, diffusion is always lower due to collisions. Therefore, the obtained coefficient is higher or equal to the real one. Then we used coefficients for the lowest diffusion for each type of anion (Cl \(\alpha =0 \% ,2\beta =100 \%\), NO3 \(\alpha =0.1 \% ,2\beta =100 \%\), SO42− \(\alpha =0.7 \% ,2\beta =99.0 \%\), PO43− \(\alpha =0.1 \% ,2\beta =99.9 \%\)) and obtained the concentration profile of the membrane for anion transmission experiments (Supplementary Fig. 17f). The concentration profile is comparable to other investigations78,87.

Please, note, that for the PO43−, it is impossible to distinguish the 2 anion types typically present in our experiments: H2PO4 and HPO42−. Since the second one is practically impossible to go through the membrane (\(-\frac{\Delta G}{{kT}} < -24\)), their mass ratio in the solution was used as a reference one (1:1.38 H2PO4 to HPO42−).

In general, the developed model provides the right order of magnitude for the diffusion coefficient, but underestimates it (by about 50%). This might be due to some systematic underestimation of the minimization process.