David and Semmes (Fractured fractals and broken dreams, vol 7, 1997) posed a problem on the Lipschitz equivalence among fractals generated by nested cubes according to various “rules”. For this problem, we show that there are uncountably many Lipschitz equivalence classes if the rules are taken arbitrarily. However, if the same rule is taken in each step of construction process of fractal, under some suitable restriction, we show that there is only a unique Lipschitz equivalence. In particular, we obtain the self-similar set if only one rule is used in construction process. Applying the second result to the self-similar sets, we can obtain the following proposition in Xi and Xiong (C R Math Acad Sci Paris 348:15–20, 2010): if $${E_{A}=\bigcup_{a\in A} (\frac{1}{n}E_{A}+\frac{a}{n}), E_{B}=\bigcup_{b\in B} (\frac{1}{n}E_{B}+\frac{b}{n})}$$ are totally disconnected self-similar sets with $${A,B\subset \{0,1,\ldots,(n-1)\}^{d}}$$ and #A = #B, then E A and E B are Lipschitz equivalent.