Skip to content

Conversation

@gichiba
Copy link

@gichiba gichiba commented Jan 25, 2021

I have two theories why this code doesn't work:

  1. There's something about the decimal/hex issue that I don't understand, so the keys are not matching up like they should.

  2. I haven't correctly imported or otherwise configured the elliptic library correctly on the client side, and so none of those functions are actually working, but still somehow the site builds.

@Dan-Nolan
Copy link
Contributor

Dan-Nolan commented Jan 26, 2021

It looks like everything is wired up properly as far as imports. I think the main trouble you're running into is that you're trying to use elliptic key methods on strings.

Like here for instance.

In order to get the key methods, you'll first have to convert from a string to a en ec key like:

const privateKey = document.getElementById("exchange-key");
const key = ec.keyFromPrivate(privateKey, 'hex');

👆 After this you'll be able to use key.sign. Similar issue on the server-side. Otherwise I think this looks pretty close!

ss251 added a commit to ss251/ECDSA-Exchange that referenced this pull request May 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants