Spectrum of a ring in which $a^p=a$ for all $a$ and prime number $p$ It is known the result that spectrum of a boolean ring is zerodimensional and compact topological space, e.g. has a base with clopen sets and satisfies Haussdorf condition. It is asked if this result can be generalized for $\mathbb{Z}_p-$algebra $A,$ where $p$ is a prime number, such that $a^p=a$ for all $a\in A.$ It seems for me that it is true also for such that rings.
Indeed, note that for arbitrary $x\in A$ we have $$V(x)\cap V(1-x^{p-1})=V((x)+(1-x^{p-1}))=V(A)=\emptyset$$ and $$V(x)\cup V(1-x^{p-1})=V((x)(1-x^{p-1}))=V(0)=\text{Spec}A,$$ 
so each base open set is closed and each base closed set is open. We can easily note like in boolean ring such that every prime ideal in A is maximal because his quotient is the field isomorphic to $\mathbb{Z}_p,$ so for prime ideals $\mathfrak{p,q}$ we know that $\mathfrak{q}\not\subset\mathfrak{p},$ so it exists $x\in \mathfrak{p}\setminus\mathfrak{q}.$ So we have $\mathfrak{p}\in V(x)$ and $\mathfrak{q}\in \text{Spec} A\setminus V(x)=V(1-x^{p-1}).$ Hence $\text{Spec}A$ is Haussdorf.
I'm not sure if my reasonings are correct. My intuition says that it is something incorrect because I thought that $0-$dimensional compact topological space is the spectrum of some boolean ring...
 A: Yep this is correct!  
Consider the following algebraic characterization of $0$-dimensional rings.

A ring $R$ is $0$-dimensional iff for every $x \in R$ there exists an $n \in \mathbb{N}$ such that $x^{n+1} R = x^n R$

Proof I think you already know the if direction.  Conversely, suppose for the sake of contradiction that $x^{n+1} y \not= x^n$ for any $y \in R, n \in \mathbb{N}$.  Then in particular the multiplicative set generated by the elements $x, 1-xy$ does not contain $0$.  So there's a prime $\mathfrak{p}$ disjoint from this multiplicative set.  That would firstly imply $x \notin \mathfrak{p}$, but since the ring is $0$-dimensional by assumption, $\mathfrak{p}$ is maximal and then $x$ is a unit in $R/\mathfrak{p}$, hence $ax - 1 \in \mathfrak{p}$ for some $a \in R$, also a contradiction.  $\square$
In your case $a^p = a$, so in fact $a^2R = aR$.
Also note that any $0$-dimensional ring is Hausdorff with respect to the Zariski topology.  This is a special case of the fact that

The minimal prime spectrum of a ring is always Hausdorff with respect to the (topology induced by the) Zariski topology.  

Proof Indeed, if $\mathfrak{p}, \mathfrak{q}$ are two distinct minimal primes of a ring, then find an element $f \in \mathfrak{p} \setminus \mathfrak{q}$.  Since $f \in \mathfrak{p}$, the image of $f \in R_\mathfrak{p}$ is in the nilradical of $R_\mathfrak{p}$, hence there exists $s \notin \mathfrak{p}$ such that $sf^n = 0$ for some $n$.  In particular, $\mathfrak{q} \in D(s), \mathfrak{p} \in D(f)$, and $D(f) \cap D(s) = \emptyset$, so we've separated $\mathfrak{p}, \mathfrak{q}$ $\square$.  
You can also show that the minimal prime spectrum of a ring is totally disconnected with respect to the Zariski topology.  So $0$-dimensional rings are quasi-compact, Hausdorff, and totally disconnected (so yes they are $0$-dimensional as topological spaces too).  
As you say, Stone duality assures us that the spectrum of any $0$-dimensional ring can be realized as the spectrum of a Boolean algebra.  In particular, we can put a Boolean algebra structure on the idempotents of any ring by defining addition as the map sending $(e,f) \to e + f - 2ef$ (and multiplication inherited from the ring).  This is isomorphic to the canonical algebra structure on the clopens of the Zariski topology.  Stone duality is telling us that the idempotent algebra associated to a $0$-dimensional ring has the same spectrum as the original ring.  
