Renamed some constants to the one in the actual protocol
Added PKI verification