This paper discusses the stochastic (E×B) motion of ions in the homogeneous magnetic field and in the spatially periodical electrostatic potential. This approach is used for the simulation of ion diffusion in potential structures formed at the boundary plasma in tokamaks. We show that the ion motion in such structures scales with a single dimensionless parameter R, which is a combination of amplitude and dimension of potential structures, magnetic field intensity and ion charge/mass ratio. The presented results show that for sufficiently large values of R, the intrinsic stochasticity regime of ion motion appears, which results in the spatial diffusion of ions. The diffusion coefficient is sufficiently high for heavy impurities. Possible further applications are mentioned.