We consider a one-dimensional superconducting wire where the total number of electrons can be controlled in the Coulomb blockade regime. We predict that a pi soliton (kink) will spontaneously form in the system when the number of electrons is odd, because this configuration has a lower energy. If the wire with an odd number of electrons is closed in a ring, the phase difference on the two sides of the soliton will generate a supercurrent detectable by a SQUID. The two degenerate states with the current flowing clockwise or counterclockwise can be utilized as a qubit.