Let $X$ be a boolean space (zero, that is, a zero-dimensional totally(totally disconnected compact;) compact space; examples include Cantor sets), and let $Y$ be a closed subset. Let $R = C(X,F_4)$ (continuous functions with values in the (discrete) four-element fieldfield; this consists precisely of things of the form $\chi_U + u \chi_V + v\chi_W$, where $U,V,W$ are pairwise disjoint (possibly empty) clopen subsets of $X$, $\chi_U$ etc represent their indicator functions, and $u,v$ are the elements of $F_4\setminus F_2$. Let $Y$ be a closed subset of $X$, and set $$S\equiv S(X,Y) = \{f \in R \mid f(y)\in F_2 { \rm \ for\ all }\ y \in Y \},$$
$$
S\equiv S(X,Y) = \{f \in R \mid f(y)\in F_2 { \rm \ for\ all }\ y \in Y \},
$$
where we regard $F_2 $ as a subset of $F_4$ in the usual way. Then $S$ certainly satisfies $a^4 = a$ for all $a \in S$.
Moreover, the pair $(X,Y)$ is a complete invariant for $S$ constructed in this manner.
Now given an arbitrary ring $T$ satisfying $a^4 = a$ for all $a \in T$, by ancient results this, this is commutative, von Neumann regular, and its maximal ideal space, $X$, is a boolean space. Modulo each $x \in X$, the quotient is either $F_4$ or $F_2$. The set $Y$, consisting of points $x\in X$ such that $a^2-a \in x$ for all $a \in T$, is closed, and we have an embedding $T \subseteq S(X,Y)$ (from the Pierce sheaf representation of $T$ as a ring of continuous sections). We want to show equality.
The map $\alpha:a \mapsto a^2$ (the Frobenius map in this context) is a ring endomorphism of $T$ (fixing all the idempotents, corresponding to clopen subsets of $X$), whose image is a Boolean algebra, and its maximal ideal space is the same, $X$. HenceBy the usual representation theorem of Boolean algebras, we obtain a subring $T_0 = C(X,Z_2)$$T_0 = C(X,F_2)$ of $T$, and $ \alpha(R) = T_0$.
Select $t \in T$; if $t^2 = t$, then $t \in T_0$ already. Otherwise, the set $Z$ consisting of the points where $z(t^2 - t) = 0$ is clopen and contains $Y$. For $s \in S(X,Y)$, let $F $ be the set of points in $X$ that kill $s^2 - s$, so that $F$ is clopen and contains $E$. Then $s|F$ is idempotent, so we can write $s|F = \chi_G $ where $G$ is a clopen subset of $F$ (and $\chi_G$ is the indicator function). Let $E$ be the projection of $F$; then we have $Es = \chi_G$, so $Es \in T_0$.
It suffices to show that $u \chi_{H_u}$ belongs to $T$. Given $z \in H_u$, there exists $t_z$ such that $z(t_z) = u$; hence there exists a clopen neighbourhood of $z$, $V_z$, \stsuch that $y(t_z) = u$ for all $y \in V_z$. The set of these $V_z$ form an open covering of $H_u$, and since the space is totally disconnected and compact, we can find a finite disjoint set of clopen neighbourhoods $V_i$ covering $H$, and corresponding $t_i = \chi_{V_i}t_i$ in $T$ with $t_i|V_i = u\chi_{V_i}$ (the constant function $u$ on $V_i$) and $\cup V_i = H_u$. Then $\sum t_i = u \chi_{u}$, so the latter belongs to $T$. Hence $S(X,Y) = T$.