Yes, for an unbiased p-n junction, the is due to the
potential difference in the depletion zone. When p-type and n-type
are stuck next to each other there is a thermally-driven diffusion of
electrons from n to p type, and of holes from p type to n-type near
the boundary, which establishes a separation of charge (excess
negative charge on the p side and excess positive charge on the n
side). The diffusion happens until enough charge has built up to
create an electric field that prevents further charge buildup
- that's when equilibrium is established, and flow is balanced in
each direction. At equilibrium, there is non-zero charge separation
and a depletion zone in the region near the boundary, from which the charge
carriers have drifted. This configuration, with a potential
difference and electron energy increase on the p-side, has required
energy input to the system. This energy comes from thermal energy in
the environment for an unbiased junction-- in this configuration a non-zero diffusion
results in a
. (A battery provides energy
for a biased junction.)