'An alternate constructor which generates a new client id.'

@classmethod
def FromPublicKey(cls, public_key):

    n = public_key.GetN()
    raw_n = ('%x' % n).decode('hex')
    mpi_format = ((struct.pack('>i', (len(raw_n) + 1)) + '\x00') + raw_n)
    return cls(('C.%s' % hashlib.sha256(mpi_format).digest()[:8].encode('hex')))
