Updated the getUserHexEncodedPublicKey to take an optional db value so we can retrieve it during the initial migration