Write z = (a + ib), then z2 = a2 - b2 +2abi
For this to equal 2i we must have
a2 - b2 = 0 and ab = 1
There are four solution sets for these: a = 1, b = 1; a = -1, b= -1; a = i, b=-i; a = -i, b = i.
These give rise to just two different solutions:
1 + i and -1 - i
.