We are given a cone with height 6, whose base is a circle with radius $\sqrt{2}$. Inside the cone, there is an inscribed cube: Its bottom face on the base of the cone, and all of its top vertices lie on the cone. What is the length of the cube's edge?