Skip to content

Incorrect public key derivation on react-native #3

@alex-miller-0

Description

@alex-miller-0

Issue Type

Bug

Description

Given the private key:

0x4735f8b1af5002ce677ae96bbf8958d7213a858f76166047346f89e5597f964d

I can successfully derive the following (correct) information on my node (v8) console:

account.privateToPublic('0x4735f8b1af5002ce677ae96bbf8958d7213a858f76166047346f89e5597f964d').toString('hex') 
> '253caada10d4ffc3ad90a8b20658a524df51b884ab0c213fce48b024f6dce4661539d81e2f776a4b087298b66fa4a46b020a2eb46046aeec171548539bcc679b'

account.publicToAddress(account.privateToPublic('0x4735f8b1af5002ce677ae96bbf8958d7213a858f76166047346f89e5597f964d')).toString('hex')
> '0x5C6a4899f99cd6A6c41a2aef0B3d355546e46F92'

However, React-Native gives me an incorrect public key:

047a0b7043c722b88ab914b3e07a4d323ee689104673f89ccd7dd3efd3a8ea932f2e1e120ad525f4c6de93053280f7a8e820145a0091f733a082ed3f3429dd6cd5

This is unfortunate because ethjs-account is the only account util I can find that doesn't error out in the RN environment.


  • react-native-cli: 2.0.1
  • react-native: 0.47.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions